Thanks to visit codestin.com
Credit goes to github.com

Skip to content

FIX: errorbar xywhere should return ndarray #12283

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

Conversation

jklymak
Copy link
Member

@jklymak jklymak commented Sep 25, 2018

PR Summary

For some reason xywhere in errorbar returns a list instead of array of values. This PR tries an array...

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

@dstansby
Copy link
Member

Hmm, I thought the point of leaving this as a list was to pass through units? How does this work with e.g. datetime units?

@jklymak
Copy link
Member Author

jklymak commented Sep 25, 2018

Why would we want a list for the units machinery?

This is really old code, and I suspect predates numpy handling of masks. Maybe it should be rethought wholesale, but I don't think we do ourselves any favours unpacking the existing ndarray and turning it into a list.

@dstansby
Copy link
Member

I think I'm thinking of this comment https://github.com/matplotlib/matplotlib/pull/12283/files#diff-7e79bc5b4cdd21de353697e9ada248b7L3171 , and also I just fixed errorbar plotting for astropy, so was thinking this change might not play well with that; #8871. I'll check if this PR breaks the example given in that issue.

@jklymak
Copy link
Member Author

jklymak commented Sep 25, 2018

I think all that stuff was before numpy arrays could have arbitrary data in them, but I could be incorrect.

@tacaswell tacaswell added this to the v3.1 milestone Sep 29, 2018
@tacaswell
Copy link
Member

@dstansby is correct, the list is to preserve units. Some of the unit frameworks loose their units when you put them into numpy arrays like that.

@jklymak
Copy link
Member Author

jklymak commented Sep 29, 2018

OK, on the other hand this didn't fail any tests, so I guess we don't test that functionality...

@jklymak jklymak closed this Sep 29, 2018
@jklymak jklymak deleted the fix-errorbar-return-arrays-not-lists branch September 30, 2018 14:34
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