Skip to content

Commit

Permalink
fix unit test and revert changes to file naming
Browse files Browse the repository at this point in the history
  • Loading branch information
emolter committed Aug 22, 2024
1 parent 099580c commit 6ff67d3
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 7 deletions.
8 changes: 3 additions & 5 deletions jwst/datamodels/tests/test_library.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,8 @@
# determining meta is the same, see `example_asn_path`)
_OBSERVATION_NUMBERS = ['1', '1', '2']
_N_MODELS = len(_OBSERVATION_NUMBERS)
_N_GROUPS = len(set(_OBSERVATION_NUMBERS))
_PRODUCT_NAME = "foo_out"
_POOL_NAME = "some_pool"
_TABLE_NAME = "some_table"


@pytest.fixture
Expand Down Expand Up @@ -138,14 +136,14 @@ def test_group_id_override(example_asn_path, asn_group_id, meta_group_id, expect

def test_asn_attributes_assignment(example_library):

expected_table_name = "jwnoprogram-a3001_none_00008_asn.json"
assert example_library.asn["table_name"] == expected_table_name
expected_table_name = "jwnoprogram-a3001"
assert example_library.asn["table_name"].startswith(expected_table_name)
assert example_library.asn["asn_pool"] == _POOL_NAME

# test that the association attributes are assigned to the models
with example_library:
for i in range(_N_MODELS):
model = example_library.borrow(i)
assert model.meta.asn.table_name == expected_table_name
assert model.meta.asn.table_name.startswith(expected_table_name)
assert model.meta.asn.pool_name == _POOL_NAME
example_library.shelve(model, i, modify=False)
2 changes: 1 addition & 1 deletion jwst/resample/resample_step.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ def process(self, input):
model.meta.resample.pixfrac = kwargs['pixfrac']
# update filename to reflect new product
# necessary to get source_catalog output names to match i2d filename
# model.meta.filename = self.output_file
model.meta.filename = self.output_file
result.shelve(model)

if len(result) == 1:
Expand Down
2 changes: 1 addition & 1 deletion jwst/source_catalog/source_catalog_step.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ def process(self, input_model):
model.data += bkg.background

if self.save_results:
# self.output_file = model.meta.filename
self.output_file = model.meta.filename
cat_filepath = self.make_output_path(ext='.ecsv')
catalog.write(cat_filepath, format='ascii.ecsv',
overwrite=True)
Expand Down

0 comments on commit 6ff67d3

Please sign in to comment.