Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork8.1k
Update Colorizer/ColorizingArtist to work with MultiNorm#30511
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?
Conversation
77bc51a
to9044189
CompareUh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
9b9aaf3
to525314e
CompareThank you for the feedback@QuLogic and apologies for my sloppy mistakes :) |
improved testing for colorizer+multinormApply suggestions from code reviewCo-authored-by: Elliott Sales de Andrade <quantum.analyst@gmail.com>updates based on feedback from@QuLogic
525314e
to23fb63c
CompareUh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
eb37db8
tod5c43e0
CompareThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
As I mentioned on the call, I think this looks okay from a low-level point-of-view, but I am at this point uncertain as to the high-level status. I hope someone more familiar with the current state can confirm.
PS,@trygvrad if you have some time to pop in to the call, it would be good to just re-iterate the current state succinctly, as I'm not sure everyone is up-to-speed right now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Sorry it took so long to get to this.
ifnormand (xx.max()>1orxx.min()<0): | ||
raiseValueError("Floating point image RGB values " | ||
"must be in the 0..1 range.") | ||
"must be in the 0..1 range") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
"must be in the0..1 range") | |
"must be in the[0,1] range") |
teenyist nit but I find interval notation clearer
"Passing a Normalize instance simultaneously with " | ||
"vmin/vmax is not supported. Please pass vmin/vmax " | ||
"directly to the norm when creating it.") | ||
"directly to the norm when creating it") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
"directlyto the norm when creating it") | |
"as argumentsto the norm object when creating it") |
I think more explicit is a bit clearer here
ifself.norm.n_components==1: | ||
ifvmaxisNone: | ||
try: | ||
vmin,vmax=vmin | ||
except (TypeError,ValueError): | ||
pass |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Just checking, this is for backwards compatibility with the current behavior, but doesn't broadcast, right?
ifisinstance(self.cmap,colors.BivarColormap): | ||
n_s= (self.cmap.N,self.cmap.M) | ||
else:# colors.MultivarColormap | ||
n_s= [part.Nforpartinself.cmap] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
n_s= [part.Nforpartinself.cmap] | |
n_s= [part.Nforpartinself.cmap] |
does this also work for BivarColormap?
scale_cls=_api.check_getitem(scale._scale_mapping,norm=norm) | ||
return_auto_norm_from_scale(scale_cls)() | ||
returnnorm | ||
else:# n_components > 1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
else:#n_components > 1 | |
elifn_components>1: |
somebody could do something silly and enter n_components = 0
elifn_components==2: | ||
raiseValueError("Invalid data entry for multivariate data. The data" | ||
" must contain complex numbers, or have a first dimension 2," | ||
" or be of a dtype with 2 fields") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
I'm not following what 2 components means in this context
Uh oh!
There was an error while loading.Please reload this page.
EDIT: closes#30511
This PR continues the work of#28658 and#28454,#29876, aiming toclose#14168. (Feature request: Bivariate colormapping)
This PR allows Colorizer and ColorizingArtist to work with
MultiNorm
andBivarColormap
andMultivarColormap
i.e. this PR will allow:
Features not included in this PR:
axes.imshow(...)
,axes.pcolor(...), and
axes.pcolormesh(...)`PR checklist