-
Notifications
You must be signed in to change notification settings - Fork 18
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
Support Python 3.12 #424
Merged
Merged
Support Python 3.12 #424
Conversation
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
yguclu
changed the title
Use 'meson' branch of Igakit
Use latest version of NumPy, Igakit, SymPDE
Aug 8, 2024
yguclu
changed the title
Use latest version of NumPy, Igakit, SymPDE
Support Python 3.12
Aug 8, 2024
Summary of what I understood in this PR:
$ python3.12 examples/maxwell_2d_multi_patch.py
> Grid :: [4,4]
> Degree :: [2,2]
> CG info :: {'niter': 829, 'success': np.True_, 'res_norm': 9.976906608695098e-09}
> L2 error :: 1.59e+00
> Solution time :: 2.72e+01
> Evaluat. time :: 3.61e-02 |
kvrigor
approved these changes
Aug 16, 2024
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.
We make Psydac support Python 3.12 by using NumPy >= 2.0 together with Petsc4py >= 3.21 and the master branch of Igakit (updated on 6 Aug 2024). We also increase the required SymPDE version to 0.19.0. For simplicity, the same requirements are made for older versions of Python.
This closes #406.
Rationale
Python 3.12 does not have a
distutils
module. Therefore, NumPy 2.0 was released on 16 Jun 2024 with a newmeson
backend for thef2py
tool which is part of the library. As of 6 Aug 2024, Igakit also moved fromdistutils
to themeson-python
build system in combination with NumPy 2.0.The first version of
petsc4py
which is compatible with Python 3.12 is shipped with PETSc 3.21, hence we use this now instead of PETSc 3.20. Such a version ofpetsc4py
also requires NumPy >= 2.0.The move to NumPy 2.0 also means that some numeric datatypes behave differently. For this we need SymPDE >= 0.19.0.
Summary of changes
pyproject.toml
, set maximum Python version to 3.12, and require SymPDE 0.19.0 instead of 0.18.3;README.md
, increase PETSc version to 3.21.4;integral
ofTensorFemSpace
, convert any NumPy result to the native Python type to avoid errors with SymPy'ssympify
(after the upgrade to NumPy 2.0);continuous-integration.yml
, add tests with Python 3.12, increase PETSc version to 3.21.4, and add check of parallel h5py.