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-6981: Implement assignment to Flag columns in the pybind11 layer. #531

Merged
merged 1 commit into from May 27, 2020

Conversation

TallJimbo
Copy link
Member

This only works when the key is a str name or a Key instance; because support for slice assignment for all other fields currently delegates so much to NumPy, it's a lot harder to make that work for Flags.

This only works when the key is a `str` name or a `Key` instance;
because support for slice assignment for all other fields currently
delegates so much to NumPy, it's a lot harder to make that work for
Flags.
Copy link
Contributor

@erykoff erykoff left a comment

Choose a reason for hiding this comment

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

Looks great! I find a 99% speed-up when setting flag columns.

@@ -799,6 +799,26 @@ def testDelete(self):
with self.assertRaises(IndexError):
del catalog[50]

def testSetFlagColumn(self):
schema = lsst.afw.table.Schema()
key = schema.addField("a", type="Flag", doc="doc for 'a'")
Copy link
Contributor

Choose a reason for hiding this comment

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

I wonder if we should add another layer to this test, with a b flag as well as an a flag, to ensure that the bit-packing behind the scenes is doing what we think it should be doing. (However, I did confirm that this does work with multiple flags).

Copy link
Member Author

Choose a reason for hiding this comment

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

The bit-packing is implemented in a level below this that has its own tests, so I think one is sufficient.

@TallJimbo TallJimbo merged commit 6c8df71 into master May 27, 2020
@TallJimbo TallJimbo deleted the tickets/DM-6981 branch May 27, 2020 14:30
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