Skip to content

Commit

Permalink
Merge pull request #204 from lsst-dm/tickets/DM-43712
Browse files Browse the repository at this point in the history
DM-43712: Add configurable buffer for template and refcat preload
  • Loading branch information
hsinfang authored Nov 13, 2024
2 parents 6bc2d8e + 7a4a239 commit ba0cfd5
Show file tree
Hide file tree
Showing 3 changed files with 192 additions and 149 deletions.
19 changes: 16 additions & 3 deletions bin.src/make_export.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,9 +118,22 @@ def _export_for_copy(butler, target_butler, wants):
if "datasets" in wants:
for selection in wants["datasets"]:
logging.debug(f"Selecting datasets: {selection}")
if "datasetType" not in selection:
selection["datasetType"] = ...
records = _filter_datasets(butler, target_butler, **selection)
if "collections" not in selection:
raise RuntimeError("Must provide collections to select datasets.")
if "datasetType" in selection:
dataset_types = [selection.pop("datasetType")]
else:
# TODO: A new query API after DM-45873 may replace or improve this usage.
all_types = {t.name for t in butler.registry.queryDatasetTypes()}
collections_info = butler.collections.query_info(
selection["collections"], include_summary=True
)
dataset_types = butler.collections._filter_dataset_types(
all_types, collections_info
)
records = _filter_datasets(
butler, target_butler, dataset_types, **selection
)
contents.saveDatasets(records)

# Save selected collections and chains
Expand Down
Loading

0 comments on commit ba0cfd5

Please sign in to comment.