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

Leaner dependencies #1280

Open
poplarShift opened this issue Apr 16, 2024 · 1 comment
Open

Leaner dependencies #1280

poplarShift opened this issue Apr 16, 2024 · 1 comment

Comments

@poplarShift
Copy link
Contributor

Hei, I'm frequently frustrated by the extensive imports that opendrift requires. While I am happy to disregard the environment/requirements file that is shipped with opendrift, for running a simple tracking experiment one should not require imports of matplotlib, colored logs, cmocean, etc. etc.

I am happy to make a draft PR but would be happy to hear your opinions first. Are simple try/except clauses with the appropriate warnings good enough for you or would you like some more advanced system with e.g. flags?

@knutfrode
Copy link
Collaborator

Hi,

We agree that a bare minimum of imports should be made.
We are planning on moving most of the analysis functionality (including plotting/animations) out of OpenDrift and into the TrajAn tool, which could help to avoid importing e.g. matplotlib for doing a simulation.
Presently plot-methods are in the basemodel module, and therefore libraries for plotting are also imported at the top of that module, according to PEP8:
https://peps.python.org/pep-0008/#imports

Pull requests for limiting unnecessary imports are welcome.
But probably best if you first make a small example PR, as @gauteh and myself could have some opinions or suggestions before merging major changes.

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