Open-source, implicit 3D structural geological modeling in Python for uncertainty analysis.

PyPI PyPI license: LGPL v3 Documentation Status Travis Build Binder DOI DOCKER


GemPy is a Python-based, open-source geomodeling library. It is capable of constructing complex 3D geological models of folded structures, fault networks and unconformities, based on the underlying powerful implicit representation approach. GemPy was designed from the ground up to support easy embedding in probabilistic frameworks for the uncertainty analysis of subsurface structures.

Check out the documentation either in the main website (better option), or the specific docs site.

Table of Contents


Geological objects

GemPy enables the modeling of complex 3D geological settings, on par with many commercial geomodeling packages, including:

The combination of these elements allows for the generation of realistic 3-D geological models in most typical geological settings.

Interpolation approach

The generation of complex structural settings is based on the powerful interpolation algorithm underlying GemPy, a unviersal cokriging method devoised by Lajaunie et al. (1997) and extended by Calcagno et al. (2008). This method is used to interpolate a 3D scalar field, such that geologically significant interfaces are isosurfces in this field.

The algorithm allows for a direct integration of two of the most relevant geological input data types:

GemPy also allows for the definition of topological elements such as combining multiple stratigraphic sequences and complex fault networks to be considered in the modeling process.

Integrated visualization

Models generated with GemPy can be visualized in several ways:

In addition to visualization, the generated models can be exported in a variety of ways:

We are also currently working on a tighter integration wtih several meshing libraries, notably CGAL and gmesh. In addition, we have established links to several other open-source libraries, including pygimli for geophysical modeling and inversion. In the current state, however, these links have to be considered as highly experimental and they are not yet part of the stable release. If you are interested in these features, feel free to contact us.

Stochastic geological modeling

One of the most advanced features that sets gempy also apart from available commercial packages is the full integration of stochastic geological modeling methods. GemPy was designed from the ground up to support stochastic geological modeling for uncertainty analysis (e.g. Monte Carlo simulations, Bayesian inference). This was achieved by writing GemPy's core architecture using the numerical computation library Theano to couple it with the probabilistic programming framework PyMC3. This enables the use of advanced sampling methods (e.g. Hamiltonian Monte Carlo) and is of particular relevance when considering uncertainties in the model input data and making use of additional secondary information in a Bayesian inference framework.

We can, for example, include uncertainties with respect to the z-position of layer boundaries in the model space. Simple Monte Carlo simulation via PyMC will then result in different model realizations.

Theano allows the automated computation of gradients, opening the door to the use of advanced gradient-based sampling methods coupling GeMpy and PyMC3 for advanced stochastic modeling. Also, the use of Theano allows making use of GPUs through cuda (see the Theano documentation for more information.

Making use of vtk interactivity and Qgrid ( , GemPy provides a functional interface to interact with input data and models.

For a more detailed elaboration of the theory behind GemPy, we refer to the open access scientific publication: "GemPy 1.0: open-source stochastic geological modeling and inversion" by de la Varga et al. (2018).


Installing GemPy

We provide the latest release version of GemPy via the Conda and PyPi package services. We highly recommend using PyPi, as it will take care of automatically installing all dependencies.

$ pip install gempy

You can also visit PyPi <>_, or GitHub <>

For more details in the installation check: Installation <>


Extensive documentation for GemPy is hosted at, explaining its capabilities, the theory behind it and providing detailed tutorials on how to use it.