Skip to content

Commit

Permalink
Fixed a broken import.
Browse files Browse the repository at this point in the history
  • Loading branch information
hpparvi committed Dec 10, 2024
1 parent 98cc0ad commit 0ac3e4a
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions specreduce/tests/test_align_along_trace.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import astropy.units as u

from specreduce.tracing import ArrayTrace
from specreduce.utils import align_spectrum_along_trace
from specreduce.utils import align_2d_spectrum_along_trace


def mk_test_image():
Expand All @@ -18,19 +18,19 @@ def mk_test_image():
def test_align_spectrum_along_trace_bad_input():
image, trace = mk_test_image()
with pytest.raises(ValueError, match='Unre'):
im = align_spectrum_along_trace(image, None) # noqa
im = align_2d_spectrum_along_trace(image, None) # noqa

with pytest.raises(ValueError, match='method must be'):
im = align_spectrum_along_trace(image, trace, method='int') # noqa
im = align_2d_spectrum_along_trace(image, trace, method='int') # noqa

with pytest.raises(ValueError, match='Spectral axis length'):
im = align_spectrum_along_trace(image.T, trace, method='interpolate', disp_axis=0) # noqa
im = align_2d_spectrum_along_trace(image.T, trace, method='interpolate', disp_axis=0) # noqa

with pytest.raises(ValueError, match='Displacement axis must be'):
im = align_spectrum_along_trace(image, trace, disp_axis=2) # noqa
im = align_2d_spectrum_along_trace(image, trace, disp_axis=2) # noqa

with pytest.raises(ValueError, match='The number of image dimensions must be'):
im = align_spectrum_along_trace(np.zeros((3, 6, 9)), trace) # noqa
im = align_2d_spectrum_along_trace(np.zeros((3, 6, 9)), trace) # noqa


@pytest.mark.parametrize("method, truth_data, truth_mask, truth_ucty",
Expand All @@ -50,7 +50,7 @@ def test_align_spectrum_along_trace_bad_input():
ids=('method=interpolate', 'method=shift'))
def test_align_spectrum_along_trace(method, truth_data, truth_mask, truth_ucty):
image, trace = mk_test_image()
im = align_spectrum_along_trace(image, trace, method=method)
im = align_2d_spectrum_along_trace(image, trace, method=method)
assert im.shape == image.shape
assert im.unit == u.DN
assert im.uncertainty.uncertainty_type == 'var'
Expand Down

0 comments on commit 0ac3e4a

Please sign in to comment.