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

[Major] Separate plotting dependencies to enable running without plotting #1611

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

kneureither
Copy link
Contributor

🔬 Background

Poetry can now be installed in a minimal mode by using poetry install --only main. Minimal mode does only include the main dependencies, specified under [tool.poetry.dependencies]. Matplotlib could also be excluded in the future, by moving it into the [tool.poetry.group.plotting.dependencies] in pyproject.toml.
All tests are passed, except test_model_performance.py which saves svg files.
fixes issue #1548.

🔮 Key changes

  • Add a poetry group for plotting (for now it only includes plotly, matplotlib could also be added in the same manner)
  • Catch plotly import in files (forecaster.py, plot_forecast_plotly.py, plot_model_parameters_plotly.py) and display warning, but proceed without plotting anything.
  • status of plotly import is handled by plotting_backend which is set to "no-backend-installed"

📋 Review Checklist

  • I have performed a self-review of my own code.
  • I have commented my code, added docstrings and data types to function definitions.
  • I have added pytests to check whether my feature / fix works.

Konstantin Neureither added 3 commits July 4, 2024 12:05
@kneureither
Copy link
Contributor Author

kneureither commented Jul 5, 2024

Can you give some feedback on the approach @ourownstory? Is that how you envisioned this to work? I would add further libraries to the plotting group and deal with them in the same manner as with plotly. I used a specific group instead of specifying the optional = true tag on a package level, because it is more user-friendly. What do you think about using the plotting_backend variable to check whether the corresponding modules are installed?

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.

1 participant