Skip to content
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 is required #23

Open
andreww opened this issue Jul 25, 2017 · 4 comments
Open

Matplotlib is required #23

andreww opened this issue Jul 25, 2017 · 4 comments

Comments

@andreww
Copy link
Owner

andreww commented Jul 25, 2017

While I remember, it seems that matplotlib is currently required to be installed (at least to run the atomistics command). For now I just installed it into the environment, but it looks like it's absence is worked around in some places. Ideally we should either add matplotlib to requirements.txt, or make sure all modules work around the absence of matplotlib in some way (even if things where it is really needed just exit with an error that says "install matplotlib you plonker".

@richetensor
Copy link
Collaborator

I'll just throw in a few additional workarounds to check that matplotlib is installed. It is probably better not to make it a requirement, as plotting is not really essential for users, just convenient, and pydis will continue to output text files that can be plotted using an external program. There is no need to heavily optimise plotting functions, so I'm quite happy liberally sprinkling the relevant sections of the code with try:...except:... statements.

@richetensor
Copy link
Collaborator

I have leavened the package with some try...except... statements. Let me know if any part of the code fails to run on your machine (with error messages attached, if possible).

@andreww
Copy link
Owner Author

andreww commented Jul 25, 2017

Will do.

It struck me on the way home that this may be a case where a decorator for functions that need matplotlib would make things tidy. @needsmatplotlib or something for functions that need matplotlib and two (or three) lines at the top of each module.

@richetensor
Copy link
Collaborator

That could be a simple solution. I'll see what I can do.

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

No branches or pull requests

2 participants