Skip to content

Commit a870f27

Browse files
authored
MAINT: update minimum required versions and CI maintanance (numpy#199)
* CI: update minimum versions following SPEC0 as of Q4 2023 * CI: adding python 3.12 to testing * MAINT: use the scientific python extra pip index for dev wheels Keep reinstalling numpy with a separated pip command to ensure the dev version is picked up even if a downstream dependency upper limited it * MAINT: content fixes for numpy 2.0
1 parent 4ea40a0 commit a870f27

File tree

3 files changed

+27
-16
lines changed

3 files changed

+27
-16
lines changed

.github/workflows/ci_tests_run_notebooks.yml

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,14 +31,19 @@ jobs:
3131
os: ubuntu-latest
3232

3333
- python-version: '3.11'
34-
toxenv: py311-test-devdeps
35-
name: with Python 3.11 and developer versioned dependencies
34+
toxenv: py311-test
35+
name: with Python 3.11 and latest released version of dependencies
36+
os: ubuntu-latest
37+
38+
- python-version: '3.12'
39+
toxenv: py312-test-devdeps
40+
name: with Python 3.12 and developer versioned dependencies
3641
os: ubuntu-latest
3742

3843
steps:
39-
- uses: actions/checkout@v3
44+
- uses: actions/checkout@v4
4045
- name: Set up Python ${{ matrix.python-version }}
41-
uses: actions/setup-python@v4
46+
uses: actions/setup-python@v5
4247
with:
4348
python-version: ${{ matrix.python-version }}
4449

content/tutorial-ma.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ rows of this file, since they contain other data we are not interested in. Separ
9292
# Read just the dates for columns 4-18 from the first row
9393
dates = np.genfromtxt(
9494
filename,
95-
dtype=np.unicode_,
95+
dtype=np.str_,
9696
delimiter=",",
9797
max_rows=1,
9898
usecols=range(4, 18),
@@ -102,7 +102,7 @@ dates = np.genfromtxt(
102102
# columns, skipping the first six rows
103103
locations = np.genfromtxt(
104104
filename,
105-
dtype=np.unicode_,
105+
dtype=np.str_,
106106
delimiter=",",
107107
skip_header=6,
108108
usecols=(0, 1),
@@ -119,7 +119,7 @@ nbcases = np.genfromtxt(
119119
)
120120
```
121121

122-
Included in the `numpy.genfromtxt` function call, we have selected the [numpy.dtype](https://numpy.org/devdocs/reference/generated/numpy.dtype.html#numpy.dtype) for each subset of the data (either an integer - `numpy.int_` - or a string of characters - `numpy.unicode_`). We have also used the `encoding` argument to select `utf-8-sig` as the encoding for the file (read more about encoding in the [official Python documentation](https://docs.python.org/3/library/codecs.html#encodings-and-unicode). You can read more about the `numpy.genfromtxt` function from the [Reference Documentation](https://numpy.org/devdocs/reference/generated/numpy.genfromtxt.html#numpy.genfromtxt) or from the [Basic IO tutorial](https://numpy.org/devdocs/user/basics.io.genfromtxt.html).
122+
Included in the `numpy.genfromtxt` function call, we have selected the [numpy.dtype](https://numpy.org/devdocs/reference/generated/numpy.dtype.html#numpy.dtype) for each subset of the data (either an integer - `numpy.int_` - or a string of characters - `numpy.str_`). We have also used the `encoding` argument to select `utf-8-sig` as the encoding for the file (read more about encoding in the [official Python documentation](https://docs.python.org/3/library/codecs.html#encodings-and-unicode). You can read more about the `numpy.genfromtxt` function from the [Reference Documentation](https://numpy.org/devdocs/reference/generated/numpy.genfromtxt.html#numpy.genfromtxt) or from the [Basic IO tutorial](https://numpy.org/devdocs/user/basics.io.genfromtxt.html).
123123

124124
+++
125125

tox.ini

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,38 @@
11
[tox]
22
envlist =
3-
py{39,310,311}-test{,-oldestdeps,-devdeps,-predeps}{,-buildhtml}
3+
py{39,310,311,312}-test{,-oldestdeps,-devdeps,-predeps}{,-buildhtml}
44
requires =
55
pip >= 19.3.1
66

77
[testenv]
88

99
description = run tests
1010

11+
setenv =
12+
devdeps: PIP_EXTRA_INDEX_URL = https://pypi.anaconda.org/scientific-python-nightly-wheels/simple
13+
1114
deps =
1215
# We use these files to specify all the dependencies, and below we override
1316
# versions for specific testing schenarios
1417
-rtest_requirements.txt
1518
-rsite/requirements.txt
1619
-rrequirements.txt
1720

18-
oldestdeps: numpy==1.20
19-
oldestdeps: matplotlib==3.4
20-
oldestdeps: scipy==1.6
21-
oldestdeps: pandas==1.2
21+
oldestdeps: numpy==1.23
22+
oldestdeps: matplotlib==3.6
23+
oldestdeps: scipy==1.8
24+
oldestdeps: pandas==1.4
25+
26+
devdeps: numpy>=0.0.dev0
27+
devdeps: scipy>=0.0.dev0
28+
devdeps: matplotlib>=0.0.dev0
29+
devdeps: pandas>=0.0.dev0
2230

2331
allowlist_externals = bash
2432

2533
commands =
26-
devdeps: pip install -U --pre --only-binary :all: -i https://pypi.anaconda.org/scipy-wheels-nightly/simple numpy
27-
devdeps: pip install -U --pre --only-binary :all: -i https://pypi.anaconda.org/scipy-wheels-nightly/simple scipy
28-
devdeps: pip install -U --pre --only-binary :all: -i https://pypi.anaconda.org/scipy-wheels-nightly/simple matplotlib
29-
devdeps: pip install -U --pre --only-binary :all: -i https://pypi.anaconda.org/scipy-wheels-nightly/simple pandas
34+
# Force numpy reinstall to work around upper version limits in downstream dependencies (e.g. pandas)
35+
devdeps: pip install -U --pre --no-deps --extra-index-url https://pypi.anaconda.org/scientific-python-nightly-wheels/simple numpy
3036

3137
pip freeze
3238

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy