Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix crds keywords #1510

Merged
merged 8 commits into from
Nov 13, 2024
2 changes: 1 addition & 1 deletion romancal/regtest/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ def ignore_asdf_paths():
"asdf_library",
"history",
# roman-specific stuff to ignore
"roman.meta.ref_file.crds.sw_version",
"roman.meta.ref_file.crds.version",
"roman.meta.calibration_software_version",
"roman.cal_logs",
"roman.meta.cal_logs",
Expand Down
6 changes: 3 additions & 3 deletions romancal/stpipe/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,16 +87,16 @@ def finalize_result(self, model, reference_files_used):
if hasattr(model.meta.ref_file, ref_name):
setattr(model.meta.ref_file, ref_name, ref_file)
# getattr(model.meta.ref_file, ref_name).name = ref_file
model.meta.ref_file.crds.sw_version = crds_client.get_svn_version()
model.meta.ref_file.crds.context_used = crds_client.get_context_used(
model.meta.ref_file.crds.version = crds_client.get_svn_version()
model.meta.ref_file.crds.context = crds_client.get_context_used(
model.crds_observatory
)

# this will only run if 'parent' is none, which happens when an individual
# step is being run or if self is a RomanPipeline and not a RomanStep.
if self.parent is None:
log.info(
f"Results used CRDS context: {model.meta.ref_file.crds.context_used}"
f"Results used CRDS context: {model.meta.ref_file.crds.context}"
)

def record_step_status(self, model, step_name, success=True):
Expand Down
4 changes: 2 additions & 2 deletions romancal/stpipe/tests/test_core.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,8 +118,8 @@ def test_crds_meta():
im = ImageModel(mk_level2_image(shape=(20, 20)))
result = FlatFieldStep.call(im)

assert result.meta.ref_file.crds.sw_version == crds_client.get_svn_version()
assert result.meta.ref_file.crds.context_used == crds_client.get_context_used(
assert result.meta.ref_file.crds.version == crds_client.get_svn_version()
assert result.meta.ref_file.crds.context == crds_client.get_context_used(
result.crds_observatory
)

Expand Down