8000 Fixed `repr` for `SecondaryAxis` by oscargus · Pull Request #22283 · matplotlib/matplotlib · GitHub
[go: up one dir, main page]

Skip to content

Fixed repr for SecondaryAxis #22283

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 2 commits into from
Jan 22, 2022
Merged

Fixed repr for SecondaryAxis #22283

merged 2 commits into from
Jan 22, 2022

Conversation

oscargus
Copy link
Member

and increase coverage for axes/_base.py

PR Summary

Main purpuse was to increase test coverage, but when I played around, I found the following:

>>> ax.secondary_xaxis('bottom')
Traceback (most recent call last):

  File ~\miniconda3\lib\site-packages\IPython\core\formatters.py:707 in __call__
    printer.pretty(obj)

  File ~\miniconda3\lib\site-packages\IPython\lib\pretty.py:410 in pretty
    return _repr_pprint(obj, self, cycle)

  File ~\miniconda3\lib\site-packages\IPython\lib\pretty.py:778 in _repr_pprint
    output = repr(obj)

  File ~\matplotlib\lib\matplotlib\axes\_base.py:711 in __repr__
    title = self.get_title(loc=k)

AttributeError: 'SecondaryAxis' object has no attribute 'get_title'

so I fixed that as well.

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

  • [N/A] New features are documented, with examples if plot related.
  • [N/A] New features have an entry in doc/users/next_whats_new/ (follow instructions in README.rst there).
  • [N/A] API changes documented in doc/api/next_api_changes/ (follow instructions in README.rst there).
  • Documentation is sphinx and numpydoc compliant (the docs should build without error).

@oscargus oscargus changed the title Fixed repr for SecondaryAxis Fixed repr for SecondaryAxis Jan 22, 2022
and increase coverage for axes/_base.py
Co-authored-by: Tim Hoffmann <2836374+timhoffm@users.noreply.github.com>
< 8000 /div>
@greglucas greglucas merged commit 075067c into matplotlib:main Jan 22, 2022
@oscargus oscargus deleted the axestests branch January 22, 2022 23:40
@QuLogic QuLogic added this to the v3.5.2 milestone Jan 24, 2022
@QuLogic
Copy link
Member
QuLogic commented Jan 24, 2022

@meeseeksdev backport to v3.5.x

@lumberbot-app
Copy link
lumberbot-app bot commented Jan 24, 2022

Owee, I'm MrMeeseeks, Look at me.

There seem to be a conflict, please backport manually. Here are approximate instructions:

  1. Checkout backport branch and update it.
git checkout v3.5.x
git pull
  1. Cherry pick the first parent branch of the this PR on top of the older branch:
git cherry-pick -m1 075067c5350210d82748bcfcb5bfca41db8e3a0b
  1. You will likely have some merge/cherry-pick conflict here, fix them and commit:
git commit -am 'Backport PR #22283: Fixed `repr` for `SecondaryAxis`'
  1. Push to a named branch:
git push YOURFORK v3.5.x:auto-backport-of-pr-22283-on-v3.5.x
  1. Create a PR against branch v3.5.x, I would have named this PR:

"Backport PR #22283 on branch v3.5.x (Fixed repr for SecondaryAxis)"

And apply the correct labels and milestones.

Congratulations — you did some good work! Hopefully your backport PR will be tested by the continuous integration and merged soon!

Remember to remove the Still Needs Manual Backport label once the PR gets merged.

If these instructions are inaccurate, feel free to suggest an improvement.

@QuLogic
Copy link
Member
QuLogic commented Jan 24, 2022

OK, I won't bother then.

@oscargus
Copy link
Member Author

Should I backport manually? No problems. Most likely it is a conflict in the tests, so should be easy to fix.

@tacaswell
Copy link
Member

@oscargus If you want to do the backport we will definitely merge it.

oscargus pushed a commit to oscargus/matplotlib that referenced this pull request Jan 26, 2022
oscargus pushed a commit to oscargus/matplotlib that referenced this pull request Jan 26, 2022
QuLogic added a commit that referenced this pull request Jan 27, 2022
…v3.5.x

Backport PR #22283: Fixed `repr` for `SecondaryAxis`
@QuLogic QuLogic modified the milestones: v3.6.0, v3.5.2 Jan 27, 2022
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.

5 participants
0