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

Backwards incompatible change to Constructs.filter_by_axis API #137

Closed
davidhassell opened this issue Apr 22, 2021 · 0 comments · Fixed by #138
Closed

Backwards incompatible change to Constructs.filter_by_axis API #137

davidhassell opened this issue Apr 22, 2021 · 0 comments · Fixed by #138
Assignees
Labels
enhancement New feature or request
Milestone

Comments

@davidhassell
Copy link
Contributor

The API changes described in #130 and #132 imply a change in Constructs.filter_by_axis, namely the existing:

    def filter_by_axis(mode=None, axes*):  # v1.8.8.0

becomes:

    def filter_by_axis(axes, axis_mode='and'):  # v1.8.9.0

The old mode and new axis_mode parameters behave the same.

Potential for existing code to silently break

The existing code

>>> d = c.filter_by_axis('or', 'domainaxis1')  # v1.8.8.0

will behave differently with this change in v1.8.9.0, in that both 'or' and 'domainaxis1'' will now count as *axes arguments , rather than the 'or' being assigned to the old mode parameter.

The way to rewrite this code would be:

>>> d = c.filter_by_axis('domainaxis1', axis_mode='or')  # v1.8.9.0
@davidhassell davidhassell added the enhancement New feature or request label Apr 22, 2021
@davidhassell davidhassell self-assigned this Apr 22, 2021
@davidhassell davidhassell changed the title Backward incompatible change to Constructs.filter_by_axis API Backwards incompatible change to Constructs.filter_by_axis API Apr 22, 2021
@davidhassell davidhassell added this to the 1.8.9.0 milestone May 10, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant