Skip to content

Logit scale nonsingular #14928

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
Sep 10, 2019
Merged

Conversation

jb-leger
Copy link
Contributor

PR Summary

This PR solves issues #14743.

This issues was present from the nonsingular method of the LogitLocator. In the PR #14512 I rewrite most of this locator, but I keep the nonsingular method from the old code. I was not the author of this bug. I fixed it because I know this very small part of the matplotlib code.

Also, I added some tests.

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

@jb-leger jb-leger force-pushed the logit_scale_nonsingular branch 2 times, most recently from 693ecee to 966cca4 Compare July 30, 2019 19:26
@jb-leger jb-leger force-pushed the logit_scale_nonsingular branch from 966cca4 to 787f6b8 Compare July 31, 2019 09:29

standard_minpos = 1e-7
initial_range = (standard_minpos, 1 - standard_minpos)
swap_vlims = False
Copy link
Member

Choose a reason for hiding this comment

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

As a state flag, I would rather name this vlims_swapped.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I agree. But I take the logic (and the name for variables) from LogLocator.

What is the best?

  • use vlims_swapped in LogitLocator,
  • use swap_vlims in LogitLocator for consistency with LogLocator,
  • use vlims_swapped in LogitLocator, and rename swap_vlims to vlims_swapped in LogLocator for consistency,

I dislike the third one (as it can introduce conflicts with other branches for no real reason). I have no opinion between the two firsts.

@tacaswell tacaswell added this to the v3.2.0 milestone Aug 12, 2019
tacaswell
tacaswell previously approved these changes Aug 24, 2019
@tacaswell
Copy link
Member

Thanks @jb-leger !

We all mostly fix bugs that we did not write ;)

@anntzer
Copy link
Contributor

anntzer commented Aug 26, 2019

Sorry, in #14624 we decided to revert the behavior of nonsingular to always order its return value in increasing order (it's a bit of a mess :( see linked discussions); it means that for this PR the swap_vlims dance should go away.

@tacaswell tacaswell dismissed their stale review September 4, 2019 16:10

Due to changes in other PRs, need to not swap the order

@tacaswell
Copy link
Member

@jb-leger I took the liberty of making the change @anntzer requested, hope you do not mind!

@tacaswell
Copy link
Member

ok, I am apparently deeply confused about this sorting stuff....

@tacaswell tacaswell force-pushed the logit_scale_nonsingular branch from 58d39e2 to dfa8367 Compare September 4, 2019 19:40
@jb-leger
Copy link
Contributor Author

jb-leger commented Sep 5, 2019

Sorry, I have a lot of administrative work these days, I did'nt had the time to interact here and to do the requested changes.

That's perfect @tacaswell, I don't mind at all that you push on this branch.

In matplotlib#14624 we reverted
changing the order of the limits to match the input order.  Doing the
same here for consistency.

Sort the limits before comparing.  We want to make sure that it works
with the values reversed, but do not expect non-singular to preserve
the order.
@anntzer anntzer merged commit bebb206 into matplotlib:master Sep 10, 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.

5 participants