8000 Fix bug in SymmetricalLogTransform. by efiring · Pull Request #14295 · matplotlib/matplotlib · GitHub
[go: up one dir, main page]

Skip to content

Fix bug in SymmetricalLogTransform. #14295

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 4 commits into from
May 22, 2019
Merged

Conversation

efiring
Copy link
Member
@efiring efiring commented May 21, 2019

By failing the copy the input array, SymmetricalLogTransform.transform_non_affine
was returning an array with points in the linear range masked.
Closes #14265. Replaces #14281.

In addition to fixing the bug, this re-implements the SymmetricalLogTransform and its
inverse so that they gracefully handle ndarrays and masked arrays, returning outputs
of the same type as their inputs.

A test is added to check this, and to verify that a round-trip returns the input values.

PR Summary

PR Checklist

  • Has Pytest style unit tests
  • Code is Flake 8 compliant
  • New features are documented, with examples if plot related
  • Documentation is sphinx and numpydoc compliant
  • Added an entry to doc/users/next_whats_new/ if major new feature (follow instructions in README.rst there)
  • Documented in doc/api/api_changes.rst if API changed in a backward-incompatible way

efiring added 4 commits May 21, 2019 09:54
By failing the copy the input array, SymmetricalLogTransform.transform_non_affine
was returning an array with points in the linear range masked.
Closes matplotlib#14265.   Replaces matplotlib#14281.
Their transform_non_affine methods have been updated following
the strategy used in LogTransform so that they work correctly
with masked arrays or plain ndarrays, but do not require any
explicit np.ma functions.
Copy link
Member
@dstansby dstansby left a comment

Choose a reason for hiding this comment

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

Thanks 👍

8000

@dstansby dstansby added this to the v3.1.1 milestone May 22, 2019
Copy link
Member
@NelleV NelleV left a comment

Choose a reason for hiding this comment

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

This looks good to me. Thanks @efiring !

@NelleV NelleV merged commit 0e81eb7 into matplotlib:master May 22, 2019
@lumberbot-app
Copy link
lumberbot-app bot commented May 22, 2019

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.1.x
$ git pull
  1. Cherry pick the first parent branch of the this PR on top of the older branch:
$ git cherry-pick -m1 0e81eb707049427731ef3d474b0a6de881147569
  1. You will likely have some merge/cherry-pick conflict here, fix them and commit:
$ git commit -am 'Backport PR #14295: Fix bug in SymmetricalLogTransform.'
  1. Push to a named branch :
git push YOURFORK v3.1.x:auto-backport-of-pr-14295-on-v3.1.x
  1. Create a PR against branch v3.1.x, I would have named this PR:

"Backport PR #14295 on branch v3.1.x"

And apply the correct labels and milestones.

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

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

efiring pushed a commit to efiring/matplotlib that referenced this pull request May 24, 2019
QuLogic added a commit that referenced this pull request May 25, 2019
…3.1.x

Backport PR #14295: Fix bug in SymmetricalLogTransform.
@dstansby dstansby removed their assignment May 25, 2019
dstansby pushed a commit to dstansby/matplotlib that referenced this pull request May 25, 2019
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.

symlog looses some points since 3.1.0 (example given)
4 participants
0