Skip to content

Commit

Permalink
Use same metadata class as pipe_base is using
Browse files Browse the repository at this point in the history
Uses private pipe_base global to determine this during the
transition period.
  • Loading branch information
timj committed Nov 23, 2021
1 parent edb21c8 commit 0e532c7
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions python/lsst/ctrl/mpexec/singleQuantumExecutor.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@
# -----------------------------
from .quantumGraphExecutor import QuantumExecutor
from lsst.utils.timer import logInfo
from lsst.daf.base import PropertyList, PropertySet
from lsst.obs.base import Instrument
from lsst.pipe.base import (
AdjustQuantumHelper,
Expand All @@ -63,6 +62,11 @@
ButlerMDC,
JsonLogFormatter,
)

# During metadata transition phase, determine metadata class by
# asking pipe_base
from lsst.pipe.base.task import _TASK_METADATA_TYPE, _TASK_FULL_METADATA_TYPE

# ----------------------------------
# Local non-exported definitions --
# ----------------------------------
Expand Down Expand Up @@ -122,7 +126,7 @@ def execute(self, taskDef, quantum, butler):
with self.captureLogging(taskDef, quantum, butler) as captureLog:

# Save detailed resource usage before task start to metadata.
quantumMetadata = PropertyList()
quantumMetadata = _TASK_METADATA_TYPE()
logInfo(None, "prep", metadata=quantumMetadata)

taskClass, label, config = taskDef.taskClass, taskDef.label, taskDef.config
Expand All @@ -148,8 +152,8 @@ def execute(self, taskDef, quantum, butler):
# duplicative with logic in pipe_base that we can't easily call
# from here; we'll fix this on DM-29761.
logInfo(None, "end", metadata=quantumMetadata)
fullMetadata = PropertySet()
fullMetadata[taskDef.label] = PropertyList()
fullMetadata = _TASK_FULL_METADATA_TYPE()
fullMetadata[taskDef.label] = _TASK_METADATA_TYPE()
fullMetadata["quantum"] = quantumMetadata
self.writeMetadata(quantum, fullMetadata, taskDef, butler)
return
Expand Down

0 comments on commit 0e532c7

Please sign in to comment.