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-15098: Add Registry.getRegion(DataId) #60

Merged
merged 3 commits into from Aug 6, 2018
Merged

Conversation

pschella
Copy link
Collaborator

No description provided.

Copy link
Member

@timj timj left a comment

Choose a reason for hiding this comment

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

Minor comments regarding docstrings and test coverage but otherwise fine.


Raises
------
`ValueError`
Copy link
Member

Choose a reason for hiding this comment

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

Exception names in a Raises block are not backtick quoted.

region = lsst.sphgeom.ConvexPolygon((lsst.sphgeom.UnitVector3d(1, 0, 0),
lsst.sphgeom.UnitVector3d(0, 1, 0),
lsst.sphgeom.UnitVector3d(0, 0, 1)))
registry.addDataUnitEntry("SkyMap", {"skymap": "DummySkyMap", "sha1": bytes()})
Copy link
Member

Choose a reason for hiding this comment

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

I've just noticed we are insisting on this being a sha1. Would it generically be better to call this hash or something?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yes, but out of scope for this ticket.

lsst.sphgeom.UnitVector3d(0, 0, 1)))
registry.addDataUnitEntry("SkyMap", {"skymap": "DummySkyMap", "sha1": bytes()})
registry.addDataUnitEntry("Tract", {"skymap": "DummySkyMap", "tract": 0, "region": region})
dataId = {"skymap": "DummySkyMap", "tract": 0}
Copy link
Member

Choose a reason for hiding this comment

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

Can you also show that tract: 1 doesn't get retrieved?

Parameters
----------
dataId : `dict`
A `dict` of `DataUnit` name, value pairs that label the `DatasetRef`
Copy link
Member

Choose a reason for hiding this comment

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

Is it confusing to call out to the DataUnit class docs here even though these arguments are not of that class?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

It is, and that should be fixed in multiple places. I'll do it on this ticket.

dataUnit = self._schema.dataUnits.getByLinkName(key)
if dataUnit.regionColumn is not None:
if haveSpatialDataUnit:
raise NotImplementedError("Cannot have more than one spatial region")
Copy link
Member

Choose a reason for hiding this comment

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

Please add a test for this condition.

-------
dataUnit : `DataUnit`
The corresponding `DataUnit` instance.
"""
Copy link
Contributor

Choose a reason for hiding this comment

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

Add Raises section?

@pschella pschella force-pushed the tickets/DM-15098 branch 3 times, most recently from f2e8c46 to 9d625b5 Compare August 1, 2018 21:35
Pim Schellart added 2 commits August 6, 2018 12:11
This makes it easier to make the distinction between
dataunits that have a table with a region column (most spatial
dataunits) and ones that don't but are still spatial (SkyPix).
@pschella pschella merged commit 0966e7d into master Aug 6, 2018
@ktlim ktlim deleted the tickets/DM-15098 branch August 25, 2018 06:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants