Skip to content

Commit

Permalink
Mark visit joint-table elements as populated by visit.
Browse files Browse the repository at this point in the history
  • Loading branch information
TallJimbo committed Jul 28, 2023
1 parent 72b8792 commit 12f8d35
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
3 changes: 3 additions & 0 deletions python/lsst/daf/butler/configs/dimensions.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -427,6 +427,7 @@ elements:
A many-to-many join table that provides region information for
visit-detector combinations.
requires: [visit, detector]
populated_by: visit
storage:
cls: lsst.daf.butler.registry.dimensions.table.TableDimensionRecordStorage

Expand Down Expand Up @@ -459,6 +460,7 @@ elements:
A many-to-many join table that relates exposures to the visits they
belong to.
requires: [exposure, visit]
populated_by: visit
always_join: true
storage:
cls: lsst.daf.butler.registry.dimensions.table.TableDimensionRecordStorage
Expand All @@ -468,6 +470,7 @@ elements:
A many-to-many join table that relates visits to the visit_systems they
belong to.
requires: [visit, visit_system]
populated_by: visit
always_join: true
storage:
cls: lsst.daf.butler.registry.dimensions.table.TableDimensionRecordStorage
Expand Down
14 changes: 14 additions & 0 deletions tests/test_dimensions.py
Original file line number Diff line number Diff line change
Expand Up @@ -285,6 +285,20 @@ def testObservationDimensions(self):
self.assertEqual(graph.temporal.names, {"observation_timespans"})
self.assertEqual(next(iter(graph.spatial)).governor, self.universe["instrument"])
self.assertEqual(next(iter(graph.temporal)).governor, self.universe["instrument"])
self.assertEqual(self.universe["visit_definition"].populated_by, self.universe["visit"])
self.assertEqual(self.universe["visit_system_membership"].populated_by, self.universe["visit"])
self.assertEqual(self.universe["visit_detector_region"].populated_by, self.universe["visit"])
self.assertEqual(
self.universe.get_elements_populated_by(self.universe["visit"]),
NamedValueSet(
{
self.universe["visit"],
self.universe["visit_definition"],
self.universe["visit_system_membership"],
self.universe["visit_detector_region"],
}
),
)

def testSkyMapDimensions(self):
graph = DimensionGraph(self.universe, names=("patch",))
Expand Down

0 comments on commit 12f8d35

Please sign in to comment.