Skip to content

Commit

Permalink
docs: refactoring documentation + adding new example
Browse files Browse the repository at this point in the history
  • Loading branch information
Lachlan Grose committed May 5, 2022
1 parent dae9e92 commit d15ba6c
Show file tree
Hide file tree
Showing 20 changed files with 1,224 additions and 18 deletions.
15 changes: 4 additions & 11 deletions .github/workflows/documentation.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
name: Build documentation and deploy

on:
release:
types: [edited, created]
push:

jobs:
documentation:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: conda-incubator/setup-miniconda@v2.0.0
- uses: conda-incubator/setup-miniconda@v2.1.1
with:
auto-activate-base: true
installer-url: https://github.com/conda-forge/miniforge/releases/download/4.10.1-0/Miniforge-pypy3-4.10.1-0-Linux-x86_64.sh
Expand All @@ -20,14 +19,8 @@ jobs:
env:
ANACONDA_API_TOKEN: ${{ secrets.ANACONDA_TOKEN }}
run: |
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
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
pip install lavavu-osmesa
python setup.py install build_ext --inplace
cd docs
make html
- name: Deploy 🚀
uses: JamesIves/github-pages-deploy-action@4.1.3
with:
branch: gh-pages # The branch the action should deploy to.
folder: docs/build/html # The folder the action should deploy.
make html
20 changes: 20 additions & 0 deletions .github/workflows/windows_CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,3 +34,23 @@ jobs:
shell: bash -l {0}
run: |
pytest
documentation:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: conda-incubator/setup-miniconda@v2.1.1
with:
auto-activate-base: true
installer-url: https://github.com/conda-forge/miniforge/releases/download/4.10.1-0/Miniforge-pypy3-4.10.1-0-Linux-x86_64.sh
channels: anaconda,conda-forge,loop3d,conda-forge/label/cf202003
python-version: 3.8
- name: Build documentation
shell: bash -l {0}
env:
ANACONDA_API_TOKEN: ${{ secrets.ANACONDA_TOKEN }}
run: |
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
pip install lavavu-osmesa
python setup.py install build_ext --inplace
cd docs
make html
21 changes: 17 additions & 4 deletions LoopStructural/modelling/input/process_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ def __init__(
self.fault_properties = fault_properties
elif fault_locations is not None:
self.fault_properties = pd.DataFrame(
fault_locations["fault_name"].unique(), columns=["name"]
fault_locations["feature_name"].unique(), columns=["name"]
).set_index("name")

if fault_edges is not None and fault_edge_properties is not None:
Expand Down Expand Up @@ -619,10 +619,15 @@ def fault_orientations(self, fault_orientations):
fault_orientations[["gx", "gy", "gz"]] = strike_dip_vector(
fault_orientations["strike"], fault_orientations["dip"]
)
if "feature_name" not in fault_orientations.columns and "fault_name" in fault_orientations.columns:
if (
"feature_name" not in fault_orientations.columns
and "fault_name" in fault_orientations.columns
):
fault_orientations["feature_name"] = fault_orientations["fault_name"]
if "feature_name" not in fault_orientations.columns:
raise ValueError("Fault orientation data must contain feature_name or fault_name")
raise ValueError(
"Fault orientation data must contain feature_name or fault_name"
)
self._fault_orientations = fault_orientations[
["X", "Y", "Z", "gx", "gy", "gz", "coord", "feature_name"]
]
Expand All @@ -645,7 +650,15 @@ def fault_locations(self, fault_locations):
fault_locations = fault_locations.copy()
fault_locations["coord"] = 0
fault_locations["val"] = 0
fault_locations["feature_name"] = fault_locations["fault_name"]
if (
"feature_name" not in fault_locations.columns
and "fault_name" in fault_locations.columns
):
fault_locations["feature_name"] = fault_locations["fault_name"]
if "feature_name" not in fault_locations.columns:
raise ValueError(
"Fault location data must contain feature_name or fault_name"
)
self._fault_locations = fault_locations[
["X", "Y", "Z", "val", "feature_name", "coord"]
]
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Getting Started

installation
background
auto_examples/index
contributors_guide
about
contributors_guide
loopstructural_design
CHANGELOG
File renamed without changes.
2 changes: 1 addition & 1 deletion docs/source/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ and a wrapper for the generalised radial basis functions provided by Surfe :cite
.. toctree::
:hidden:

getting_started
getting_started/index
auto_examples/index
user_guide/index

Expand Down
2 changes: 2 additions & 0 deletions examples/4_advanced/bbox.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
origin, 519572.569,7489723.89,-4800.0
maximum,551978.745,7516341.01,1200.0

0 comments on commit d15ba6c

Please sign in to comment.