Skip to content

Commit

Permalink
Merge pull request #41 from autonomio/migrate_to_hatch
Browse files Browse the repository at this point in the history
Migrate to hatch
  • Loading branch information
mikkokotila authored Apr 20, 2024
2 parents e1dbe39 + 32e6fa5 commit c6ac9da
Show file tree
Hide file tree
Showing 11 changed files with 70 additions and 46 deletions.
7 changes: 1 addition & 6 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

<hr>
44 changes: 12 additions & 32 deletions .github/workflows/ci-deploy.yml
Original file line number Diff line number Diff line change
@@ -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
47 changes: 47 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -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 = "[email protected]" },
]
maintainers = [
{ name = "Mikko Kotila", email = "[email protected]" },
]
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",
]
2 changes: 2 additions & 0 deletions wrangle/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,5 @@
from .array.array_random_shuffle import array_random_shuffle as shuffle

del array, col, df, dic

__version__ = '0.7.5'
4 changes: 2 additions & 2 deletions wrangle/df/df_corr_extratrees.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion wrangle/df/df_corr_randomforest.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion wrangle/df/df_groupby_params.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 = []

Expand Down
2 changes: 1 addition & 1 deletion wrangle/df/df_rename_cols.py
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down
2 changes: 1 addition & 1 deletion wrangle/df/df_rescale_log.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion wrangle/df/df_rescale_sqrt.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion wrangle/df/df_to_xy.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit c6ac9da

Please sign in to comment.