@@ -39,22 +39,6 @@ def test_plugin(specviz2d_helper):
3939 assert pext .marks ['trace' ].marks_list [0 ].visible is True
4040 assert len (pext .marks ['trace' ].marks_list [0 ].x ) > 0
4141
42- # test importing traces
43- img = specviz2d_helper .get_data ('Spectrum 2D' )
44- flat_trace = tracing .FlatTrace (img , trace_pos = 25 )
45- fit_trace = tracing .FitTrace (img )
46-
47- for imported_trace in [flat_trace , fit_trace ]:
48- pext .import_trace (imported_trace )
49- exported_trace = pext .export_trace (add_data = False )
50- assert isinstance (exported_trace , type (imported_trace ))
51-
52- # # array trace needs to go through loader, uncomment after JDAT-5518
53- # array_trace = tracing.ArrayTrace(img, np.arange(len(img.spectral_axis)))
54- # specviz2d_helper.load(array_trace)
55- # exported_trace = pext.export_trace(add_data=False)
56- # assert isinstance(exported_trace, tracing.ArrayTrace)
57-
5842 # create FlatTrace
5943 pext .trace_type_selected = 'Flat'
6044 pext .trace_pixel = 28
@@ -176,6 +160,23 @@ def test_plugin(specviz2d_helper):
176160 with pytest .raises (ValueError ):
177161 pext .export_extract (invalid_kwarg = 5 )
178162
163+ # test importing traces
164+ img = specviz2d_helper .get_data ('Spectrum 2D' )
165+ flat_trace = tracing .FlatTrace (img , trace_pos = 25 )
166+ fit_trace = tracing .FitTrace (img )
167+
168+ for imported_trace in [flat_trace , fit_trace ]:
169+ pext .import_trace (imported_trace )
170+ exported_trace = pext .export_trace (add_data = False )
171+ assert isinstance (exported_trace , type (imported_trace ))
172+
173+ # array trace needs to go through loader, uncomment after JDAT-5518
174+ array_trace = tracing .ArrayTrace (img , np .arange (len (img .spectral_axis )))
175+ specviz2d_helper .load (array_trace , data_label = 'array_trace' )
176+ pext .trace_trace .selected = 'array_trace'
177+ exported_trace = pext .export_trace (add_data = False )
178+ assert isinstance (exported_trace , tracing .ArrayTrace )
179+
179180
180181@pytest .mark .remote_data
181182@pytest .mark .filterwarnings ('ignore' )
0 commit comments