Skip to content

Commit

Permalink
Add python 3.12 | Remove python 3.7 (#15)
Browse files Browse the repository at this point in the history
* update python versions

* add adapter for minmax scaler to handle list instead of tuple

* upgrade mlblocks

* add dep packages

* fix lint

* remove python 3.13 for now
  • Loading branch information
sarahmish authored Nov 21, 2024
1 parent 73d2088 commit 2ec0f1b
Show file tree
Hide file tree
Showing 7 changed files with 51 additions and 15 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
- name: Python
uses: actions/setup-python@v1
with:
python-version: 3.8
python-version: 3.10

- name: Build
run: |
Expand All @@ -25,4 +25,4 @@ jobs:
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{secrets.GITHUB_TOKEN}}
publish_dir: docs/_build/html
publish_dir: docs/_build/html
6 changes: 3 additions & 3 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
python-version: ['3.8', '3.9', '3.10', '3.11']
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12']
os: [ubuntu-latest]
steps:
- uses: actions/checkout@v1
Expand All @@ -50,7 +50,7 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
python-version: ['3.8', '3.9', '3.10', '3.11']
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12']
os: [ubuntu-latest, macos-latest]
steps:
- uses: actions/checkout@v1
Expand All @@ -68,7 +68,7 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
python-version: ['3.8', '3.9', '3.10', '3.11']
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12']
os: [ubuntu-latest, macos-latest, windows-latest]
steps:
- uses: actions/checkout@v1
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ combine third party tools or implement new functionalities from scratch.

## Requirements

**ml-stars** has been developed and tested on [Python 3.8, 3.9, 3.10, and 3.11](https://www.python.org/downloads/)
**ml-stars** has been developed and tested on [Python 3.8, 3.9, 3.10, 3.11, and 3.12](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
Expand Down
25 changes: 25 additions & 0 deletions mlstars/adapters/sklearn.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# -*- coding: utf-8 -*-

from sklearn.preprocessing import MinMaxScaler


class Scaler(MinMaxScaler):
"""sklearn.preprocessing.MinMaxScaler adapter.
Convert feature_range into a tuple.
Args:
feature_range (list):
List of two elements. Desired range of transformed data.
copy (bool):
Set to False to perform inplace row normalization and avoid a copy.
"""

def __init__(self, feature_range=(0, 1), copy=True):
feature_range = tuple(feature_range)

super(Scaler, self).__init__(
feature_range=feature_range,
copy=copy
)
5 changes: 3 additions & 2 deletions mlstars/primitives/sklearn.preprocessing.MinMaxScaler.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
{
"name": "sklearn.preprocessing.MinMaxScaler",
"contributors": [
"Hector Dominguez <[email protected]>"
"Hector Dominguez <[email protected]>",
"Sarah Alnegheimish <[email protected]>"
],
"documentation": "http://scikit-learn.org/stable/modules/generated/sklearn.preprocessing.MinMaxScaler.html",
"description": "Transforms features by scaling each feature to a given range",
Expand All @@ -10,7 +11,7 @@
"subtype": "transformer"
},
"modalities": [],
"primitive": "sklearn.preprocessing.MinMaxScaler",
"primitive": "mlstars.adapters.sklearn.Scaler",
"fit": {
"method": "fit",
"args": [
Expand Down
22 changes: 16 additions & 6 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,14 @@
history = history_file.read()

install_requires = [
'Keras>=2.4,<2.15',
'mlblocks>=0.6.1',
'Keras>=2.4,<4',
'mlblocks>=0.6.2',
'numpy>=1.17.4,<2',
'pandas>=1,<3',
'scikit-learn>=0.22,<1.2',
'scikit-learn>=0.22,<2',
'scipy>=1.4.1,<2',
'statsmodels>=0.12.0,<0.15',
'tensorflow>=2.2,<2.15',
'tensorflow>=2.2,<3',
'xgboost>=0.72.1,<2',

# fix google/protobuf/descriptor
Expand All @@ -38,7 +38,7 @@
# general
'bumpversion>=0.5.3,<0.6',
'pip>=9.0.1',
'watchdog>=0.8.3,<0.11',
'watchdog>=0.8.3,<7',

# docs
'docutils>=0.12,<0.18',
Expand All @@ -49,6 +49,15 @@
'markupsafe<2.1.0',
'ipython>=6.5,<9',
'Jinja2>=2,<3',

# 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',
Expand Down Expand Up @@ -82,6 +91,7 @@
'Programming Language :: Python :: 3.9',
'Programming Language :: Python :: 3.10',
'Programming Language :: Python :: 3.11',
'Programming Language :: Python :: 3.12',
],
description='Primitives and Pipelines for Time Series Data.',
entry_points={
Expand All @@ -103,7 +113,7 @@
keywords='mlstars',
name='ml-stars',
packages=find_packages(include=['mlstars', 'mlstars.*']),
python_requires='>=3.8,<3.12',
python_requires='>=3.8,<3.13',
setup_requires=setup_requires,
test_suite='tests',
tests_require=tests_require,
Expand Down
2 changes: 1 addition & 1 deletion tox.ini
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[tox]
envlist = lint, docs, py3{7, 8, 9, 10, 11}-{readme,pytest,minimum,tutorials}
envlist = lint, docs, py3{8, 9, 10, 11, 12}-{readme,pytest,minimum,tutorials}

[testenv]
skipsdist = false
Expand Down

0 comments on commit 2ec0f1b

Please sign in to comment.