You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
mcolors.to_rgba_array("none") returns an empty array while mcolors.to_rgba("none") and mcolors.to_rgba_array(["none"]) return (0,0,0,0) (which is the documented value of None) and this leads to inconsistencies when trying to use mcolors.same_color
Someone at scipy tracked this down to being an issue w/ eager conversion to color that relies on 'none'/empty array for if statements to preserve the correct alpha values. xref #28710
The existing behaviour is clearly deliberate but I agree with @story645 about what I expected to happen. Is it worth adding a boolean parameter so you could choose between the two behaviours?
Is it worth adding a boolean parameter so you could choose between the two behaviours?
I've been thinking of a sort of true constant for none, but flagging would probably do the same trick - what I'm thinking is that it could be really useful to know which parts of the codebase need the empty behavior.
Activity
story645 commentedon Aug 12, 2024
Someone at scipy tracked this down to being an issue w/ eager conversion to color that relies on 'none'/empty array for if statements to preserve the correct alpha values. xref #28710
rcomer commentedon Mar 9, 2025
The existing behaviour is clearly deliberate but I agree with @story645 about what I expected to happen. Is it worth adding a boolean parameter so you could choose between the two behaviours?
story645 commentedon Mar 9, 2025
I've been thinking of a sort of true constant for none, but flagging would probably do the same trick - what I'm thinking is that it could be really useful to know which parts of the codebase need the empty behavior.