Skip to content

Use SymPDE version 0.19.1 #445

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

Merged
merged 15 commits into from
Mar 5, 2025
Merged

Use SymPDE version 0.19.1 #445

merged 15 commits into from
Mar 5, 2025

Conversation

yguclu
Copy link
Member

@yguclu yguclu commented Oct 16, 2024

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 #457.

@e-moral-sanchez
Copy link
Contributor

This PR is linked to pyccel/sympde#170 .

After the change that coordinates must be real, the symbols used in the tests to write the exact solution must also be declared as real.

@e-moral-sanchez e-moral-sanchez marked this pull request as ready for review December 6, 2024 12:12
Copy link

codacy-production bot commented Feb 6, 2025

Coverage summary from Codacy

See diff coverage on Codacy

Coverage variation Diff coverage
+0.00%
Coverage variation details
Coverable lines Covered lines Coverage
Common ancestor commit (cb49555) 30704 18443 60.07%
Head commit (e7eea52) 61408 (+30704) 36886 (+18443) 60.07% (+0.00%)

Coverage variation is the difference between the coverage for the head and common ancestor commits of the pull request branch: <coverage of head commit> - <coverage of common ancestor commit>

Diff coverage details
Coverable lines Covered lines Diff coverage
Pull request (#445) 0 0 ∅ (not applicable)

Diff coverage is the percentage of lines that are covered by tests out of the coverable lines that the pull request added or modified: <covered lines added or modified>/<coverable lines added or modified> * 100%

See your quality gate settings    Change summary preferences

Codacy stopped sending the deprecated coverage status on June 5th, 2024. Learn more

@yguclu yguclu changed the title Use branch "real_coord" of SymPDE Use SymPDE version 0.19.1 Mar 5, 2025
yguclu added 4 commits March 5, 2025 19:12
Use SymPDE version 0.19.1
Remove useless whitespace changes
Minor formatting changes
@yguclu yguclu dismissed e-moral-sanchez’s stale review March 5, 2025 21:19

Required change (update SymPDE version) has been already applied.

@yguclu yguclu merged commit ae3e803 into devel Mar 5, 2025
9 checks passed
@yguclu yguclu deleted the real_coord branch March 5, 2025 21:29
max-models added a commit to max-models/psydac-for-struphy that referenced this pull request Mar 25, 2025
* 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]>

* Use CI from psydac-for-struphy

* Install with .[test]

---------

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]>
spossann added a commit to max-models/psydac-for-struphy that referenced this pull request Apr 4, 2025
* 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]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants