Skip to content

Commit ba0cfd5

Browse files
authored
Merge pull request #204 from lsst-dm/tickets/DM-43712
DM-43712: Add configurable buffer for template and refcat preload
2 parents 6bc2d8e + 7a4a239 commit ba0cfd5

File tree

3 files changed

+192
-149
lines changed

3 files changed

+192
-149
lines changed

bin.src/make_export.py

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -118,9 +118,22 @@ def _export_for_copy(butler, target_butler, wants):
118118
if "datasets" in wants:
119119
for selection in wants["datasets"]:
120120
logging.debug(f"Selecting datasets: {selection}")
121-
if "datasetType" not in selection:
122-
selection["datasetType"] = ...
123-
records = _filter_datasets(butler, target_butler, **selection)
121+
if "collections" not in selection:
122+
raise RuntimeError("Must provide collections to select datasets.")
123+
if "datasetType" in selection:
124+
dataset_types = [selection.pop("datasetType")]
125+
else:
126+
# TODO: A new query API after DM-45873 may replace or improve this usage.
127+
all_types = {t.name for t in butler.registry.queryDatasetTypes()}
128+
collections_info = butler.collections.query_info(
129+
selection["collections"], include_summary=True
130+
)
131+
dataset_types = butler.collections._filter_dataset_types(
132+
all_types, collections_info
133+
)
134+
records = _filter_datasets(
135+
butler, target_butler, dataset_types, **selection
136+
)
124137
contents.saveDatasets(records)
125138

126139
# Save selected collections and chains

0 commit comments

Comments
 (0)