diff --git a/.github/workflows/lint.yaml b/.github/workflows/lint.yaml index 171d9aa..ea9dbf0 100644 --- a/.github/workflows/lint.yaml +++ b/.github/workflows/lint.yaml @@ -17,7 +17,7 @@ jobs: - name: Install run: | - $CONDA/bin/conda install -c lsstts ts-pre-commit-config -y + $CONDA/bin/conda install -c lsstts python=3.11 ts-pre-commit-config -y - name: Generate pre commit configuration run: | diff --git a/Jenkinsfile b/Jenkinsfile index 06f98bf..99346c2 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -106,6 +106,7 @@ pipeline { source ${env.SAL_SETUP_FILE} cd ${env.WHOME}/ts_wep/ + ${env.SAL_USERS_HOME}/.checkout_repo.sh \${WORK_BRANCHES} setup -k -r . echo Checkout wep lfs data diff --git a/doc/versionHistory.rst b/doc/versionHistory.rst index 1101fe2..8de8e67 100644 --- a/doc/versionHistory.rst +++ b/doc/versionHistory.rst @@ -2,6 +2,27 @@ Version History =============== +v0.13.3 +------- + +* Update Jenkinsfile to checkout the work branches for ts_wep. + +* Update lint github action to pin python 3.11. + +* In mtaos, update do_runOFC to allow users to pass in configuration. + +* In model.py, update call to query datasets from the butler to retrieve the wavefront errors. + +* Update unit tests to conform with latest changes in wep. + +* In config_schema, remove configuration option from cutout pipeline. + +* In ``utility.py``, mark ``getCamType`` as deprecated. + +* In mtaos, pass data instrument name to the model class if it is defined in the configuration. + +* In config_schema, add option to override the data instrument name. + v0.13.2 ------- diff --git a/python/lsst/ts/mtaos/config_schema.py b/python/lsst/ts/mtaos/config_schema.py index 52ac7e9..8115662 100644 --- a/python/lsst/ts/mtaos/config_schema.py +++ b/python/lsst/ts/mtaos/config_schema.py @@ -79,6 +79,20 @@ type: string additionalProperties: false + data_instrument_name: + description: >- + A dictionary that maps the name of the instrument to the name used in + the pipeline task. + type: object + properties: + comcam: + type: string + lsstCam: + type: string + lsstFamCam: + type: string + additionalProperties: false + pipeline_n_processes: description: Number of processes to use when running pipeline. type: integer @@ -373,9 +387,6 @@ type: object additionalProperties: false properties: - donutTemplateSize: - type: integer - default: 160 donutStampSize: type: integer default: 160 @@ -404,9 +415,6 @@ type: object additionalProperties: false properties: - donutTemplateSize: - type: integer - default: 160 donutStampSize: type: integer default: 160 diff --git a/python/lsst/ts/mtaos/model.py b/python/lsst/ts/mtaos/model.py index f7ecba4..e0e1733 100644 --- a/python/lsst/ts/mtaos/model.py +++ b/python/lsst/ts/mtaos/model.py @@ -1013,9 +1013,6 @@ def _gather_outputs( # Get output data_ids = butler.registry.queryDatasets( self.zernike_table_name, - dataId=dict( - instrument=self.data_instrument_name[instrument], exposure=visit_id - ), collections=[run_name], ) diff --git a/python/lsst/ts/mtaos/mtaos.py b/python/lsst/ts/mtaos/mtaos.py index 9b42ac6..135e89f 100644 --- a/python/lsst/ts/mtaos/mtaos.py +++ b/python/lsst/ts/mtaos/mtaos.py @@ -267,6 +267,11 @@ async def configure(self, config: typing.Any) -> None: ), pipeline_n_processes=config.pipeline_n_processes, zernike_table_name=config.zernike_table_name, + data_instrument_name=( + config.data_instrument_name + if hasattr(config, "data_instrument_name") + else None + ), ) if dof_state0 is not None: @@ -532,11 +537,6 @@ async def do_runOFC(self, data): result="runOFC started.", ) - if len(data.config) > 0: - raise NotImplementedError( - "User provided configuration overrides not supported yet." - ) - async with self.issue_correction_lock: if data.userGain != 0.0: warnings.warn( diff --git a/python/lsst/ts/mtaos/utility.py b/python/lsst/ts/mtaos/utility.py index f10ae17..041eae1 100644 --- a/python/lsst/ts/mtaos/utility.py +++ b/python/lsst/ts/mtaos/utility.py @@ -48,7 +48,6 @@ from lsst.daf.butler import Butler from lsst.obs.base import DefineVisitsTask, Instrument from lsst.obs.lsst.translators.lsstCam import LsstCamTranslator -from lsst.ts.wep.utils import CamType from lsst.utils import getPackageDir @@ -142,15 +141,7 @@ def getCamType(camera): ValueError The camera is not supported. """ - - if camera == "lsstCam": - return CamType.LsstCam - elif camera == "lsstFamCam": - return CamType.LsstFamCam - elif camera == "comcam": - return CamType.ComCam - else: - raise ValueError("The camera (%s) is not supported." % camera) + raise DeprecationWarning("This method is deprecated.") def getCscName(): diff --git a/tests/test_configByFile.py b/tests/test_configByFile.py index 41ead77..fee48d3 100644 --- a/tests/test_configByFile.py +++ b/tests/test_configByFile.py @@ -23,7 +23,6 @@ import unittest from lsst.ts import mtaos -from lsst.ts.wep.utils import CamType class TestConfigByFile(unittest.TestCase): @@ -41,10 +40,6 @@ def tearDown(self): except KeyError: pass - def testGetCamType(self): - camType = self.config.getCamType() - self.assertEqual(camType, CamType.ComCam) - def testGetInstName(self): instName = self.config.getInstName() self.assertEqual(instName, "comcam") diff --git a/tests/test_configByObj.py b/tests/test_configByObj.py index f54323a..0028130 100644 --- a/tests/test_configByObj.py +++ b/tests/test_configByObj.py @@ -23,7 +23,6 @@ import unittest from lsst.ts import mtaos -from lsst.ts.wep.utils import CamType class Config(object): @@ -57,10 +56,6 @@ def tearDown(self): except KeyError: pass - def testGetCamType(self): - camType = self.configObj.getCamType() - self.assertEqual(camType, CamType.ComCam) - def testGetInstName(self): instName = self.configObj.getInstName() self.assertEqual(instName, "comcam") diff --git a/tests/test_model.py b/tests/test_model.py index 10ae578..6b4c280 100644 --- a/tests/test_model.py +++ b/tests/test_model.py @@ -321,7 +321,6 @@ def test_generate_wep_configuration(self): "doOverscan": True, } expected_zernike_science_sensor_config = { - "donutTemplateSize": 160, "donutStampSize": 160, "initialCutoutPadding": 40, } @@ -371,7 +370,6 @@ def test_generate_wep_configuration_custom_donut_catalog_online(self): } expected_zernike_science_sensor_config = { - "donutTemplateSize": 160, "donutStampSize": 160, "initialCutoutPadding": 40, } @@ -416,7 +414,6 @@ def test_generate_wep_configuration_custom_isr(self): "doOverscan": True, } expected_zernike_science_sensor_config = { - "donutTemplateSize": 160, "donutStampSize": 160, "initialCutoutPadding": 40, } @@ -460,7 +457,6 @@ def test_generate_wep_configuration_custom_zernike_science_sensor(self): "doOverscan": True, } expected_zernike_science_sensor_config = { - "donutTemplateSize": 160, "donutStampSize": 160, "initialCutoutPadding": 80, } @@ -546,9 +542,9 @@ def assert_estimate_zernikes_science_sensor_task( assert "CutOutDonutsScienceSensorTask" in wep_configuration["tasks"] assert "calcZernikesTask" in wep_configuration["tasks"] assert "config" in wep_configuration["tasks"]["CutOutDonutsScienceSensorTask"] - for config in set( - ("donutTemplateSize", "donutStampSize", "initialCutoutPadding") - ).union(expected_zernike_science_sensor_config): + for config in set(("donutStampSize", "initialCutoutPadding")).union( + expected_zernike_science_sensor_config + ): assert ( config in wep_configuration["tasks"]["CutOutDonutsScienceSensorTask"]["config"] diff --git a/tests/test_utility.py b/tests/test_utility.py index 3e6f885..11602ba 100644 --- a/tests/test_utility.py +++ b/tests/test_utility.py @@ -34,7 +34,6 @@ from lsst.obs.lsst.translators.lsstCam import LsstCamTranslator from lsst.ts import mtaos from lsst.ts.wep.task.cutOutDonutsCwfsTask import CutOutDonutsCwfsTask -from lsst.ts.wep.utils import CamType from lsst.ts.wep.utils import getModulePath as getModulePathWep @@ -76,13 +75,6 @@ def testGetIsrDirPath(self): os.environ.pop("ISRDIRPATH") - def testGetCamType(self): - self.assertEqual(mtaos.getCamType("lsstCam"), CamType.LsstCam) - self.assertEqual(mtaos.getCamType("lsstFamCam"), CamType.LsstFamCam) - self.assertEqual(mtaos.getCamType("comcam"), CamType.ComCam) - - self.assertRaises(ValueError, mtaos.getCamType, "wrongType") - def testGetCscName(self): cscName = mtaos.getCscName() self.assertEqual(cscName, "MTAOS")