Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork7.9k
Preparations for multivariate plotting#29877
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
base:main
Are you sure you want to change the base?
Uh oh!
There was an error while loading.Please reload this page.
Changes fromall commits
5e0266a
6985111
f42d65b
73713e7
78b173e
3979e09
adb4ee3
a276d89
File filter
Filter by extension
Conversations
Uh oh!
There was an error while loading.Please reload this page.
Jump to
Uh oh!
There was an error while loading.Please reload this page.
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -690,7 +690,17 @@ | ||
try: | ||
xm = np.ma.masked_where(~(np.isfinite(x)), x, copy=False) | ||
except TypeError: | ||
if len(x.dtype.descr) == 1: | ||
return x | ||
else: | ||
# in case of a dtype with multiple fields: | ||
try: | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others.Learn more. Would be good to get at least partial coverage for this branch. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others.Learn more. I haven't really been involved in this work nor understand how it works, but there is quite a bit of introduced code to deal with multiple datatypes? If this will be covered by tests/functionality in later PRs, that is fine, if not, please add tests for (most of) it. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others.Learn more. | ||
mask = np.empty(x.shape, dtype=np.dtype('bool, '*len(x.dtype.descr))) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others.Learn more. Could the dtype be e.g. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others.Learn more. This is an interesting idea. I'll make a prototype and see if this would add unnecessary complexity somewhere else. | ||
for dd, dm in zip(x.dtype.descr, mask.dtype.descr): | ||
mask[dm[0]] = ~(np.isfinite(x[dd[0]])) | ||
xm = np.ma.array(x, mask=mask, copy=False) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others.Learn more. Do numpy masked arrays actually support struct arrays as mask, with possibly different masking of the fields? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others.Learn more. I have found that this is the only way numpy supports masking dtypes with multiple fields, but I will see if | ||
except TypeError: | ||
return x | ||
return xm | ||
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -278,32 +278,3 @@ def get_cmap(name=None, lut=None): | ||
return _colormaps[name] | ||
else: | ||
return _colormaps[name].resampled(lut) | ||
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.