Clone the latest version of the software using:

git clone

or download the source from the PyApprox github repository.


To get all the features of PyApprox it is best to install PyApprox dependencies with conda. However if this is not possible or desirable PyApprox can also be installed entirely with pip. If pip is used the user will not have access to the benchmarks based on the finite element modeling package fenics.


The most robust way to install PyApprox is to create a new environment. Pyapprox can be installed in an existing environment, however the user will need to take care to ensure that any upgrades or downgrades suggested by conda will not cause issues with the current environment.

To create a new environment use:

conda env create -f environment.yml

This will create an environment called pyapprox-dev. Activate this environment with:

conda activate pyapprox-dev

Once the new environment, or an existing environment, has been activated run the following in the PyApprox root directory to install PyApprox:

pip install -e .

The -e argument specifies to install softlinks so that any changes made by the user to the source in the source folders are reflected in the install when importing modules.


To install PyApprox entirely with pip simply run the following in the PyApprox root directory to install PyApprox:

pip install -e .

Note that sometimes developers need to remove all files generated when installing. To do this use:

python clean --all
find . -name "*.pyc" -exec rm -f {} \;


To run all tests use:

python test

To test docstring examples use:

pytest --doctest-modules

or in pyapprox/docs directory run:

make doctest

To test all docstrings in a file use:

python -m doctest -v

Some tests will be skipped if not all optional packages are installed.

Create Documentation

To create the documentation fenics must be installed. Creating documentation also requires Sphinx 1.7 or later, sphinx, numpydoc, and sphinx-automodapi. These are automatically installed with pip install -e . command.

Html documentation can be generated with:

cd docs
make html

A PDF of the documentation can be generated with:

cd docs
make latexpdf

Note that sometimes the documentation of functions using numpydoc can render incorrectly when usd with sphinx_rtd_theme (see this thread). As a workaround find the file:


add the following at the end of the file if not already present:

.classifier:before {
    font-style: normal;
    margin: 0.5em;
    content: ":";