From 607d755c33d0ce270d19b0c061af77be3a71b246 Mon Sep 17 00:00:00 2001 From: Tiago Ribeiro Date: Wed, 11 Dec 2024 14:03:09 -0700 Subject: [PATCH 1/4] In auxtel/daytime_checkout/slew_and_take_image_checkout.py, fix how TCS readiness is configured. --- .../auxtel/daytime_checkout/slew_and_take_image_checkout.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python/lsst/ts/standardscripts/auxtel/daytime_checkout/slew_and_take_image_checkout.py b/python/lsst/ts/standardscripts/auxtel/daytime_checkout/slew_and_take_image_checkout.py index e7afa642a..f8b0b142f 100644 --- a/python/lsst/ts/standardscripts/auxtel/daytime_checkout/slew_and_take_image_checkout.py +++ b/python/lsst/ts/standardscripts/auxtel/daytime_checkout/slew_and_take_image_checkout.py @@ -84,7 +84,7 @@ def __init__(self, index=1, add_remotes: bool = True): # published to the efd. self.atcs = ATCS(domain=self.domain, intended_usage=atcs_usage, log=self.log) - tcs_ready_to_take_data = self.atcs if add_remotes else None + tcs_ready_to_take_data = self.atcs.ready_to_take_data if add_remotes else None self.latiss = LATISS( domain=self.domain, intended_usage=latiss_usage, From 43a232576aa1e40e0dbf6c1a7aa32bfcea44283e Mon Sep 17 00:00:00 2001 From: Tiago Ribeiro Date: Thu, 12 Dec 2024 14:47:26 -0700 Subject: [PATCH 2/4] In maintel/m1m3/enable_m1m3_slew_controller_flags.py, update run_block method to use new m1m3_in_engineering_mode context manager to enter/exit engineering mode when setting slew controller settings. --- .../maintel/m1m3/enable_m1m3_slew_controller_flags.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/python/lsst/ts/standardscripts/maintel/m1m3/enable_m1m3_slew_controller_flags.py b/python/lsst/ts/standardscripts/maintel/m1m3/enable_m1m3_slew_controller_flags.py index dc18c33b4..5837905d8 100644 --- a/python/lsst/ts/standardscripts/maintel/m1m3/enable_m1m3_slew_controller_flags.py +++ b/python/lsst/ts/standardscripts/maintel/m1m3/enable_m1m3_slew_controller_flags.py @@ -164,6 +164,7 @@ async def configure(self, config): async def run_block(self): - for flag, enable in zip(self.config.slew_flags, self.config.enable): - self.log.info(f"Setting m1m3 slew flag {flag.name} to {enable}.") - await self.mtcs.set_m1m3_slew_controller_settings(flag, enable) + async with self.mtcs.m1m3_in_engineering_mode(): + for flag, enable in zip(self.config.slew_flags, self.config.enable): + self.log.info(f"Setting m1m3 slew flag {flag.name} to {enable}.") + await self.mtcs.set_m1m3_slew_controller_settings(flag, enable) From 642493998ff94dd69e0a6d168ba95b1081d2ea44 Mon Sep 17 00:00:00 2001 From: Tiago Ribeiro Date: Fri, 13 Dec 2024 09:59:33 -0700 Subject: [PATCH 3/4] Update enable_m1m3_controller_flags unit test to mock the m1m3_in_engineering_mode async context manager. --- tests/test_maintel_m1m3_enable_m1m3_controller_flags.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/tests/test_maintel_m1m3_enable_m1m3_controller_flags.py b/tests/test_maintel_m1m3_enable_m1m3_controller_flags.py index 161e1f5b8..6a795d3c5 100644 --- a/tests/test_maintel_m1m3_enable_m1m3_controller_flags.py +++ b/tests/test_maintel_m1m3_enable_m1m3_controller_flags.py @@ -35,9 +35,16 @@ async def basic_make_script(self, index): self.script.mtcs = unittest.mock.AsyncMock() self.script.mtcs.start_task = utils.make_done_future() self.script.mtcs.set_m1m3_slew_controller_settings = unittest.mock.AsyncMock() + self.script.mtcs.configure_mock( + m1m3_in_engineering_mode=self.mock_m1m3_in_engineering_mode + ) return (self.script,) + @contextlib.asynccontextmanager + async def mock_m1m3_in_engineering_mode(self): + yield + @contextlib.asynccontextmanager async def make_dry_script(self): async with self.make_script(): From 1e33e354b1cd459a1d23ccc0593363ae212ede31 Mon Sep 17 00:00:00 2001 From: edennihy Date: Fri, 13 Dec 2024 08:44:54 -0700 Subject: [PATCH 4/4] Add news fragments. --- doc/news/DM-47890.bugfix.rst | 1 + doc/news/DM-47890.feature.rst | 1 + 2 files changed, 2 insertions(+) create mode 100644 doc/news/DM-47890.bugfix.rst create mode 100644 doc/news/DM-47890.feature.rst diff --git a/doc/news/DM-47890.bugfix.rst b/doc/news/DM-47890.bugfix.rst new file mode 100644 index 000000000..7569bc7e4 --- /dev/null +++ b/doc/news/DM-47890.bugfix.rst @@ -0,0 +1 @@ +In `auxtel/daytime_checkout/slew_and_take_image_checkout.py`, fix how TCS readiness is configured. diff --git a/doc/news/DM-47890.feature.rst b/doc/news/DM-47890.feature.rst new file mode 100644 index 000000000..ec47eaa0e --- /dev/null +++ b/doc/news/DM-47890.feature.rst @@ -0,0 +1 @@ +In `maintel/m1m3/enable_m1m3_slew_controller_flags.py`, update `run_block`` method to use new `m1m3_in_engineering_mode`` context manager to enter/exit engineering mode when setting slew controller settings.