Skip to content

Commit

Permalink
Swap doProduceAlerts back to do Write Alerts
Browse files Browse the repository at this point in the history
  • Loading branch information
bsmartradio committed Feb 27, 2024
1 parent cfb4a33 commit c996371
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions python/lsst/ap/association/packageAlerts.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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)

Expand Down
4 changes: 2 additions & 2 deletions tests/test_packageAlerts.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit c996371

Please sign in to comment.