Package: parafields
Welcome to parafieldsparafieldsis 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 othersGeneration of distributed fields using domain decomposition
and MPI throughmpi4pyUsesnumpydata structures to ease integration with the
Python ecosystem of scientific softwareOptional caching of matrix-vector productsEasy integration into e.g.FEniCSx-basedPDE solvers (Example that is currently not tested as part of our CI)parafieldsimplements these features through Python bindings to theparafields-core C++ library.
The following options are supported in the backend but not yet in the Python bindings:axiparallel and full geometric anisotropyvalue transforms like log-normal, folded normal, or
sign function (excursion set)Coarsening and refinement of random fields for multigrid/-scale methodsInstallationparafieldsis available from PyPI and can be installed usingpip:python -m pip install parafieldsThis will install a sequential, pre-compiled version ofparafields.
In order to useparafieldsin an MPI-parallel context, you need to
instead build the package from source:python -m pip install --no-binary parafields -v parafieldsThis will build the package from source and link against your system MPI.Additionally,parafieldsdefines the following optional dependency sets:jupyter: All requirements for an interactive Jupyter interface toparafieldstests: All requirements for runningparafields's unit testsdocs: All requirements for buildingsparafields's Sphinx documentationThese optional dependencies can be installed by installing e.g.parafields[jupyter].UsageThis is a minimal usage example of theparafieldspackage:For more examples, check out theparafields documentation.Reporting IssuesIf you need support withparafieldsor found a bug, consider a bug onthe issue tracker.Contributingparafieldswelcomes external contributions. For the best possible contributor
experience, consider opening an issue onthe issue trackerbefore 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 ofparafields, use the following instructions:gitclonehttps://github.com/parafields/parafields.gitcdparafields
python-mpipinstall-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 testspython-mpytest# Parallel testsmpirun--oversubscribe-np4python-mpytest--only-mpiIn order to locally build the Sphinx documentation, use the following commands:sphinx-build-thtml./doc./htmlAcknowledgmentsTheparafields-core C++ libraryis
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.