Skip to main content

Parallel Parameter Fields for Uncertainty Quantification

Project description

Welcome to parafields

License GitHub Workflow Status Documentation Status codecov

parafields is a Python package that provides Gaussian random fields based on circulant embedding. Core features are:

  • Large variety of covariance functions: exponential, Gaussian, Matérn, spherical and cubic covariance functions, among others
  • Generation of distributed fields using domain decomposition and MPI through mpi4py
  • Uses numpy data structures to ease integration with the Python ecosystem of scientific software
  • Optional caching of matrix-vector products
  • Easy integration into e.g. FEniCSx-based PDE solvers (Example that is currently not tested as part of our CI)

parafields implements these features through Python bindings to the parafields-core C++ library. The following options are supported in the backend but not yet in the Python bindings:

  • axiparallel and full geometric anisotropy
  • value transforms like log-normal, folded normal, or sign function (excursion set)
  • Coarsening and refinement of random fields for multigrid/-scale methods

Installation

parafields is available from PyPI and can be installed using pip:

python -m pip install parafields

This will install a sequential, pre-compiled version of parafields. In order to use parafields in an MPI-parallel context, you need to instead build the package from source:

python -m pip install --no-binary parafields -v parafields

This will build the package from source and link against your system MPI.

Additionally, parafields defines the following optional dependency sets:

  • jupyter: All requirements for an interactive Jupyter interface to parafields
  • tests: All requirements for running parafields's unit tests
  • docs: All requirements for buildings parafields's Sphinx documentation

These optional dependencies can be installed by installing e.g. parafields[jupyter].

Usage

This is a minimal usage example of the parafields package:

Minimum usage example

For more examples, check out the parafields documentation.

Reporting Issues

If you need support with parafields or found a bug, consider a bug on the issue tracker.

Contributing

parafields welcomes external contributions. For the best possible contributor experience, consider opening an issue on the issue tracker before you start developing. Announcing your intended development in this way allows us to clarify whether it is in the scope of the package. Contributions are then done via a pull request on the GitHub repository. Please also add your name to the list of copyright holders.

For a development installation of parafields, use the following instructions:

git clone https://github.com/parafields/parafields.git
cd parafields
python -m pip install -v --editable .[tests,docs,jupyter]

Before contributing, make sure that the unit tests pass and that new functionality is covered by unit tests. The unit tests can be run using pytest:

# Sequential tests
python -m pytest

# Parallel tests
mpirun --oversubscribe -np 4 python -m pytest --only-mpi

In order to locally build the Sphinx documentation, use the following commands:

sphinx-build -t html ./doc ./html

Acknowledgments

The parafields-core C++ library is work by Ole Klein whichis supported by the federal ministry of education and research of Germany (Bundesministerium für Bildung und Forschung) and the ministry of science, research and arts of the federal state of Baden-Württemberg (Ministerium für Wissenschaft, Forschung und Kunst Baden-Württemberg).

The Python bindings are realized by the Scientific Software Center of Heidelberg University. The Scientific Software Center is funded as part of the Excellence Strategy of the German Federal and State Governments.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

parafields-1.0.2.tar.gz (33.9 kB view hashes)

Uploaded Source

Built Distributions

parafields-1.0.2-cp312-cp312-win_amd64.whl (2.2 MB view hashes)

Uploaded CPython 3.12 Windows x86-64

parafields-1.0.2-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (3.1 MB view hashes)

Uploaded CPython 3.12 manylinux: glibc 2.17+ x86-64

parafields-1.0.2-cp312-cp312-macosx_10_9_x86_64.whl (2.8 MB view hashes)

Uploaded CPython 3.12 macOS 10.9+ x86-64

parafields-1.0.2-cp311-cp311-win_amd64.whl (2.2 MB view hashes)

Uploaded CPython 3.11 Windows x86-64

parafields-1.0.2-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (3.1 MB view hashes)

Uploaded CPython 3.11 manylinux: glibc 2.17+ x86-64

parafields-1.0.2-cp311-cp311-macosx_10_9_x86_64.whl (2.8 MB view hashes)

Uploaded CPython 3.11 macOS 10.9+ x86-64

parafields-1.0.2-cp310-cp310-win_amd64.whl (2.2 MB view hashes)

Uploaded CPython 3.10 Windows x86-64

parafields-1.0.2-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (3.1 MB view hashes)

Uploaded CPython 3.10 manylinux: glibc 2.17+ x86-64

parafields-1.0.2-cp310-cp310-macosx_10_9_x86_64.whl (2.8 MB view hashes)

Uploaded CPython 3.10 macOS 10.9+ x86-64

parafields-1.0.2-cp39-cp39-win_amd64.whl (2.2 MB view hashes)

Uploaded CPython 3.9 Windows x86-64

parafields-1.0.2-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (3.1 MB view hashes)

Uploaded CPython 3.9 manylinux: glibc 2.17+ x86-64

parafields-1.0.2-cp39-cp39-macosx_10_9_x86_64.whl (2.8 MB view hashes)

Uploaded CPython 3.9 macOS 10.9+ x86-64

parafields-1.0.2-cp38-cp38-win_amd64.whl (2.2 MB view hashes)

Uploaded CPython 3.8 Windows x86-64

parafields-1.0.2-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (3.1 MB view hashes)

Uploaded CPython 3.8 manylinux: glibc 2.17+ x86-64

parafields-1.0.2-cp38-cp38-macosx_10_9_x86_64.whl (2.8 MB view hashes)

Uploaded CPython 3.8 macOS 10.9+ x86-64

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page