-
Notifications
You must be signed in to change notification settings - Fork 46
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
matplotlib backend set in /algorithms/spot_finding/per_image_analysis.py #795
Comments
I think it is reasonable to move the entire |
Doing this would make mocking harder, but I don't see any test directly importing this file, so there is no immediate downside as far as I can see. |
This directly sets the Agg canvas instead of relying on global state. This fixes dials#795 by still allowing GUI plots if required by the user.
This directly sets the Agg canvas instead of relying on global state. This fixes dials#795 by still allowing GUI plots if required by the user.
Reopening, because it seems this is throwing lots of warnings because matplotlib versions/support and backends. Need to have another look. Might be worth backing out change and putting the other one in for now. |
Avoids setting the backend in `per_image_analysis.py` and instead relies on the caller to have set it correctly. Putative fix for #795.
I've switched to the moving commit 5f59558 which hopefully solves without the issues of the other one. |
Context
While trying to debug code in
dials.stills_process
, I was unable to show plots using matplotlib when I put a breakpoint in the code (atleast not interactively). The reason seems to stem fromdials/algorithms/spot_finding/per_image_analysis.py
Lines 8 to 15 in 63d2fef
Here the matplotlib backend is set as part of a global import which turns off interactive plotting. Thus when a program imports something from this file, the global import lines for matplotlib turn off interactive plotting (this is what's happening with
dials.stills_process
). Indials.stills_process
this is happening indirectly through imports made fromindexer.py
-->max_cell.py
Question
I was wondering if there is a reason for declaring the backend at the top in
per_image_analysis.py
? Can anything be done to not set the backend here and instead do so when plotting is done within the program ?Just for demonstration, here is a barebones program that does not currently show plots. This is similar to the case in
dials.stills_process
The text was updated successfully, but these errors were encountered: