Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cleanup #81

Merged
merged 9 commits into from
Sep 22, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: CI
on:
push:
branches:
- "master"
- "*"
pull_request:
branches:
- "*"
Expand All @@ -25,7 +25,7 @@ jobs:
fail-fast: false
matrix:
os: ["ubuntu-latest"]
python-version: ["3.7", "3.10"]
python-version: ["3.9", "3.10", "3.11"]
steps:
- uses: actions/checkout@v3
with:
Expand Down Expand Up @@ -56,7 +56,7 @@ jobs:
- name: Set up conda environment
shell: bash -l {0}
run: |
python -m pip install -e .[tests]
python -m pip install -e .[dev]
conda list

- name: Run Tests
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pypi-release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
run: |
git clean -xdf
git restore -SW .
python setup.py sdist
python -m build
- name: Check built artifacts
run: |
python -m twine check --strict dist/*
Expand Down
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,9 @@ nosetests.xml
.cache/
__pycache__/
.eggs/
.hypothesis/
*~

*.ini

# Dynamic versioning
numpy_groupies/_version.py
6 changes: 0 additions & 6 deletions MANIFEST.in

This file was deleted.

157 changes: 55 additions & 102 deletions README.md

Large diffs are not rendered by default.

4 changes: 1 addition & 3 deletions conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,7 @@


def pytest_configure(config):
config.addinivalue_line(
"markers", "deselect_if(func): function to deselect tests from parametrization"
)
config.addinivalue_line("markers", "deselect_if(func): function to deselect tests from parametrization")


def pytest_collection_modifyitems(config, items):
Expand Down
35 changes: 15 additions & 20 deletions numpy_groupies/__init__.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
from ._version import get_versions
from .aggregate_purepy import aggregate as aggregate_py


def dummy_no_impl(*args, **kwargs):
raise NotImplementedError(
"You may need to install another package (numpy, "
"weave, or numba) to access a working implementation."
"You may need to install another package (numpy or numba) to access a working implementation."
)


Expand All @@ -21,7 +19,7 @@ def dummy_no_impl(*args, **kwargs):

aggregate_np = aggregate
from .aggregate_numpy_ufunc import aggregate as aggregate_ufunc
from .utils_numpy import (
from .utils import (
label_contiguous_1d,
multi_arange,
relabel_groups_masked,
Expand All @@ -30,25 +28,13 @@ def dummy_no_impl(*args, **kwargs):
)


try:
try:
import weave
except ImportError:
from scipy import weave
except ImportError:
aggregate_wv = None
else:
from .aggregate_weave import aggregate as aggregate_wv, step_count, step_indices

aggregate = aggregate_wv


try:
import numba
except ImportError:
aggregate_nb = None
else:
from .aggregate_numba import aggregate as aggregate_nb, step_count, step_indices
from .aggregate_numba import aggregate as aggregate_nb
from .aggregate_numba import step_count, step_indices

aggregate = aggregate_nb

Expand All @@ -57,5 +43,14 @@ def uaggregate(group_idx, a, **kwargs):
return unpack(group_idx, aggregate(group_idx, a, **kwargs))


__version__ = get_versions()["version"]
del get_versions
try:
# Version is added only when packaged
from ._version import __version__
except ImportError:
try:
from setuptools_scm import get_version
except ImportError:
__version__ = "0.0.0"
else:
__version__ = get_version(root="..", relative_to=__file__)
del get_version
Loading