You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A non-list but list-like object (e.g., the JWST ModelContainer) should be saved in the same way as a list of models if it does not have its own save() method. However, this is not what currently happens, because
checks specifically for list, not anything that looks like a list.
See the unit tests below.
def test_save_list(tmp_cwd, model_list):
"""ensure all models are saved using the model's save method. This test passes"""
step = StepWithModel()
step.run(model_list)
for i in range(3):
assert (tmp_cwd / f"test{i}-saved.txt").exists()
def test_save_container(tmp_cwd, model_list):
"""ensure list-like save still works for non-list sequence.
This test fails on an AssertionError. step runs fine, but nothing is saved at all.
Behavior should be changed so that this test passes.
"""
container = SimpleContainer(model_list)
step = StepWithModel()
step.run(container)
for i in range(3):
assert (tmp_cwd / f"test{i}-saved.txt").exists()
Note these make use of the SimpleContainer and StepWithModel classes here:
A non-list but list-like object (e.g., the JWST ModelContainer) should be saved in the same way as a list of models if it does not have its own
save()
method. However, this is not what currently happens, becausestpipe/src/stpipe/step.py
Line 544 in 02840fe
See the unit tests below.
Note these make use of the
SimpleContainer
andStepWithModel
classes here:stpipe/tests/test_step.py
Line 493 in 53ca364
The text was updated successfully, but these errors were encountered: