Skip to content

Commit

Permalink
Merge pull request #271 from lsst/tickets/DM-41365
Browse files Browse the repository at this point in the history
DM-41365: Use new Butler get_dataset_type and find_dataset APIs
  • Loading branch information
timj authored Nov 3, 2023
2 parents ef1ac55 + 567e2c6 commit 8caecd3
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 12 deletions.
4 changes: 2 additions & 2 deletions python/lsst/ctrl/mpexec/preExecInit.py
Original file line number Diff line number Diff line change
Expand Up @@ -431,13 +431,13 @@ def _check_compatibility(datasetType: DatasetType, expected: DatasetType, is_inp
self.full_butler.registry.registerDatasetType(datasetType)
except ConflictingDefinitionError:
if not _check_compatibility(
datasetType, self.full_butler.registry.getDatasetType(datasetType.name), is_input
datasetType, self.full_butler.get_dataset_type(datasetType.name), is_input
):
raise
else:
_LOG.debug("Checking DatasetType %s against registry", datasetType)
try:
expected = self.full_butler.registry.getDatasetType(datasetType.name)
expected = self.full_butler.get_dataset_type(datasetType.name)
except KeyError:
# Likely means that --register-dataset-types is forgotten.
missing_datasetTypes.add(datasetType.name)
Expand Down
16 changes: 6 additions & 10 deletions tests/test_cmdLineFwk.py
Original file line number Diff line number Diff line change
Expand Up @@ -860,14 +860,10 @@ def testSimpleQGraphOutputsFail(self):
butler.registry.refresh()

# drop one of the two outputs from one task
ref1 = butler.registry.findDataset(
"add2_dataset2", collections=args.output, instrument="INSTR", detector=0
)
ref1 = butler.find_dataset("add2_dataset2", collections=args.output, instrument="INSTR", detector=0)
self.assertIsNotNone(ref1)
# also drop the metadata output
ref2 = butler.registry.findDataset(
"task1_metadata", collections=args.output, instrument="INSTR", detector=0
)
ref2 = butler.find_dataset("task1_metadata", collections=args.output, instrument="INSTR", detector=0)
self.assertIsNotNone(ref2)
butler.pruneDatasets([ref1, ref2], disassociate=True, unstore=True, purge=True)

Expand Down Expand Up @@ -912,13 +908,13 @@ def testSimpleQGraphClobberOutputs(self):
butler.registry.refresh()

# drop one of the two outputs from one task
ref1 = butler.registry.findDataset(
"add2_dataset2", collections=args.output, dataId=dict(instrument="INSTR", detector=0)
ref1 = butler.find_dataset(
"add2_dataset2", collections=args.output, data_id=dict(instrument="INSTR", detector=0)
)
self.assertIsNotNone(ref1)
# also drop the metadata output
ref2 = butler.registry.findDataset(
"task1_metadata", collections=args.output, dataId=dict(instrument="INSTR", detector=0)
ref2 = butler.find_dataset(
"task1_metadata", collections=args.output, data_id=dict(instrument="INSTR", detector=0)
)
self.assertIsNotNone(ref2)
butler.pruneDatasets([ref1, ref2], disassociate=True, unstore=True, purge=True)
Expand Down

0 comments on commit 8caecd3

Please sign in to comment.