Skip to content

Cleanup Barbs._find_tails. #24290

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

Merged
merged 1 commit into from
Oct 29, 2022
Merged

Cleanup Barbs._find_tails. #24290

merged 1 commit into from
Oct 29, 2022

Conversation

anntzer
Copy link
Contributor

@anntzer anntzer commented Oct 28, 2022

  • numpydoc.
  • use np.around instead of manual rounding, and divmod instead of separate div and mod; cast to int at the end.

PR Summary

PR Checklist

Tests and Styling

  • Has pytest style unit tests (and pytest passes).
  • Is Flake 8 compliant (install flake8-docstrings and run flake8 --docstring-convention=all).

Documentation

  • Documentation is sphinx and numpydoc compliant (the docs should build without error).
  • New plotting related features are documented with examples.

Release Notes

  • New features are marked with a .. versionadded:: directive in the docstring and documented in doc/users/next_whats_new/
  • API changes are marked with a .. versionchanged:: directive in the docstring and documented in doc/api/next_api_changes/
  • Release notes conform with instructions in next_whats_new/README.rst or next_api_changes/README.rst

mag = mag % full

mag = half * np.around(mag / half)
n_flags, mag = divmod(mag, flag)
Copy link
Member

Choose a reason for hiding this comment

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

AFAICS this would not work for non-array inputs.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Indeed. However we only ever call this with actual arrays, so I just adjusted the docstring accordingly.

- numpydoc.
- use np.around instead of manual rounding, and divmod instead of
  separate div and mod; cast to int at the end.
@QuLogic QuLogic merged commit 54360f3 into matplotlib:main Oct 29, 2022
@QuLogic QuLogic added this to the v3.7.0 milestone Oct 29, 2022
@anntzer anntzer deleted the bft branch October 29, 2022 08:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants