Fix recarray support in PlotDataItem#3278
Conversation
|
I think I came across this not working when doing the documentation for PlotDataItem a while back... I don't have a particularly strong opinion about whether or not I'm trying to think of a good argument for why |
@hjholmberg care to weigh in on this? |
|
I was using |
|
Merging as this fixes an issue that we have in our documentation as working (but doesn't). The discussion about whether we should support this is for another time. Thanks for the report @hjholmberg and thanks for the fix @ixjlyons |
Fixes #3275
I'm not sure if this ever worked. As far as I know,
recarrayhasn't supported this kind of membership check, and it doesn't make sense semantically for normalndarray.During my testing, I figured normal arrays with named fields might also be worth supporting. The
dataTypehelper function identifies them as "recarray", so the modified code path handles both. Only therecarraysubclass implements attribute access to the fields, otherwisegetattr(data, "x", None)would've been slightly more concise.