sktime / pytorch-forecasting

Time series forecasting with PyTorch
https://pytorch-forecasting.readthedocs.io/
MIT License
3.99k stars 631 forks source link

[MNT] isolate `matplotlib` as soft dependency #1636

Closed fkiraly closed 2 months ago

fkiraly commented 2 months ago

Isolates matplotlib as soft dependency in a new soft dep set all_extras. https://github.com/jdb78/pytorch-forecasting/issues/1616

The imports happen in plot_sth methods throughout the code base, some attached to classes, some not. This allows to use pytorch-forecasting without plotting or graphical logging, or use a different plotting backend manually.

Isolation strategy:

codecov-commenter commented 2 months ago

:warning: Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

Attention: Patch coverage is 80.48780% with 8 lines in your changes missing coverage. Please review.

Project coverage is 90.10%. Comparing base (6061af6) to head (20f606d). Report is 1 commits behind head on master.

Files with missing lines Patch % Lines
pytorch_forecasting/data/timeseries.py 50.00% 2 Missing :warning:
pytorch_forecasting/models/base_model.py 83.33% 2 Missing :warning:
pytorch_forecasting/models/nbeats/__init__.py 83.33% 1 Missing :warning:
pytorch_forecasting/models/nhits/__init__.py 83.33% 1 Missing :warning:
...ing/models/temporal_fusion_transformer/__init__.py 87.50% 1 Missing :warning:
pytorch_forecasting/utils/_dependencies.py 80.00% 1 Missing :warning:

:exclamation: Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #1636 +/- ## ========================================== - Coverage 90.19% 90.10% -0.10% ========================================== Files 32 32 Lines 4734 4768 +34 ========================================== + Hits 4270 4296 +26 - Misses 464 472 +8 ``` | [Flag](https://app.codecov.io/gh/jdb78/pytorch-forecasting/pull/1636/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Jan+Beitner) | Coverage Δ | | |---|---|---| | [cpu](https://app.codecov.io/gh/jdb78/pytorch-forecasting/pull/1636/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Jan+Beitner) | `90.10% <80.48%> (-0.10%)` | :arrow_down: | | [pytest](https://app.codecov.io/gh/jdb78/pytorch-forecasting/pull/1636/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Jan+Beitner) | `90.10% <80.48%> (-0.10%)` | :arrow_down: | Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Jan+Beitner#carryforward-flags-in-the-pull-request-comment) to find out more.

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.