-
Notifications
You must be signed in to change notification settings - Fork 32
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
Test against numpy 2.0 #166
Merged
Merged
Changes from 13 commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
ed272b5
test against np2
ocefpaf 85c8db3
test code generation
ocefpaf 277a4ed
harden the paths a bit so it can be called from anywhere
ocefpaf b0f3e8c
add scipy and fix some typos
ocefpaf ff329d9
add xarray
ocefpaf dee4b45
do code gen with np2
ocefpaf 6bed3dd
install everything that uses np from nightly
ocefpaf e5b9abc
simplify workflow
ocefpaf a4b654b
no build isolation
ocefpaf ebfd69c
we can import numpy with pep517/518
ocefpaf e70ede0
add ruff np2 checks
ocefpaf 3c28185
fix promotion type
ocefpaf cf38651
fix copy-n-pasta
ocefpaf 8f39666
oldest-supported-numpy won't be needed once np2 lands
ocefpaf File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
name: Test code generation | ||
|
||
on: | ||
pull_request: | ||
push: | ||
branches: [main] | ||
|
||
jobs: | ||
code-generation: | ||
runs-on: ubuntu-latest | ||
defaults: | ||
run: | ||
shell: bash -l {0} | ||
|
||
steps: | ||
- name: checkout | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Setup Micromamba | ||
uses: mamba-org/setup-micromamba@v1 | ||
with: | ||
environment-name: TEST | ||
init-shell: bash | ||
create-args: >- | ||
python=3 pip | ||
--file requirements-dev.txt | ||
--channel conda-forge | ||
|
||
- name: Install nightly version of numpy | ||
run: | | ||
python -m pip install --pre --index-url https://pypi.anaconda.org/scientific-python-nightly-wheels/simple --extra-index-url https://pypi.org/simple numpy scipy pandas -U | ||
|
||
- name: Test Code Generation | ||
run: > | ||
git clone https://github.com/TEOS-10/GSW-C.git ../GSW-C | ||
&& git clone https://github.com/TEOS-10/GSW-Matlab.git ../GSW-Matlab | ||
&& python tools/copy_from_GSW-C.py | ||
&& python tools/mat2npz.py | ||
&& python tools/make_ufuncs.py | ||
&& python tools/make_wrapped_ufuncs.py | ||
&& python tools/fix_wrapped_ufunc_typos.py | ||
|
||
- name: Install gsw | ||
run: > | ||
python -m pip install -v -e . --no-deps --no-build-isolation --force-reinstall | ||
&& python -m pytest -s -rxs -v gsw/tests |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,11 @@ | ||
check-manifest | ||
dask | ||
numpydoc | ||
pandas>=2 | ||
pytest | ||
scipy | ||
setuptools_scm | ||
sphinx | ||
sphinx_rtd_theme | ||
twine | ||
pandas>=2 | ||
dask | ||
xarray |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The hardest part was setting up the np2.0 test! This was the only failure we had due to https://numpy.org/devdocs/numpy_2_0_migration_guide.html#changes-to-numpy-data-type-promotion
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@efiring this is the only code change in this PR. Everything else is to be able to set a testing matrix with numpy 2.0. This PR also adds a test for the code generation step that serves both as test and developer breadcrumbs in case we need to do that locally.