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-39828: Use 'Catalog.__getitem__' instead of 'get' in selectors. #151

Merged
merged 1 commit into from Jul 3, 2023

Conversation

TallJimbo
Copy link
Member

'get' actually invokes the ColumnView method via getattr forwarding, and that's less capable than Catalog.getitem as well as being a pointless forward to ColumnView.getitem that probably never needed to exist.

@@ -86,7 +86,7 @@ def averageRaDecFromCat(cat):
dec_mean : `float`
Mean Dec in radians.
"""
return averageRaDec(cat.get("coord_ra"), cat.get("coord_dec"))
return averageRaDec(cat["coord_ra"], cat["coord_dec"])
Copy link
Member

Choose a reason for hiding this comment

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

The docstring for cat says that it must have a get method. Should that be changed to say __getitem__ that can accept 'coord_ra' and 'coord_dec'? Similarly for averageRaFromCat and averageDecFromCat.

'get' actually invokes the ColumnView method via __getattr__
forwarding, and that's less capable than Catalog.__getitem__ as well as
being a pointless forward to ColumnView.__getitem__ that probably never
needed to exist.
@TallJimbo TallJimbo merged commit f45f9ba into main Jul 3, 2023
1 check passed
@TallJimbo TallJimbo deleted the tickets/DM-39828 branch July 3, 2023 19:48
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