Join GitHub today
GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
colors: ensure masked array data is an ndarray #6622
Conversation
mdboom
added the
needs_review
label
Jun 21, 2016
|
Hmm... that failure on travis is worrying. Let me see if I can reproduce it... |
|
Can't reproduce that failure locally... |
|
Travis failures are transient and non related |
|
Looks OK to me, but I suggest adding a brief comment so that someone doesn't look at it a year from now and "optimize" it away, thinking it is superfluous. |
tacaswell
added this to the
2.0 (style change major release)
milestone
Jun 21, 2016
|
Still not have tagged a v1.5.2, should probably backport this? |
|
If you can backport this for 1.5.2, that would be excellent :) |
tacaswell
merged commit f8ea2c5
into matplotlib:master
Jun 22, 2016
tacaswell
removed the
needs_review
label
Jun 22, 2016
tacaswell
added a commit
that referenced
this pull request
Jun 22, 2016
|
|
tacaswell |
8d9357e
|
|
backported to 1.5.x as 8d9357e |
|
Backported as it fixes a major Yt headache |
QuLogic
modified the milestone: 1.5.2 (Critical bug fix release), 2.0 (style change major release)
Jun 23, 2016
ngoldbaum
referenced
this pull request
May 31, 2017
Merged
Interpret data to normalize as ndarrays #8696
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
ngoldbaum commentedJun 21, 2016
This fixes compatibility for imshow plots with array data that is a unit-aware ndarray subclass, for example data from yt.units or astropy.units.
Take for example the following script:
This produces the following traceback right now: https://gist.github.com/ngoldbaum/27effb41173859132fed08a0ad5485ee
This is not isolated to yt's units - if one tries the same thing with astropy's units the same issue arises. Pint does not have this issue because Pint's
Quantityclass is not an ndarray subclass, so when it is converted to a masked array inmatplotlib.image, the units are stripped.This function seems to expect
result.datato be an instance of the base ndarray class. This patch just enforces that expectation explicitly.