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

New matplotlib release v3.9.0 breaks Forecaster class #136

Open
lyubomirShoylev opened this issue May 22, 2024 · 0 comments
Open

New matplotlib release v3.9.0 breaks Forecaster class #136

lyubomirShoylev opened this issue May 22, 2024 · 0 comments

Comments

@lyubomirShoylev
Copy link

Problem

I am running the following setup:

  • Python v3.10.13
  • greykite==0.5.0

When attempting to run an instance of the greykite.framework.templates.forecaster.Forecaster class, I get the following error log (output of the loguru library):

  File "C:\Users\lyubomir.shoylev\work\forecasting_debug\silverkite\model.py", line 11, in <module>
    from greykite.framework.templates.forecaster import Forecaster

  File "C:\Users\lyubomir.shoylev\work\forecasting_debug\.venv\lib\site-packages\greykite\framework\templates\forecaster.py", line 37, in <module>
    from greykite.framework.pipeline.pipeline import ForecastResult

  File "C:\Users\lyubomir.shoylev\work\forecasting_debug\.venv\lib\site-packages\greykite\framework\pipeline\pipeline.py", line 47, in <module>
    from greykite.framework.input.univariate_time_series import UnivariateTimeSeries

  File "C:\Users\lyubomir.shoylev\work\forecasting_debug\.venv\lib\site-packages\greykite\framework\input\univariate_time_series.py", line 41, in <module>
    from greykite.common.viz.timeseries_plotting import add_groupby_column

  File "C:\Users\lyubomir.shoylev\work\forecasting_debug\.venv\lib\site-packages\greykite\common\viz\timeseries_plotting.py", line 37, in <module>
    from greykite.common.viz.colors_utils import get_color_palette

  File "C:\Users\lyubomir.shoylev\work\forecasting_debug\.venv\lib\site-packages\greykite\common\viz\colors_utils.py", line 25, in <module>
    from matplotlib.cm import get_cmap

ImportError: cannot import name 'get_cmap' from 'matplotlib.cm' (C:\Users\lyubomir.shoylev\work\forecasting_debug\.venv\lib\site-packages\matplotlib\cm.py)

Reason

The newest release of matplotlib v.3.9.0 merged a commit that moves the deprecated matplotlib.cm.get_cmap() function used in the colors_utils component of greykite. The commit can be found here. The function is moved from the matplotlib.cm module to the matplotlib.pyplot module.

The matplotlib.pyplot version was introduced in this commit, which is merged in since v3.6.0.

Possible solutions

Currently, the matplotlib version imported with the greykite package is determined in the setup.py by line 18 as "matplotlib>=3.4.1".

I propose to either:

  • Update requirements to maximal version v3.8.4.
  • Update requirements to minimal version v3.6.0, and update the import statement to the pyplot component.
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

1 participant