diff --git a/conda/meta.yaml b/conda/meta.yaml index fdc1f96e..58f5c6f2 100644 --- a/conda/meta.yaml +++ b/conda/meta.yaml @@ -14,6 +14,8 @@ build: - auxtel_enable_atcs = lsst.ts.IntegrationTests.auxtel_enable_atcs:run_auxtel_enable_atcs - auxtel_housekeeping = lsst.ts.IntegrationTests.auxtel_housekeeping:run_auxtel_housekeeping - auxtel_image_taking = lsst.ts.IntegrationTests.image_taking_verification:run_auxtel_image_taking + - auxtel_latiss_acquire = lsst.ts.IntegrationTests.auxtel_latiss_acquire:run_auxtel_latiss_acquire + - auxtel_latiss_take_sequence = lsst.ts.IntegrationTests.auxtel_latiss_take_sequence:run_auxtel_latiss_take_sequence - auxtel_latiss_acquire_and_take_sequence = lsst.ts.IntegrationTests.auxtel_latiss_acquire_and_take_sequence:run_auxtel_latiss_acquire_and_take_sequence - auxtel_latiss_calibrations = lsst.ts.IntegrationTests.auxtel_latiss_calibrations:run_auxtel_latiss_calibrations - auxtel_latiss_checkout = lsst.ts.IntegrationTests.auxtel_latiss_checkout:run_auxtel_latiss_checkout diff --git a/doc/version-history.rst b/doc/version-history.rst index 508b77b1..ef80480d 100644 --- a/doc/version-history.rst +++ b/doc/version-history.rst @@ -10,6 +10,12 @@ Version History .. No new work should be required in order to complete this section. .. Below is an example of a version history format. +v0.23.0 +------- +* Fixed the csc_state_transition.py script to add the csc_index to the Class instantiation. +* Updated the LATISS Acquire and Take Sequence tests to use the separate scripts instead of the combined script. +* Updated ts-conda-build to version 0.4. + v0.22.0 ------- * Switched M1M3 to individual state transitions. diff --git a/pyproject.toml b/pyproject.toml index ee233284..60203641 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -24,6 +24,8 @@ auxtel_disabled_enabled = "lsst.ts.IntegrationTests.auxtel_disabled_enabled:run_ auxtel_enable_atcs = "lsst.ts.IntegrationTests.auxtel_enable_atcs:run_auxtel_enable_atcs" auxtel_housekeeping = "lsst.ts.IntegrationTests.auxtel_housekeeping:run_auxtel_housekeeping" auxtel_image_taking = "lsst.ts.IntegrationTests.image_taking_verification:run_auxtel_image_taking" +auxtel_latiss_acquire = "lsst.ts.IntegrationTests.auxtel_latiss_acquire:run_auxtel_latiss_acquire" +auxtel_latiss_take_sequence = "lsst.ts.IntegrationTests.auxtel_latiss_take_sequence:run_auxtel_latiss_take_sequence" auxtel_latiss_acquire_and_take_sequence = "lsst.ts.IntegrationTests.auxtel_latiss_acquire_and_take_sequence:run_auxtel_latiss_acquire_and_take_sequence" auxtel_latiss_calibrations = "lsst.ts.IntegrationTests.auxtel_latiss_calibrations:run_auxtel_latiss_calibrations" auxtel_latiss_checkout = "lsst.ts.IntegrationTests.auxtel_latiss_checkout:run_auxtel_latiss_checkout" diff --git a/python/lsst/ts/IntegrationTests/__init__.py b/python/lsst/ts/IntegrationTests/__init__.py index b9642415..8b82b502 100644 --- a/python/lsst/ts/IntegrationTests/__init__.py +++ b/python/lsst/ts/IntegrationTests/__init__.py @@ -31,9 +31,11 @@ from .auxtel_disabled_enabled import * from .auxtel_enable_atcs import * from .auxtel_housekeeping import * +from .auxtel_latiss_acquire import * from .auxtel_latiss_acquire_and_take_sequence import * from .auxtel_latiss_calibrations import * from .auxtel_latiss_checkout import * +from .auxtel_latiss_take_sequence import * from .auxtel_latiss_wep_align import * from .auxtel_offline_standby import * from .auxtel_prepare_for_flat import * diff --git a/python/lsst/ts/IntegrationTests/auxtel_latiss_acquire.py b/python/lsst/ts/IntegrationTests/auxtel_latiss_acquire.py new file mode 100644 index 00000000..ee5d43fb --- /dev/null +++ b/python/lsst/ts/IntegrationTests/auxtel_latiss_acquire.py @@ -0,0 +1,76 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- +# This file is part of ts_IntegrationTests. +# +# Developed for the Vera C. Rubin Observatory Telescope & Site Software system. +# This product includes software developed by the Vera C. Rubin Observatory +# Project (https://www.lsst.org). +# See the COPYRIGHT file at the top-level directory of this distribution +# for details of code ownership. +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License + +__all__ = [ + "AuxTelLatissAcquire", + "run_auxtel_latiss_acquire", +] + +import argparse +import asyncio + +from lsst.ts.IntegrationTests import BaseScript + +from .configs.config_registry import registry + + +class AuxTelLatissAcquire(BaseScript): + """Execute the given Standard or External script, + with the given Yaml configuration, + placed in the given ScriptQueue location. + + Parameters + ---------- + sequence : `str` + Defines which sequence to run. + Choices are ["verify", "nominal", "test"]. + """ + + index: int = 2 + configs: tuple = ([],) + scripts: list = [ + ("auxtel/latiss_acquire.py", BaseScript.is_external), + ] + + def __init__(self, sequence: str) -> None: + super().__init__() + self.sequence = sequence + self.configs = (registry[f"auxtel_acquire_{sequence}"],) + + +def run_auxtel_latiss_acquire() -> None: + parser = argparse.ArgumentParser() + parser.add_argument( + "sequence", + type=str, + choices=["verify", "nominal", "test"], + help="Specify which sequence to run.", + ) + args = parser.parse_args() + script_class = AuxTelLatissAcquire(sequence=args.sequence) + print( + f"\nAuxTel Latiss Acquire; " + f"running the {script_class.scripts[0][0]} script, " + f"for the {script_class.sequence} sequence, " + f"with configuration;\n{script_class.configs}" + ) + asyncio.run(script_class.run()) diff --git a/python/lsst/ts/IntegrationTests/auxtel_latiss_acquire_and_take_sequence.py b/python/lsst/ts/IntegrationTests/auxtel_latiss_acquire_and_take_sequence.py index 938ded5d..1971546c 100644 --- a/python/lsst/ts/IntegrationTests/auxtel_latiss_acquire_and_take_sequence.py +++ b/python/lsst/ts/IntegrationTests/auxtel_latiss_acquire_and_take_sequence.py @@ -42,13 +42,13 @@ class AuxTelLatissAcquireTakeSequence(BaseScript): ---------- sequence : `str` Defines which sequence to run. - Choices are ["pointing", "verify", "nominal", "test"]. + Choices are ["pointing",]. """ index: int = 2 configs: tuple = ([],) scripts: list = [ - ("auxtel/latiss_acquire.py", BaseScript.is_external), + ("auxtel/latiss_acquire_and_take_sequence.py", BaseScript.is_external), ] def __init__(self, sequence: str) -> None: @@ -62,7 +62,9 @@ def run_auxtel_latiss_acquire_and_take_sequence() -> None: parser.add_argument( "sequence", type=str, - choices=["pointing", "verify", "nominal", "test"], + choices=[ + "pointing", + ], help="Specify which sequence to run.", ) args = parser.parse_args() diff --git a/python/lsst/ts/IntegrationTests/auxtel_latiss_take_sequence.py b/python/lsst/ts/IntegrationTests/auxtel_latiss_take_sequence.py new file mode 100644 index 00000000..37354dae --- /dev/null +++ b/python/lsst/ts/IntegrationTests/auxtel_latiss_take_sequence.py @@ -0,0 +1,76 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- +# This file is part of ts_IntegrationTests. +# +# Developed for the Vera C. Rubin Observatory Telescope & Site Software system. +# This product includes software developed by the Vera C. Rubin Observatory +# Project (https://www.lsst.org). +# See the COPYRIGHT file at the top-level directory of this distribution +# for details of code ownership. +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License + +__all__ = [ + "AuxTelLatissTakeSequence", + "run_auxtel_latiss_take_sequence", +] + +import argparse +import asyncio + +from lsst.ts.IntegrationTests import BaseScript + +from .configs.config_registry import registry + + +class AuxTelLatissTakeSequence(BaseScript): + """Execute the given Standard or External script, + with the given Yaml configuration, + placed in the given ScriptQueue location. + + Parameters + ---------- + sequence : `str` + Defines which sequence to run. + Choices are ["verify", "nominal", "test"]. + """ + + index: int = 2 + configs: tuple = ([],) + scripts: list = [ + ("auxtel/latiss_take_sequence.py", BaseScript.is_standard), + ] + + def __init__(self, sequence: str) -> None: + super().__init__() + self.sequence = sequence + self.configs = (registry[f"auxtel_take_sequence_{sequence}"],) + + +def run_auxtel_latiss_take_sequence() -> None: + parser = argparse.ArgumentParser() + parser.add_argument( + "sequence", + type=str, + choices=["verify", "nominal", "test"], + help="Specify which sequence to run.", + ) + args = parser.parse_args() + script_class = AuxTelLatissTakeSequence(sequence=args.sequence) + print( + f"\nAuxTel Latiss Take Sequence; " + f"running the {script_class.scripts[0][0]} script, " + f"for the {script_class.sequence} sequence, " + f"with configuration;\n{script_class.configs}" + ) + asyncio.run(script_class.run()) diff --git a/python/lsst/ts/IntegrationTests/configs/auxtel_night_operations_configs.py b/python/lsst/ts/IntegrationTests/configs/auxtel_night_operations_configs.py index 2ca39e71..860d9ba0 100644 --- a/python/lsst/ts/IntegrationTests/configs/auxtel_night_operations_configs.py +++ b/python/lsst/ts/IntegrationTests/configs/auxtel_night_operations_configs.py @@ -107,7 +107,6 @@ registry["auxtel_acquire_and_take_sequence_pointing"] = yaml.safe_dump( { "object_name": "HD164461", - "rot_type": "PhysicalSky", "acq_filter": "empty_1", "acq_grating": "empty_1", "target_pointing_tolerance": 4, @@ -115,15 +114,16 @@ "do_acquire": True, "do_take_sequence": False, "do_pointing_model": True, - "reason": "IntegrationTesting", - "program": "IntegrationTesting", + "reason": "IntegrationTesting_PointingConfiguration", + "program": "IntegrationTesting_PointingConfiguration", }, explicit_start=True, canonical=True, ) +# latiss_acquire and latiss_take_sequence configs # verfiy -registry["auxtel_acquire_and_take_sequence_verify"] = yaml.safe_dump( +registry["auxtel_acquire_verify"] = yaml.safe_dump( { "object_name": "HD164461", "rot_type": "PhysicalSky", @@ -132,50 +132,69 @@ "acq_exposure_time": 0.4, "target_pointing_tolerance": 6, "max_acq_iter": 3, - "do_acquire": True, - "do_take_sequence": False, - "do_pointing_model": False, "target_pointing_verification": False, - "reason": "IntegrationTesting", - "program": "IntegrationTesting", + "reason": "IntegrationTesting_VerifyConfiguration", + "program": "IntegrationTesting_VerifyConfiguration", + }, + explicit_start=True, + canonical=True, +) +registry["auxtel_take_sequence_verify"] = yaml.safe_dump( + { + "filter_sequence": ["SDSSr_65mm"], + "grating_sequence": ["empty_1"], + "reason": "IntegrationTesting_VerifyConfiguration", + "program": "IntegrationTesting_VerifyConfiguration", }, explicit_start=True, canonical=True, ) # nominal/standard -registry["auxtel_acquire_and_take_sequence_nominal"] = yaml.safe_dump( +registry["auxtel_acquire_nominal"] = yaml.safe_dump( { "object_name": "HD164461", "rot_type": "PhysicalSky", "acq_filter": "SDSSr_65mm", "acq_grating": "empty_1", + "target_pointing_tolerance": 5, + "target_pointing_verification": False, + "reason": "IntegrationTesting_NominalConfiguration", + "program": "IntegrationTesting_NominalConfiguration", + }, + explicit_start=True, + canonical=True, +) +registry["auxtel_take_sequence_nominal"] = yaml.safe_dump( + { "grating_sequence": ["holo4_003", "holo4_003", "empty_1"], "filter_sequence": ["empty_1", "SDSSr_65mm", "SDSSr_65mm"], "exposure_time_sequence": [4.0, 4.0, 1.0], - "target_pointing_tolerance": 5, - "target_pointing_verification": False, - "do_acquire": True, - "do_take_sequence": True, - "reason": "IntegrationTesting", - "program": "IntegrationTesting", + "reason": "IntegrationTesting_NominalConfiguration", + "program": "IntegrationTesting_NominalConfiguration", }, explicit_start=True, canonical=True, ) # test -registry["auxtel_acquire_and_take_sequence_test"] = yaml.safe_dump( +registry["auxtel_acquire_test"] = yaml.safe_dump( { "object_name": "HD164461", "rot_type": "PhysicalSky", + "reason": "IntegrationTesting_TestConfiguration", + "program": "IntegrationTesting_TestConfiguration", + }, + explicit_start=True, + canonical=True, +) +registry["auxtel_take_sequence_test"] = yaml.safe_dump( + { "grating_sequence": ["holo4_003", "holo4_003", "holo4_003"], "filter_sequence": ["SDSSr_65mm", "SDSSr_65mm", "SDSSr_65mm"], "exposure_time_sequence": [5.0, 5.0, 5.0], - "do_acquire": False, - "do_take_sequence": True, - "reason": "IntegrationTesting", - "program": "IntegrationTesting", + "reason": "IntegrationTesting_TestConfiguration", + "program": "IntegrationTesting_TestConfiguration", }, explicit_start=True, canonical=True, diff --git a/python/lsst/ts/IntegrationTests/csc_state_transition.py b/python/lsst/ts/IntegrationTests/csc_state_transition.py index 74ec7d77..ed2ebc7f 100644 --- a/python/lsst/ts/IntegrationTests/csc_state_transition.py +++ b/python/lsst/ts/IntegrationTests/csc_state_transition.py @@ -168,6 +168,7 @@ def main(opts: argparse.Namespace) -> None: script_class = CSCStateTransition( csc=opts.csc, state=opts.state, + csc_index=opts.csc_index, additional_configuration=opts.additional_configuration, ) except KeyError as ke: diff --git a/tests/test_auxtel_night_operations.py b/tests/test_auxtel_night_operations.py index 38b2ede1..587e6fe5 100644 --- a/tests/test_auxtel_night_operations.py +++ b/tests/test_auxtel_night_operations.py @@ -25,7 +25,9 @@ from lsst.ts import salobj from lsst.ts.IntegrationTests import ( + AuxTelLatissAcquire, AuxTelLatissAcquireTakeSequence, + AuxTelLatissTakeSequence, AuxTelLatissWEPAlign, AuxTelResetOffsets, ScriptQueueController, @@ -92,11 +94,15 @@ async def test_auxtel_latiss_wep_align(self) -> None: # Assert scripts passed. self.assertEqual(script_class.script_states, [8]) - @parameterized.expand(["pointing", "verify", "nominal", "test"]) + @parameterized.expand( + [ + "pointing", + ] + ) async def test_auxtel_latiss_acquire_and_take_sequence(self, sequence: str) -> None: """Execute the AuxTelLatissAcquireTakeSequence integration test script, which runs the - ts_standardscripts/auxtel/auxtel_latiss_acquire_and_take_sequence.py + ts_externalscripts/auxtel/auxtel_latiss_acquire_and_take_sequence.py script. Use the configurations stored in the auxtel_night_operations_configs.py module. @@ -117,3 +123,53 @@ async def test_auxtel_latiss_acquire_and_take_sequence(self, sequence: str) -> N self.assertEqual(len(self.controller.queue_list), num_scripts) # Assert scripts passed. self.assertEqual(script_class.script_states, [8]) + + @parameterized.expand(["verify", "nominal", "test"]) + async def test_auxtel_latiss_acquire(self, sequence: str) -> None: + """Execute the AuxTelLatissAcquire integration test scripts, + which runs the + ts_externalscripts/auxtel/auxtel_latiss_acquire.py script. + Use the configurations stored in the auxtel_night_operations_configs.py + module. + """ + # Instantiate the AuxTelLatissAcquire integration tests. + script_class = AuxTelLatissAcquire(sequence=sequence) + # Get number of scripts + num_scripts = len(script_class.scripts) + print( + f"AuxTel Latiss Acquire. " + f"Running the {script_class.scripts[0][0]} script, " + f"for the {script_class.sequence} sequence, " + f"\nwith configuration;\n{script_class.configs}" + ) + # Execute the scripts. + await script_class.run() + # Assert script was added to ScriptQueue. + self.assertEqual(len(self.controller.queue_list), num_scripts) + # Assert scripts passed. + self.assertEqual(script_class.script_states, [8]) + + @parameterized.expand(["verify", "nominal", "test"]) + async def test_auxtel_latiss_take_sequence(self, sequence: str) -> None: + """Execute the AuxTelLatissTakeSequence integration test scripts, + which runs the + ts_externalscripts/auxtel/auxtel_latiss_acquire.py script. + Use the configurations stored in the auxtel_night_operations_configs.py + module. + """ + # Instantiate the AuxTelLatissTakeSequence integration tests. + script_class = AuxTelLatissTakeSequence(sequence=sequence) + # Get number of scripts + num_scripts = len(script_class.scripts) + print( + f"AuxTel Latiss Take Sequence. " + f"Running the {script_class.scripts[0][0]} script, " + f"for the {script_class.sequence} sequence, " + f"\nwith configuration;\n{script_class.configs}" + ) + # Execute the scripts. + await script_class.run() + # Assert script was added to ScriptQueue. + self.assertEqual(len(self.controller.queue_list), num_scripts) + # Assert scripts passed. + self.assertEqual(script_class.script_states, [8])