Skip to content

Commit be804c7

Browse files
committed
2 parents 43a0e60 + 5c47ef6 commit be804c7

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

62 files changed

+2606
-480
lines changed
Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,14 @@
11
name: Build documentation and deploy
22

33
on:
4-
release:
5-
types: [edited, created]
4+
push:
65

76
jobs:
87
documentation:
98
runs-on: ubuntu-latest
109
steps:
1110
- uses: actions/checkout@v2
12-
- uses: conda-incubator/setup-miniconda@v2.0.0
11+
- uses: conda-incubator/setup-miniconda@v2.1.1
1312
with:
1413
auto-activate-base: true
1514
installer-url: https://github.com/conda-forge/miniforge/releases/download/4.10.1-0/Miniforge-pypy3-4.10.1-0-Linux-x86_64.sh
@@ -20,14 +19,8 @@ jobs:
2019
env:
2120
ANACONDA_API_TOKEN: ${{ secrets.ANACONDA_TOKEN }}
2221
run: |
23-
conda install -c conda-forge theano cython numpy pandas imageio scipy matplotlib sphinx=3.5.4 sphinx-gallery sphinxcontrib-bibtex sphinx_rtd_theme myst-parser scikit-learn scikit-image pyamg flake8 pytest networkx -y
22+
conda install -c conda-forge theano cython numpy pandas imageio scipy matplotlib sphinx sphinx-gallery sphinxcontrib-bibtex pydata-sphinx-theme myst-parser scikit-learn scikit-image pyamg flake8 pytest networkx python=3.9 -y
2423
pip install lavavu-osmesa
2524
python setup.py install build_ext --inplace
2625
cd docs
27-
make html
28-
29-
- name: Deploy 🚀
30-
uses: JamesIves/github-pages-deploy-action@4.1.3
31-
with:
32-
branch: gh-pages # The branch the action should deploy to.
33-
folder: docs/build/html # The folder the action should deploy.
26+
make html

.github/workflows/release-please.yml

Lines changed: 46 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,51 @@ on:
44
- master
55
name: release-please
66
jobs:
7+
continuous-integration:
8+
name: Continuous integration ${{ matrix.os }} python ${{ matrix.python-version }}
9+
runs-on: ${{ matrix.os }}
10+
strategy:
11+
fail-fast: false
12+
matrix:
13+
os: ["ubuntu-latest", "windows-latest"] #"macos-latest",
14+
python-version: ["3.7","3.8","3.9"]
15+
steps:
16+
- uses: actions/checkout@v2
17+
- uses: conda-incubator/setup-miniconda@v2
18+
with:
19+
python-version: ${{ matrix.python }}
20+
- name: Installing dependencies
21+
shell: bash -l {0}
22+
run: |
23+
conda install -c conda-forge cython numpy scipy scikit-image scikit-learn pyamg flake8 pytest networkx osqp numba statsmodels scikit-fmm matplotlib -y
24+
- name: Checking formatting of code
25+
shell: bash -l {0}
26+
run: |
27+
# stop the build if there are Python syntax errors or undefined names
28+
flake8 LoopStructural --count --select=E9,F63,F7,F82 --show-source --statistics
29+
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
30+
flake8 LoopStructural --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
31+
- name: Building and install
32+
shell: bash -l {0}
33+
run: |
34+
pip install .
35+
- name: pytest
36+
shell: bash -l {0}
37+
run: |
38+
pytest
39+
documentation-test:
40+
runs-on: ubuntu-latest
41+
#needs: continuous-integration
42+
steps:
43+
- uses: actions/checkout@v2
44+
- run: |
45+
docker build . -t=lsdocs -f docs/Dockerfile
46+
docker run -v $(pwd):/LoopStructural lsdocs bash LoopStructural/docs/build_docs.sh
47+
48+
749
release-please:
850
runs-on: ubuntu-latest
51+
needs: documentation-test
952
steps:
1053
- uses: GoogleCloudPlatform/release-please-action@v2
1154
id: release
@@ -21,22 +64,9 @@ jobs:
2164
if: ${{ needs.release-please.outputs.release_created }}
2265
steps:
2366
- uses: actions/checkout@v2
24-
- uses: conda-incubator/setup-miniconda@v2.0.0
25-
with:
26-
auto-activate-base: true
27-
installer-url: https://github.com/conda-forge/miniforge/releases/download/4.10.1-0/Miniforge-pypy3-4.10.1-0-Linux-x86_64.sh
28-
channels: anaconda,conda-forge,loop3d,conda-forge/label/cf202003
29-
python-version: 3.8
30-
- name: Build documentation
31-
shell: bash -l {0}
32-
env:
33-
ANACONDA_API_TOKEN: ${{ secrets.ANACONDA_TOKEN }}
34-
run: |
35-
conda install -c conda-forge theano cython numpy pandas imageio scipy matplotlib sphinx sphinx-gallery sphinxcontrib-bibtex sphinx_rtd_theme myst-parser scikit-learn scikit-image pyamg flake8 pytest networkx python=3.9 -y
36-
pip install lavavu-osmesa
37-
python setup.py install build_ext --inplace
38-
cd docs
39-
make html
67+
- run: |
68+
docker build . -t=lsdocs -f docs/Dockerfile
69+
docker run -v $(pwd):/LoopStructural lsdocs bash LoopStructural/docs/build_docs.sh
4070
- name: Deploy 🚀
4171
uses: JamesIves/github-pages-deploy-action@4.1.3
4272
with:

.github/workflows/windows_CI.yml

Lines changed: 0 additions & 36 deletions
This file was deleted.

CHANGELOG.md

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,63 @@
11
# Changelog
22

3+
### [1.4.10](https://www.github.com/Loop3D/LoopStructural/compare/v1.4.9...v1.4.10) (2022-07-20)
4+
5+
6+
### Bug Fixes
7+
8+
* :bug: unconformities weren't working. ([304335d](https://www.github.com/Loop3D/LoopStructural/commit/304335d0421297ca026fa26a2e6fed2e4c16332b))
9+
* adding loopjson encoder ([ec1b84e](https://www.github.com/Loop3D/LoopStructural/commit/ec1b84e7881977d7ec1fec7ecf00b45770f5d832))
10+
* adding more informative errors to p2 tetra ([c63cae7](https://www.github.com/Loop3D/LoopStructural/commit/c63cae7e9c03be10b566d4b5b85987956d164a78))
11+
* adding python alternatives for cg and fold cg ([5ffef3b](https://www.github.com/Loop3D/LoopStructural/commit/5ffef3b482e1fedaaf2ec6a6c8c44a392d6def6f))
12+
* catch all exceptions, raise import ([a071416](https://www.github.com/Loop3D/LoopStructural/commit/a071416cb602db135c9fa9d67d99ceb79ddb0407))
13+
* catch dfi import error ([f9c8aa0](https://www.github.com/Loop3D/LoopStructural/commit/f9c8aa0b04996dd5ad887871b950b2851c4310bb))
14+
* catch modulenotfound raise importerror ([836ee84](https://www.github.com/Loop3D/LoopStructural/commit/836ee843f418956fc9bd578868030eba537960e2))
15+
* don't add unconformity if base feature is None ([be4d8ac](https://www.github.com/Loop3D/LoopStructural/commit/be4d8ac220d1fe9a58738652ccf823631cab607e))
16+
* faults enabled bug, ~ does not flip boolean, changing to not ([0c68788](https://www.github.com/Loop3D/LoopStructural/commit/0c6878837e8eeb24b2ca9009cced0a8ecb6750ac))
17+
* feature type enums renaming ([616b554](https://www.github.com/Loop3D/LoopStructural/commit/616b55440944055d284484381ace2d068e5259c1))
18+
* featuretype enum ([c256746](https://www.github.com/Loop3D/LoopStructural/commit/c2567465855b9a8ae6a97c1ded5972ec18a89b30))
19+
* fold cg ([a35f41a](https://www.github.com/Loop3D/LoopStructural/commit/a35f41a0a1f2be50e9d15ae8d4e2d92877526eff))
20+
* lavavu.camera bug when keys are missing ([b554c3c](https://www.github.com/Loop3D/LoopStructural/commit/b554c3c143b27e592672f87d1982ae455779aade))
21+
* missing enum ([bc34bb4](https://www.github.com/Loop3D/LoopStructural/commit/bc34bb4e8cb07a006529c26a7982b3e2b3ea0241))
22+
* model plotter uses BaseFeature to check type ([a2bd0f0](https://www.github.com/Loop3D/LoopStructural/commit/a2bd0f01a7c297ecf01fc0c612dc0d123ac16702))
23+
* pli import is optional ([6347742](https://www.github.com/Loop3D/LoopStructural/commit/6347742847460821a11ce840af51972f0b5df43b))
24+
* raise error if cython can't be imported ([f5b82eb](https://www.github.com/Loop3D/LoopStructural/commit/f5b82ebf96e7b93052693f99af783ea18511aa48))
25+
* recursive error fix ([f3180f3](https://www.github.com/Loop3D/LoopStructural/commit/f3180f3beaae36a424be1de7f2512800fbe39022))
26+
* renaming enums to be consistent with calls ([57ed443](https://www.github.com/Loop3D/LoopStructural/commit/57ed44349c5b8f04e967d049f55aa35f1440e324))
27+
* unconformities causing nan slicing due to recurvsive error ([728fc5f](https://www.github.com/Loop3D/LoopStructural/commit/728fc5f053345ae6901631bf60bd1d2457574d66))
28+
29+
30+
### Documentation
31+
32+
* :memo: added example for plotting unconformities ([bad53a0](https://www.github.com/Loop3D/LoopStructural/commit/bad53a01e21e39dcdbdc3a5c218e9c9957050f9b))
33+
* fixing new documentation so that data can be loaded ([7ac5a0d](https://www.github.com/Loop3D/LoopStructural/commit/7ac5a0d1752c6aad2e8f5112ec4d6efeaa93dd20))
34+
* missing variable ([7df88a2](https://www.github.com/Loop3D/LoopStructural/commit/7df88a2111c259de367b734a095452a747b8a019))
35+
* renaming cython to _cython so its not included in docs ([27e88a1](https://www.github.com/Loop3D/LoopStructural/commit/27e88a1d4f3c8f3461481972fc1b13fda7513f0d))
36+
* trying to ignore cython ([6582d0c](https://www.github.com/Loop3D/LoopStructural/commit/6582d0c8381588e8f59c623641c7d8ce451891fc))
37+
* updating documentation ([493beea](https://www.github.com/Loop3D/LoopStructural/commit/493beeac3ade0b35c49895d91c64aa8926d9a3b7))
38+
* using docker to build docs ([f499aae](https://www.github.com/Loop3D/LoopStructural/commit/f499aae76107e09e15d2b9ce56e75fa9b2e0560b))
39+
40+
### [1.4.9](https://www.github.com/Loop3D/LoopStructural/compare/v1.4.8...v1.4.9) (2022-05-05)
41+
42+
43+
### Documentation
44+
45+
* fixing docs ci ([2e0d472](https://www.github.com/Loop3D/LoopStructural/commit/2e0d47292ccc20c071256cbb51ac8736c6851f9e))
46+
47+
### [1.4.8](https://www.github.com/Loop3D/LoopStructural/compare/v1.4.7...v1.4.8) (2022-05-05)
48+
49+
50+
### Bug Fixes
51+
52+
* :bug: faults where feature name given not fault_name were crashing ([dae9e92](https://www.github.com/Loop3D/LoopStructural/commit/dae9e92f4b2f94ebcaefe85dfc419bfdef69b43a))
53+
54+
55+
### Documentation
56+
57+
* adding geopandas to doc test ([b6613a9](https://www.github.com/Loop3D/LoopStructural/commit/b6613a91fd158405ac01d8c9675618bcb6e6af12))
58+
* fixing fault network example ([6f4f2fc](https://www.github.com/Loop3D/LoopStructural/commit/6f4f2fcba8e1e708c17acfa569d6592f0a33c9d6))
59+
* refactoring documentation + adding new example ([d15ba6c](https://www.github.com/Loop3D/LoopStructural/commit/d15ba6c391af889e0a0e57f4eced126fe6521461))
60+
361
### [1.4.7](https://www.github.com/Loop3D/LoopStructural/compare/v1.4.6...v1.4.7) (2022-05-04)
462

563

LoopStructural/analysis/_fault_intersection.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
from skimage.measure import marching_cubes
22
import pandas as pd
33
import numpy as np
4+
from LoopStructural.modelling.features import FeatureType
45

56
from LoopStructural.utils import getLogger
67

@@ -26,7 +27,7 @@ def calculate_fault_intersections(model, threshold=0.001):
2627
"""
2728
fault_names = []
2829
for f in model.features:
29-
if f.type == "fault":
30+
if f.type == FeatureType.FAULT:
3031
fault_names.append(f.name)
3132
fault_matrix = pd.DataFrame(columns=fault_names)
3233
for f in fault_names:

LoopStructural/datasets/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,3 +17,4 @@
1717
from ._base import load_unconformity
1818
from ._base import load_duplex
1919
from ._base import load_tabular_intrusion
20+
from ._base import load_geological_map_data

LoopStructural/datasets/_base.py

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,3 +157,71 @@ def load_tabular_intrusion():
157157
data = pd.read_csv(join(module_path, Path("data/tabular_intrusion.csv")))
158158
bb = np.array([[0, 0, 0], [5, 5, 5]])
159159
return data, bb
160+
161+
162+
def load_geological_map_data():
163+
module_path = dirname(__file__)
164+
contacts = pd.read_csv(
165+
join(module_path, Path("data/geological_map_data/contacts.csv"))
166+
)
167+
stratigraphic_orientations = pd.read_csv(
168+
join(
169+
module_path, Path("data/geological_map_data/stratigraphic_orientations.csv")
170+
)
171+
)
172+
stratigraphic_thickness = pd.read_csv(
173+
join(module_path, Path("data/geological_map_data/stratigraphic_thickness.csv")),
174+
skiprows=1,
175+
names=["name", "thickness"],
176+
)
177+
stratigraphic_order = pd.read_csv(
178+
join(module_path, Path("data/geological_map_data/stratigraphic_order.csv")),
179+
skiprows=1,
180+
names=["order", "unit name"],
181+
)
182+
bbox = pd.read_csv(
183+
join(module_path, Path("data/geological_map_data/bbox.csv")),
184+
index_col=0,
185+
header=None,
186+
names=["X", "Y", "Z"],
187+
)
188+
fault_properties = pd.read_csv(
189+
join(module_path, Path("data/geological_map_data/fault_displacement.csv")),
190+
index_col=0,
191+
)
192+
fault_edges = []
193+
with open(
194+
join(module_path, Path("data/geological_map_data/fault_edges.txt")), "r"
195+
) as f:
196+
for l in f.read().split("\n"):
197+
faults = l.split(",")
198+
if len(faults) == 2:
199+
fault_edges.append((faults[0], faults[1]))
200+
fault_locations = pd.read_csv(
201+
join(module_path, Path("data/geological_map_data/fault_locations.csv"))
202+
)
203+
fault_orientations = pd.read_csv(
204+
join(module_path, Path("data/geological_map_data/fault_orientations.csv"))
205+
)
206+
return (
207+
contacts,
208+
stratigraphic_orientations,
209+
stratigraphic_thickness,
210+
stratigraphic_order,
211+
bbox,
212+
fault_locations,
213+
fault_orientations,
214+
fault_properties,
215+
fault_edges,
216+
)
217+
218+
219+
def load_fault_trace():
220+
import geopandas
221+
222+
module_path = dirname(__file__)
223+
224+
fault_trace = geopandas.read_file(
225+
join(module_path, Path("data/fault_trace/fault_trace.shp"))
226+
)
227+
return fault_trace

0 commit comments

Comments
 (0)