| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
|
So, defiantly 🐲 in up-sampling when mixing masking + over/under with in the kernel foot print. import matplotlib.pyplot as plt
import matplotlib as mpl
import matplotlib.colors as mcolors
import matplotlib.image as mimage
import matplotlib.cm as mcm
import numpy as np
import copy
cm = copy.copy(mcm.get_cmap('viridis'))
cm.set_over('r')
cm.set_under('b')
cm.set_bad('k')
n = mcolors.Normalize(vmin=0, vmax=100)
data = np.arange(100, dtype='float').reshape(10, 10)
data[5, 5] = -1
data[7, 7] = 101
data[3, 3] = np.nan
data[5, 3] = np.inf
mask = np.zeros_like(data).astype('bool')
mask[3, 5] = True
data = np.ma.masked_array(data, mask)
fig, ax_grid = plt.subplots(3, 6)
for interp, ax in zip(mimage._interpd_, ax_grid.ravel()):
ax.set_title(interp)
im = ax.imshow(data, norm=n, cmap=cm, interpolation=interp)
|
Sorry, something went wrong.
|
Right, forget about the topo failure, that is due to the resample vs not resample change and I have not looked into it yet. |
Sorry, something went wrong.
|
On the bright side I have managed to fix this without having to change classic style and only update 1 test image, on the down side, one test is still broken. |
Sorry, something went wrong.
|
and I have fixed the checker-board effect in that png above, that was due to Agg's aggressive clipping. |
Sorry, something went wrong.
|
Of course this passes locally... |
Sorry, something went wrong.
When determining which pixels to mask in the resampled image, if _any_ contribution to final value comes from a masked pixel, mask the result. Due to Agg special-casing the meaning of the alpha channel, the interpolation for the mask channel needs to be done separately. This is probably a template for doing the over/under separately. print out exact hash on travis
|
|
||
| install: | ||
| - ccache -s | ||
| - git describe |
There was a problem hiding this comment.
I'm not concerned about this, but would like to make sure that you intended to have this here.
Sorry, something went wrong.
There was a problem hiding this comment.
I did, was a bit worried that gh/travis were having caching / timeout issues and not running the code I thought it was running (turns out the problem is I had accidentally depended on dictionary ordering in 3.6). I think this is a good idea to keep around so that we can verify exactly what code travis runs for testing locally (it should be running on the merge into the target branch, when it re-sets what that merge is is not something I fully understand yet).
Sorry, something went wrong.
|
The CI failure appears non-transient. |
Sorry, something went wrong.
|
What happened to Appveyor? |
Sorry, something went wrong.
|
It doesn't run on the v2.0.x branch. |
Sorry, something went wrong.
|
How did I not know that? |
Sorry, something went wrong.
There was a problem hiding this comment.
Looks reasonable to me. Only a minor question.
Sorry, something went wrong.
| # 'unshare' the mask array to | ||
| # needed to suppress numpy warning | ||
| del out_mask | ||
| invalid_mask = ~output.mask * ~np.isnan(output.data) |
There was a problem hiding this comment.
Would & work here instead of *? Would make more sense given the boolean masks.
Sorry, something went wrong.
There was a problem hiding this comment.
Are there performance rather than semantic advantages? I think ~(a & b) would also work and have one less temprorary.
Sorry, something went wrong.
|
|
||
| fig, ax_grid = plt.subplots(3, 6) | ||
| for interp, ax in zip(sorted(mimage._interpd_), ax_grid.ravel()): | ||
| ax.set_title(interp) |
There was a problem hiding this comment.
I don't think there's any point adding a title if remove_text is True in the decorator. Otherwise this patch looks good to me.
Sorry, something went wrong.
There was a problem hiding this comment.
The title is there for human debuggers later (I often copy-past tests into another buffer and just run them)
Sorry, something went wrong.
There was a problem hiding this comment.
👍
Sorry, something went wrong.
| for interp, ax in zip(sorted(mimage._interpd_), ax_grid.ravel()): | ||
| ax.set_title(interp) | ||
| ax.imshow(data, norm=n, cmap=cm, interpolation=interp) | ||
| ax.axis('off') |
There was a problem hiding this comment.
Same as above, prseumably pointless with remove_text == True
Sorry, something went wrong.
Sorry, something went wrong.
|
sigh |
Sorry, something went wrong.
|
The build also failed matplotlib.tests.test_image.test_rotate_image.test on 2.7 and 3.4 when this got merged, though I'm not sure why. This wasn't a troublesome test before. |
Sorry, something went wrong.
|
Even weirder, #8144 is failling on that test on 3.5 but not other versions, even after a rebuild... |
Sorry, something went wrong.
|
The rotate image test did give me trouble when working on this. |
Sorry, something went wrong.
|
I have sorted out the reason (but not the cause) of the rotate_image failures, for some reason the set_bad from the test added here is leaking out to other tests. |
Sorry, something went wrong.
|
Maybe it should use deepcopy instead of copy? |
Sorry, something went wrong.
|
That would fix it, but we should also fix ColorMap so that copy works as expected, see #8299 |
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
Closes #8012
The code changes are in the first commit, the image changes are in the second.
This probably needs some more tests and docs. I suspect there is at least one more 🐉 down here...
attn @mdboom