From 324e85fab04b92d4aa7912b21f426b766bb3e504 Mon Sep 17 00:00:00 2001 From: Mikko Kotila Date: Sat, 20 Apr 2024 16:38:09 +0300 Subject: [PATCH 1/4] deploy CI to hatch --- .github/workflows/ci-deploy.yml | 44 +++++++++--------------------- pyproject.toml | 47 +++++++++++++++++++++++++++++++++ wrangle/__init__.py | 2 ++ 3 files changed, 61 insertions(+), 32 deletions(-) create mode 100644 pyproject.toml diff --git a/.github/workflows/ci-deploy.yml b/.github/workflows/ci-deploy.yml index 78b74dd..e915bc6 100644 --- a/.github/workflows/ci-deploy.yml +++ b/.github/workflows/ci-deploy.yml @@ -1,45 +1,25 @@ -name: Publish Python Package [NEW] +name: Upload Python Package + on: release: types: [created] -permissions: - contents: read - jobs: - test: - runs-on: ubuntu-latest - strategy: - matrix: - python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"] - steps: - - uses: actions/checkout@v4 - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v5 - with: - python-version: ${{ matrix.python-version }} - - name: Install dependencies - run: | - pip install -r requirements.txt - - name: Run tests - run: | - test_script.py deploy: runs-on: ubuntu-latest - environment: release - permissions: - id-token: write steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v1 - name: Set up Python - uses: actions/setup-python@v5 + uses: actions/setup-python@v1 with: - python-version: "3.12" + python-version: '3.x' - name: Install dependencies run: | - pip install setuptools wheel build - - name: Build + python -m pip install --upgrade pip + pip install hatch + - name: Build and publish + env: + PYPI_API_TOKEN: ${{ secrets.PYPI_API_TOKEN }} run: | - python -m build - - name: Publish - uses: pypa/gh-action-pypi-publish@release/v1 + hatch build + hatch publish --user __token__ --auth $PYPI_API_TOKEN \ No newline at end of file diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..f5ab4d3 --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,47 @@ +[build-system] +requires = ["hatchling"] +build-backend = "hatchling.build" + +[project] +name = "wrangle" +dynamic = ["version"] +description = "Wrangle - Data Preparation for Deep Learning" +readme = "README.md" +license = "MIT" +authors = [ + { name = "Mikko Kotila", email = "mailme@mikkokotila.com" }, +] +maintainers = [ + { name = "Mikko Kotila", email = "mailme@mikkokotila.com" }, +] +classifiers = [ + "Intended Audience :: Science/Research", + "License :: OSI Approved :: MIT License", + "Operating System :: MacOS", + "Operating System :: POSIX", + "Operating System :: Unix", + "Programming Language :: Python :: 3.6", + "Topic :: Scientific/Engineering :: Artificial Intelligence", + "Topic :: Scientific/Engineering :: Human Machine Interfaces", + "Topic :: Scientific/Engineering :: Mathematics", +] +dependencies = [ + "numpy", + "pandas", + "scikit-learn", + "scipy", + "statsmodels>=0.11.0", + "tensorflow", +] + +[project.urls] +Download = "https://github.com/autonomio/wrangle/" +Homepage = "http://autonom.io" + +[tool.hatch.version] +path = "wrangle/__init__.py" + +[tool.hatch.build.targets.sdist] +include = [ + "/wrangle", +] diff --git a/wrangle/__init__.py b/wrangle/__init__.py index 7276ece..6259ab0 100644 --- a/wrangle/__init__.py +++ b/wrangle/__init__.py @@ -8,3 +8,5 @@ from .array.array_random_shuffle import array_random_shuffle as shuffle del array, col, df, dic + +__version__ = '0.7.4' From 930d32fde26c2960afbf50381c7e3db9f6407e22 Mon Sep 17 00:00:00 2001 From: Mikko Kotila Date: Sat, 20 Apr 2024 16:40:19 +0300 Subject: [PATCH 2/4] fixed drop() axis param --- wrangle/df/df_corr_extratrees.py | 4 ++-- wrangle/df/df_corr_randomforest.py | 2 +- wrangle/df/df_groupby_params.py | 2 +- wrangle/df/df_rename_cols.py | 2 +- wrangle/df/df_rescale_log.py | 2 +- wrangle/df/df_rescale_sqrt.py | 2 +- wrangle/df/df_to_xy.py | 2 +- 7 files changed, 8 insertions(+), 8 deletions(-) diff --git a/wrangle/df/df_corr_extratrees.py b/wrangle/df/df_corr_extratrees.py index f597bed..d05c0fb 100644 --- a/wrangle/df/df_corr_extratrees.py +++ b/wrangle/df/df_corr_extratrees.py @@ -13,8 +13,8 @@ def df_corr_extratrees(data, y): ''' - x = data.drop(y, 1).values - labels = data.drop(y, 1).columns + x = data.drop(y, axis=1).values + labels = data.drop(y, axis=1).columns y = data[y].values reg = ExtraTreesClassifier(max_depth=3, n_estimators=100) diff --git a/wrangle/df/df_corr_randomforest.py b/wrangle/df/df_corr_randomforest.py index aba7d3f..0d841b9 100644 --- a/wrangle/df/df_corr_randomforest.py +++ b/wrangle/df/df_corr_randomforest.py @@ -22,7 +22,7 @@ def df_corr_randomforest(data, y, destructive=True): data = data.copy(deep=True) x = data.drop(y, 1).values - labels = data.drop(y, 1).columns + labels = data.drop(y, axis=1).columns y = data[y].values reg = RandomForestRegressor(max_depth=3, n_estimators=100) diff --git a/wrangle/df/df_groupby_params.py b/wrangle/df/df_groupby_params.py index 9bf3f17..8fb6911 100644 --- a/wrangle/df/df_groupby_params.py +++ b/wrangle/df/df_groupby_params.py @@ -19,7 +19,7 @@ def df_groupby_params(data, import signs from .df_restructure_values import df_restructure_values - docs = df_restructure_values(data.drop(metric, 1), 'tuple').values + docs = df_restructure_values(data.drop(metric, axis=1), 'tuple').values out = [] diff --git a/wrangle/df/df_rename_cols.py b/wrangle/df/df_rename_cols.py index c62ba74..66a4f64 100644 --- a/wrangle/df/df_rename_cols.py +++ b/wrangle/df/df_rename_cols.py @@ -18,7 +18,7 @@ def df_rename_cols(data, exclude=None, prefix='C', destructive=False): data = data.copy(deep=True) if exclude is not None: - data = data.drop(exclude, 1) + data = data.drop(exclude, axis=1) temp = data[exclude].values no_of_cols = data.shape[1] diff --git a/wrangle/df/df_rescale_log.py b/wrangle/df/df_rescale_log.py index b4afb48..53c4915 100644 --- a/wrangle/df/df_rescale_log.py +++ b/wrangle/df/df_rescale_log.py @@ -19,7 +19,7 @@ def df_rescale_log(data, retain_cols=None, destructive=False): data = data.copy(deep=True) if retain_cols is not None: - data = data.drop(retain_cols, 1) + data = data.drop(retain_cols, axis=1) temp = data[retain_cols] numeric = data.select_dtypes(include=['int', 'float']).columns diff --git a/wrangle/df/df_rescale_sqrt.py b/wrangle/df/df_rescale_sqrt.py index 548f0a5..731f0c0 100644 --- a/wrangle/df/df_rescale_sqrt.py +++ b/wrangle/df/df_rescale_sqrt.py @@ -18,7 +18,7 @@ def df_rescale_sqrt(data, retain_cols=None, destructive=False): data = data.copy(deep=True) if retain_cols is not None: - data = data.drop(retain_cols, 1) + data = data.drop(retain_cols, axis=1) temp = data[retain_cols] numeric = data.select_dtypes(include=['int', 'float']).columns diff --git a/wrangle/df/df_to_xy.py b/wrangle/df/df_to_xy.py index 94fbd3f..5a86ee7 100644 --- a/wrangle/df/df_to_xy.py +++ b/wrangle/df/df_to_xy.py @@ -8,4 +8,4 @@ def df_to_xy(data, y_col): The column with the y values ''' - return data.drop(y_col, 1).values, data[y_col].values + return data.drop(y_col, axis=1).values, data[y_col].values From 9c2e7c6135ed6855b06fefc1b99835c967e01c59 Mon Sep 17 00:00:00 2001 From: Mikko Kotila Date: Sat, 20 Apr 2024 16:40:54 +0300 Subject: [PATCH 3/4] updated version number --- wrangle/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wrangle/__init__.py b/wrangle/__init__.py index 6259ab0..e2028d8 100644 --- a/wrangle/__init__.py +++ b/wrangle/__init__.py @@ -9,4 +9,4 @@ del array, col, df, dic -__version__ = '0.7.4' +__version__ = '0.7.5' From 32e6fa58690a4dcf0e1dccc185f4701a0ec8f406 Mon Sep 17 00:00:00 2001 From: Mikko Kotila Date: Sat, 20 Apr 2024 16:42:37 +0300 Subject: [PATCH 4/4] updated PR template --- .github/PULL_REQUEST_TEMPLATE.md | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index 21b257e..8fc1d05 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -9,15 +9,10 @@ the below items: - [ ] Code is [PEP8](https://www.python.org/dev/peps/pep-0008/) - [ ] I'm making the PR to `master` -#### Docs - -- [ ] [Docs](https://autonomio.github.io/talos) are updated -- [ ] [Docs](https://autonomio.github.io/talos) version is correct (index.html and \_coverpage.md) - #### Tests - [ ] Changes have gone through actual use testing -- [ ] All local tests have passed (run ./test.sh in /talos) +- [ ] All local tests have passed (`python test_script.py`) - [ ] Tests have been updated to reflect the changes