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-31924: make data ID packing configurable #63

Merged
merged 3 commits into from Apr 27, 2023
Merged

Conversation

TallJimbo
Copy link
Member

No description provided.

I'm not sure this was ever used by daf_butler code that made it to
the 'main' branch, and it definitely hasn't been used in a long while.
@TallJimbo TallJimbo force-pushed the tickets/DM-31924 branch 2 times, most recently from 3b40a0e to 47e07b8 Compare April 18, 2023 15:41
Copy link
Contributor

@parejkoj parejkoj left a comment

Choose a reason for hiding this comment

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

This does look like a better approach, but I'm nervous about some of the explicit and implicit logic.

I think pycov would be not very happy about the series of nested ifs with the existing tests; I don't know how much of a pain it would be to get full coverage of the __init__, but at least mapping out a chunk of that space would make me more comfortable.

python/lsst/skymap/packers.py Outdated Show resolved Hide resolved
python/lsst/skymap/packers.py Show resolved Hide resolved
python/lsst/skymap/packers.py Show resolved Hide resolved
python/lsst/skymap/packers.py Show resolved Hide resolved
a fixed set of bands defined in this class, but this should be avoided
in new code.
n_bands : `int` or `None`, optional
The number of bands to leave room for in the packed ID. If `None`,
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe worth mentioning here why one might want n_bands != len(bands)? > makes sense to me, to leave room for future changes, but should < be a logic or value error? I didn't make the connection as to why both of these could be passed until I looked at the logic of the code below.

Copy link
Member Author

Choose a reason for hiding this comment

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

I could see < being useful especially when it comes from the config interface, as a way to more easily have single consistent mapping of which sometimes only a subset is used (e.g. broadband + narrowband filters).

Copy link
Contributor

Choose a reason for hiding this comment

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

I think that's worth a sentence in this docstring, because I don't feel it's an obvious usage.

python/lsst/skymap/packers.py Outdated Show resolved Hide resolved
python/lsst/skymap/packers.py Outdated Show resolved Hide resolved
tests/test_packers.py Show resolved Hide resolved
python/lsst/skymap/packers.py Outdated Show resolved Hide resolved
a fixed set of bands defined in this class, but this should be avoided
in new code.
a fixed set of bands defined in this class. When calling code can
enumerate the bands it is likely to see providing an explict mapping is
Copy link
Contributor

Choose a reason for hiding this comment

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

"it is likely to see providing"?

Copy link
Member Author

Choose a reason for hiding this comment

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

comma makes all the difference; should be "is likely to see, providing"

Copy link
Contributor

@parejkoj parejkoj left a comment

Choose a reason for hiding this comment

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

Thanks for the cleanups: handful of other comments.

@TallJimbo TallJimbo merged commit 790e439 into main Apr 27, 2023
1 check passed
@TallJimbo TallJimbo deleted the tickets/DM-31924 branch April 27, 2023 01:57
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

2 participants