Compatibility with numpy 2#764
Merged
Merged
Conversation
Long commit description provided. Quick overview. - Numpy C-API dispatch table use changed. - SWIG files rejigged for change C-API. - data "lock" flag implemented as flags.writeable is no longer in np2 - Changes to float() and int(). - pixi.toml changes to run np2. Badlands is only np1 now so full testing with it can only happen once badlands np2 is release.
* Fix - Update path in environment.yml to correct file * Fix typo * add old version on README * GH workflow updates Taken from `issue-metric-patch` changes * Sending _rebuild_solver = True for init_temp in UWGeodynamics If the temperature fields, BCs, solver are initialised after the `Model.solver` then stale temperature fields can be used. This change prevents this occurring. * Applying fix for github runners and openmpi comms layer choice * Disable ucx comms in conda-build-test.yml UCX isn't offered as a communication style for github runners. So it's disabled at test runtime.. * update conda dir - update the environment.yml to reference a new definitions taken from pixi. ie `pixi project export conda-environment > environment.yml` - remove obsolete bits for the conda build definitions. These changes should enable a v2.18.x binder image. * Update README * Pin zipp binder issues with zipp, let's try pin it to another version * add dockerignore to minimise the binder build size * Improve dockerignore * update .dockerignore
numpy 1 and 2 compatibility fixes - by default numpy < 2 is switched on - numpy 2 is supported by underworld2. - numpy 2 isn't supported by badlands, therefore UWGeo-Badlands coupling can only run numpy 1.
Updated changelog for release 2.18.0 with new features, changes, and fixes.
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Numpy 2 compatibility.
PR Checklist
CONTRIBUTING.rstdocument.CHANGELOG.md.Still numpy 1 is set as the default, but now underworld2 can be compiled and run with numpy 2 as well. This extends the longevity of underworld2 for ages to come.
For those interested in coupling models: UWGeo + Badlands no numpy 2 yet as Badlands is not numpy 2 compatible yet.
TL;DL; of the changes
- Numpy C-API dispatch table use changed: Now every .so created by UW2 (libStGermain.so, libUnderworld.so, etc...) gets it's own private version of the dispatch table. Previously only libStGermain.so got a copy and shared it to other .so files. In numpy 2 this sharing is no longer on by default. Changing all .so files to have their own version of the table works for both numpy 1 & 2. The redundancy of this table is negligable.
- SWIG files rejigged for change with dispatch table C-API: calling
import_array()- data "lock" flag implemented as flags.writeable is no longer in np2
- Changes to float() and int() as per numpy 2 changes.