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

Add _Axis.getattr_from and _Axis.getitem_from. #183

Merged
merged 1 commit into from
Nov 30, 2023
Merged

Add _Axis.getattr_from and _Axis.getitem_from. #183

merged 1 commit into from
Nov 30, 2023

Conversation

thetorpedodog
Copy link
Contributor

This aims to eliminate the annoyance (and potential error) of writing

thing = whatever.obs if axis is _Axis.OBS else whatever.var

by letting you say

thing = axis.getattr_from(whatever)

instead.

This aims to eliminate the annoyance (and potential error) of writing

    thing = whatever.obs if axis is _Axis.OBS else whatever.var

by letting you say

    thing = axis.getattr_from(whatever)

instead.
Copy link
Member

@bkmartinjr bkmartinjr left a comment

Choose a reason for hiding this comment

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

OK w/ me as long as we are vigilant about using it!

Afterthought: I wonder if the name could be more self-explanatory? E.g., get_axis_attr or some such?

@ebezzi ebezzi marked this pull request as ready for review November 30, 2023 22:50
@ebezzi
Copy link
Member

ebezzi commented Nov 30, 2023

@thetorpedodog merging this PR so that I can use it in #179. Thanks!

@ebezzi ebezzi merged commit c6f6fd8 into main Nov 30, 2023
6 checks passed
@ebezzi ebezzi deleted the axis-getters branch November 30, 2023 23:06
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.

3 participants