From 145034f1aa629a3a34e4b5c736f816723439d4c3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Brigitta=20Sip=C5=91cz?= Date: Wed, 20 Dec 2023 16:37:32 -0800 Subject: [PATCH 1/4] CI: update minimum versions following SPEC0 as of Q4 2023 --- tox.ini | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tox.ini b/tox.ini index e6f26ac8..a561670a 100644 --- a/tox.ini +++ b/tox.ini @@ -15,10 +15,10 @@ deps = -rsite/requirements.txt -rrequirements.txt - oldestdeps: numpy==1.20 - oldestdeps: matplotlib==3.4 - oldestdeps: scipy==1.6 - oldestdeps: pandas==1.2 + oldestdeps: numpy==1.23 + oldestdeps: matplotlib==3.6 + oldestdeps: scipy==1.8 + oldestdeps: pandas==1.4 allowlist_externals = bash From 613eaeb9adcfa7f33cf5ffd8c60e552ca981f19a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Brigitta=20Sip=C5=91cz?= Date: Wed, 20 Dec 2023 16:41:11 -0800 Subject: [PATCH 2/4] CI: adding python 3.12 to testing --- .github/workflows/ci_tests_run_notebooks.yml | 13 +++++++++---- tox.ini | 2 +- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci_tests_run_notebooks.yml b/.github/workflows/ci_tests_run_notebooks.yml index 9b55c58f..31ddb5d8 100644 --- a/.github/workflows/ci_tests_run_notebooks.yml +++ b/.github/workflows/ci_tests_run_notebooks.yml @@ -31,14 +31,19 @@ jobs: os: ubuntu-latest - python-version: '3.11' - toxenv: py311-test-devdeps - name: with Python 3.11 and developer versioned dependencies + toxenv: py311-test + name: with Python 3.11 and latest released version of dependencies + os: ubuntu-latest + + - python-version: '3.12' + toxenv: py312-test-devdeps + name: with Python 3.12 and developer versioned dependencies os: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v4 + uses: actions/setup-python@v5 with: python-version: ${{ matrix.python-version }} diff --git a/tox.ini b/tox.ini index a561670a..8f2e5878 100644 --- a/tox.ini +++ b/tox.ini @@ -1,6 +1,6 @@ [tox] envlist = - py{39,310,311}-test{,-oldestdeps,-devdeps,-predeps}{,-buildhtml} + py{39,310,311,312}-test{,-oldestdeps,-devdeps,-predeps}{,-buildhtml} requires = pip >= 19.3.1 From 07e9da089a84a96af195d543f76a856bd0e2f7ac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Brigitta=20Sip=C5=91cz?= Date: Wed, 20 Dec 2023 17:02:47 -0800 Subject: [PATCH 3/4] 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 --- tox.ini | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/tox.ini b/tox.ini index 8f2e5878..4c3157e3 100644 --- a/tox.ini +++ b/tox.ini @@ -8,6 +8,9 @@ requires = description = run tests +setenv = + devdeps: PIP_EXTRA_INDEX_URL = https://pypi.anaconda.org/scientific-python-nightly-wheels/simple + deps = # We use these files to specify all the dependencies, and below we override # versions for specific testing schenarios @@ -20,13 +23,16 @@ deps = oldestdeps: scipy==1.8 oldestdeps: pandas==1.4 + devdeps: numpy>=0.0.dev0 + devdeps: scipy>=0.0.dev0 + devdeps: matplotlib>=0.0.dev0 + devdeps: pandas>=0.0.dev0 + allowlist_externals = bash commands = - devdeps: pip install -U --pre --only-binary :all: -i https://pypi.anaconda.org/scipy-wheels-nightly/simple numpy - devdeps: pip install -U --pre --only-binary :all: -i https://pypi.anaconda.org/scipy-wheels-nightly/simple scipy - devdeps: pip install -U --pre --only-binary :all: -i https://pypi.anaconda.org/scipy-wheels-nightly/simple matplotlib - devdeps: pip install -U --pre --only-binary :all: -i https://pypi.anaconda.org/scipy-wheels-nightly/simple pandas + # Force numpy reinstall to work around upper version limits in downstream dependencies (e.g. pandas) + devdeps: pip install -U --pre --no-deps --extra-index-url https://pypi.anaconda.org/scientific-python-nightly-wheels/simple numpy pip freeze From f375a5cff4a19d5af2985e27ee9a95653465c10c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Brigitta=20Sip=C5=91cz?= Date: Wed, 20 Dec 2023 20:59:57 -0800 Subject: [PATCH 4/4] MAINT: content fixes for numpy 2.0 --- content/tutorial-ma.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/content/tutorial-ma.md b/content/tutorial-ma.md index 90a7fa31..fcb69eb2 100644 --- a/content/tutorial-ma.md +++ b/content/tutorial-ma.md @@ -92,7 +92,7 @@ rows of this file, since they contain other data we are not interested in. Separ # Read just the dates for columns 4-18 from the first row dates = np.genfromtxt( filename, - dtype=np.unicode_, + dtype=np.str_, delimiter=",", max_rows=1, usecols=range(4, 18), @@ -102,7 +102,7 @@ dates = np.genfromtxt( # columns, skipping the first six rows locations = np.genfromtxt( filename, - dtype=np.unicode_, + dtype=np.str_, delimiter=",", skip_header=6, usecols=(0, 1), @@ -119,7 +119,7 @@ nbcases = np.genfromtxt( ) ``` -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). +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). +++