Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 0 additions & 35 deletions .github/workflows/continuous-integration.yml

This file was deleted.

86 changes: 86 additions & 0 deletions .github/workflows/testing.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
# This workflow installs SymPDE and runs its tests with supported Python versions.
# It follows the testing layout used by Psydac while omitting Psydac-specific
# MPI, HDF5, PETSc, and example jobs.

name: Unit tests

on:
push:
branches: [ master ]
paths:
- 'sympde/**'
- 'pyproject.toml'
- '.github/workflows/testing.yml'

pull_request:
branches: [ master ]
types:
- opened
- reopened
- synchronize
- ready_for_review

workflow_dispatch:

jobs:
test:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ ubuntu-latest, macos-latest ]
python-version: [ '3.9', '3.10', '3.11', '3.12', '3.13', '3.14' ]

name: ${{ matrix.os }} / Python ${{ matrix.python-version }}

steps:
- uses: actions/checkout@v6

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v6
with:
python-version: ${{ matrix.python-version }}
cache: 'pip'
cache-dependency-path: |
pyproject.toml

- name: Upgrade pip, setuptools, and wheel
run: |
pip install --upgrade pip setuptools wheel

- name: Install project
run: |
pip install .[test]
pip freeze

- name: Initialize test directory
run: |
mkdir scratch

- name: Run coverage tests on macOS
if: runner.os == 'macOS'
working-directory: ./scratch
run: >-
pytest -n auto --dist loadgroup
--cov sympde --cov-report term-missing --cov-report xml
--pyargs sympde -ra

- name: Run tests on Ubuntu
if: runner.os == 'Linux'
working-directory: ./scratch
run: >-
pytest -n auto --dist loadgroup
--pyargs sympde -ra

- name: Upload coverage report
if: runner.os == 'macOS'
uses: actions/upload-artifact@v4
with:
name: coverage-report-${{ matrix.os }}-python-${{ matrix.python-version }}
path: scratch/coverage.xml

- name: Print detailed coverage results on macOS
if: runner.os == 'macOS'
working-directory: ./scratch
run: |
coverage report --ignore-errors --show-missing --sort=cover
18 changes: 18 additions & 0 deletions AUTHORS
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
Maintainers
-----------
* Yaman Güçlü <yaman.guclu@gmail.com> (original author, project lead)
* Martin Campos Pinto <martin.campos-pinto@ipp.mpg.de>

Contributors
------------
* Ahmed Ratnani (original author)
* Said Hadjout (original author)
* Antoine Lavandier
* Martin Campos Pinto
* Tom Caruso
* Alisa Kirkinskaia
* Elena Moral Sánchez
* Alexander Hoffmann
* Valentin Carlier
* Paul Rigor
* Frederik Schnack
78 changes: 78 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
# Change Log

All notable changes to this project will be documented in this file.

## [0.20.0] - 2026-09-07

### Added

- #185: Store interface orientations when exporting domain connectivity, allowing them to be restored when loading a domain.
- #185: Add consistency checks when constructing mapped domains.

### Changed

- #185: Require an explicit orientation when constructing multipatch interfaces, including through `Interface`, `Domain.join()`, and `Domain.from_file()`. This is a breaking change for callers and domain files that omitted orientation information.
- #185: Clean up expression evaluation and expand its API documentation.
- [DEVELOPER] Run tests in parallel with `pytest-xdist`, while keeping the HDF5 gallery tests serial.

## [0.19.3] - 2026-07-17

### Fixed

- #187: Avoid redundant symbolic expansion in `is_linear_expression()`, fixing severe slowdowns for some expressions.

### Changed

- #187: Refactor and document `is_linear_expression()` and remove its unused `integral` argument.

## [0.19.2] - 2025-04-02

### Changed

- #177: Drop support for Python 3.8 and require Python 3.9 or newer.
- #177: Add testing and installation support for Python 3.13.

## [0.19.1] - 2025-03-05

### Added

- #173: Add `Domain.subdomains` and `Domain.mappings`, which consistently return tuples for both single-patch and multipatch domains.
- #173: Allow `Domain.join()` to be called with a single patch.
- [DEVELOPER] Add terminal-expression tests for exact Navier–Stokes solutions.

### Fixed

- #170: Mark domain coordinates as real SymPy symbols, avoiding code-generation problems for complex expressions.
- #174: Fix README markup so the project description renders correctly on PyPI.

### Changed

- #172: Expand the source-installation and virtual-environment instructions.

## [0.19.0] - 2024-08-14

### Added

- #154: Add support and continuous-integration testing for Python 3.12.
- #158: Accept NumPy scalar values as parameters of analytical mappings.
- #155: Allow `Domain.join()` connectivity entries to reference patch objects directly instead of only their indices.

### Changed

- #155: Document `Domain.join()` and make joined-domain construction less dependent on patch ordering.
- #164: Document how SymPDE branches can be tested against the Psydac test suite.
- #165: Replace the obsolete build badge with the GitHub Actions CI badge.

### Fixed

- #167: Fix README markup rejected by the PyPI uploader.

### Removed

- #165: Remove the obsolete Travis CI configuration.

[0.20.0]: https://github.com/pyccel/sympde/compare/v0.19.3...v0.20.0
[0.19.3]: https://github.com/pyccel/sympde/compare/v0.19.2...v0.19.3
[0.19.2]: https://github.com/pyccel/sympde/compare/v0.19.1...v0.19.2
[0.19.1]: https://github.com/pyccel/sympde/compare/v0.19.0...v0.19.1
[0.19.0]: https://github.com/pyccel/sympde/compare/v0.18.3...v0.19.0
100 changes: 100 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
# SymPDE

[![CI status](https://github.com/pyccel/sympde/actions/workflows/testing.yml/badge.svg?branch=master&event=push)](https://github.com/pyccel/sympde/actions/workflows/testing.yml)
[![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/pyccel/sympde/master)
[![Documentation Status](https://readthedocs.org/projects/sympde/badge/?version=latest)](http://sympde.readthedocs.io/en/latest/?badge=latest)

**SymPDE** is a symbolic calculus library for partial differential equations and variational forms.
It can be used to provide capabilities similar to the [FEniCS](https://fenicsproject.org/) project by extending and writing your own *printing* functions.

Examples of its use can be found in [Psydac](https://github.com/pyccel/psydac) and [Gelato](https://github.com/pyccel/gelato).

## Installation

### Set up a virtual environment

We always recommend working in a Python virtual environment.
To create a new one, we recommend the [`venv`](https://packaging.python.org/en/latest/guides/installing-using-pip-and-virtual-environments/#creating-a-virtual-environment) package:

```bash
python3 -m venv <ENV-PATH>
```

Here, `<ENV-PATH>` is the location where the virtual environment will be created.
A new directory will be created at that location.

To activate the environment from a new terminal session, run:

```bash
source <ENV-PATH>/bin/activate
```

### Option 1: Install from PyPI

Make sure that the preferred virtual environment is activated, then run:

```bash
pip install sympde
```

This downloads the correct version of SymPDE from [PyPI](https://pypi.org/project/sympde/) and installs it in the virtual environment.

### Option 2: Install from sources

First, clone the repository with Git and change to the repository directory:

```bash
git clone https://github.com/pyccel/sympde.git
cd sympde
```

To check out a specific branch, tag, or commit named `<TAG>`, run `git checkout <TAG>`.

- **Static mode**

Install the source files in the virtual environment with:

```bash
pip install .
```

Further changes to the cloned directory are not reflected in the installed package. This is why we call it a **static** installation.

- **Editable mode**

To make changes to the library and see them when the package is imported, install SymPDE in **editable** mode:

```bash
pip install --editable ".[test]"
```

### Running the tests

The complete test suite can be run from any directory with:

```bash
pytest -n auto --dist loadgroup --pyargs sympde -ra
```

## For developers

Because many important SymPDE features are only tested in Psydac, new pull requests should also be tested against the Psydac test suite.
This can be done by opening a pull request in Psydac whose only change is to install the corresponding SymPDE branch.
To achieve this, modify the line corresponding to `sympde` in Psydac's `pyproject.toml` file.

For instance, to test a new SymPDE branch called `my_feature`, use:

```python
# Our packages from PyPI
'sympde @ https://github.com/pyccel/sympde/archive/refs/heads/my_feature.zip',
```

Similarly, to test an unreleased version of SymPDE called `v0.18.4-trunk`, use:

```python
# Our packages from PyPI
'sympde @ https://github.com/pyccel/sympde/archive/refs/tags/v0.18.4-trunk.zip',
```

Do not forget the comma at the end of the line, as this is an item in a list.
Also note the words `heads` and `tags` in the paths: the former is used for Git branches, while the latter is used for Git tags, which may or may not correspond to GitHub releases.
Loading
Loading