Skip to content

Commit

Permalink
Merge pull request #491 from lsst/tickets/DM-46599
Browse files Browse the repository at this point in the history
DM-46599: Stop using deprecated Butler.collections property
  • Loading branch information
dhirving authored Oct 15, 2024
2 parents 54c5bc6 + 2664d83 commit 2b7fa98
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 11 deletions.
8 changes: 4 additions & 4 deletions python/lsst/obs/base/_instrument.py
Original file line number Diff line number Diff line change
Expand Up @@ -701,9 +701,9 @@ def loadCamera(butler: Butler, dataId: DataId, *, collections: Any = None) -> tu
Data ID that identifies at least the ``instrument`` and ``exposure``
dimensions.
collections : Any, optional
Collections to be searched, overriding ``self.butler.collections``.
Can be any of the types supported by the ``collections`` argument
to butler construction.
Collections to be searched, overriding
``self.butler.collections.defaults``. Can be any of the types
supported by the ``collections`` argument to butler construction.
Returns
-------
Expand All @@ -722,7 +722,7 @@ def loadCamera(butler: Butler, dataId: DataId, *, collections: Any = None) -> tu
Raised when ``dataId`` does not specify a valid data ID.
"""
if collections is None:
collections = list(butler.collections)
collections = list(butler.collections.defaults)
# Registry would do data ID expansion internally if we didn't do it first,
# but we might want an expanded data ID ourselves later, so we do it here
# to ensure it only happens once.
Expand Down
10 changes: 5 additions & 5 deletions python/lsst/obs/base/defineVisits.py
Original file line number Diff line number Diff line change
Expand Up @@ -357,7 +357,7 @@ def compute(
Struct describing the visit and the exposures associated with it.
collections : Any, optional
Collections to be searched for raws and camera geometry, overriding
``self.butler.collections``.
``self.butler.collections.defaults``.
Can be any of the types supported by the ``collections`` argument
to butler construction.
Expand Down Expand Up @@ -479,7 +479,7 @@ def _buildVisitRecords(
constituent exposures.
collections : Any, optional
Collections to be searched for raws and camera geometry, overriding
``self.butler.collections``.
``self.butler.collections.defaults``.
Can be any of the types supported by the ``collections`` argument
to butler construction.
Expand Down Expand Up @@ -637,7 +637,7 @@ def run(
instrument, and are expected to be on-sky science exposures.
collections : Any, optional
Collections to be searched for raws and camera geometry, overriding
``self.butler.collections``.
``self.butler.collections.defaults``.
Can be any of the types supported by the ``collections`` argument
to butler construction.
update_records : `bool`, optional
Expand Down Expand Up @@ -1203,7 +1203,7 @@ def computeExposureBounds(
Dimension record for the exposure.
collections : Any, optional
Collections to be searched for raws and camera geometry, overriding
``self.butler.collections``.
``self.butler.collections.defaults``.
Can be any of the types supported by the ``collections`` argument
to butler construction.
Expand All @@ -1214,7 +1214,7 @@ def computeExposureBounds(
sphere representing that detector's corners projected onto the sky.
"""
if collections is None:
collections = list(self.butler.collections)
collections = list(self.butler.collections.defaults)
camera, versioned = loadCamera(self.butler, exposure.dataId, collections=collections)
if not versioned and self.config.requireVersionedCamera:
raise LookupError(f"No versioned camera found for exposure {exposure.dataId}.")
Expand Down
2 changes: 1 addition & 1 deletion tests/test_defineVisits.py
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ def testPickleTask(self):
self.assertEqual(self.task.log.name, copy.log.name)
self.assertEqual(self.task.config, copy.config)
self.assertEqual(self.task.butler._config, copy.butler._config)
self.assertEqual(list(self.task.butler.collections), list(copy.butler.collections))
self.assertEqual(list(self.task.butler.collections.defaults), list(copy.butler.collections.defaults))
self.assertEqual(self.task.butler.run, copy.butler.run)
self.assertEqual(self.task.universe, copy.universe)

Expand Down
2 changes: 1 addition & 1 deletion tests/test_ingest.py
Original file line number Diff line number Diff line change
Expand Up @@ -467,7 +467,7 @@ def testPickleTask(self):
self.assertEqual(self.task.log.name, copy.log.name)
self.assertEqual(self.task.config, copy.config)
self.assertEqual(self.task.butler._config, copy.butler._config)
self.assertEqual(list(self.task.butler.collections), list(copy.butler.collections))
self.assertEqual(list(self.task.butler.collections.defaults), list(copy.butler.collections.defaults))
self.assertEqual(self.task.butler.run, copy.butler.run)
self.assertEqual(self.task.universe, copy.universe)
self.assertEqual(self.task.datasetType, copy.datasetType)
Expand Down

0 comments on commit 2b7fa98

Please sign in to comment.