Skip to content

Commit

Permalink
TEMPORARY workaround to avoid schema validation errors
Browse files Browse the repository at this point in the history
  • Loading branch information
larrybradley committed Apr 25, 2024
1 parent 1d7e8ba commit 3f677da
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 20 deletions.
12 changes: 6 additions & 6 deletions romancal/stpipe/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

import roman_datamodels as rdm
from roman_datamodels.datamodels import ImageModel
from stpipe import Pipeline, Step, crds_client
from stpipe import Pipeline, Step

from ..lib.suffix import remove_suffix

Expand Down Expand Up @@ -66,11 +66,11 @@ def finalize_result(self, model, reference_files_used):

# 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:
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.crds_observatory
)
# if self.parent is None:
# 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.crds_observatory
# )

def record_step_status(self, model, step_name, success=True):
"""
Expand Down
27 changes: 13 additions & 14 deletions romancal/stpipe/tests/test_core.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
from astropy.time import Time
from roman_datamodels.datamodels import FlatRefModel, ImageModel
from roman_datamodels.maker_utils import mk_level2_image
from stpipe import crds_client

import romancal
from romancal.stpipe import RomanPipeline, RomanStep
Expand Down Expand Up @@ -80,23 +79,23 @@ def process(self):
assert any("Splines failed to reticulate" in l for l in result.cal_logs)


def test_crds_meta():
"""Test that context and software versions are set"""
# def test_crds_meta():
# """Test that context and software versions are set"""

class ReflectStep(RomanStep):
def process(self, input):
return input
# class ReflectStep(RomanStep):
# def process(self, input):
# return input

im = ImageModel(mk_level2_image(shape=(20, 20)))
im.meta.ref_file.crds.sw_version = "junkversion"
im.meta.ref_file.crds.context_used = "junkcontext"
# im = ImageModel(mk_level2_image(shape=(20, 20)))
# im.meta.ref_file.crds.sw_version = "junkversion"
# im.meta.ref_file.crds.context_used = "junkcontext"

result = ReflectStep.call(im)
# result = ReflectStep.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(
result.crds_observatory
)
# 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(
# result.crds_observatory
# )


def test_calibration_software_version():
Expand Down

0 comments on commit 3f677da

Please sign in to comment.