Skip to content

Commit

Permalink
fixed failure to raise NoGroupID for in-memory models with None for o…
Browse files Browse the repository at this point in the history
…bservation parameters
  • Loading branch information
emolter committed Aug 30, 2024
1 parent 2afe670 commit 04e2fa5
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
3 changes: 3 additions & 0 deletions jwst/datamodels/library.py
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,9 @@ def _attrs_to_group_id(
"""
Combine a number of file metadata values into a ``group_id`` string
"""
for val in (program_number, observation_number, visit_number, visit_group, sequence_id, activity_id, exposure_number):
if val is None:
raise NoGroupID(f"Missing required value for group_id: {val}")
return (
f"jw{program_number}{observation_number}{visit_number}"
f"_{visit_group}{sequence_id}{activity_id}"
Expand Down
4 changes: 1 addition & 3 deletions jwst/outlier_detection/tests/test_outlier_detection.py
Original file line number Diff line number Diff line change
Expand Up @@ -268,10 +268,8 @@ def test_outlier_step_spec(tmp_cwd, tmp_path):
# Make it an exposure type outlier detection expects
miri_cal.meta.exposure.type = "MIR_LRS-FIXEDSLIT"

# Make a couple copies
# Make a couple copies, give them unique exposure numbers and filename
container = ModelContainer([miri_cal, miri_cal.copy(), miri_cal.copy()])

# Give each image a unique name so output files don't overwrite
for i, model in enumerate(container):
model.meta.filename = f'test_{i}_cal.fits'

Expand Down
1 change: 0 additions & 1 deletion jwst/resample/resample.py
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,6 @@ def resample_many_to_many(self, input_models):
"""
output_models = []
for group_id, indices in input_models.group_indices.items():
print("indices", indices)
output_model = self.blank_output

copy_asn_info_from_library(input_models, output_model)
Expand Down

0 comments on commit 04e2fa5

Please sign in to comment.