Skip to content

Commit

Permalink
Update documentation.
Browse files Browse the repository at this point in the history
- Eliminate redundant line breaks in notebook output.
- Convert validation tests into examples, which can be refined later.
  • Loading branch information
ioannis-vm committed Dec 3, 2024
1 parent befdf19 commit 16df91e
Show file tree
Hide file tree
Showing 15 changed files with 291 additions and 1,826 deletions.
13 changes: 13 additions & 0 deletions doc/source/_static/hide_empty_pre.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
document.addEventListener("DOMContentLoaded", function() {
document.querySelectorAll('div.nboutput.docutils.container').forEach(function(div) {
// Our objective is to hide all `div` elements of which all
// children elements only contain whitespace.
// This remedies the nbsphinx issue where an extra newline was
// added to each line in the code block output.
let isEmpty = Array.from(div.children).every(child => !child.textContent.trim());

if (isEmpty) {
div.style.display = 'none';
}
});
});
1 change: 1 addition & 0 deletions doc/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@
html_static_path = ['_static']

html_css_files = ['css/custom.css']
html_js_files = ['hide_empty_pre.js']

# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
Expand Down
25 changes: 22 additions & 3 deletions doc/source/examples/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,17 @@ Complete list
| |assessment of a steel moment frame structure using the |
| |FEMA P-58 methodology. |
+-----------+---------------------------------------------------------+
|`E2`_ |Example of a simple assessment involving a single loss |
| |function. The example and associated input files can be |
| |easily extended to include more loss functions and input |
| |demands. |
+-----------+---------------------------------------------------------+
|`E3`_ |Example validating the estimated damage state |
| |probabilities of a single component. |
+-----------+---------------------------------------------------------+
|`E4`_ | |
| | |
+-----------+---------------------------------------------------------+

Grouped by feature
------------------
Expand All @@ -43,7 +54,7 @@ The following sections group the examples above based on the specific features t
+------------------------------------------------------+---------------------------------------------------------+
|Feature |Examples |
+======================================================+=========================================================+
|:ref:`Model calibration <fo_calibration>` |`E1`_ |
|:ref:`Model calibration <fo_calibration>` |`E1`_, `E2`_ |
+------------------------------------------------------+---------------------------------------------------------+
|:ref:`RID|PID inference <fo_pidrid>` |`E1`_ |
+------------------------------------------------------+---------------------------------------------------------+
Expand All @@ -56,9 +67,11 @@ The following sections group the examples above based on the specific features t
+------------------------------------------------------+---------------------------------------------------------+
|Feature |Examples |
+======================================================+=========================================================+
|:ref:`Loss maps <fo_loss_maps>` |`E1`_ |
|:ref:`Loss maps <fo_loss_maps>` |`E1`_, `E2`_ |
+------------------------------------------------------+---------------------------------------------------------+
|:ref:`Active decision variables <fo_active_dvs>` |`E1`_, `E2`_ |
+------------------------------------------------------+---------------------------------------------------------+
|:ref:`Active decision variables <fo_active_dvs>` |`E1`_ |
|:ref:`Loss functions <fo_loss_functions>` |`E2`_ |
+------------------------------------------------------+---------------------------------------------------------+
|:ref:`Loss aggregation <fo_loss_aggregation>` |`E1`_ |
+------------------------------------------------------+---------------------------------------------------------+
Expand All @@ -68,5 +81,11 @@ The following sections group the examples above based on the specific features t
:hidden:

notebooks/example_1.pct.py
notebooks/example_2.pct.py
notebooks/example_3.pct.py
notebooks/example_4.pct.py

.. _E1: notebooks/example_1.pct.py
.. _E2: notebooks/example_2.pct.py
.. _E3: notebooks/example_3.pct.py
.. _E4: notebooks/example_4.pct.py
Loading

0 comments on commit 16df91e

Please sign in to comment.