Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use same metadata class as pipe_base is using #154

Merged
merged 1 commit into from
Dec 6, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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