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

Update for NumPy 2.0 and Python 3.13 #328

Merged
merged 3 commits into from
Sep 4, 2024
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
5 changes: 2 additions & 3 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
steps:
- uses: actions/setup-python@v1
with:
python-version: "3.8"
python-version: "3.10"

- uses: actions/cache@v2
with:
Expand All @@ -33,9 +33,8 @@ jobs:
- name: Install dependencies & configure cesium
run: |
pip install --upgrade pip
pip install wheel numpy requests six python-dateutil pytest pytest-cov mock coverage
pip install wheel setuptools_scm numpy cython requests six python-dateutil pytest pytest-cov mock coverage
make install
pip install cython==0.29.23
python setup.py build_ext -i
pip install -e .

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/wheel_tests_and_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
fail-fast: false
matrix:
os: [ubuntu-latest]
cibw_python: ["cp38-*", "cp39-*", "cp310-*", "cp311-*"]
cibw_python: ["cp310-*", "cp311-*", "cp312-*"]
cibw_manylinux: [manylinux2014]
cibw_arch: ["x86_64"]
steps:
Expand Down
4 changes: 2 additions & 2 deletions cesium/featurize.py
Original file line number Diff line number Diff line change
Expand Up @@ -452,8 +452,8 @@ def save_featureset(fset, path, **kwargs):
kwargs[k] = []

# Bypass savez to allow for `allow_pickle` keyword
# See https://github.com/numpy/numpy/pull/5770
np.lib.npyio._savez(path, [], kwargs, compress=True, allow_pickle=False)
# See also https://github.com/numpy/numpy/pull/27335
np.lib._npyio_impl._savez(path, [], kwargs, compress=True, allow_pickle=False)


def load_featureset(path):
Expand Down
2 changes: 1 addition & 1 deletion cesium/time_series.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ def _make_array_if_possible(x):
of arrays to (p, n) arrays.
"""
try:
x = np.asfarray(x).squeeze()
x = np.asarray(x, dtype=float).squeeze()
except ValueError:
pass
return x
Expand Down
2 changes: 1 addition & 1 deletion cesium/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ def extract_time_series(
x for x in archive.getmembers() if not x.name.startswith((".", "/"))
]
extracted_names = [x.name for x in members_to_extract]
archive.extractall(path=extract_dir, members=members_to_extract)
archive.extractall(path=extract_dir, members=members_to_extract, filter="data")
all_paths = [os.path.join(extract_dir, f) for f in extracted_names]
elif zipfile.is_zipfile(data_path):
archive = zipfile.ZipFile(data_path)
Expand Down
3 changes: 1 addition & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[build-system]
requires = ["setuptools", "setuptools_scm", "numpy", "Cython>=0.25"]
requires = ["setuptools", "setuptools_scm", "numpy>=2.0,<3.0", "Cython>=3.0"]
build-backend = "setuptools.build_meta"

[project]
Expand All @@ -26,7 +26,6 @@ classifiers = [
"Operating System :: Unix",
"Operating System :: MacOS",
]

dynamic = ["version", "dependencies"]

[project.urls]
Expand Down
3 changes: 1 addition & 2 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
numpy>=1.14.3
numpy>=2.0,<3.0
scipy>=0.16.0
scikit-learn>=0.22.1
pandas>=0.17.0
Expand All @@ -7,4 +7,3 @@ toolz
gatspy>=0.3.0
cloudpickle
joblib>=0.14.1
setuptools-scm>=7.1.0
Loading