Skip to content

Commit 6ad16c4

Browse files
authored
Merge pull request #640 from cgre-aachen/dev_alexj
[WIP] Current GemPy Patches
2 parents 2a76ec8 + 7c03166 commit 6ad16c4

29 files changed

+356
-107
lines changed

.github/workflows/pytest.yml

Lines changed: 117 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,117 @@
1+
name: GemPy CI Conda Requirements
2+
3+
on:
4+
push:
5+
branches: [ dev_alexj, master, main, release, fixing_actions ]
6+
7+
pull_request:
8+
branches: [ dev_alexj, master, main, release ]
9+
10+
# Allows you to run this workflow manually from the Actions tab
11+
workflow_dispatch:
12+
13+
jobs:
14+
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
15+
testing_conda:
16+
name: Conda install ${{ matrix.case.os }} py${{ matrix.case.python-version }} ${{ matrix.case.name }}
17+
runs-on: ${{ matrix.case.os }}-latest
18+
defaults:
19+
run:
20+
shell: bash -l {0}
21+
22+
strategy:
23+
fail-fast: false
24+
matrix:
25+
os: [ ubuntu, ] # macos, windows] # Only Linux currently.
26+
case:
27+
- python-version: 3.8
28+
name: basic
29+
os: ubuntu
30+
31+
env:
32+
DISPLAY: ':99.0'
33+
PYVISTA_OFF_SCREEN: 'True'
34+
ALLOW_PLOTTING: true
35+
SHELLOPTS: 'errexit:pipefail'
36+
OS: ${{ matrix.case.os }}
37+
PYTHON: ${{ matrix.case.python-version }}
38+
GITHUBACTION: "true"
39+
40+
steps:
41+
# Cancel any previous run of the test job; [pin v0.8.0 (2021-02-13)]
42+
- name: Cancel Previous Runs
43+
uses: styfle/cancel-workflow-action@3d86a7cc43670094ac248017207be0295edbc31d
44+
with:
45+
access_token: ${{ github.token }}
46+
47+
- uses: actions/checkout@v2
48+
- name: Setup Headless Display
49+
run: |
50+
sudo apt-get update && sudo apt-get install libgl1-mesa-glx xvfb -y
51+
sudo apt-get install -y xvfb
52+
Xvfb :99 -screen 0 1024x768x24 > /dev/null 2>&1 &
53+
sleep 3
54+
55+
- name: Install dependencies
56+
run: |
57+
conda list gempy
58+
conda list gdal
59+
conda list pyvista
60+
conda list vtk
61+
conda list pandas
62+
conda list numpy
63+
conda install gdal
64+
python -m pip install --upgrade pip
65+
pip install -r dev-requirements.txt
66+
67+
- name: Run tests with pytest
68+
run: |
69+
pytest
70+
71+
testing_pip:
72+
name: Pip install ${{ matrix.case.os }} py${{ matrix.case.python-version }} ${{ matrix.case.name }}
73+
runs-on: ${{ matrix.case.os }}-latest
74+
defaults:
75+
run:
76+
shell: bash -l {0}
77+
78+
strategy:
79+
fail-fast: false
80+
matrix:
81+
os: [ ubuntu, ] # macos, windows] # Only Linux currently.
82+
case:
83+
- python-version: 3.8
84+
name: basic
85+
os: ubuntu
86+
87+
env:
88+
DISPLAY: ':99.0'
89+
PYVISTA_OFF_SCREEN: 'True'
90+
ALLOW_PLOTTING: true
91+
SHELLOPTS: 'errexit:pipefail'
92+
OS: ${{ matrix.case.os }}
93+
PYTHON: ${{ matrix.case.python-version }}
94+
GITHUBACTION: "true"
95+
steps:
96+
# Cancel any previous run of the test job; [pin v0.8.0 (2021-02-13)]
97+
- name: Cancel Previous Runs
98+
uses: styfle/cancel-workflow-action@3d86a7cc43670094ac248017207be0295edbc31d
99+
with:
100+
access_token: ${{ github.token }}
101+
102+
- uses: actions/checkout@v2
103+
- name: Setup Headless Display
104+
run: |
105+
sudo apt-get update && sudo apt-get install libgl1-mesa-glx xvfb -y
106+
sudo apt-get install -y xvfb
107+
Xvfb :99 -screen 0 1024x768x24 > /dev/null 2>&1 &
108+
sleep 3
109+
110+
- name: Install dependencies
111+
run: |
112+
python -m pip install --upgrade pip
113+
pip install -r dev-requirements.txt
114+
115+
- name: Run tests with pytest
116+
run: |
117+
pytest

.travis.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ install:
4343
- conda install theano
4444

4545
# Installs from pip
46-
- pip install welly pymc3 pooch
46+
- pip install welly pymc3
4747

4848
- pip install scikit-image>=0.17 sklearn
4949

@@ -62,6 +62,8 @@ install:
6262

6363
- python -c "import pyvista as pv;print(pv.Report())"
6464

65+
- pip install pooch
66+
6567
stages:
6668
- test
6769

CODE_OF_CONDUCT.md

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
# Contributor Covenant Code of Conduct
2+
3+
## Our Pledge
4+
5+
In the interest of fostering an open and welcoming environment, we as
6+
contributors and maintainers pledge to making participation in our project and
7+
our community a harassment-free experience for everyone, regardless of age, body
8+
size, disability, ethnicity, sex characteristics, gender identity and expression,
9+
level of experience, education, socio-economic status, nationality, personal
10+
appearance, race, religion, or sexual identity and orientation.
11+
12+
## Our Standards
13+
14+
Examples of behavior that contributes to creating a positive environment
15+
include:
16+
17+
* Using welcoming and inclusive language
18+
* Being respectful of differing viewpoints and experiences
19+
* Gracefully accepting constructive criticism
20+
* Focusing on what is best for the community
21+
* Showing empathy towards other community members
22+
23+
Examples of unacceptable behavior by participants include:
24+
25+
* The use of sexualized language or imagery and unwelcome sexual attention or
26+
advances
27+
* Trolling, insulting/derogatory comments, and personal or political attacks
28+
* Public or private harassment
29+
* Publishing others' private information, such as a physical or electronic
30+
address, without explicit permission
31+
* Other conduct which could reasonably be considered inappropriate in a
32+
professional setting
33+
34+
## Our Responsibilities
35+
36+
Project maintainers are responsible for clarifying the standards of acceptable
37+
behavior and are expected to take appropriate and fair corrective action in
38+
response to any instances of unacceptable behavior.
39+
40+
Project maintainers have the right and responsibility to remove, edit, or
41+
reject comments, commits, code, wiki edits, issues, and other contributions
42+
that are not aligned to this Code of Conduct, or to ban temporarily or
43+
permanently any contributor for other behaviors that they deem inappropriate,
44+
threatening, offensive, or harmful.
45+
46+
## Scope
47+
48+
This Code of Conduct applies both within project spaces and in public spaces
49+
when an individual is representing the project or its community. Examples of
50+
representing a project or community include using an official project e-mail
51+
address, posting via an official social media account, or acting as an appointed
52+
representative at an online or offline event. Representation of a project may be
53+
further defined and clarified by project maintainers.
54+
55+
## Enforcement
56+
57+
Instances of abusive, harassing, or otherwise unacceptable behavior may be
58+
reported by contacting the project team at [email protected]. All
59+
complaints will be reviewed and investigated and will result in a response that
60+
is deemed necessary and appropriate to the circumstances. The project team is
61+
obligated to maintain confidentiality with regard to the reporter of an incident.
62+
Further details of specific enforcement policies may be posted separately.
63+
64+
Project maintainers who do not follow or enforce the Code of Conduct in good
65+
faith may face temporary or permanent repercussions as determined by other
66+
members of the project's leadership.
67+
68+
## Attribution
69+
70+
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
71+
available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html
72+
73+
[homepage]: https://www.contributor-covenant.org
74+
75+
For answers to common questions about this code of conduct, see
76+
https://www.contributor-covenant.org/faq

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,9 +58,9 @@ Follow these [guidelines](https://github.com/cgre-aachen/gempy/blob/WIP_readme-u
5858

5959
## Publications using GemPy
6060

61-
* Güdük, N., de la Varga, M. Kaukolinna, J. and Wellmann, F. (in review). Model-Based Probabilistic Inversion Using Magnetic Data: A Case Study on the Kevitsa Deposit.
62-
* Schaaf, A., de la Varga, M., Wellmann, F., & Bond, C. E. (2020). [Constraining stochastic 3-D structural geological models with topology information using Approximate Bayesian Computation using GemPy 2.1](https://gmd.copernicus.org/preprints/gmd-2020-136/gmd-2020-136.pdf). Geoscientific Model Development Discussions, 1-24.
63-
* Stamm, F. A., de la Varga, M., and Wellmann, F. (2019). [Actors, actions, and uncertainties: optimizing decision-making based on 3-D structural geological models](https://se.copernicus.org/articles/10/2015/2019/se-10-2015-2019.html), Solid Earth, 10, 2015–2043.
61+
* Güdük, N.; de la Varga, M.; Kaukolinna, J.; Wellmann, F. (2021). [Model-Based Probabilistic Inversion Using Magnetic Data: A Case Study on the Kevitsa Deposit](https://doi.org/10.3390/geosciences11040150). Geosciences, 11, 150. https://doi.org/10.3390/geosciences11040150 (open access).
62+
* Schaaf, A., de la Varga, M., Wellmann, F., & Bond, C. E. (2020). [Constraining stochastic 3-D structural geological models with topology information using Approximate Bayesian Computation using GemPy 2.1](https://gmd.copernicus.org/preprints/gmd-2020-136/gmd-2020-136.pdf). Geoscientific Model Development Discussions, 1-24 (open access).
63+
* Stamm, F. A., de la Varga, M., and Wellmann, F. (2019). [Actors, actions, and uncertainties: optimizing decision-making based on 3-D structural geological models](https://se.copernicus.org/articles/10/2015/2019/se-10-2015-2019.html), Solid Earth, 10, 2015–2043 (open access).
6464
* Wellmann, F., Schaaf, A., de la Varga, M., & von Hagke, C. (2019). [From Google Earth to 3D Geology Problem 2: Seeing Below the Surface of the Digital Earth](
6565
https://www.sciencedirect.com/science/article/pii/B9780128140482000156).
6666
In Developments in Structural Geology and Tectonics (Vol. 5, pp. 189-204). Elsevier.

dev-requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
-r optional-requirements.txt
22

33
# This are additional libraries necessary to run sphinx and all the test
4-
sphinx
4+
sphinx==3.5.4
55
sphinx_gallery
66
emg3d==0.11.0
77
ipywidgets

docs/source/installation.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ Here, we provide advice that should use in most cases (but certainly not all):
121121

122122
``$ conda install theano``
123123

124-
If the installation fails at some point try to re-install anaconda for a single user (no administrator priveleges)
124+
If the installation fails at some point try to re-install anaconda for a single user (no administrator privileges)
125125
and with the Path Environment set.
126126
To use Theano with ``numpy version 1.16.0`` or following, it has to be updated to ``Theano 1.0.4`` using
127127

environment_conda.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
name: gempy
2+
channels:
3+
- conda-forge
4+
dependencies:
5+
- subsurface
6+
- geopandas
7+
- gempy

environment_pip.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
name: gempy
2+
channels:
3+
- conda-forge
4+
dependencies:
5+
- subsurface
6+
- geopandas
7+
- pip
8+
- pip:
9+
- gempy
10+
- pyqt5

examples/integrations/gempy_subsurface.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,10 @@
1010
import subsurface as sb
1111
from subsurface.reader import read_netcdf
1212

13-
data_url = "https://raw.githubusercontent.com/softwareunderground/subsurface/t21-main/examples/tutorials/wells_unstructured.nc"
13+
data_url = "https://raw.githubusercontent.com/softwareunderground/subsurface/main" \
14+
"/examples/tutorials/wells_unstructured.nc"
1415

15-
data_hash = '05198041f2bffcc03d138f7f2b1802657228725c4a895d819d4f5fbc0e9978ca'
16+
data_hash = "206290db4e563e379361725349ebf4a02628f4700d361599aedff37fab9cf5b9"
1617
borehole_unstructured_data_file = pooch.retrieve(url=data_url,
1718
known_hash=data_hash)
1819

examples/tutorials/ch1_fundamentals/ch1_1_basics.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
# - Additional data
3434
# - Faults
3535
#
36-
# We will see each of this class in further detail in the future.
36+
# We will see each of these classes in further detail in the future.
3737
#
3838
# Most of data can also be generated from raw data that comes in the form
3939
# of CSV-files (CSV = comma-separated values). Such files might be
@@ -42,13 +42,13 @@
4242
# Microsoft Excel or LibreOffice Calc.
4343
#
4444
# In this tutorial, all input data is created by importing such CSV-files.
45-
# These exemplary files can be found in the ``input_data`` folder in the
45+
# These example files can be found in the ``input_data`` folder in the
4646
# root folder of GemPy. The data comprises :math:`x`-, :math:`y`- and
4747
# :math:`z`-positional values for all surface points and orientation
4848
# measurements. For the latter, poles, azimuth and polarity are
4949
# additionally included. Surface points are furthermore assigned a
5050
# formation. This might be a lithological unit such as "Sandstone" or a
51-
# structural feature such as "Main Fault". It is decisive to remember
51+
# structural feature such as "Main Fault". It is important to remember
5252
# that, in GemPy, interface position points mark the **bottom** of a
5353
# layer. If such points are needed to resemble a top of a formation (e.g.
5454
# when modeling an intrusion), this can be achieved by defining a
@@ -119,13 +119,13 @@
119119
#
120120
# You can assign several surfaces to one series. The order of the units
121121
# within such as series is only relevant for the color code, thus we
122-
# recommend to be consistent. You can define this order via another
122+
# recommend being consistent. You can define this order via another
123123
# attribute "``order_formations``/ " or by using the specific command
124124
# ``set_order_formations``. (If the order of the pile differs from the
125125
# final result the color of the interfaces and input data will be
126126
# different.)
127127
#
128-
# Every fault is treated as an independent series and have to be at set at
128+
# Every fault is treated as an independent series and has to be at set at
129129
# the **top of the pile**. The relative order between the distinct faults
130130
# defines the tectonic relation between them (first entry is the
131131
# youngest).
@@ -189,7 +189,7 @@
189189
# Our model input data, here named "*geo\_model*", contains all the
190190
# information that is essential for the construction of our model. You can
191191
# access different types of information by using ``gp.get_data`` or simply
192-
# by accessiong the atrribues.
192+
# by accessiong the atrributes.
193193
#
194194
# We can, for example, return the coordinates of our modeling grid via:
195195
#
@@ -283,15 +283,15 @@
283283

284284
# %%
285285
# This function rescales the extent and coordinates of the original data
286-
# (and store it in the attribute ``geo_data_res`` which behaves as a usual
286+
# (and stores it in the attribute ``geo_data_res`` which behaves as a usual
287287
# ``InputData`` object) and adds mathematical parameters that are needed
288288
# for conducting the interpolation. The computation of this step may take
289289
# a while, as it also compiles a theano function which is required for the
290290
# model computation. However, should this not be needed, we can skip it by
291291
# declaring ``compile_theano = False`` in the function.
292292
#
293293
# Furthermore, this preparation process includes an assignment of numbers
294-
# to each formation. Note that GemPy's always creates a default basement
294+
# to each formation. Note that GemPy always creates a default basement
295295
# formation as the last formation number. Afterwards, numbers are
296296
# allocated from youngest to oldest as defined by the sequence of series
297297
# and formations. On the property ``formations`` on our interpolation
@@ -315,7 +315,7 @@
315315
# ``compute_model``. By default, this will return two separate solutions
316316
# in the form of arrays. The first gives information on the lithological
317317
# formations, the second on the fault network in the model. These arrays
318-
# consist of two subarrays as entries each:
318+
# consist of two subarrays as entries described here:
319319
#
320320
# 1. Lithology block model solution:
321321
#

0 commit comments

Comments
 (0)