Skip to content

Commit 7ea72b5

Browse files
authored
Merge pull request #243 from Computer-Aided-Validation-Laboratory/dic-guide
Doc Improvements
2 parents fc39a3f + 7cbff5a commit 7ea72b5

64 files changed

Lines changed: 1447 additions & 248 deletions

Some content is hidden

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

docs/apidoc.sh

Lines changed: 80 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
set -e
1+
#!/usr/bin/env bash
2+
set -e
23
set -o pipefail
34

45
echo "=========================================="
@@ -11,23 +12,16 @@ error_exit() {
1112
exit 1
1213
}
1314

14-
# Generate the python API documentation
15+
# Python API documentation
1516
sphinx-apidoc -f -o ./source --separate ../src/pyvale/ ../src/pyvale/data/* ../src/pyvale/examples/* || error_exit "sphinx-apidoc failed"
1617

1718
# Remove autogenerated TOC file
1819
rm -f source/modules.rst || error_exit "Failed to remove modules.rst"
1920

20-
# Generate the C++ API documentation
21-
( cd ./source && doxygen Doxyfile ) || error_exit "doxygen generation failed"
22-
2321
echo "Updating generated RST files..."
2422

25-
# Change title for dataset file
26-
# sed -i '0,/pyvale.dataset/s/pyvale.dataset/pyvale.dataset/' source/pyvale.dataset.rst || error_exit "Failed to update dataset title"
27-
# sed -i '0,/dataset.dataset/s/dataset.dataset/pyvale.dataset/' source/pyvale.dataset.dataset.rst || error_exit "Failed to update dataset title"
28-
2923
# Modules to process
30-
modules=("dic" "blender" "mooseherder" "sensorsim" "verif" "dataset")
24+
modules=("dic" "blender" "mooseherder" "sensorsim" "verif" "dataset" "strain")
3125

3226
for mod in "${modules[@]}"; do
3327
rst="source/pyvale.${mod}.rst"
@@ -59,3 +53,79 @@ rm -f ./source/pyvale.dic.dic2dcpp.rst || error_exit "Failed to remove dic2dcpp.
5953

6054
echo "PYTHON API DOCUMENTATION GENERATED SUCCESSFULLY!"
6155

56+
# ------------------------------------------------------------------
57+
# Generate C++ API documentation
58+
# ------------------------------------------------------------------
59+
echo "=========================================="
60+
echo " GENERATING C++ API DOCUMENTATION..."
61+
echo "=========================================="
62+
63+
# Run Doxygen (optional, if you still want it)
64+
( cd ./source && doxygen Doxyfile ) || error_exit "doxygen generation failed"
65+
66+
# Create RST files for each C++ header
67+
for mod in "${modules[@]}"; do
68+
src_dir="../src/pyvale/${mod}/cpp"
69+
out_dir="source/cpp/${mod}"
70+
71+
mkdir -p "$out_dir"
72+
73+
for file in "$src_dir"/*.hpp; do
74+
[ -e "$file" ] || continue
75+
76+
filename=$(basename "$file")
77+
base="${filename%.hpp}"
78+
rst_file="${out_dir}/${base}.rst"
79+
80+
echo "Generating $rst_file"
81+
82+
cat > "$rst_file" <<EOF
83+
${filename}
84+
==================
85+
86+
.. doxygenfile:: ${filename}
87+
:project: pyvale
88+
:path: ${src_dir}
89+
EOF
90+
done
91+
done
92+
93+
# ------------------------------------------------------------------
94+
# Generate module-level index RST files for C++ headers
95+
# ------------------------------------------------------------------
96+
for mod in "${modules[@]}"; do
97+
out_dir="source/cpp/${mod}"
98+
index_file="source/cpp/cpp_${mod}.rst"
99+
100+
headers=""
101+
for f in "$out_dir"/*.rst; do
102+
[ -e "$f" ] || continue # skip if no files
103+
headers="$headers $(basename "$f")"
104+
done
105+
106+
# Skip if no headers found
107+
[ -z "$headers" ] && continue
108+
109+
# Sort headers alphabetically
110+
headers=$(echo $headers | tr ' ' '\n' | sort)
111+
112+
echo "Generating module index $index_file"
113+
114+
{
115+
echo "${mod}"
116+
echo "=================="
117+
echo ""
118+
echo ".. toctree::"
119+
echo " :caption: C++ Source Files"
120+
echo " :maxdepth: 1"
121+
echo ""
122+
for h in $headers; do
123+
echo " ${mod}/${h}"
124+
done
125+
} > "$index_file"
126+
done
127+
128+
129+
130+
echo "C++ RST FILES GENERATED SUCCESSFULLY!"
131+

docs/requirements.txt

Lines changed: 18 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,35 @@
1-
# --- Core Sphinx Builder ---
1+
# Core Stuff
22
sphinx
3-
babel # For language support/i18n
4-
docutils # For RST parsing (fundamental)
5-
imagesize # For image dimension handling
6-
pygments # For code highlighting
7-
snowballstemmer # For search indexing (used by epub3 builder)
3+
babel
4+
docutils
5+
imagesize
6+
pygments
7+
snowballstemmer
8+
breathe
89

9-
# --- Theme and Parser ---
10+
# Theme
1011
furo
1112
alabaster
1213
myst-parser
1314

14-
# --- Sphinx Extensions (Directly Listed in conf.py) ---
15+
# nice formatting stuff
1516
sphinx-codeautolink
1617
sphinx-copybutton
17-
breathe # For C++ documentation integration
18-
sphinx-gallery # For example gallery generation
18+
sphinx-gallery
19+
sphinx-design
20+
sphinx-autodoc-typehints
21+
ipywidgets
22+
matplotlib
23+
pillow
1924

20-
# --- Extension Dependencies ---
21-
sphinx-autodoc-typehints # You use 'autodoc' which benefits from this
22-
ipywidgets # Often required by sphinx-gallery examples (e.g., matplotlib output)
23-
matplotlib # Required for plotting in sphinx-gallery examples
24-
pillow # Required for various image/gallery operations
25-
26-
# --- Specific sphinxcontrib Extensions (Explicitly added to resolve previous errors) ---
27-
sphinxcontrib-applehelp # Needed if the epub3 builder triggers it (which is common)
25+
sphinxcontrib-applehelp
2826
sphinxcontrib-devhelp
2927
sphinxcontrib-htmlhelp
3028
sphinxcontrib-jsmath
31-
sphinxcontrib-qthelp # Added proactively for completeness
29+
sphinxcontrib-qthelp
3230
sphinxcontrib-serializinghtml
3331

34-
# --- Your Project Dependencies (From your original list) ---
32+
# other random stuff
3533
certifi
3634
idna
3735
jinja2

docs/source/Doxyfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -943,7 +943,7 @@ WARN_LOGFILE =
943943
# spaces. See also FILE_PATTERNS and EXTENSION_MAPPING
944944
# Note: If this tag is empty the current directory is searched.
945945

946-
INPUT = ../../src/pyvale/dic/cpp
946+
INPUT = ../../src/pyvale/dic/cpp ../../src/pyvale/strain/cpp
947947

948948
# This tag can be used to specify the character encoding of the source files
949949
# that doxygen parses. Internally doxygen uses the UTF-8 encoding. Doxygen uses

docs/source/_static/custom.css

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,7 @@
99
color: #0066cc !important; /* Monokai-style cyan */
1010
}
1111

12+
.code-scroll {
13+
max-height: 400px;
14+
overflow: auto;
15+
}

docs/source/_static/hrdic.png

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../../../images/hrdic.png

docs/source/api_cpp.rst

Lines changed: 3 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -2,21 +2,9 @@ Detailed C++ API
22
=================
33

44

5-
Digital Image Correlation
6-
-------------------------
7-
8-
95
.. toctree::
106
:maxdepth: 1
11-
:caption: C++ Header Files
7+
:caption: Modules
128

13-
cpp/dicbruteforce
14-
cpp/dicfourier
15-
cpp/dicinterpolator
16-
cpp/dicmain
17-
cpp/dicoptimizer
18-
cpp/dicrg
19-
cpp/dicscanmethod
20-
cpp/dicsmooth
21-
cpp/dicstrain
22-
cpp/dicutil
9+
./cpp/cpp_dic.rst
10+
./cpp/cpp_strain.rst

docs/source/api_py.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ Detailed Python API
1010
pyvale.sensorsim
1111
pyvale.blender
1212
pyvale.dic
13+
pyvale.strain
1314
pyvale.mooseherder
1415
pyvale.verif
1516
pyvale.dataset

docs/source/cite.rst

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,28 @@ Citing Pyvale
44
If Pyvale has contributed to your research or work please acknowledge the
55
project in your academic puplications using the following citation:
66

7+
.. tab-set::
78

9+
.. tab-item:: APA
10+
11+
Hirst, J., Sibson, L., Tayeb, A., Poole, B., Sampson, M., Bielajewa, W., ... & Fletcher, L. (2026).
12+
PYVALE: A Fast, Scalable, Open-Source 2D Digital Image Correlation (DIC) Engine
13+
Capable of Handling Gigapixel Images.
14+
*arXiv preprint arXiv:2601.12941*.
15+
16+
.. tab-item:: MLA
17+
18+
Hirst, Joel, et al. "PYVALE: A Fast, Scalable, Open-Source 2D Digital Image Correlation
19+
(DIC) Engine Capable of Handling Gigapixel Images."
20+
*arXiv preprint arXiv:2601.12941* (2026).
21+
22+
.. tab-item:: Bibtex
23+
24+
.. code-block::
25+
26+
@article{pyvale2026,
27+
title={PYVALE: A Fast, Scalable, Open-Source 2D Digital Image Correlation (DIC) Engine Capable of Handling Gigapixel Images},
28+
author={Hirst, Joel and Sibson, Lorna and Tayeb, Adel and Poole, Ben and Sampson, Megan and Bielajewa, Wiera and Atkinson, Michael and Marsh, Alex and Spencer, Rory and Hamill, Rob and others},
29+
journal={arXiv preprint arXiv:2601.12941},
30+
year={2026}
31+
}

docs/source/conf.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,13 @@
2828
'sphinx.ext.autodoc',
2929
'sphinx.ext.napoleon',
3030
'sphinx.ext.autosummary',
31-
'sphinx.ext.viewcode', # Adds source code links
31+
'sphinx.ext.intersphinx',
32+
'sphinx_design',
33+
'sphinx.ext.viewcode',
3234
'sphinx_codeautolink',
3335
'sphinx_copybutton',
3436
'sphinx_gallery.gen_gallery',
37+
'sphinx.ext.mathjax',
3538
'breathe',
3639
'myst_parser'
3740
]

docs/source/cpp/dicbruteforce.rst

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

0 commit comments

Comments
 (0)