Skip to content

Commit

Permalink
Remove default entries from composites configuration
Browse files Browse the repository at this point in the history
Defining ExposureF and calexp disassembly behavior in the default
configuration did not gain us anything over the default "false".
It was there for historical purposes but it now confuses downstream
overrides.
  • Loading branch information
timj committed Jul 30, 2020
1 parent 17014ce commit 1e14c67
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 6 deletions.
6 changes: 3 additions & 3 deletions python/lsst/daf/butler/configs/datastores/composites.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@ default: false
# Types can be StorageClass names or DatasetType names, with DatasetType
# name always taking preference over StorageClass name.
disassembled:
ExposureI: false
ExposureF: false
calexp: false
# This is a place holder to seed the mapping so that specific configs
# can override and allows this default to be used as documentation
__null__: false
11 changes: 10 additions & 1 deletion python/lsst/daf/butler/core/composites.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,9 +83,18 @@ def __init__(self, config: Union[str, ButlerConfig, CompositesConfig], *,
assert isinstance(config, CompositesConfig)
self.config = config

# Pre-filter the disassembly lookup table to remove the
# placeholder __ key we added for documentation.
# It should be harmless but might confuse validation
# Retain the entry as a Config so change in place
disassemblyMap = self.config[DISASSEMBLY_KEY]
for k in set(disassemblyMap):
if k.startswith("__"):
del disassemblyMap[k]

# Calculate the disassembly lookup table -- no need to process
# the values
self._lut = processLookupConfigs(self.config[DISASSEMBLY_KEY], universe=universe)
self._lut = processLookupConfigs(disassemblyMap, universe=universe)

def shouldBeDisassembled(self, entity: Union[DatasetRef, DatasetType, StorageClass]) -> bool:
"""Given some choices, indicate whether the entity should be
Expand Down
2 changes: 0 additions & 2 deletions tests/test_composites.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,8 @@ def testConfig(self):
self.assertIn("default", c)
# Check merging has worked
rootKey = "disassembled"
self.assertIn(f".{rootKey}.calexp", c)
self.assertIn(f".{rootKey}.dummyTrue", c)
self.assertIn(f".{rootKey}.StructuredComposite", c)
self.assertIn(f".{rootKey}.ExposureF", c)

# Check that all entries are booleans (this is meant to be enforced
# internally)
Expand Down

0 comments on commit 1e14c67

Please sign in to comment.