Skip to content

Commit fe6c88b

Browse files
author
Fahrettin Kuran
committed
docs: add auxiliary example notebooks and revise structure
1 parent 9181b5c commit fe6c88b

21 files changed

Lines changed: 166223 additions & 245 deletions

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ instance/
6969
.scrapy
7070

7171
# Sphinx documentation
72-
docs/_build/
72+
doc/_build/
7373

7474
# PyBuilder
7575
.pybuilder/
@@ -135,6 +135,7 @@ venv/
135135
ENV/
136136
env.bak/
137137
venv.bak/
138+
quaket_env/
138139

139140
# Spyder project settings
140141
.spyderproject

doc/conf.py

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,26 +11,34 @@
1111
author = 'GEM Foundation and Électricité de France'
1212
release = '0.1'
1313

14-
1514
# -- General configuration ---------------------------------------------------
1615
# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration
1716

17+
import os
18+
import sys
19+
import shutil
20+
1821
extensions = [
1922
'sphinx.ext.todo',
2023
'sphinx.ext.coverage',
2124
'sphinx.ext.mathjax',
2225
'sphinx.ext.viewcode',
2326
'sphinx.ext.githubpages',
24-
'recommonmark',
25-
'nbsphinx'
27+
'sphinx_rtd_theme',
28+
'myst_parser',
29+
'nbsphinx',
30+
'nbsphinx_link',
2631
]
2732

33+
nbsphinx_allow_errors = True
34+
nbsphinx_execute = 'never'
35+
2836
templates_path = ['_templates']
29-
exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store']
37+
exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store', '**.ipynb_checkpoints']
3038

3139

3240
# -- Options for HTML output -------------------------------------------------
3341
# https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output
3442

35-
html_theme = 'sphinx_rtd_theme'
43+
html_theme = "sphinx_rtd_theme"
3644
#html_static_path = ['_static']

doc/contents/auxiliary.rst

Lines changed: 19 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -1,51 +1,27 @@
1-
Auxiliary module
1+
Auxiliary Module
22
################################
33

4-
The :index:`auxiliary` module contains functionalities for preparing input and processing outputs of various simulations.
4+
The :index:`auxiliary` module contains corollary functions that support the capabilities of the
5+
platform's core modules (e.g., the source, ground-motion, and site-response modules).
6+
This module, therefore, acts as a bridge between raw data and the functions available in the simulation platform
7+
by supporting I/O tools, statistical analysis, visualisation, and data management.
58

6-
In particular, it provides:
9+
Currently, the Auxiliary Module includes functions underpinning the Seismic Source Module
10+
and its associated case study.
711

8-
- Tools for preparing the input to MCQsim and post-processing the output.
12+
However, as the project will progress to ground motion and site modules, new functionalities
13+
will be integrated into this framework. Consequently, this task will remain active throughout
14+
the project, enabling continuous updates and refinements in response to the platform's evolving
15+
requirements.
916

10-
Pre-simulation
11-
*********************************************
17+
To ensure a structured development process, the module is, for time being, subdivided into
18+
three primary sub-sections: catalogue processing, statistical tools - plotting, and spatial
19+
distributions.
1220

13-
The pre-simulation tool focuses on preparing and managing input information.
14-
Its core functionalities include:
21+
Tutorial Contents
22+
-----------------
1523

16-
- **Fault information management**:
17-
Import and modify fault segment data stored in GeoJSON format, including geometrical and attribute handling;
18-
19-
- **Geometry validation**:
20-
Check and validate the geometric consistency of fault segments to ensure accurate meshing and simulation;
21-
22-
- **Triangular meshing**:
23-
Generate triangular meshes based on the fault geometry, enabling detailed structural representation;
24-
25-
- **STL file creation**:
26-
Convert the meshed fault segments into STL (Stereolithography or Standard Triangle Language) file format,
27-
suitable for 3D visualization and numerical simulations;
28-
29-
30-
Post simulation
31-
*********************************************
32-
33-
The post-simulation tool focuses on processing output results.
34-
Its core functionalities include:
35-
36-
- **Catalog processing**:
37-
Load catalogue as a `.mat` file and save it as a `.csv` file;
38-
39-
- **Statistical evaluation**:
40-
Compute statistics for magnitude, rupture area, mean slip, and mean stress drop;
41-
42-
- **3D spatial visualization**:
43-
Visualize spatial distribution of events;
44-
45-
- **Magnitude-frequency distribution (MFD)**:
46-
Generate MFDs of the simulated earthquake catalogue;
47-
48-
49-
PSHA
50-
*********************************************
24+
.. toctree::
25+
:maxdepth: 1
5126

27+
ses_processing

doc/contents/case.rst

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

doc/contents/gmc.rst

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
1-
Ground motion module
1+
Ground Motion Module
22
################################
33

44
The *ground motion module* will contain functionalities for computing ground motion parameters
55
using ground-motion models (GMMs) implemented into the OQ Engine.
66

77

8+
In progress..
9+
10+
811

912

doc/contents/installation.rst

Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
Installation
2+
################################
3+
4+
This guide covers the necessary steps to set up your environment for the **Simulation Platform**. You will need to install Python dependencies and system-level tools like the Generic Mapping Tools (GMT).
5+
Also, the tutorials rely on the **OpenQuake Model Building Toolkit (oq-mbtk)** for seismic catalogue processing and statistical analysis. Before proceeding, you must have ``oq-mbtk`` installed.
6+
7+
Here we demonstrate the installation of the QuakeT and its necessary dependencies, respectively.
8+
9+
Get the QuakeT Source Code
10+
==========================
11+
12+
Open a terminal and move to the folder where you intend to install the tools;
13+
14+
Clone the repository using the `web URL of QuakeT repository: <https://github.com/GEMScienceTools/quakeT.git>`_
15+
16+
.. code-block:: bash
17+
18+
git clone https://github.com/GEMScienceTools/quakeT.git
19+
20+
Go to the folder where you cloned the QuakeT repository and make it in “editable” mod running the following command:
21+
22+
.. code-block:: bash
23+
24+
pip install -e .
25+
26+
OpenQuake MBTK Setup
27+
========================
28+
Please follow the official installation instructions of **oq-mbtk** here:
29+
`OpenQuake MBTK Installation Guide. <https://gemsciencetools.github.io/oq-mbtk/contents/installation.html>`_
30+
31+
Python Environment Setup
32+
========================
33+
34+
It is highly recommended to use a virtual environment (conda or venv) to avoid dependency conflicts.
35+
36+
.. code-block:: bash
37+
38+
# Create and activate a virtual environment (optional)
39+
python -m venv quaket_env
40+
source quaket_env/bin/activate # On Windows: quaket_env\Scripts\activate
41+
42+
# Install Python libraries
43+
pip install pandas geopandas shapely matplotlib ipython
44+
45+
System Requirements
46+
===================
47+
48+
The spatial distribution tutorials require **GMT** to be installed on your operating system.
49+
50+
macOS
51+
-----
52+
53+
The easiest way to install these tools on macOS is using `Homebrew <https://brew.sh/>`_:
54+
55+
.. code-block:: bash
56+
57+
brew install gmt
58+
59+
Windows
60+
-------
61+
62+
1. **GMT:** Download and run the executable installer (.exe) from the `GMT Official Releases <https://www.generic-mapping-tools.org/download/>`_. During installation, ensure you check the box **"Add GMT to the system PATH"**.
63+
2. **Ghostscript:** (Required by GMT for PNG output) Download and install from the `Ghostscript site <https://ghostscript.com/releases/gsdnld.html>`_.
64+
65+
Linux
66+
-------
67+
68+
Use the package manager to install the required tools:
69+
70+
.. code-block:: bash
71+
72+
sudo apt update
73+
sudo apt install gmt gmt-dcw gmt-gshhg
74+
75+
Verification
76+
============
77+
78+
After installation, verify that the tools are correctly set up by running these commands in your terminal or command prompt:
79+
80+
.. code-block:: bash
81+
82+
gmt --version
83+
84+
.. note::
85+
If you receive a "command not found" error, you may need to restart your terminal or manually add the installation folders to your system's Environment Variables (PATH).

doc/contents/ses_processing.nblink

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"path": "../../openquake/quaket/auxiliary/ses_processing.ipynb"
3+
}

doc/contents/site.rst

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
1-
Site and site-effects module
1+
Site and Site-Effects Module
22
################################
33

44
Within the *site and site-effects module*, functionalities will be developed for modelling the site response.
55

66

7+
In progress..
8+
9+
10+
711

doc/contents/ssc.rst

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
1-
Seismic source module
1+
Seismic Source Module
22
################################
33

44
The *seismic source module* will contain codes for evaluating models related to seismic sources.
55

66

7+
In progress..
8+
9+
10+
711

doc/contents/tutorials.rst

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

0 commit comments

Comments
 (0)