-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Avoid all-NaNs warning #2252
base: master
Are you sure you want to change the base?
Avoid all-NaNs warning #2252
Conversation
I'm uncertain whether the way is the best. If the data becomes all-NaNs, the bounds don't change, like if the plot is waiting for data. With the fix, lines like `RuntimeWarning: All-NaN slice encountered ...` don't appear if the data consists of only NaNs. And please make your mind up to whether `ScatterPlotItem.bounds` is a tuple or a list. I'd rather make it a tuple everywhere.
Hi @StSav012 Thanks for the PR. Looks like the CI doesn't like one of the changes, perhaps there is a case where
There are a ton of these kinds of inconsistencies throughout the library; really hoping that when we start rolling out type-hinting, it will catch more of them. I'm good with migrating to tuples (or even better ,named tuples); but I would have to make sure that we're not dependent on the mutability of that list somewhere. |
I'm really puzzled about two things: - somewhere `ScatterPlotItem.bounds` becomes just `None`, not even `(None, None)` (Where is it?? I grepped everything.); - I haven't PRed the hotfix, even knowing about the issue.
Hi, @j9ac9k, Thank you. You're absolutely right. Have you happened to know why |
I don't know off the top of my head, but I would speculate that this value is None when the item isn't visible yet. |
Oh, my bad.
self.bounds = [(None, None), (None, None)] helps.
|
So reading through With all that in mind, we have a number of things worth doing:
|
I don't think this is needed; I know there is always the spacebar heater workflow but in this case we have a well defined method, so someone querying the
I know we chatted about this earlier, but at the risk of changing my opinion and pushing you in front of the bus, I don't think this is needed either. This PR doesn't change |
I'm uncertain whether the way is the best. If the data becomes all-NaNs, the bounds don't change, like if the plot is waiting for data.
With the fix, lines like
RuntimeWarning: All-NaN slice encountered ...
don't appear if the data consists of only NaNs.And please make your mind up to whether
ScatterPlotItem.bounds
is a tuple or a list. I'd rather make it a tuple everywhere.