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.
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/activateMake sure that the preferred virtual environment is activated, then run:
pip install sympdeThis downloads the correct version of SymPDE from PyPI and installs it in the virtual environment.
First, clone the repository with Git and change to the repository directory:
git clone https://github.com/pyccel/sympde.git
cd sympdeTo 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]"
The complete test suite can be run from any directory with:
pytest -n auto --dist loadgroup --pyargs sympde -raThe 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/htmlBecause 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.