Skip to content

Latest commit

 

History

508 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SymPDE

CI status Binder Documentation Status

SymPDE is a symbolic calculus library for partial differential equations and variational forms. It can be used to provide capabilities similar to the FEniCS project by extending and writing your own printing functions.

Examples of its use can be found in Psydac and 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 package:

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:

source <ENV-PATH>/bin/activate

Option 1: Install from PyPI

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

pip install sympde

This downloads the correct version of SymPDE from PyPI and installs it in the virtual environment.

Option 2: Install from sources

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

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:

    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:

    pip install --editable ".[test]"

Running the tests

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

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

The documentation dependencies are installed separately, and the HTML pages are built with warnings treated as errors:

pip install --editable ".[docs]"
sphinx-build -W --keep-going -b html doc doc/_build/html

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. 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:

# 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:

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

About

Symbolic calculus for partial differential equations (and variational forms)

Topics

Resources

Stars

25 stars

Watchers

7 watching

Forks

Releases

Packages

Used by

Contributors

Languages