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
Conversation
There was a problem hiding this 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` |
There was a problem hiding this comment.
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.
tests/test_sqlRegistry.py
Outdated
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()}) |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
tests/test_sqlRegistry.py
Outdated
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} |
There was a problem hiding this comment.
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` |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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") |
There was a problem hiding this comment.
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. | ||
""" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add Raises
section?
f2e8c46
to
9d625b5
Compare
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).
9d625b5
to
0d9f3a9
Compare
0d9f3a9
to
0966e7d
Compare
No description provided.