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-25776: Adapt to daf.butler.DataCoordinate API changes. #44

Merged
merged 1 commit into from
Jul 18, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
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
6 changes: 3 additions & 3 deletions python/lsst/skymap/packers.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

__all__ = ("SkyMapDimensionPacker",)

from lsst.daf.butler import DimensionPacker, ExpandedDataCoordinate, DimensionGraph, DataCoordinate
from lsst.daf.butler import DimensionPacker, DimensionGraph, DataCoordinate


class SkyMapDimensionPacker(DimensionPacker):
Expand All @@ -30,7 +30,7 @@ class SkyMapDimensionPacker(DimensionPacker):

Parameters
----------
fixed : `lsst.daf.butler.ExpandedDataCoordinate`
fixed : `lsst.daf.butler.DataCoordinate`
Expanded data ID that must include at least the skymap dimension.
dimensions : `lsst.daf.butler.DimensionGraph`
The dimensions of data IDs packed by this instance. Must include
Expand Down Expand Up @@ -73,7 +73,7 @@ def configure(cls, dimensions):
kwds = {}
return metadata, kwds

def __init__(self, fixed: ExpandedDataCoordinate, dimensions: DimensionGraph):
def __init__(self, fixed: DataCoordinate, dimensions: DimensionGraph):
super().__init__(fixed, dimensions)
record = fixed.records["skymap"]
self._skyMapName = record.name
Expand Down
8 changes: 5 additions & 3 deletions tests/test_packers.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
import lsst.utils.tests

try:
from lsst.daf.butler import ExpandedDataCoordinate, DimensionUniverse, DimensionGraph, DataCoordinate
from lsst.daf.butler import DimensionUniverse, DimensionGraph, DataCoordinate
HAVE_DAF_BUTLER = True
except ImportError:
HAVE_DAF_BUTLER = False
Expand All @@ -37,17 +37,19 @@ class SkyMapDimensionPackerTestCase(lsst.utils.tests.TestCase):

def setUp(self):
self.universe = DimensionUniverse()
self.fixed = ExpandedDataCoordinate(
self.fixed = DataCoordinate.fromFullValues(
DimensionGraph(universe=self.universe, names=["skymap"]),
values=("unimportant",),
).expanded(
records={
"skymap": self.universe["skymap"].RecordClass.fromDict({
"name": "unimportant",
"tract_max": 5,
"patch_nx_max": 3,
"patch_ny_max": 3,
})
})
}
)

def testWithoutFilter(self):
dimensions = DimensionGraph(universe=self.universe, names=["tract", "patch"])
Expand Down