Skip to content

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

Merged
aaronayres35 merged 5 commits into
mainfrom
fix/axis-error-crashing-plot
Jan 23, 2023
Merged

Prevent axis related plot crash when plot is resized too small#848
aaronayres35 merged 5 commits into
mainfrom
fix/axis-error-crashing-plot

Conversation

@aaronayres35
Copy link
Copy Markdown
Contributor

@aaronayres35 aaronayres35 commented Jan 19, 2023

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
Copy link
Copy Markdown
Contributor

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
Copy link
Copy Markdown
Contributor

corranwebster commented Jan 20, 2023

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

@aaronayres35 aaronayres35 merged commit 8da731e into main Jan 23, 2023
@aaronayres35 aaronayres35 deleted the fix/axis-error-crashing-plot branch January 23, 2023 15:19
corranwebster pushed a commit that referenced this pull request Jan 24, 2023
* dont raise if datalow > datahigh

* additional NaN checking in auto_ticks

* add some logging about the bad range coming from the mappper

* better warning message
corranwebster pushed a commit that referenced this pull request Jan 24, 2023
* dont raise if datalow > datahigh

* additional NaN checking in auto_ticks

* add some logging about the bad range coming from the mappper

* better warning message
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants