glue-viz / glue-geospatial

Experimental plugin to support satellite imagery
BSD 3-Clause "New" or "Revised" License
13 stars 3 forks source link

Warning about number of points when plotting histogram #6

Closed robintw closed 8 years ago

robintw commented 8 years ago

When adding a histogram display, you get a warning saying that there are lots of points and things might get slow...however I don't think this actually applies for a histogram (as the actual plot only has a few rectangles on it, regardless of the count of points).

astrofrog commented 8 years ago

I think the warning is still relevant because computing the histogram does require access to the full data and will be slow - however maybe the warning should be made clearer in that respect and more histogram-specific?

robintw commented 8 years ago

Yes, that'd be good. The wording at the moment sounds like the issue is with the plotting, whereas it is actually with the calculation.

(Also, is there a global configuration to suppress these messages? I'll be doing quite a lot with big datasets - and would rather not be warned each time)

astrofrog commented 8 years ago

Just for the record, the warning is raised here:

https://github.com/glue-viz/glue/blob/master/glue/viewers/common/qt/data_viewer.py#L179

We could add a setting in glue/config.py in the settings registry to enable/disable these warnings, and we could then check in _confirm_large_data if that option is set and return True if so.

To get a more specific error message for histograms, we could introduce a class-level constant that contains the warning, and could then be overridden by sub-classes.

Do you want to try and implement this, or would you like me to do it?

robintw commented 8 years ago

That sounds good. I'll definitely do a PR for the first part of that, which sounds fairly simple - and then I'll see if I have time to extend it to deal with class-specific warnings.

robintw commented 8 years ago

PR submitted, see https://github.com/glue-viz/glue/pull/999