-
Notifications
You must be signed in to change notification settings - Fork 54
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
Remove setting backend to agg
automatically
#100
Conversation
I agree, it's better to remove it to prevent unexpected knock-on effects for users. I think for now we can simply warn users that they may need to set a backend themselves (perhaps throw a warning when tobac.plotting is imported?) and deal with any problems if they appear. I think it would be best to make the plotting tools an optional import in future and remove matplotlib as a dependency (unless using plotting) |
Okay, I added warnings if As I've said in a few different venues now, I do wonder what the future of the plotting module (and to a lesser extent the analysis module) is. I think there are advantages to having easy tools available for new users, but at the moment they both rely extensively on |
I agree, I think that at the very least we should avoid needing matplotlib as a mandatory dependency. Both the plotting and analysis modules are heavily reliant on iris, so will obviously need big changes when we shift to xarray. I think we should keep both as they are for now, but at some point add warnings to note that these tools may not be available in version 2. I think that some plotting and analysis tools should remain, but more as examples for usage of tobac and for demonstrating how e.g. figures in papers and the examples notebooks are produced than as a core part of tobac. Anyway, happy for this PR to be merged |
Resolves #95.
@w-k-jones I think there's a chance that this could potentially break some code. For example, if a user tries to run
tobac.plotting.plot_tracks_mask_field_loop
in a script without setting their own backend, it could break. We could resolve it by putting the matplotlib imports into each function and settingmpl.use('agg')
there, but I still think we're better off having the users set their own backend asagg
isn't appropriate for all cases.