-
Notifications
You must be signed in to change notification settings - Fork 21
Support Python 3.13 #475
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.13 #475
Conversation
|
Unfortunately Psydac requires mpi4py version < 4, which is not compatible with Python 3.13. See issue #420. |
|
Currently blocked by issue #420. |
Coverage summary from CodacySee diff coverage on Codacy
Coverage variation details
Coverage variation is the difference between the coverage for the head and common ancestor commits of the pull request branch: Diff coverage details
Diff coverage is the percentage of lines that are covered by tests out of the coverable lines that the pull request added or modified: See your quality gate settings Change summary preferences |
|
After PR #478 there is no blocking issue for using Python 3.13. There is however an installation error for @max-models Could you maybe have a look at the error? |
|
@max-models I suspect the problem is with Cython. We are currently installing an old version (0.29.37) which is probably not compatible with CPython 3.13 |
* Support Python 3.13 (pyccel#475) Closes pyccel#476: * Do not restrict the maximum Python version to 3.12 in `pyproject.toml` * Require `Cython >= 3` to avoid `h5py` installation crash w/ Python 3.13 * Require `sympde == 0.19.2` which supports Python 3.13 * Run unit tests with Python 3.13 too * Trigger CI * Install struphy from devel in CI --------- Co-authored-by: Yaman Güçlü <[email protected]>
* fix bug gmres (pyccel#452) Solves issue pyccel#451. * CI Updates: Code coverage report, Ubuntu 24.04, PETSc 3.22 (pyccel#443) Summary of changes: - Integrate Codacy reporting - Lock runner versions to `ubuntu-24.04` and `macos-14`. The [`*-latest` runner versions](https://github.com/actions/runner-images#available-images) are moving targets; we wish to avoid surprise failing tests caused by runner upgrades (e.g. see [macOS issue](pyccel#421) from last year) . - Upgrade PETSc to [v3.22](https://petsc.org/release/changes/322/). * Expose inter-/histopolation matrices in GlobalProjector, add unit tests (pyccel#347) Fixes pyccel#346. The inter-/histopolation matrices are now exposed in `GlobalProjector.imat_kronecker` as a `LinearOperator` object of type `KroneckerStencilMatrix` (in the case where both domain and codomain are scalar spaces) or `BlockLinearOperator` (in the case where at least one space is vector valued). The unit tests in `feec/tests/test_commuting_projections.py` have been enhanced: they now also test how close `imat_kronecker` is to being the right-inverse of the `solver`attribute (which uses a Kronecker product of 1D linear solvers). --------- Co-authored-by: Yaman Güçlü <[email protected]> Co-authored-by: Max Lindqvist <[email protected]> Co-authored-by: Martin Campos Pinto <[email protected]> * Avoid installing h5py from cache (pyccel#430) Add the flag `--no-cache-dir` to `pip` in order to guarantee that `h5py` is always built during installation. See: - https://stackoverflow.com/questions/45594707/what-is-pips-no-cache-dir-good-for; - https://docs.h5py.org/en/stable/build.html#custom-installation. Re-using a prebuilt `h5py` (*i.e.* cached `h5py`) could become an issue when `h5py` dependencies upgrade. For example, If people have a cached version of the h5py library which was compiled using NumPy < 2.0 and try to install Psydac in a clean Python environment, they end up with a broken version. This is because the cached version of h5py tries to call C functions from NumPy 2.0 which are not ABI compatible. --------- Co-authored-by: Yaman Güçlü <[email protected]> * Allow keyword parameters in the dot method of `MatrixFreeLinearOperator` (pyccel#456) Allow the creation of a `MatrixFreeLinearOperator` object with a dot function that takes multiple keyword arguments, as for instance function parameters. * Small fixes for operators with complex (pyccel#455) - Make `ScaledLinearOperator` work with a complex scalar; - Take real part of `r.dot(r)` to avoid complex warning in `sqrt`; - Add unit test. * Fix Greville point collocation matrix for single grid point case (pyccel#446) Previously, in the case when `self.greville.size == 1`, `collocation_matrix` would return an empty matrix. Now, if the grid has a single Greville point, the collocation matrix is simplified to a 1x1 matrix with a value of 1. * Use SymPDE version 0.19.1 (pyccel#445) Update Psydac after the breaking change introduced by version 0.19.1 of SymPDE: domain coordinates are real symbols. Further, the new version is needed in order to solve pyccel#457. --------- Co-authored-by: Elena Moral Sánchez <[email protected]> * Improve FEM API (names, properties, constructors...) & plot_field() (pyccel#468) Improve the FEM API to make it more user-friendly and compatible between single-patch and multi-patch APIs (fix pyccel#459 and fix pyccel#460): * Rename abstract property `vector_space` of `FemSpace` as `coeff_space` * Rename `ProductFemSpace` as `MultipatchFemSpace` * Do not use class constructors as factories (previously `ProductFemSpace()` could return a `VectorFemSpace` object) * Provide more specific helper properties for FEM spaces, such as - `is_vector_valued` and `is_multipatch` (also remove a method `is_scalar` which was implemented in _some_ FEM spaces but not used) - `patch_spaces`, `component_spaces` and `axis_spaces` which always return tuples of Fem spaces (or an error) * Provide more specific helper properties for FEM fields, such as - `component_fields` and `patch_fields` and `axis_fields` which always return tuples of FEM fields (or an error) * Improve the `VectorFemSpace` class (in particular its constructor) to better match the `FemSpace` abstract interface. Since these changes are also motivated by a better compatibility between single-patch and multi-patch APIs (see issue pyccel#331), this PR also modifies the `plot_field` function (previously in `psydac.feec.multipatch.plotting_utilities`), which is: * made compatible with single patch and multi patch fields * renamed as `plot_field_2d` since it only handles 2d fields * tested (not the content but the runs) in single and multipatch configurations for scalar and vector-valued FEM fields * moved with its module `psydac.feec.multipatch.plotting_utilities` to `psydac.fem.plotting_utilities` since it is not specific to FEEC or multipatch. --------- Co-authored-by: Yaman Güçlü <[email protected]> * Enable mpi4py 4.0 (pyccel#478) Closes pyccel#420. Fix usage of function `Translate_ranks` which had non-backward-compatible changes in mpi4py version 4.0: https://mpi4py.readthedocs.io/en/stable/changes.html. --------- Co-authored-by: Stefan Possanner <[email protected]> Co-authored-by: Max Lindqvist <[email protected]> Co-authored-by: Yaman Güçlü <[email protected]> * Removed dependency <4 for mpi4py * Set ubuntu-latest and macos-14 in pyproject.toml * Removed parallel hdf5 * Install struphy from rename-vector_space-to_coeff_space in CI * Removed python 3.13 from the CI * 3.13 --> 3.12 for macos CI * Removed Run MPI tests with Pytest * Removed codacy * Support Python 3.13 (pyccel#475) Closes pyccel#476: * Do not restrict the maximum Python version to 3.12 in `pyproject.toml` * Require `Cython >= 3` to avoid `h5py` installation crash w/ Python 3.13 * Require `sympde == 0.19.2` which supports Python 3.13 * Run unit tests with Python 3.13 too * Added Set up environment variables * Commented out macos tests * Install struphy from devel branch --------- Co-authored-by: Elena Moral Sánchez <[email protected]> Co-authored-by: Paul Rigor <[email protected]> Co-authored-by: Stefan Possanner <[email protected]> Co-authored-by: Yaman Güçlü <[email protected]> Co-authored-by: Martin Campos Pinto <[email protected]> Co-authored-by: Stefan Possanner <[email protected]>
* Support Python 3.13 (pyccel#475) Closes pyccel#476: * Do not restrict the maximum Python version to 3.12 in `pyproject.toml` * Require `Cython >= 3` to avoid `h5py` installation crash w/ Python 3.13 * Require `sympde == 0.19.2` which supports Python 3.13 * Run unit tests with Python 3.13 too * Fix PSYDAC_BACKEND_GPYCCEL flags on latest Apple silicon (pyccel#480) Currently, Psydac can not be used on Apple M4 computers since the `PSYDAC_BACKEND_GPYCCEL['flags']` is not set correctly. This change sets the flag for `Apple MX (etc.)` to `apple-mX`, which should work so long as the naming scheme stays unchanged. In addition, the regular expression used to find the GFortran version is now defined in a raw string instead of a standard Python UTF8 string. This avoids a `SyntaxWarning: invalid escape sequence`. --------- Co-authored-by: Yaman Güçlü <[email protected]> * from pyccel.commands.epyccel import epyccel * from pyccel.commands.epyccel import epyccel * Reinstall pyccel devel * Require Pyccel devel branch in pyproject.toml * Try another syntax in pyproject.toml * Comment out changes to continuous-integration.yml * Remove commented lines from continuous-integration.yml * Trigger CI * import epyccel correctly in test_epyccel_flags.py * Resolve warnings in sequential unit tests (pyccel#481) * Use raw strings for docstrings with LaTeX to avoid UTF8 syntax warnings on escape sequences; * Use CSC matrices to avoid SciPy sparse solver warning. We do not address the NumPy warnings which arise in our MPI unit tests (see pyccel#353). * Update axpy_kernels.py * undo type change in kernel * small bugfix * Added r before a docstring * Fixed stencil2IJV_kernels.py so it can be compiled with C * Removed blank line * Run CI with both C and fortran * Temporary: install struphy from test-pyccel-devel-in-ci * Added matrix.compile_language to the test job name * Trigger CI * Added a compile-with-pyccel-devel job which just compiles the code with pyccel devel (no testing) * Reset the pyccel version to pyccel >= 1.11.2 (from pypi) * Updated the job name * Updated the job name * Updated the job name --------- Co-authored-by: Yaman Güçlü <[email protected]> Co-authored-by: Elena Moral Sánchez <[email protected]> Co-authored-by: e-moral-sanchez <[email protected]>
* Support Python 3.13 (pyccel#475) Closes pyccel#476: * Do not restrict the maximum Python version to 3.12 in `pyproject.toml` * Require `Cython >= 3` to avoid `h5py` installation crash w/ Python 3.13 * Require `sympde == 0.19.2` which supports Python 3.13 * Run unit tests with Python 3.13 too * Fix PSYDAC_BACKEND_GPYCCEL flags on latest Apple silicon (pyccel#480) Currently, Psydac can not be used on Apple M4 computers since the `PSYDAC_BACKEND_GPYCCEL['flags']` is not set correctly. This change sets the flag for `Apple MX (etc.)` to `apple-mX`, which should work so long as the naming scheme stays unchanged. In addition, the regular expression used to find the GFortran version is now defined in a raw string instead of a standard Python UTF8 string. This avoids a `SyntaxWarning: invalid escape sequence`. --------- Co-authored-by: Yaman Güçlü <[email protected]> * Resolve warnings in sequential unit tests (pyccel#481) * Use raw strings for docstrings with LaTeX to avoid UTF8 syntax warnings on escape sequences; * Use CSC matrices to avoid SciPy sparse solver warning. We do not address the NumPy warnings which arise in our MPI unit tests (see pyccel#353). * Pass `out` parameter to `petsc_to_psydac` (pyccel#483) * Rename `dot` as `inner` in `Vector`, `VectorSpace`, and subclasses (pyccel#484) Main changes -------------- * Rename the method `dot` of the base class `VectorSpace` as `inner`, and make it an abstract method (which must be implemented by the subclasses). * Rename the method `dot` of the base class `Vector` as `inner`. This is a concrete method which calls `self.space.inner` and does not need to be overridden by the subclasses. * Add `inner` methods to the classes `StencilVector`, `BlockVectorSpace`, and `DenseVectorSpace`. These methods override the abstract method of the base class as required, and are derived from the former functions `Stencil.dot`, `BlockVector.dot`, and `DenseVector.dot`, which have been removed (see next point). * Remove the property `dtype` and the method `dot` (now `inner`) from the classes `StencilVector`, `BlockVector`, and `DenseVector`, because the default methods of the base class already provide a sufficient implementation. This fixes pyccel#330. Necessary additional changes ------------------------------ * Update all linear solvers in `linalg.solvers` with the new method calls; * Update all unit tests with the new method calls, in files: - `api/tests/test_assembly.py` - `feec/tests/test_commuting_projections.py` - `feec/tests/test_global_projectors.py` - `linalg/tests/test_block.py` - `linalg/tests/test_linalg.py` - `linalg/tests/test_stencil_interface_matrix.py` - `linalg/tests/test_stencil_vector.py` Unrelated additional changes ----------------------------- * Rename the class `VectorDot` as `VectorInner` in module `api.ast.linalg`, although never used in Psydac. * Speed up 3D unit tests in: - `feec/tests/test_commuting_projectors.py` - `feec/tests/test_global_projectors.py` * Update docstring for inner product in polar/dense.py (pyccel#488) --------- Co-authored-by: Yaman Güçlü <[email protected]> * Add a `dot_inner` concrete method to the base class `LinearOperator` (pyccel#493) Implement `M.dot(u).inner(v)`, or `(M @ u).inner(v)`, without creating a temporary vector. The result of the dot product is written to a local work vector stored in the `LinearOperator` object. This work vector is then used to compute the inner product with the vector `v`. The subclasses do not need to override this method, unless a more efficient implementation which avoids writing to the work vector altogether (reducing memory pressure) is needed. A unit test is added: function `test_dot_inner` in file psydac/linalg/tests/test_linalg.py. Additionally, the helper function `get_StencilVectorSpace` defined in psydac/linalg/tests/test_linalg.py (only used in the same file and in test_matrix_free.py) has a new signature and now works in any number of dimensions. Fixes pyccel#491. * Install PETSc-3.23.2 (latest version) (pyccel#499) * Update authors (pyccel#500) * Trigger CI --------- Co-authored-by: Yaman Güçlü <[email protected]> Co-authored-by: Elena Moral Sánchez <[email protected]> Co-authored-by: Martin Campos Pinto <[email protected]>
* Support Python 3.13 (pyccel#475) Closes pyccel#476: * Do not restrict the maximum Python version to 3.12 in `pyproject.toml` * Require `Cython >= 3` to avoid `h5py` installation crash w/ Python 3.13 * Require `sympde == 0.19.2` which supports Python 3.13 * Run unit tests with Python 3.13 too * Fix PSYDAC_BACKEND_GPYCCEL flags on latest Apple silicon (pyccel#480) Currently, Psydac can not be used on Apple M4 computers since the `PSYDAC_BACKEND_GPYCCEL['flags']` is not set correctly. This change sets the flag for `Apple MX (etc.)` to `apple-mX`, which should work so long as the naming scheme stays unchanged. In addition, the regular expression used to find the GFortran version is now defined in a raw string instead of a standard Python UTF8 string. This avoids a `SyntaxWarning: invalid escape sequence`. --------- Co-authored-by: Yaman Güçlü <[email protected]> * from pyccel.commands.epyccel import epyccel * from pyccel.commands.epyccel import epyccel * Reinstall pyccel devel * Require Pyccel devel branch in pyproject.toml * Try another syntax in pyproject.toml * Comment out changes to continuous-integration.yml * Remove commented lines from continuous-integration.yml * Trigger CI * import epyccel correctly in test_epyccel_flags.py * Resolve warnings in sequential unit tests (pyccel#481) * Use raw strings for docstrings with LaTeX to avoid UTF8 syntax warnings on escape sequences; * Use CSC matrices to avoid SciPy sparse solver warning. We do not address the NumPy warnings which arise in our MPI unit tests (see pyccel#353). * Update axpy_kernels.py * undo type change in kernel * Pass `out` parameter to `petsc_to_psydac` (pyccel#483) * Rename `dot` as `inner` in `Vector`, `VectorSpace`, and subclasses (pyccel#484) Main changes -------------- * Rename the method `dot` of the base class `VectorSpace` as `inner`, and make it an abstract method (which must be implemented by the subclasses). * Rename the method `dot` of the base class `Vector` as `inner`. This is a concrete method which calls `self.space.inner` and does not need to be overridden by the subclasses. * Add `inner` methods to the classes `StencilVector`, `BlockVectorSpace`, and `DenseVectorSpace`. These methods override the abstract method of the base class as required, and are derived from the former functions `Stencil.dot`, `BlockVector.dot`, and `DenseVector.dot`, which have been removed (see next point). * Remove the property `dtype` and the method `dot` (now `inner`) from the classes `StencilVector`, `BlockVector`, and `DenseVector`, because the default methods of the base class already provide a sufficient implementation. This fixes pyccel#330. Necessary additional changes ------------------------------ * Update all linear solvers in `linalg.solvers` with the new method calls; * Update all unit tests with the new method calls, in files: - `api/tests/test_assembly.py` - `feec/tests/test_commuting_projections.py` - `feec/tests/test_global_projectors.py` - `linalg/tests/test_block.py` - `linalg/tests/test_linalg.py` - `linalg/tests/test_stencil_interface_matrix.py` - `linalg/tests/test_stencil_vector.py` Unrelated additional changes ----------------------------- * Rename the class `VectorDot` as `VectorInner` in module `api.ast.linalg`, although never used in Psydac. * Speed up 3D unit tests in: - `feec/tests/test_commuting_projectors.py` - `feec/tests/test_global_projectors.py` * Update docstring for inner product in polar/dense.py (pyccel#488) --------- Co-authored-by: Yaman Güçlü <[email protected]> * Add a `dot_inner` concrete method to the base class `LinearOperator` (pyccel#493) Implement `M.dot(u).inner(v)`, or `(M @ u).inner(v)`, without creating a temporary vector. The result of the dot product is written to a local work vector stored in the `LinearOperator` object. This work vector is then used to compute the inner product with the vector `v`. The subclasses do not need to override this method, unless a more efficient implementation which avoids writing to the work vector altogether (reducing memory pressure) is needed. A unit test is added: function `test_dot_inner` in file psydac/linalg/tests/test_linalg.py. Additionally, the helper function `get_StencilVectorSpace` defined in psydac/linalg/tests/test_linalg.py (only used in the same file and in test_matrix_free.py) has a new signature and now works in any number of dimensions. Fixes pyccel#491. * Install PETSc-3.23.2 (latest version) (pyccel#499) * Update authors (pyccel#500) * Removed all template decorators * Removed the @template pyccel decorator since it has been deprecated * Added T as a T = TypeVar('T', float, complex) * Added T as a T = TypeVar('T', float, complex) * Fixed missing typevar in stencil2IJV_kernels.py * Added TypeVar('T', float, complex) to field_evaluation_kernels.py * Added TypeVar('T', float, complex) to field_evaluation_kernels.py * T-->T[:] * Corrected the shape of T * Correction * T --> T[:], T[:,:], ... * Correction * Make a const in psydac/core/bsplines_kernels.py * Use h5py < 3.14.0 * Revert h5py version restriction * Pin h5py to 3.13.0 to avoid the PEP 621 error (project license) * bugfix * Set license to MIT * revert h5py specification * Set h5py to 3.13.0 * Fix the code generation of unnecessary derivatives (pyccel#490) This PR changes the code generation involved in the `discretize` function to avoid calculating unnecessary derivatives. This allows for using constant spline (degree 0) discretizations, for which we have to make a special case in the calculation of ghost regions in `psydac/linalg/stencil.py`. Additionally, we add basic unit tests checking discretizations using zero-degree splines. This fixes pyccel#489 and fixes pyccel#307. On this occasion, we also do small changes in the `.github/workflows/testing.yml` script as some tests had complications without them. --------- Co-authored-by: Yaman Güçlü <[email protected]> * Replaced const with Final * Renamed compiler to compiler-family * Added compiler_config * libdir --> libdirs * libdirs --> libdir * Removed return from merge_sort * Trigger CI * Set pyccel version to >= 2.0 * Set pyccel >= 2.0 in pyproject.toml * Renamed compiler to compiler_family * renamed fflags to flags for epyccel arguments * Replace accelerators with openmp (True or False) * Bugfix in pyproject.toml * Removed merge conflicts * Updated ci * Skip the h5py installation test * Skip the h5py installation test * remove psydac pyccelized kernels before uninstalling * Moved struphy tests to a separate job * Renamed jobs to be more clear * Moved the shape check out of matmul in bsplines_kernels.py, this can't stay because STL doesn't allow for shape 0 arrays. Now we only call the matmul kernel if the shape is not 0, otherwise c[:] = 0.0 * Define sh_a and sh_b before the loops * Only do the loops in basis_funs_p if degree > 0 since we otherwise create arrays of size 0 * Trigger CI --------- Co-authored-by: Yaman Güçlü <[email protected]> Co-authored-by: Elena Moral Sánchez <[email protected]> Co-authored-by: e-moral-sanchez <[email protected]> Co-authored-by: Martin Campos Pinto <[email protected]> Co-authored-by: Frederik Schnack <[email protected]>
* Support Python 3.13 (pyccel#475) Closes pyccel#476: * Do not restrict the maximum Python version to 3.12 in `pyproject.toml` * Require `Cython >= 3` to avoid `h5py` installation crash w/ Python 3.13 * Require `sympde == 0.19.2` which supports Python 3.13 * Run unit tests with Python 3.13 too * Fix PSYDAC_BACKEND_GPYCCEL flags on latest Apple silicon (pyccel#480) Currently, Psydac can not be used on Apple M4 computers since the `PSYDAC_BACKEND_GPYCCEL['flags']` is not set correctly. This change sets the flag for `Apple MX (etc.)` to `apple-mX`, which should work so long as the naming scheme stays unchanged. In addition, the regular expression used to find the GFortran version is now defined in a raw string instead of a standard Python UTF8 string. This avoids a `SyntaxWarning: invalid escape sequence`. --------- Co-authored-by: Yaman Güçlü <[email protected]> * Resolve warnings in sequential unit tests (pyccel#481) * Use raw strings for docstrings with LaTeX to avoid UTF8 syntax warnings on escape sequences; * Use CSC matrices to avoid SciPy sparse solver warning. We do not address the NumPy warnings which arise in our MPI unit tests (see pyccel#353). * Pass `out` parameter to `petsc_to_psydac` (pyccel#483) * Rename `dot` as `inner` in `Vector`, `VectorSpace`, and subclasses (pyccel#484) Main changes -------------- * Rename the method `dot` of the base class `VectorSpace` as `inner`, and make it an abstract method (which must be implemented by the subclasses). * Rename the method `dot` of the base class `Vector` as `inner`. This is a concrete method which calls `self.space.inner` and does not need to be overridden by the subclasses. * Add `inner` methods to the classes `StencilVector`, `BlockVectorSpace`, and `DenseVectorSpace`. These methods override the abstract method of the base class as required, and are derived from the former functions `Stencil.dot`, `BlockVector.dot`, and `DenseVector.dot`, which have been removed (see next point). * Remove the property `dtype` and the method `dot` (now `inner`) from the classes `StencilVector`, `BlockVector`, and `DenseVector`, because the default methods of the base class already provide a sufficient implementation. This fixes pyccel#330. Necessary additional changes ------------------------------ * Update all linear solvers in `linalg.solvers` with the new method calls; * Update all unit tests with the new method calls, in files: - `api/tests/test_assembly.py` - `feec/tests/test_commuting_projections.py` - `feec/tests/test_global_projectors.py` - `linalg/tests/test_block.py` - `linalg/tests/test_linalg.py` - `linalg/tests/test_stencil_interface_matrix.py` - `linalg/tests/test_stencil_vector.py` Unrelated additional changes ----------------------------- * Rename the class `VectorDot` as `VectorInner` in module `api.ast.linalg`, although never used in Psydac. * Speed up 3D unit tests in: - `feec/tests/test_commuting_projectors.py` - `feec/tests/test_global_projectors.py` * Update docstring for inner product in polar/dense.py (pyccel#488) --------- Co-authored-by: Yaman Güçlü <[email protected]> * Add a `dot_inner` concrete method to the base class `LinearOperator` (pyccel#493) Implement `M.dot(u).inner(v)`, or `(M @ u).inner(v)`, without creating a temporary vector. The result of the dot product is written to a local work vector stored in the `LinearOperator` object. This work vector is then used to compute the inner product with the vector `v`. The subclasses do not need to override this method, unless a more efficient implementation which avoids writing to the work vector altogether (reducing memory pressure) is needed. A unit test is added: function `test_dot_inner` in file psydac/linalg/tests/test_linalg.py. Additionally, the helper function `get_StencilVectorSpace` defined in psydac/linalg/tests/test_linalg.py (only used in the same file and in test_matrix_free.py) has a new signature and now works in any number of dimensions. Fixes pyccel#491. * Install PETSc-3.23.2 (latest version) (pyccel#499) * Update authors (pyccel#500) * Fix the code generation of unnecessary derivatives (pyccel#490) This PR changes the code generation involved in the `discretize` function to avoid calculating unnecessary derivatives. This allows for using constant spline (degree 0) discretizations, for which we have to make a special case in the calculation of ghost regions in `psydac/linalg/stencil.py`. Additionally, we add basic unit tests checking discretizations using zero-degree splines. This fixes pyccel#489 and fixes pyccel#307. On this occasion, we also do small changes in the `.github/workflows/testing.yml` script as some tests had complications without them. --------- Co-authored-by: Yaman Güçlü <[email protected]> * Fix bug in `allocate_matrices` in `DiscreteBilinearForm` (pyccel#507) Always use the maximum padding between test and trial spaces in `allocate_matrices` in `DiscreteBilinearForm`. (Earlier this was not done in the case of scalar spaces.) Fixes pyccel#504. * Enable Pyccel 2.0 (pyccel#503) Pyccel 2.0 was just released, which means some of the kernels in Psydac need to be updated: - Remove the `template` decorator (see pyccel/pyccel#2331) * Add `T` as `TypeVar` * Specify `T`, `T[:]`, `T[:,:]`, ... in function arguments. - Replace `@types` decorators (see pyccel/pyccel#2329) - Replace `const` with `Final` (see pyccel/pyccel#2340) Further changes: - Update import path for `epyccel` (fixes pyccel#426) - Update arguments to `epyccel` (see pyccel/pyccel#2348): * Rename `fflags` to `flags` * Replace `accelerators` list with `openmp` bool - Require Pyccel >= 2.0.1 (fixes pyccel#471) --------- Co-authored-by: Yaman Güçlü <[email protected]> Co-authored-by: Elena Moral Sánchez <[email protected]> Co-authored-by: Emily Bourne <[email protected]> * install struphy from devel in testing * add gvec non-python dependencies --------- Co-authored-by: Yaman Güçlü <[email protected]> Co-authored-by: Max <[email protected]> Co-authored-by: Elena Moral Sánchez <[email protected]> Co-authored-by: Martin Campos Pinto <[email protected]> Co-authored-by: Frederik Schnack <[email protected]> Co-authored-by: Elena Moral Sánchez <[email protected]> Co-authored-by: Emily Bourne <[email protected]>
* Support Python 3.13 (pyccel#475) Closes pyccel#476: * Do not restrict the maximum Python version to 3.12 in `pyproject.toml` * Require `Cython >= 3` to avoid `h5py` installation crash w/ Python 3.13 * Require `sympde == 0.19.2` which supports Python 3.13 * Run unit tests with Python 3.13 too * Fix PSYDAC_BACKEND_GPYCCEL flags on latest Apple silicon (pyccel#480) Currently, Psydac can not be used on Apple M4 computers since the `PSYDAC_BACKEND_GPYCCEL['flags']` is not set correctly. This change sets the flag for `Apple MX (etc.)` to `apple-mX`, which should work so long as the naming scheme stays unchanged. In addition, the regular expression used to find the GFortran version is now defined in a raw string instead of a standard Python UTF8 string. This avoids a `SyntaxWarning: invalid escape sequence`. --------- Co-authored-by: Yaman Güçlü <[email protected]> * Resolve warnings in sequential unit tests (pyccel#481) * Use raw strings for docstrings with LaTeX to avoid UTF8 syntax warnings on escape sequences; * Use CSC matrices to avoid SciPy sparse solver warning. We do not address the NumPy warnings which arise in our MPI unit tests (see pyccel#353). * Pass `out` parameter to `petsc_to_psydac` (pyccel#483) * Rename `dot` as `inner` in `Vector`, `VectorSpace`, and subclasses (pyccel#484) Main changes -------------- * Rename the method `dot` of the base class `VectorSpace` as `inner`, and make it an abstract method (which must be implemented by the subclasses). * Rename the method `dot` of the base class `Vector` as `inner`. This is a concrete method which calls `self.space.inner` and does not need to be overridden by the subclasses. * Add `inner` methods to the classes `StencilVector`, `BlockVectorSpace`, and `DenseVectorSpace`. These methods override the abstract method of the base class as required, and are derived from the former functions `Stencil.dot`, `BlockVector.dot`, and `DenseVector.dot`, which have been removed (see next point). * Remove the property `dtype` and the method `dot` (now `inner`) from the classes `StencilVector`, `BlockVector`, and `DenseVector`, because the default methods of the base class already provide a sufficient implementation. This fixes pyccel#330. Necessary additional changes ------------------------------ * Update all linear solvers in `linalg.solvers` with the new method calls; * Update all unit tests with the new method calls, in files: - `api/tests/test_assembly.py` - `feec/tests/test_commuting_projections.py` - `feec/tests/test_global_projectors.py` - `linalg/tests/test_block.py` - `linalg/tests/test_linalg.py` - `linalg/tests/test_stencil_interface_matrix.py` - `linalg/tests/test_stencil_vector.py` Unrelated additional changes ----------------------------- * Rename the class `VectorDot` as `VectorInner` in module `api.ast.linalg`, although never used in Psydac. * Speed up 3D unit tests in: - `feec/tests/test_commuting_projectors.py` - `feec/tests/test_global_projectors.py` * Update docstring for inner product in polar/dense.py (pyccel#488) --------- Co-authored-by: Yaman Güçlü <[email protected]> * Add a `dot_inner` concrete method to the base class `LinearOperator` (pyccel#493) Implement `M.dot(u).inner(v)`, or `(M @ u).inner(v)`, without creating a temporary vector. The result of the dot product is written to a local work vector stored in the `LinearOperator` object. This work vector is then used to compute the inner product with the vector `v`. The subclasses do not need to override this method, unless a more efficient implementation which avoids writing to the work vector altogether (reducing memory pressure) is needed. A unit test is added: function `test_dot_inner` in file psydac/linalg/tests/test_linalg.py. Additionally, the helper function `get_StencilVectorSpace` defined in psydac/linalg/tests/test_linalg.py (only used in the same file and in test_matrix_free.py) has a new signature and now works in any number of dimensions. Fixes pyccel#491. * Install PETSc-3.23.2 (latest version) (pyccel#499) * Update authors (pyccel#500) * Fix the code generation of unnecessary derivatives (pyccel#490) This PR changes the code generation involved in the `discretize` function to avoid calculating unnecessary derivatives. This allows for using constant spline (degree 0) discretizations, for which we have to make a special case in the calculation of ghost regions in `psydac/linalg/stencil.py`. Additionally, we add basic unit tests checking discretizations using zero-degree splines. This fixes pyccel#489 and fixes pyccel#307. On this occasion, we also do small changes in the `.github/workflows/testing.yml` script as some tests had complications without them. --------- Co-authored-by: Yaman Güçlü <[email protected]> * Fix bug in `allocate_matrices` in `DiscreteBilinearForm` (pyccel#507) Always use the maximum padding between test and trial spaces in `allocate_matrices` in `DiscreteBilinearForm`. (Earlier this was not done in the case of scalar spaces.) Fixes pyccel#504. * Enable Pyccel 2.0 (pyccel#503) Pyccel 2.0 was just released, which means some of the kernels in Psydac need to be updated: - Remove the `template` decorator (see pyccel/pyccel#2331) * Add `T` as `TypeVar` * Specify `T`, `T[:]`, `T[:,:]`, ... in function arguments. - Replace `@types` decorators (see pyccel/pyccel#2329) - Replace `const` with `Final` (see pyccel/pyccel#2340) Further changes: - Update import path for `epyccel` (fixes pyccel#426) - Update arguments to `epyccel` (see pyccel/pyccel#2348): * Rename `fflags` to `flags` * Replace `accelerators` list with `openmp` bool - Require Pyccel >= 2.0.1 (fixes pyccel#471) --------- Co-authored-by: Yaman Güçlü <[email protected]> Co-authored-by: Elena Moral Sánchez <[email protected]> Co-authored-by: Emily Bourne <[email protected]> * New installation procedure and README (pyccel#510) Recently the installation of `h5py` in parallel mode (i.e. with MPI support through `mpi4py`) seems to have been simplified. This may be due to the recent move of `mpi4py` to wheels, or other factors. Therefore we can now simplify our installation procedure as follows: ```sh pip install h5py --no-cache-dir --no-binary h5py pip install .[test] ``` We update here the CI workflows and completely rewrite our README file. **Commit summary** - Completely rewrite `README.md`: * Expand initial description * Add Citing and Contributing sections * Shorten Installation section * Reorganize documentation sections * Move detailed installation instructions to separate file `docs/installation.md` * Move mesh generation to separate file `docs/psydac-mesh.md` - Add BibTeX file `CITING.bib` with citation of 2022 ECCOMAS proceedings - Remove obsolete files `requirements.txt` and `requirements_extra.txt` - Rename (and move) `docs_requirements.txt` as `docs/requirements.txt` - Update installation procedure in `testing` CI workflow - Change name in `testing` workflow from "Run tests" to "Unit tests" - Modify `testing` and `documentation` workflows so that they only run when needed - Allow running workflows manually - Fix broken CI badge in `README.md` * Removed python -m pip install -r requirements.txt * Removed duplicated requirements from pyproject.toml * Removed duplicated requirements from pyproject.toml --------- Co-authored-by: Yaman Güçlü <[email protected]> Co-authored-by: Elena Moral Sánchez <[email protected]> Co-authored-by: Martin Campos Pinto <[email protected]> Co-authored-by: Frederik Schnack <[email protected]> Co-authored-by: Elena Moral Sánchez <[email protected]> Co-authored-by: Emily Bourne <[email protected]>
* Support Python 3.13 (pyccel#475) Closes pyccel#476: * Do not restrict the maximum Python version to 3.12 in `pyproject.toml` * Require `Cython >= 3` to avoid `h5py` installation crash w/ Python 3.13 * Require `sympde == 0.19.2` which supports Python 3.13 * Run unit tests with Python 3.13 too * Fix PSYDAC_BACKEND_GPYCCEL flags on latest Apple silicon (pyccel#480) Currently, Psydac can not be used on Apple M4 computers since the `PSYDAC_BACKEND_GPYCCEL['flags']` is not set correctly. This change sets the flag for `Apple MX (etc.)` to `apple-mX`, which should work so long as the naming scheme stays unchanged. In addition, the regular expression used to find the GFortran version is now defined in a raw string instead of a standard Python UTF8 string. This avoids a `SyntaxWarning: invalid escape sequence`. --------- Co-authored-by: Yaman Güçlü <[email protected]> * Resolve warnings in sequential unit tests (pyccel#481) * Use raw strings for docstrings with LaTeX to avoid UTF8 syntax warnings on escape sequences; * Use CSC matrices to avoid SciPy sparse solver warning. We do not address the NumPy warnings which arise in our MPI unit tests (see pyccel#353). * Pass `out` parameter to `petsc_to_psydac` (pyccel#483) * Rename `dot` as `inner` in `Vector`, `VectorSpace`, and subclasses (pyccel#484) Main changes -------------- * Rename the method `dot` of the base class `VectorSpace` as `inner`, and make it an abstract method (which must be implemented by the subclasses). * Rename the method `dot` of the base class `Vector` as `inner`. This is a concrete method which calls `self.space.inner` and does not need to be overridden by the subclasses. * Add `inner` methods to the classes `StencilVector`, `BlockVectorSpace`, and `DenseVectorSpace`. These methods override the abstract method of the base class as required, and are derived from the former functions `Stencil.dot`, `BlockVector.dot`, and `DenseVector.dot`, which have been removed (see next point). * Remove the property `dtype` and the method `dot` (now `inner`) from the classes `StencilVector`, `BlockVector`, and `DenseVector`, because the default methods of the base class already provide a sufficient implementation. This fixes pyccel#330. Necessary additional changes ------------------------------ * Update all linear solvers in `linalg.solvers` with the new method calls; * Update all unit tests with the new method calls, in files: - `api/tests/test_assembly.py` - `feec/tests/test_commuting_projections.py` - `feec/tests/test_global_projectors.py` - `linalg/tests/test_block.py` - `linalg/tests/test_linalg.py` - `linalg/tests/test_stencil_interface_matrix.py` - `linalg/tests/test_stencil_vector.py` Unrelated additional changes ----------------------------- * Rename the class `VectorDot` as `VectorInner` in module `api.ast.linalg`, although never used in Psydac. * Speed up 3D unit tests in: - `feec/tests/test_commuting_projectors.py` - `feec/tests/test_global_projectors.py` * Update docstring for inner product in polar/dense.py (pyccel#488) --------- Co-authored-by: Yaman Güçlü <[email protected]> * Add a `dot_inner` concrete method to the base class `LinearOperator` (pyccel#493) Implement `M.dot(u).inner(v)`, or `(M @ u).inner(v)`, without creating a temporary vector. The result of the dot product is written to a local work vector stored in the `LinearOperator` object. This work vector is then used to compute the inner product with the vector `v`. The subclasses do not need to override this method, unless a more efficient implementation which avoids writing to the work vector altogether (reducing memory pressure) is needed. A unit test is added: function `test_dot_inner` in file psydac/linalg/tests/test_linalg.py. Additionally, the helper function `get_StencilVectorSpace` defined in psydac/linalg/tests/test_linalg.py (only used in the same file and in test_matrix_free.py) has a new signature and now works in any number of dimensions. Fixes pyccel#491. * Install PETSc-3.23.2 (latest version) (pyccel#499) * Update authors (pyccel#500) * Fix the code generation of unnecessary derivatives (pyccel#490) This PR changes the code generation involved in the `discretize` function to avoid calculating unnecessary derivatives. This allows for using constant spline (degree 0) discretizations, for which we have to make a special case in the calculation of ghost regions in `psydac/linalg/stencil.py`. Additionally, we add basic unit tests checking discretizations using zero-degree splines. This fixes pyccel#489 and fixes pyccel#307. On this occasion, we also do small changes in the `.github/workflows/testing.yml` script as some tests had complications without them. --------- Co-authored-by: Yaman Güçlü <[email protected]> * Fix bug in `allocate_matrices` in `DiscreteBilinearForm` (pyccel#507) Always use the maximum padding between test and trial spaces in `allocate_matrices` in `DiscreteBilinearForm`. (Earlier this was not done in the case of scalar spaces.) Fixes pyccel#504. * Enable Pyccel 2.0 (pyccel#503) Pyccel 2.0 was just released, which means some of the kernels in Psydac need to be updated: - Remove the `template` decorator (see pyccel/pyccel#2331) * Add `T` as `TypeVar` * Specify `T`, `T[:]`, `T[:,:]`, ... in function arguments. - Replace `@types` decorators (see pyccel/pyccel#2329) - Replace `const` with `Final` (see pyccel/pyccel#2340) Further changes: - Update import path for `epyccel` (fixes pyccel#426) - Update arguments to `epyccel` (see pyccel/pyccel#2348): * Rename `fflags` to `flags` * Replace `accelerators` list with `openmp` bool - Require Pyccel >= 2.0.1 (fixes pyccel#471) --------- Co-authored-by: Yaman Güçlü <[email protected]> Co-authored-by: Elena Moral Sánchez <[email protected]> Co-authored-by: Emily Bourne <[email protected]> * New installation procedure and README (pyccel#510) Recently the installation of `h5py` in parallel mode (i.e. with MPI support through `mpi4py`) seems to have been simplified. This may be due to the recent move of `mpi4py` to wheels, or other factors. Therefore we can now simplify our installation procedure as follows: ```sh pip install h5py --no-cache-dir --no-binary h5py pip install .[test] ``` We update here the CI workflows and completely rewrite our README file. **Commit summary** - Completely rewrite `README.md`: * Expand initial description * Add Citing and Contributing sections * Shorten Installation section * Reorganize documentation sections * Move detailed installation instructions to separate file `docs/installation.md` * Move mesh generation to separate file `docs/psydac-mesh.md` - Add BibTeX file `CITING.bib` with citation of 2022 ECCOMAS proceedings - Remove obsolete files `requirements.txt` and `requirements_extra.txt` - Rename (and move) `docs_requirements.txt` as `docs/requirements.txt` - Update installation procedure in `testing` CI workflow - Change name in `testing` workflow from "Run tests" to "Unit tests" - Modify `testing` and `documentation` workflows so that they only run when needed - Allow running workflows manually - Fix broken CI badge in `README.md` * Removed <<<<<< HEAD --------- Co-authored-by: Yaman Güçlü <[email protected]> Co-authored-by: Elena Moral Sánchez <[email protected]> Co-authored-by: Martin Campos Pinto <[email protected]> Co-authored-by: Frederik Schnack <[email protected]> Co-authored-by: Elena Moral Sánchez <[email protected]> Co-authored-by: Emily Bourne <[email protected]>
* Support Python 3.13 (pyccel#475) Closes pyccel#476: * Do not restrict the maximum Python version to 3.12 in `pyproject.toml` * Require `Cython >= 3` to avoid `h5py` installation crash w/ Python 3.13 * Require `sympde == 0.19.2` which supports Python 3.13 * Run unit tests with Python 3.13 too * Fix PSYDAC_BACKEND_GPYCCEL flags on latest Apple silicon (pyccel#480) Currently, Psydac can not be used on Apple M4 computers since the `PSYDAC_BACKEND_GPYCCEL['flags']` is not set correctly. This change sets the flag for `Apple MX (etc.)` to `apple-mX`, which should work so long as the naming scheme stays unchanged. In addition, the regular expression used to find the GFortran version is now defined in a raw string instead of a standard Python UTF8 string. This avoids a `SyntaxWarning: invalid escape sequence`. --------- Co-authored-by: Yaman Güçlü <[email protected]> * Resolve warnings in sequential unit tests (pyccel#481) * Use raw strings for docstrings with LaTeX to avoid UTF8 syntax warnings on escape sequences; * Use CSC matrices to avoid SciPy sparse solver warning. We do not address the NumPy warnings which arise in our MPI unit tests (see pyccel#353). * Pass `out` parameter to `petsc_to_psydac` (pyccel#483) * Rename `dot` as `inner` in `Vector`, `VectorSpace`, and subclasses (pyccel#484) Main changes -------------- * Rename the method `dot` of the base class `VectorSpace` as `inner`, and make it an abstract method (which must be implemented by the subclasses). * Rename the method `dot` of the base class `Vector` as `inner`. This is a concrete method which calls `self.space.inner` and does not need to be overridden by the subclasses. * Add `inner` methods to the classes `StencilVector`, `BlockVectorSpace`, and `DenseVectorSpace`. These methods override the abstract method of the base class as required, and are derived from the former functions `Stencil.dot`, `BlockVector.dot`, and `DenseVector.dot`, which have been removed (see next point). * Remove the property `dtype` and the method `dot` (now `inner`) from the classes `StencilVector`, `BlockVector`, and `DenseVector`, because the default methods of the base class already provide a sufficient implementation. This fixes pyccel#330. Necessary additional changes ------------------------------ * Update all linear solvers in `linalg.solvers` with the new method calls; * Update all unit tests with the new method calls, in files: - `api/tests/test_assembly.py` - `feec/tests/test_commuting_projections.py` - `feec/tests/test_global_projectors.py` - `linalg/tests/test_block.py` - `linalg/tests/test_linalg.py` - `linalg/tests/test_stencil_interface_matrix.py` - `linalg/tests/test_stencil_vector.py` Unrelated additional changes ----------------------------- * Rename the class `VectorDot` as `VectorInner` in module `api.ast.linalg`, although never used in Psydac. * Speed up 3D unit tests in: - `feec/tests/test_commuting_projectors.py` - `feec/tests/test_global_projectors.py` * Update docstring for inner product in polar/dense.py (pyccel#488) --------- Co-authored-by: Yaman Güçlü <[email protected]> * Add a `dot_inner` concrete method to the base class `LinearOperator` (pyccel#493) Implement `M.dot(u).inner(v)`, or `(M @ u).inner(v)`, without creating a temporary vector. The result of the dot product is written to a local work vector stored in the `LinearOperator` object. This work vector is then used to compute the inner product with the vector `v`. The subclasses do not need to override this method, unless a more efficient implementation which avoids writing to the work vector altogether (reducing memory pressure) is needed. A unit test is added: function `test_dot_inner` in file psydac/linalg/tests/test_linalg.py. Additionally, the helper function `get_StencilVectorSpace` defined in psydac/linalg/tests/test_linalg.py (only used in the same file and in test_matrix_free.py) has a new signature and now works in any number of dimensions. Fixes pyccel#491. * Install PETSc-3.23.2 (latest version) (pyccel#499) * Update authors (pyccel#500) * Fix the code generation of unnecessary derivatives (pyccel#490) This PR changes the code generation involved in the `discretize` function to avoid calculating unnecessary derivatives. This allows for using constant spline (degree 0) discretizations, for which we have to make a special case in the calculation of ghost regions in `psydac/linalg/stencil.py`. Additionally, we add basic unit tests checking discretizations using zero-degree splines. This fixes pyccel#489 and fixes pyccel#307. On this occasion, we also do small changes in the `.github/workflows/testing.yml` script as some tests had complications without them. --------- Co-authored-by: Yaman Güçlü <[email protected]> * Fix bug in `allocate_matrices` in `DiscreteBilinearForm` (pyccel#507) Always use the maximum padding between test and trial spaces in `allocate_matrices` in `DiscreteBilinearForm`. (Earlier this was not done in the case of scalar spaces.) Fixes pyccel#504. * Enable Pyccel 2.0 (pyccel#503) Pyccel 2.0 was just released, which means some of the kernels in Psydac need to be updated: - Remove the `template` decorator (see pyccel/pyccel#2331) * Add `T` as `TypeVar` * Specify `T`, `T[:]`, `T[:,:]`, ... in function arguments. - Replace `@types` decorators (see pyccel/pyccel#2329) - Replace `const` with `Final` (see pyccel/pyccel#2340) Further changes: - Update import path for `epyccel` (fixes pyccel#426) - Update arguments to `epyccel` (see pyccel/pyccel#2348): * Rename `fflags` to `flags` * Replace `accelerators` list with `openmp` bool - Require Pyccel >= 2.0.1 (fixes pyccel#471) --------- Co-authored-by: Yaman Güçlü <[email protected]> Co-authored-by: Elena Moral Sánchez <[email protected]> Co-authored-by: Emily Bourne <[email protected]> * New installation procedure and README (pyccel#510) Recently the installation of `h5py` in parallel mode (i.e. with MPI support through `mpi4py`) seems to have been simplified. This may be due to the recent move of `mpi4py` to wheels, or other factors. Therefore we can now simplify our installation procedure as follows: ```sh pip install h5py --no-cache-dir --no-binary h5py pip install .[test] ``` We update here the CI workflows and completely rewrite our README file. **Commit summary** - Completely rewrite `README.md`: * Expand initial description * Add Citing and Contributing sections * Shorten Installation section * Reorganize documentation sections * Move detailed installation instructions to separate file `docs/installation.md` * Move mesh generation to separate file `docs/psydac-mesh.md` - Add BibTeX file `CITING.bib` with citation of 2022 ECCOMAS proceedings - Remove obsolete files `requirements.txt` and `requirements_extra.txt` - Rename (and move) `docs_requirements.txt` as `docs/requirements.txt` - Update installation procedure in `testing` CI workflow - Change name in `testing` workflow from "Run tests" to "Unit tests" - Modify `testing` and `documentation` workflows so that they only run when needed - Allow running workflows manually - Fix broken CI badge in `README.md` * Fast Matrix Assembly (pyccel#448) This PR implements the sum factorization algorithm as shown in **Sum factorization techniques in Isogeometric Analysis** by Andrea Bressan & Stefan Takacs for **bilinear forms on 3D volumes**. The old element-by-element assembly can still be employed by passing a corresponding flag ```python # a some BilinearForm a_h = discretize(a, domain_h, (Vh, Vh), backend=backend, sum_factorization=False) ``` Currently, the new generated code does not make use of OpenMP. Main changes -------------- - Write new module `psydac.api.fem_common` which: * Contains the old functions previously in module `psydac.api.fem`. * Has functions `construct_test_space_arguments` and `construct_trial_space_arguments` returning also the multiplicity. * Has new functions `compute_max_nderiv`, `compute_imports`, `compute_free_arguments`. - Move `DiscreteSumForm` to a new module `psydac.api.fem_sum_form`. - Create a new module `psydac.api.fem_bilinear_form` which only contains one new class `DiscreteBilinearForm`. The new module shows all imports clearly. The new class: * Generates the code to assemble the given discrete bilinear form into a matrix (a `BlockLinearOperator` object of `StencilMatrix` objects, or just a single `StencilMatrix` object), using sum factorization. * Does not inherit from `BasicDiscrete` (and hence `BasicCodeGen`). Accordingly, no PSYDAC abstract syntax tree (an object representing a function, of class `DefNode`) is created by the constructor of `AST`, which stores it in its `expr` attribute. (Both classes `DefNode` and `AST` are defined in module `psydac.api.ast.fem`.) * Does not create a `Parser` object from `psydac.api.ast.parser`, which used to convert a PSYDAC `DefNode` to an old-Pyccel `FunctionDef` from `psydac.pyccel.ast.core`. * Does not generate the old assembly Python code (in the form of a string) using the function `pycode` from `psydac.pyccel.codegen.printing.pycode`. - Add a new unit test file `api/tests/test_sum_factorization_assembly_3d`. - Modify function `discretize` in module `psydac.api.discretization` so that, given a bilinear form in 3D and not asking for OpenMP support, it creates an object of type `DiscreteBilinearForm` from module `psydac.api.fem_bilinear_form`. In all other cases, or if `sum_factorization=False`, it creates an object of namesake type from the old module `psydac.api.fem`. Other changes -------------- - Expand docstring of class `AST` in module `psydac.api.ast.fem`. - Expand docstrings of function `parse` and class `Parser` in module `psydac.api.ast.parser`. Clean up `Parser.__init__`. - Minor cleanup in class `BasicCodeGen` in module `psydac.api.basic`. - Generate random filenames using `random.choice()` instead of `random.SystemRandom().choice()`. Unrelated to matrix assembly: - Add method `set_scalar` to `ScaledLinearOperator`. - Reimplement method `idot` of `LinearOperator` using local storage. This avoids creating unnecessary temporary vectors (especially beneficial for the method `dot` of `SumLinearOperator`). --------- Co-authored-by: Yaman Güçlü <[email protected]> Co-authored-by: elmosa <[email protected]> * Improve multipatch FEM API (pyccel#509) ### Commit summary - Fix pyccel#461 : Move contents of `psydac/feec/multipatch/api.py` to `psydac/api/feec.py` and `psydac/api/discretization.py`. - Remove old code from `psydac/feec/multipatch/operators.py` and replace it by the contents in `psydac/feec/multipatch/non_matching_operators.py` to make the structure more clear. - Fix pyccel#463 - Fix pyccel#272 : keep the `FEMLinearOperator` as a more light-weight class that encapsulates a `LinearOperator` and has a `apply` and `__call__` function to make it act on a `FEMField`. Remove duplicated code with `LinearOperator`. Make operators in `psydac/feec` subclasses of `LinearOperator`. - Fix pyccel#462: Add conforming projections and Hodge operators to single-patch `DiscreteDeRham` - Add single-patch test for the conforming projectors - Adapt all the tests/files to the new notations. For the single patch cases mostly renaming `derham_h.derivatives` to `derham_h.derivatives()` and `derham_h.derivatives_as_matrices` to `derham_h.derivatives(kind='linop')` - Merge single-patch and multi-patch operators to the same file if it makes things clearer. Take Hodge and conforming projection operators out of the multipatch subdirectory. - Fix pyccel#409 : the global projector interface in DiscreteDeRhamMultipatch - Fix pyccel#331. - Add a `SparseMatrixLinearOperator` in `psydac/linalg/sparse.py` to use a sparse matrix as a `LinearOperator`. This is needed for the conforming projections. - Rename `GlobalProjectors` to `GlobalGeometricProjectors` ### Notes With the current changes, we get all FEEC operators directly from the discrete de Rham object. Further, the same code also runs if the domain is a single patch. --------- Co-authored-by: Yaman Güçlü <[email protected]> * Allow `mpi_dims_mask` with geometry file (pyccel#526) Add the optional parameter `mpi_dims_mask` to the constructor of class `Geometry`, as well as its class methods `from_discrete_mapping` and `from_topological_domain`. Add unit tests to verify that the domain is correctly decomposed. --------- Co-authored-by: Alisa Kirkinskaia <[email protected]> Co-authored-by: Alisa Kirkinskaia <[email protected]> * Fix the parallel low-level 2D Poisson example (pyccel#528) Fix `examples/poisson_2d_mapping.py`: - Use renamed method `get_assembly_grids` (formerly `get_quadrature_grids`) of class `TensorFemSpace` - Add missing definition of `Vnew` variable in the case of distributed visualization - Avoid string warnings * Fix method `plot_2d_decomposition` of `TensorFemSpace` (pyccel#529) Fix bug in method `plot_2d_decomposition` of `TensorFemSpace`, which was failing when run in parallel with a distributed spline mapping. - Create a new test file `psydac/fem/tests/test_tensor.py` with a unit test which fails on the `devel` branch. This compares the generated PNG images with "reference" ones which are known to be correct, within a 2 % relative tolerance on each of the RGB channels. - Only evaluate mapping in local subdomain owned by process - Gather global mapping information on root process - Add optional parameters `fig`, `ax`, and `mpi_root` - Add docstring - Update `examples/poisson_2d_mapping.py` to pass the correct mapping (i.e. also a distributed spline mapping if that is used in the computations) to `plot_2d_decomposition`. * Describe library name in README.md (pyccel#535) Add a NOTE block with the meaning of the PSYDAC acronym, as well as its pronounciation. * Fix parallelization bug in polar splines (pyccel#539) * change version to 2.6.0.dev0 * remove test_tensor.py * install struohy from 108-psydac-change-renaming-of-globalpojector --------- Co-authored-by: Yaman Güçlü <[email protected]> Co-authored-by: Max <[email protected]> Co-authored-by: Elena Moral Sánchez <[email protected]> Co-authored-by: Martin Campos Pinto <[email protected]> Co-authored-by: Frederik Schnack <[email protected]> Co-authored-by: Elena Moral Sánchez <[email protected]> Co-authored-by: Emily Bourne <[email protected]> Co-authored-by: Julian Owezarek <[email protected]> Co-authored-by: Alisa Kirkinskaia <[email protected]> Co-authored-by: Alisa Kirkinskaia <[email protected]>
Running description
Update
pyproject.toml:pipwill install branchfix-issue-176of SymPDE.This is to test PR pyccel/sympde#177, and is not meant to be merged for now.
If everything works well, we could use this PR to update the version of SymPDE and support Python 3.13.
TO DO / Done:
mpi4py4.0.0 #420pyproject.tomlh5pyinstallation problem with Python 3.13 (see CI log) -- fixed by installing Cython >= 3pyproject.toml:pipwill install SymPDE version 0.19.2Final summary
Closes #476:
pyproject.tomlCython >= 3as this avoidsh5pyinstallation problems with Python 3.13sympde == 0.19.2which supports Python 3.13