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

DM-32261: use datasets' defaults collection #153

Merged
merged 1 commit into from
Feb 28, 2022
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
15 changes: 6 additions & 9 deletions python/lsst/ap/verify/workspace.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@
import re
import stat

import lsst.skymap
import lsst.daf.butler as dafButler
import lsst.obs.base as obsBase

Expand Down Expand Up @@ -221,19 +220,17 @@ def workButler(self):
"""
if self._workButler is None:
try:
# Hard-code the collection names because it's hard to infer the inputs from the Butler
# Dataset generation puts all preloaded datasets in <instrument>/defaults.
# However, this definition excludes raws, which are not preloaded.
queryButler = dafButler.Butler(self.repo, writeable=True) # writeable for _workButler
inputs = {
lsst.skymap.BaseSkyMap.SKYMAP_RUN_COLLECTION_NAME,
}
inputs = []
for dimension in queryButler.registry.queryDataIds('instrument'):
instrument = obsBase.Instrument.fromName(dimension["instrument"], queryButler.registry)
defaultName = instrument.makeCollectionName("defaults")
inputs.append(defaultName)
rawName = instrument.makeDefaultRawIngestRunName()
inputs.add(rawName)
inputs.append(rawName)
self._ensureCollection(queryButler.registry, rawName, dafButler.CollectionType.RUN)
inputs.add(instrument.makeCalibrationCollectionName())
inputs.add(instrument.makeRefCatCollectionName())
inputs.update(queryButler.registry.queryCollections(re.compile(r"templates/\w+")))

# Create an output chain here, so that workButler can see it.
# Definition does not conflict with what pipetask --output uses.
Expand Down