diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml new file mode 100644 index 0000000..2e7b334 --- /dev/null +++ b/.github/workflows/tests.yml @@ -0,0 +1,30 @@ +name: Tests + +on: + push: + branches: + - main + pull_request: + branches: + - main + +jobs: + test: + runs-on: ubuntu-latest + strategy: + matrix: + python-version: ["3.9", "3.10", "3.11"] + + 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 package and dev dependencies + run: pip install -e ".[dev]" + + - name: Run tests + run: pytest tests/ diff --git a/README.md b/README.md index 4eef55c..7a70e7d 100644 --- a/README.md +++ b/README.md @@ -37,7 +37,7 @@ X = np.random.rand(1000, 128) y = np.random.randint(0, 10, (1000,)) n_splits = 3 -s = SimilarityStratifiedSplit(n_splits, get_distances) +s = SimilarityStratifiedSplit(n_splits, dist_func=get_distances) for train_index, test_index in s.split(X, y): print(f"Train indices: {train_index}\nTest indices: {test_index}") diff --git a/setup.py b/setup.py index dfd6ce7..ccd40c5 100644 --- a/setup.py +++ b/setup.py @@ -14,15 +14,15 @@ url="https://github.com/timothyckl/similarity-stratified-split", author="timothyckl", author_email="timothy.ckl@outlook.com", - license="", + license="MIT", classifiers=[ "License :: OSI Approved :: MIT License", "Programming Language :: Python :: 3.9", "Operating System :: OS Independent" ], - install_requires=["numpy==1.23.5"], - extra_require={ - "dev": ["pytest==7.4.3"] + install_requires=["numpy>=1.23.5"], + extras_require={ + "dev": ["pytest==7.4.3", "scipy"] }, - python_require=">=3.9" + python_requires=">=3.9" )