enthought / chaco

Chaco is a Python package for building interactive and custom 2-D plots.
http://docs.enthought.com/chaco/
Other
292 stars 99 forks source link

Prevent axis related plot crash when plot is resized too small #848

Closed aaronayres35 closed 1 year ago

aaronayres35 commented 1 year ago

This PR includes a defensive programming "fix" to #824 to prevent plot crashing. The real fix would be to track down where the bad inputs are coming from. However, regardless I think it makes sense for auto_ticks to be more robust to bad inputs as was discussed on the issue.

Also, in the same downstream project, when an application is resized to be very small and an inspector pane visibility is toggled, the plot some how ends up in a situation where datalow > datahigh in chaco.axis.py and we are hitting the RunTimeError. I believe it makes sense to handle this case the same that we do for where datalow == datahigh (namely there is no plot we could show so we have no ticks). I am unable to cause the downstream project's plots to crash when working off of this branch.

corranwebster commented 1 year ago

Do we know which data range/mapper is giving the bad values? I'm worried that there may be other places which are relying on the datalow <= datahigh invariant and so this may just push the error elsewhere.

In any case additional logging of the case datalow > datahigh (equal is OK) may be worthwhile.

corranwebster commented 1 year ago

Failure is unrelated - the same changes are needed as in upstream pacakages for ubuntu-latest