From bd4c4733acb8e3d6a7c6ca894262f8b316b5d125 Mon Sep 17 00:00:00 2001 From: Sarah Alnegheimish Date: Fri, 14 Apr 2023 17:55:20 -0400 Subject: [PATCH 1/5] =?UTF-8?q?Bump=20version:=200.3.5=20=E2=86=92=200.3.6?= =?UTF-8?q?.dev0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- mlprimitives/__init__.py | 2 +- setup.cfg | 2 +- setup.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/mlprimitives/__init__.py b/mlprimitives/__init__.py index 150d8ed..34704ba 100644 --- a/mlprimitives/__init__.py +++ b/mlprimitives/__init__.py @@ -4,7 +4,7 @@ __author__ = 'MIT Data To AI Lab' __email__ = 'dailabmit@gmail.com' -__version__ = '0.3.5' +__version__ = '0.3.6.dev0' import os diff --git a/setup.cfg b/setup.cfg index 1add6c4..c3907c7 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,5 +1,5 @@ [bumpversion] -current_version = 0.3.5 +current_version = 0.3.6.dev0 commit = True tag = True parse = (?P\d+)\.(?P\d+)\.(?P\d+)(\.(?P[a-z]+)(?P\d+))? diff --git a/setup.py b/setup.py index 1f638ff..63216e1 100644 --- a/setup.py +++ b/setup.py @@ -122,6 +122,6 @@ test_suite='tests', tests_require=tests_require, url='https://github.com/MLBazaar/MLPrimitives', - version='0.3.5', + version='0.3.6.dev0', zip_safe=False, ) From a340047f4c527bc3935bf7f94c6171208337d916 Mon Sep 17 00:00:00 2001 From: Sarah Alnegheimish <40212131+sarahmish@users.noreply.github.com> Date: Thu, 14 Mar 2024 16:29:47 -0400 Subject: [PATCH 2/5] update python, tests, and docs (#279) --- .github/workflows/tests.yml | 18 ++++++++---- mlprimitives/adapters/statsmodels.py | 6 ++-- .../custom/timeseries_preprocessing.py | 6 +++- .../primitives/xgboost.XGBClassifier.json | 1 - .../primitives/xgboost.XGBRegressor.json | 1 - setup.py | 28 +++++++++++++------ tests/adapters/test_statsmodels.py | 8 +++--- tests/custom/test_timeseries_preprocessing.py | 2 +- tox.ini | 12 ++++---- 9 files changed, 51 insertions(+), 31 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 5421844..aa9757a 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -11,7 +11,7 @@ jobs: runs-on: ${{ matrix.os }} strategy: matrix: - python-version: [3.6, 3.7, 3.8] + python-version: ['3.8', '3.9', '3.10', '3.11'] os: [ubuntu-20.04, macos-latest] steps: - uses: actions/checkout@v1 @@ -20,7 +20,9 @@ jobs: with: python-version: ${{ matrix.python-version }} - name: Install package - run: pip install .[dev] + run: | + pip install --upgrade pip setuptools wheel + pip install .[dev] - name: make test-devel run: make test-devel @@ -28,7 +30,7 @@ jobs: runs-on: ${{ matrix.os }} strategy: matrix: - python-version: [3.6, 3.7, 3.8] + python-version: ['3.8', '3.9', '3.10', '3.11'] os: [ubuntu-20.04, macos-latest] steps: - uses: actions/checkout@v1 @@ -37,7 +39,9 @@ jobs: with: python-version: ${{ matrix.python-version }} - name: Install package and dependencies - run: pip install rundoc . + run: | + pip install --upgrade pip setuptools wheel + pip install rundoc . - name: make test-readme run: make test-readme @@ -45,7 +49,7 @@ jobs: runs-on: ${{ matrix.os }} strategy: matrix: - python-version: [3.6, 3.7, 3.8] + python-version: ['3.8', '3.9', '3.10', '3.11'] os: [ubuntu-20.04, macos-latest] steps: - uses: actions/checkout@v1 @@ -54,6 +58,8 @@ jobs: with: python-version: ${{ matrix.python-version }} - name: Install package and dependencies - run: pip install .[test] + run: | + pip install --upgrade pip setuptools wheel + pip install .[test] - name: make test-unit run: make test-unit diff --git a/mlprimitives/adapters/statsmodels.py b/mlprimitives/adapters/statsmodels.py index 78a70e8..fa9cf23 100644 --- a/mlprimitives/adapters/statsmodels.py +++ b/mlprimitives/adapters/statsmodels.py @@ -1,5 +1,5 @@ import numpy as np -from statsmodels.tsa import arima_model +from statsmodels.tsa.arima import model class ARIMA(object): @@ -45,8 +45,8 @@ def predict(self, X): num_sequences = len(X) for sequence in range(num_sequences): - arima = arima_model.ARIMA(X[sequence], order=(self.p, self.d, self.q)) - arima_fit = arima.fit(disp=0) + arima = model.ARIMA(X[sequence], order=(self.p, self.d, self.q)) + arima_fit = arima.fit() arima_results.append(arima_fit.forecast(self.steps)[0]) arima_results = np.asarray(arima_results) diff --git a/mlprimitives/custom/timeseries_preprocessing.py b/mlprimitives/custom/timeseries_preprocessing.py index 5648440..db1093b 100644 --- a/mlprimitives/custom/timeseries_preprocessing.py +++ b/mlprimitives/custom/timeseries_preprocessing.py @@ -269,4 +269,8 @@ def cutoff_window_sequences(X, timeseries, window_size, cutoff_time=None, time_i output.append(selected.values) - return np.array(output) + output = np.array(output, dtype=object) + if output.ndim >= 2: + output = output.astype(float) + + return output diff --git a/mlprimitives/primitives/xgboost.XGBClassifier.json b/mlprimitives/primitives/xgboost.XGBClassifier.json index d2d7393..e55c020 100644 --- a/mlprimitives/primitives/xgboost.XGBClassifier.json +++ b/mlprimitives/primitives/xgboost.XGBClassifier.json @@ -29,7 +29,6 @@ "args": [ { "name": "X", - "keyword": "data", "type": "ndarray" } ], diff --git a/mlprimitives/primitives/xgboost.XGBRegressor.json b/mlprimitives/primitives/xgboost.XGBRegressor.json index 6503adb..43c78c8 100644 --- a/mlprimitives/primitives/xgboost.XGBRegressor.json +++ b/mlprimitives/primitives/xgboost.XGBRegressor.json @@ -29,7 +29,6 @@ "args": [ { "name": "X", - "keyword": "data", "type": "ndarray" } ], diff --git a/setup.py b/setup.py index 63216e1..4b20e28 100644 --- a/setup.py +++ b/setup.py @@ -12,24 +12,24 @@ history = history_file.read() install_requires = [ - 'Keras>=2.4,<2.5', + 'Keras>=2.4,<2.15', 'featuretools>=0.6.1,<0.23', 'iso639>=0.1.4,<0.2', 'langdetect>=1.0.7,<2', 'lightfm>=1.15,<2', - 'mlblocks>=0.4.0.dev0,<0.7', + 'mlblocks>=0.6,<0.7', 'networkx>=2.0,<3', 'nltk>=3.3,<4', - 'numpy<1.21.0,>=1.16.0', + 'numpy>=1.16.0,<2', 'opencv-python>=3.4.0.12,<4.7', 'pandas>=1,<2', 'python-louvain>=0.10,<0.14', # community 'scikit-image>=0.15', 'scikit-learn>=0.21', 'scipy>=1.1.0,<2', - 'statsmodels>=0.9.0,<0.13', - 'tensorflow>=2,<2.5', - 'xgboost>=0.72.1,<1', + 'statsmodels>=0.9.0,<0.15', + 'tensorflow>=2,<2.15', + 'xgboost>=0.72.1,<2', 'protobuf<4', ] @@ -59,6 +59,15 @@ 'mistune>=0.7,<2', 'Jinja2>=2,<3.1', + # fails on Sphinx < v3.4 + 'alabaster<=0.7.12', + # fails on Sphins < v5.0 + 'sphinxcontrib-applehelp<1.0.8', + 'sphinxcontrib-devhelp<1.0.6', + 'sphinxcontrib-htmlhelp<2.0.5', + 'sphinxcontrib-serializinghtml<1.1.10', + 'sphinxcontrib-qthelp<1.0.7', + # style check 'flake8>=3.7.7,<4', 'isort>=4.3.4,<5', @@ -91,9 +100,10 @@ 'License :: OSI Approved :: MIT License', 'Natural Language :: English', 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.6', - 'Programming Language :: Python :: 3.7', 'Programming Language :: Python :: 3.8', + 'Programming Language :: Python :: 3.9', + 'Programming Language :: Python :: 3.10', + 'Programming Language :: Python :: 3.11', ], description='Pipelines and primitives for machine learning and data science.', entry_points = { @@ -117,7 +127,7 @@ long_description_content_type='text/markdown', name='mlprimitives', packages=find_packages(include=['mlprimitives', 'mlprimitives.*']), - python_requires='>=3.6,<3.9', + python_requires='>=3.8,<3.12', setup_requires=setup_requires, test_suite='tests', tests_require=tests_require, diff --git a/tests/adapters/test_statsmodels.py b/tests/adapters/test_statsmodels.py index bca5ec1..88f7b34 100644 --- a/tests/adapters/test_statsmodels.py +++ b/tests/adapters/test_statsmodels.py @@ -6,7 +6,7 @@ from mlprimitives.adapters.statsmodels import ARIMA -@patch('statsmodels.tsa.arima_model.ARIMA') +@patch('statsmodels.tsa.arima.model.ARIMA') def test_arima_1d(arima_mock): arima = ARIMA(1, 0, 0, 3) X = np.array([1, 2, 3, 4, 5]) @@ -15,7 +15,7 @@ def test_arima_1d(arima_mock): assert arima_mock.call_args[1] == {'order': (1, 0, 0)} -@patch('statsmodels.tsa.arima_model.ARMAResults.forecast') +@patch('statsmodels.tsa.arima.model.ARIMAResultsWrapper.forecast') def test_predict_1d(arima_mock): arima_mock.return_value = [[1, 2, 3]] @@ -29,7 +29,7 @@ def test_predict_1d(arima_mock): arima_mock.assert_called_once_with(3) -@patch('statsmodels.tsa.arima_model.ARIMA') +@patch('statsmodels.tsa.arima.model.ARIMA') def test_arima_2d(arima_mock): arima = ARIMA(1, 0, 0, 3) X = np.array([ @@ -46,7 +46,7 @@ def test_arima_2d(arima_mock): assert arima_mock.call_args_list[2][1] == {'order': (1, 0, 0)} -@patch('statsmodels.tsa.arima_model.ARMAResults.forecast') +@patch('statsmodels.tsa.arima.model.ARIMAResultsWrapper.forecast') def test_predict_2d(arima_mock): arima_mock.side_effect = [ [[1, 2, 3]], diff --git a/tests/custom/test_timeseries_preprocessing.py b/tests/custom/test_timeseries_preprocessing.py index 05b4b26..aed8966 100644 --- a/tests/custom/test_timeseries_preprocessing.py +++ b/tests/custom/test_timeseries_preprocessing.py @@ -417,7 +417,7 @@ def test_not_enough_data(self): [15, 35], [16, 36] ]) - ]) + ], dtype=object) assert_allclose( array[0], diff --git a/tox.ini b/tox.ini index a63bfd3..9a25c4d 100644 --- a/tox.ini +++ b/tox.ini @@ -1,17 +1,19 @@ [tox] -envlist = py3{6,7,8}, test-devel +envlist = py3{8,9,10,11}, test-devel [travis] python = 3.8: py38, test-devel - 3.7: py37 - 3.6: py36 + 3.9: py39 + 3.10: py310 + 3.11: py311 [gh-actions] python = 3.8: py38, test-devel - 3.7: py37 - 3.6: py36 + 3.9: py39 + 3.10: py310 + 3.11: py311 [testenv] passenv = CI TRAVIS TRAVIS_* From 2e370ae22b1dbbc4f940869364543c2ab7374291 Mon Sep 17 00:00:00 2001 From: Sarah Alnegheimish Date: Thu, 14 Mar 2024 16:38:46 -0400 Subject: [PATCH 3/5] =?UTF-8?q?Bump=20version:=200.3.6.dev0=20=E2=86=92=20?= =?UTF-8?q?0.3.6.dev1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- mlprimitives/__init__.py | 2 +- setup.cfg | 2 +- setup.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/mlprimitives/__init__.py b/mlprimitives/__init__.py index 34704ba..b7f2950 100644 --- a/mlprimitives/__init__.py +++ b/mlprimitives/__init__.py @@ -4,7 +4,7 @@ __author__ = 'MIT Data To AI Lab' __email__ = 'dailabmit@gmail.com' -__version__ = '0.3.6.dev0' +__version__ = '0.3.6.dev1' import os diff --git a/setup.cfg b/setup.cfg index c3907c7..6bfd1ff 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,5 +1,5 @@ [bumpversion] -current_version = 0.3.6.dev0 +current_version = 0.3.6.dev1 commit = True tag = True parse = (?P\d+)\.(?P\d+)\.(?P\d+)(\.(?P[a-z]+)(?P\d+))? diff --git a/setup.py b/setup.py index 4b20e28..da7437d 100644 --- a/setup.py +++ b/setup.py @@ -132,6 +132,6 @@ test_suite='tests', tests_require=tests_require, url='https://github.com/MLBazaar/MLPrimitives', - version='0.3.6.dev0', + version='0.3.6.dev1', zip_safe=False, ) From a38f9dc0f0c920983cb53a13e9235d1b73749a4b Mon Sep 17 00:00:00 2001 From: Sarah Alnegheimish Date: Fri, 22 Mar 2024 13:40:31 -0400 Subject: [PATCH 4/5] add release notes --- HISTORY.md | 8 ++++++++ README.md | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/HISTORY.md b/HISTORY.md index 7000c14..f678124 100644 --- a/HISTORY.md +++ b/HISTORY.md @@ -1,5 +1,13 @@ # History +## 0.4.0 - 2024-03-22 + +### General Imporvements + +* Upgrade python versions 3.9, 3.10, and 3.11 - [Issue #279](https://github.com/MLBazaar/MLPrimitives/issues/279) by @sarahmish +* Adapt to statsmodels.tsa.arima_model.ARIMA deprecation + - [Issue #253](https://github.com/MLBazaar/MLPrimitives/issues/253) by @sarahmish + ## 0.3.5 - 2023-04-14 ### General Imporvements diff --git a/README.md b/README.md index 1635c32..5b12933 100644 --- a/README.md +++ b/README.md @@ -39,7 +39,7 @@ combine third party tools or implement new functionalities from scratch. ## Requirements -**MLPrimitives** has been developed and tested on [Python 3.6, 3.7 and 3.8](https://www.python.org/downloads/) +**MLPrimitives** has been developed and tested on [Python 3.8, 3.9, 3.10, and 3.11](https://www.python.org/downloads/) Also, although it is not strictly required, the usage of a [virtualenv](https://virtualenv.pypa.io/en/latest/) is highly recommended in order to avoid From d91d210c17a149cf8fb6cf51a87459393628e14e Mon Sep 17 00:00:00 2001 From: Sarah Alnegheimish Date: Fri, 22 Mar 2024 13:40:39 -0400 Subject: [PATCH 5/5] =?UTF-8?q?Bump=20version:=200.3.6.dev1=20=E2=86=92=20?= =?UTF-8?q?0.4.0.dev0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- mlprimitives/__init__.py | 2 +- setup.cfg | 2 +- setup.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/mlprimitives/__init__.py b/mlprimitives/__init__.py index b7f2950..7ecebe2 100644 --- a/mlprimitives/__init__.py +++ b/mlprimitives/__init__.py @@ -4,7 +4,7 @@ __author__ = 'MIT Data To AI Lab' __email__ = 'dailabmit@gmail.com' -__version__ = '0.3.6.dev1' +__version__ = '0.4.0.dev0' import os diff --git a/setup.cfg b/setup.cfg index 6bfd1ff..29ceee1 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,5 +1,5 @@ [bumpversion] -current_version = 0.3.6.dev1 +current_version = 0.4.0.dev0 commit = True tag = True parse = (?P\d+)\.(?P\d+)\.(?P\d+)(\.(?P[a-z]+)(?P\d+))? diff --git a/setup.py b/setup.py index da7437d..2159c62 100644 --- a/setup.py +++ b/setup.py @@ -132,6 +132,6 @@ test_suite='tests', tests_require=tests_require, url='https://github.com/MLBazaar/MLPrimitives', - version='0.3.6.dev1', + version='0.4.0.dev0', zip_safe=False, )