From b52b04428ab9ebf347acf7e1c4ce4d044e7d4b1c Mon Sep 17 00:00:00 2001 From: David Manowitz Date: Thu, 4 Jul 2024 14:39:22 -0400 Subject: [PATCH] remove numpy pin (#272) --- .github/workflows/ci.yml | 2 +- environment.yml | 2 +- hierarchicalforecast/utils.py | 5 ++++- nbs/utils.ipynb | 5 ++++- settings.ini | 4 ++-- setup.py | 2 +- 6 files changed, 13 insertions(+), 7 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f15b9fd..5171fa4 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -43,7 +43,7 @@ jobs: fail-fast: false matrix: os: [ubuntu-latest, macos-latest, windows-latest] - python-version: [3.7, 3.8, 3.9, '3.10'] + python-version: ['3.8', '3.9', '3.10', '3.11', '3.12'] steps: - name: Clone repo uses: actions/checkout@v2 diff --git a/environment.yml b/environment.yml index 766162f..336531a 100644 --- a/environment.yml +++ b/environment.yml @@ -3,7 +3,7 @@ channels: - conda-forge dependencies: - jupyterlab - - numpy<1.24 + - numpy - numba - pandas - scikit-learn diff --git a/hierarchicalforecast/utils.py b/hierarchicalforecast/utils.py index 61b507e..15282e6 100644 --- a/hierarchicalforecast/utils.py +++ b/hierarchicalforecast/utils.py @@ -284,7 +284,10 @@ def plot_series(self, df_plot = Y_df.loc[series].set_index('ds') cols = models if models is not None else df_plot.columns cols_wo_levels = [col for col in cols if ('-lo-' not in col and '-hi-' not in col)] - cmap = plt.cm.get_cmap("tab10", 10) + try: + cmap = plt.get_cmap("tab10", 10) + except AttributeError: + cmap = plt.cm.get_cmap("tab10", 10) cmap = [cmap(i) for i in range(10)][:len(cols_wo_levels)] cmap_dict = dict(zip(cols_wo_levels, cmap)) for col in cols_wo_levels: diff --git a/nbs/utils.ipynb b/nbs/utils.ipynb index c79df61..655a100 100644 --- a/nbs/utils.ipynb +++ b/nbs/utils.ipynb @@ -660,7 +660,10 @@ " df_plot = Y_df.loc[series].set_index('ds')\n", " cols = models if models is not None else df_plot.columns\n", " cols_wo_levels = [col for col in cols if ('-lo-' not in col and '-hi-' not in col)]\n", - " cmap = plt.cm.get_cmap(\"tab10\", 10)\n", + " try:\n", + " cmap = plt.get_cmap(\"tab10\", 10)\n", + " except AttributeError:\n", + " cmap = plt.cm.get_cmap(\"tab10\", 10)\n", " cmap = [cmap(i) for i in range(10)][:len(cols_wo_levels)]\n", " cmap_dict = dict(zip(cols_wo_levels, cmap))\n", " for col in cols_wo_levels:\n", diff --git a/settings.ini b/settings.ini index 20b03ee..4f8df5c 100644 --- a/settings.ini +++ b/settings.ini @@ -9,13 +9,13 @@ author_email = business@nixtla.io copyright = Nixtla Inc. branch = main version = 0.4.1 -min_python = 3.7 +min_python = 3.8 audience = Developers language = English custom_sidebar = True license = apache2 status = 2 -requirements = numpy<1.24 numba pandas scikit-learn quadprog matplotlib tqdm +requirements = numpy numba pandas scikit-learn quadprog matplotlib tqdm dev_requirements = datasetsforecast nbdev statsforecast>=1.0.0 requests scipy nbs_path = nbs doc_path = _docs diff --git a/setup.py b/setup.py index 03dd1cb..5265ffe 100644 --- a/setup.py +++ b/setup.py @@ -22,7 +22,7 @@ } statuses = [ '1 - Planning', '2 - Pre-Alpha', '3 - Alpha', '4 - Beta', '5 - Production/Stable', '6 - Mature', '7 - Inactive' ] -py_versions = '3.6 3.7 3.8 3.9 3.10'.split() +py_versions = '3.8 3.9 3.10 3.11 3.12'.split() requirements = cfg.get('requirements','').split() if cfg.get('pip_requirements'): requirements += cfg.get('pip_requirements','').split()