Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DM-41062: Add topic finding to efdUtils #64

Merged
merged 4 commits into from
Oct 10, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
11 changes: 6 additions & 5 deletions tests/test_butlerUtils.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@
)
from lsst.summit.utils.butlerUtils import removeDataProduct # noqa: F401
import lsst.daf.butler as dafButler
from lsst.daf.butler import DatasetRef
from lsst.resources import ResourcePath


Expand Down Expand Up @@ -110,7 +111,7 @@ def setUp(self):
self.assertIsInstance(self.dataCoordMinimal, dafButler.dimensions.DataCoordinate)
# NB the type check below is currently using a non-public API, but
# at present there isn't a good alternative
viewType = dafButler.core.dimensions._coordinate._DataCoordinateFullView
viewType = dafButler.dimensions._coordinate._DataCoordinateFullView
Copy link
Contributor

@TallJimbo TallJimbo Oct 10, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Better to drop this assertIsInstance check or replace it with a check on something that is public, like lsst.daf.butler.NamedKeyMapping. Leaving this dependency on a private symbol is just asking for your code to break unexpectedly in the future, and it's just a test, not a production use case.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done, thanks.

self.assertIsInstance(self.dataCoordFullView, viewType)

def test_getLatissDefaultCollections(self):
Expand Down Expand Up @@ -178,14 +179,14 @@ def test_getMostRecentDataId(self):

def test_getDatasetRefForDataId(self):
dRef = getDatasetRefForDataId(self.butler, 'raw', self.rawDataId)
self.assertIsInstance(dRef, lsst.daf.butler.core.datasets.ref.DatasetRef)
self.assertIsInstance(dRef, DatasetRef)

dRef = getDatasetRefForDataId(self.butler, 'raw', self.rawDataIdNoDayObSeqNum)
self.assertIsInstance(dRef, lsst.daf.butler.core.datasets.ref.DatasetRef)
self.assertIsInstance(dRef, DatasetRef)
dRef = getDatasetRefForDataId(self.butler, 'raw', self.dataCoordMinimal)
self.assertIsInstance(dRef, lsst.daf.butler.core.datasets.ref.DatasetRef)
self.assertIsInstance(dRef, DatasetRef)
dRef = getDatasetRefForDataId(self.butler, 'raw', self.dataCoordFullView)
self.assertIsInstance(dRef, lsst.daf.butler.core.datasets.ref.DatasetRef)
self.assertIsInstance(dRef, DatasetRef)

def test__dayobs_present(self):
goods = [{'day_obs': 123}, {'exposure.day_obs': 234}, {'day_obs': 345, 'otherkey': -1}]
Expand Down