Skip to content

Commit

Permalink
DOC: Last fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
florian-wagner committed Dec 7, 2022
1 parent c6d4e20 commit cd44c01
Show file tree
Hide file tree
Showing 6 changed files with 49 additions and 58 deletions.
61 changes: 21 additions & 40 deletions INSTALLATION.rst
@@ -1,7 +1,24 @@
Installation
============

|conda| |downloads| |platforms| |condaversion| |latest|
.. raw:: html

<p style="height:22px">
<a href="https://anaconda.org/gimli/pygimli" >
<img src="https://anaconda.org/gimli/pygimli/badges/installer/conda.svg?style=flat-square"/>
</a>
<a href="https://anaconda.org/gimli/pygimli" >
<img src="https://anaconda.org/gimli/pygimli/badges/installer/conda.svg?style=flat-square"/>
<a href="https://anaconda.org/gimli/pygimli" >
<img src="https://anaconda.org/gimli/pygimli/badges/version.svg?style=flat-square"/>
</a>
<a href="https://anaconda.org/gimli/pygimli" >
<img src="https://anaconda.org/gimli/pygimli/badges/latest_release_date.svg?style=flat-square"/>
</a>
<a href="https://anaconda.org/gimli/pygimli" >
<img src="https://anaconda.org/gimli/pygimli/badges/platforms.svg?style=flat-square"/>
</a>
</p>

On all platforms, we recommend to install pyGIMLi via the conda package manager
contained in the Anaconda distribution. For details on how to install Anaconda,
Expand All @@ -19,7 +36,7 @@ Open a terminal (Linux & Mac) or the Anaconda Prompt (Windows) and type:

.. code-block:: bash
conda create -n pg -c gimli -c conda-forge pygimli=1.3.0
conda create -n pg -c gimli -c conda-forge pygimli=1.3.1
If you are using Windows or Mac, a new environment named "pg" should be visible
in the Anaconda Navigator. If you want to use pyGIMLi from the command line, you
Expand Down Expand Up @@ -67,7 +84,7 @@ again and install pygimli using mamba just as mentioned above.
import condacolab
condacolab.check()
!mamba install -c gimli pygimli=1.3
!mamba install -c gimli pygimli=1.3.1
Testing the installation
------------------------
Expand Down Expand Up @@ -122,40 +139,4 @@ Later you can just update the pygimli code by
Only if you need recent changes to the C++ core, you have to compile
pyGIMLi using your systems toolchain as described in
https://www.pygimli.org/compilation.html#sec-build

.. raw:: html

<p style="height:22px">
<a href="https://anaconda.org/gimli/pygimli" >
<img src="https://anaconda.org/gimli/pygimli/badges/installer/conda.svg?style=flat-square"/>
</a>
<a href="https://anaconda.org/gimli/pygimli" >
<img src="https://anaconda.org/gimli/pygimli/badges/installer/conda.svg?style=flat-square"/>
<a href="https://anaconda.org/gimli/pygimli" >
<img src="https://anaconda.org/gimli/pygimli/badges/version.svg?style=flat-square"/>
</a>
<a href="https://anaconda.org/gimli/pygimli" >
<img src="https://anaconda.org/gimli/pygimli/badges/latest_release_date.svg?style=flat-square"/>
</a>
<a href="https://anaconda.org/gimli/pygimli" >
<img src="https://anaconda.org/gimli/pygimli/badges/platforms.svg?style=flat-square"/>
</a>
</p>

.. .. image directive s
.. .. |conda| image:: https://anaconda.org/gimli/pygimli/badges/installer/conda.svg
:target: https://anaconda.org/gimli/pygimli
.. .. |downloads| image:: https://anaconda.org/gimli/pygimli/badges/downloads.svg
:target: https://anaconda.org/gimli/pygimli
.. .. |condaversion| image:: https://anaconda.org/gimli/pygimli/badges/version.svg
:target: https://anaconda.org/gimli/pygimli
.. .. |latest| image:: https://anaconda.org/gimli/pygimli/badges/latest_release_date.svg
:target: https://anaconda.org/gimli/pygimli
.. .. |platforms| image:: https://anaconda.org/gimli/pygimli/badges/platforms.svg
:target: https://anaconda.org/gimli/pygimli
https://www.pygimli.org/compilation.html#sec-build
2 changes: 1 addition & 1 deletion README.md
Expand Up @@ -45,7 +45,7 @@ separate environment. Here we call this environment pg, but you can give it any
name. Note that this environment has to be created only once.

``` bash
conda create -n pg -c gimli -c conda-forge pygimli=1.2.6
conda create -n pg -c gimli -c conda-forge pygimli=1.3.1
```

If you are using Windows or Mac, a new environment named “pg” should be visible in the Anaconda Navigator. If you want to use pygimli from the command line, you have to activate the environment. You can put this line in your ~/.bashrc file so that it is activated automatically if you open a terminal.
Expand Down
3 changes: 2 additions & 1 deletion doc/_static/css/custom.css
Expand Up @@ -70,7 +70,8 @@ nav#bd-docs-nav {


footer.bd-footer {
opacity: 80%;
background: var(--pst-color-background);
opacity: 65%;
}

/* Bold font fixes */
Expand Down
17 changes: 8 additions & 9 deletions doc/conf.py
Expand Up @@ -117,14 +117,13 @@ def reset_mpl(gallery_conf, fname):
join(SPHINXDOC_PATH, "tutorials")],
"gallery_dirs": ["_examples_auto", "_tutorials_auto"],

# Currently deactivated until this is fixed: https://github.com/sphinx-gallery/sphinx-gallery/issues/967
# "reference_url": {
# "pygimli": "https://pygimli.org",
# "python": "https://docs.python.org/dev",
# "numpy": "https://numpy.org/doc/stable",
# "scipy": "https://docs.scipy.org/doc/scipy/reference",
# "matplotlib": "https://matplotlib.org/stable",
# },
"reference_url": {
"pygimli": "https://pygimli.org",
"python": "https://docs.python.org/dev",
"numpy": "https://numpy.org/doc/stable",
"scipy": "https://docs.scipy.org/doc/scipy/reference",
"matplotlib": "https://matplotlib.org/stable",
},

# Don"t report time of fast scripts (< 10 sec)
"min_reported_time": 10,
Expand All @@ -148,7 +147,7 @@ def reset_mpl(gallery_conf, fname):
"reset_modules": (reset_mpl),

# Avoid representation of mpl axis, LineCollections, etc.
'ignore_repr_types': r'matplotlib[text, axes, collections]',
"ignore_repr_types": r"matplotlib[text, axes, collections]",
}

pyvista = pygimli.optImport("pyvista", "build the gallery with 3D visualizations")
Expand Down
1 change: 0 additions & 1 deletion doc/examples/2_seismics/plot_04_koenigsee.py
Expand Up @@ -15,7 +15,6 @@
"""
# sphinx_gallery_thumbnail_number = 5

###############################################################################
# We import pyGIMLi and the traveltime module.

import pygimli as pg
Expand Down
23 changes: 17 additions & 6 deletions doc/examples/3_dc_and_ip/plot_01_ert_2d_mod_inv.py
@@ -1,7 +1,7 @@
# -*- coding: utf-8 -*-
"""
2D ERT modeling and inversion
-----------------------------
=============================
"""
# sphinx_gallery_thumbnail_number = 6

Expand All @@ -13,9 +13,10 @@
from pygimli.physics import ert

###############################################################################
# Create geometry definition for the modelling domain.
#
# worldMarker=True indicates the default boundary conditions for the ERT
# Geometry definition
# -------------------
# Create geometry definition for the modelling domain. ``worldMarker=True``
# indicates the default boundary conditions for the ERT
world = mt.createWorld(start=[-50, 0], end=[50, -50], layers=[-1, -5],
worldMarker=True)

Expand All @@ -38,6 +39,8 @@
pg.show(geom)

###############################################################################
# Synthetic data generation
# -------------------------
# Create a Dipole Dipole ('dd') measuring scheme with 21 electrodes.
scheme = ert.createData(elecs=np.linspace(start=-15, stop=15, num=21),
schemeName='dd')
Expand Down Expand Up @@ -96,6 +99,8 @@
ert.show(data)

###############################################################################
# Inversion with the ERTManager
# -----------------------------
# Initialize the ERTManager, e.g. with a data container or a filename.
mgr = ert.ERTManager('simple.dat')
###############################################################################
Expand All @@ -121,6 +126,8 @@
marker=2)

###############################################################################
# Inversion with custom mesh
# --------------------------
# The inversion domain for ERT problems needs a boundary that represents the
# far regions in the subsurface of the halfspace.
# Give a cell marker lower than the marker for the inversion region, the lowest
Expand All @@ -132,13 +139,17 @@
###############################################################################
# The Inversion can be called with data and mesh as argument as well
model = mgr.invert(data, mesh=grid, lam=20, verbose=True)
# np.testing.assert_approx_equal(mgr.inv.chi2(), 0.951027, significant=3)
# sphinx_gallery_start_ignore
np.testing.assert_approx_equal(mgr.inv.chi2(), 1.4, significant=2)
# sphinx_gallery_end_ignore

###############################################################################
# Visualization
# -------------
# You can of course get access to mesh and model and plot them for your own.
# Note that the cells of the parametric domain of your mesh might be in
# a different order than the values in the model array if regions are used.
# The manager can help to permutate them into the right order.
np.testing.assert_approx_equal(mgr.inv.chi2(), 1.4, significant=2)

modelPD = mgr.paraModel(model) # do the mapping
pg.show(mgr.paraDomain, modelPD, label='Model', cMap='Spectral_r',
Expand Down

0 comments on commit cd44c01

Please sign in to comment.