pyccel / psydac

Python 3 library for isogeometric analysis
https://pyccel.github.io/psydac/
MIT License
47 stars 17 forks source link

Support Python 3.12 #424

Closed yguclu closed 1 month ago

yguclu commented 1 month ago

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 new meson backend for the f2py tool which is part of the library. As of 6 Aug 2024, Igakit also moved from distutils to the meson-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 of petsc4py 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

kvrigor commented 1 month ago

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

image