From c996371bbd66905850f3bc4ee8291c3aa6bf8682 Mon Sep 17 00:00:00 2001 From: Brianna Smart Date: Mon, 26 Feb 2024 11:19:45 -0800 Subject: [PATCH] Swap doProduceAlerts back to do Write Alerts --- python/lsst/ap/association/packageAlerts.py | 6 +++--- tests/test_packageAlerts.py | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/python/lsst/ap/association/packageAlerts.py b/python/lsst/ap/association/packageAlerts.py index f95b7ed0..0f79138d 100644 --- a/python/lsst/ap/association/packageAlerts.py +++ b/python/lsst/ap/association/packageAlerts.py @@ -75,7 +75,7 @@ class PackageAlertsConfig(pexConfig.Config): default=False, ) - doPackageAlerts = pexConfig.Field( + doWriteAlerts = pexConfig.Field( dtype=bool, doc="Write alerts to disk if true.", default=False, @@ -149,7 +149,7 @@ def run(self, """Package DiaSources/Object and exposure data into Avro alerts. Alerts can be sent to the alert stream if ``doProduceAlerts`` is set - and written to disk if ``doPackageAlerts`` is set. Both can be set at the + and written to disk if ``doWriteAlerts`` is set. Both can be set at the same time, and are independent of one another. Writes Avro alerts to a location determined by the @@ -225,7 +225,7 @@ def run(self, if self.config.doProduceAlerts: self.produceAlerts(alerts, ccdVisitId) - if self.config.doPackageAlerts: + if self.config.doWriteAlerts: with open(os.path.join(self.config.alertWriteLocation, f"{ccdVisitId}.avro"), "wb") as f: self.alertSchema.store_alerts(f, alerts) diff --git a/tests/test_packageAlerts.py b/tests/test_packageAlerts.py index 2de452cd..c7752368 100644 --- a/tests/test_packageAlerts.py +++ b/tests/test_packageAlerts.py @@ -458,10 +458,10 @@ def mock_produce(*args, **kwargs): def testRun_without_produce(self): """Test the run method of package alerts with produce set to False and - doPackageAlerts set to true. + doWriteAlerts set to true. """ - packConfig = PackageAlertsConfig(doPackageAlerts=True) + packConfig = PackageAlertsConfig(doWriteAlerts=True) tempdir = tempfile.mkdtemp(prefix='alerts') packConfig.alertWriteLocation = tempdir packageAlerts = PackageAlertsTask(config=packConfig)