Skip to content

Commit b06d6ac

Browse files
authored
doc!: organize and rename examples, and additional small fixes (#235)
1 parent af441cd commit b06d6ac

30 files changed

+104
-90
lines changed

.github/workflows/ci.yml

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -347,60 +347,60 @@ jobs:
347347
run: |
348348
mv iguana relocated
349349
source relocated/bin/this_iguana.sh --verbose # do not use --githubCI option, since we want this environment to be for only this step
350-
relocated/bin/iguana-example-basic test_data.hipo ${{ env.num_events }}
350+
relocated/bin/iguana_ex_cpp_00_run_functions test_data.hipo ${{ env.num_events }}
351351
mv relocated iguana
352352
### set iguana environment, since the next steps will check the iguana installation
353353
- name: set iguana environment
354354
run: source iguana/bin/this_iguana.sh --verbose --githubCI
355355
### test installed examples
356356
###### cpp
357-
- run: iguana-example-basic test_data.hipo ${{ env.num_events }}
357+
- run: iguana_ex_cpp_00_run_functions test_data.hipo ${{ env.num_events }}
358358
if: ${{ matrix.id == 'cpp' }}
359-
- run: iguana-example-bank-rows test_data.hipo ${{ env.num_events }}
359+
- run: iguana_ex_cpp_01_action_functions test_data.hipo ${{ env.num_events }}
360360
if: ${{ matrix.id == 'cpp' }}
361-
- run: iguana-example-dataframes test_data.hipo ${{ env.num_events }}
361+
- run: iguana_ex_cpp_dataframes test_data.hipo ${{ env.num_events }}
362362
if: ${{ matrix.id == 'cpp' }}
363-
- run: iguana-example-config-files iguana/etc/iguana/examples
363+
- run: iguana_ex_cpp_config_files iguana/etc/iguana/examples
364364
if: ${{ matrix.id == 'cpp' }}
365365
###### python
366-
- run: iguana-example-basic.py test_data.hipo ${{ env.num_events }}
366+
- run: iguana_ex_python_00_run_functions.py test_data.hipo ${{ env.num_events }}
367367
if: ${{ matrix.id == 'python' }}
368-
- run: iguana-example-bank-rows.py test_data.hipo ${{ env.num_events }}
368+
- run: iguana_ex_python_01_action_functions.py test_data.hipo ${{ env.num_events }}
369369
if: ${{ matrix.id == 'python' }}
370-
- run: iguana-example-hipopy.py test_data.hipo ${{ env.num_events }}
370+
- run: iguana_ex_python_hipopy.py test_data.hipo ${{ env.num_events }}
371371
if: ${{ matrix.id == 'python' }}
372372
###### fortran
373-
- run: iguana-example-fortran test_data.hipo ${{ env.num_events }}
373+
- run: iguana_ex_fortran_01_action_functions test_data.hipo ${{ env.num_events }}
374374
if: ${{ matrix.id == 'fortran' }}
375375
### test ROOT macro
376-
- name: test iguana_example_ROOT_macro.C interpreted
377-
run: root -b -q iguana_src/examples/iguana_example_ROOT_macro.C
376+
- name: test iguana_ex_cpp_ROOT_macro.C interpreted
377+
run: root -b -q iguana_src/examples/iguana_ex_cpp_ROOT_macro.C
378378
if: ${{ matrix.id == 'cpp' }}
379-
- name: test iguana_example_ROOT_macro.C compiled
380-
run: root -b -q iguana_src/examples/iguana_example_ROOT_macro.C+
379+
- name: test iguana_ex_cpp_ROOT_macro.C compiled
380+
run: root -b -q iguana_src/examples/iguana_ex_cpp_ROOT_macro.C+
381381
if: ${{ matrix.id == 'cpp' }}
382382
### test consumers
383383
- name: consumer test make
384384
if: ${{ matrix.id == 'cpp' }}
385385
run: |
386386
make -C iguana_src/examples/build_with_make
387387
echo "========================================= TEST RUN ========================================="
388-
iguana_src/examples/build_with_make/bin/iguana-example-basic test_data.hipo 10
388+
iguana_src/examples/build_with_make/bin/iguana_ex_cpp_00_run_functions test_data.hipo 10
389389
- name: consumer test meson
390390
if: ${{ matrix.id == 'cpp' }}
391391
run: |
392392
meson setup build_consumer_meson iguana_src/examples/build_with_meson --prefix=$(pwd)/install_consumer_meson
393393
meson install -C build_consumer_meson
394394
echo "========================================= TEST RUN ========================================="
395-
install_consumer_meson/bin/iguana-example-basic test_data.hipo 10
395+
install_consumer_meson/bin/iguana_ex_cpp_00_run_functions test_data.hipo 10
396396
- name: consumer test cmake
397397
if: ${{ matrix.id == 'cpp' }}
398398
run: |
399399
cmake -B build_consumer_cmake -S iguana_src/examples/build_with_cmake -DCMAKE_PREFIX_PATH=$(pwd)/hipo -G Ninja --install-prefix=$(pwd)/install_consumer_cmake
400400
cmake --build build_consumer_cmake
401401
cmake --install build_consumer_cmake
402402
echo "========================================= TEST RUN ========================================="
403-
install_consumer_cmake/bin/iguana-example-basic test_data.hipo 10
403+
install_consumer_cmake/bin/iguana_ex_cpp_00_run_functions test_data.hipo 10
404404
### upload artifacts
405405
- uses: actions/upload-artifact@v4
406406
if: always()

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ Iguana is not a framework for _reading_ data, rather it is a set of algorithms t
2121

2222
#### Language Bindings
2323
1. [Python](/bind/python/README.md)
24-
1. [Fortran](https://jeffersonlab.github.io/iguana/doxygen/group__fortran__usage__guide.html)
24+
1. [All others: see the Iguana User's guide](https://jeffersonlab.github.io/iguana/doxygen)
2525

2626
### For Developers
2727
1. [Design Notes](doc/design.md)

bind/python/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,6 @@ For Python to be able to find and use these bindings, you need to set some envir
3636
3737
## Running the Examples
3838
39-
Example Python scripts are found in this directory as `iguana-example-*.py`; they will be installed in the `bin/` subdirectory.
39+
Example Python scripts are found in this directory as `iguana_ex_*.py`; they will be installed in the `bin/` subdirectory.
4040
4141
Most of them are analogous to the C++ examples, but some may be specific to the Python bindings.

bind/python/iguana-example-basic.py renamed to bind/python/iguana_ex_python_00_run_functions.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,8 @@
22

33
"""!
44
@begin_doc_example{python}
5-
@file iguana-example-basic.py
6-
@brief Python version of `iguana-example-basic.cc`
7-
@see `iguana-example-basic.cc` for more information
5+
@file iguana_ex_python_00_run_functions.py
6+
@brief Python version of `iguana_ex_cpp_00_run_functions.cc` (for more details, see this `.cc` file)
87
@end_doc_example
98
@doxygen_off
109
"""

bind/python/iguana-example-bank-rows.py renamed to bind/python/iguana_ex_python_01_action_functions.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,8 @@
22

33
"""!
44
@begin_doc_example{python}
5-
@file iguana-example-bank-rows.py
6-
@brief Python version of `iguana-example-bank-rows.cc`
7-
@see `iguana-example-bank-rows.cc` for more information
5+
@file iguana_ex_python_01_action_functions.py
6+
@brief Python version of `iguana_ex_cpp_01_action_functions.cc` (for more details, see this `.cc` file)
87
@end_doc_example
98
@doxygen_off
109
"""

bind/python/iguana-example-hipopy.py renamed to bind/python/iguana_ex_python_hipopy.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
"""!
44
@begin_doc_example{python}
5-
@file iguana-example-hipopy.py
5+
@file iguana_ex_python_hipopy.py
66
@brief Python iguana example using HIPOPy: https://github.com/mfmceneaney/hipopy
77
@end_doc_example
88
@doxygen_off

bind/python/meson.build

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@ install_subdir(
77

88
if(get_option('install_examples'))
99
python_examples = [
10-
'iguana-example-basic.py',
11-
'iguana-example-bank-rows.py',
12-
'iguana-example-hipopy.py',
10+
'iguana_ex_python_00_run_functions.py',
11+
'iguana_ex_python_01_action_functions.py',
12+
'iguana_ex_python_hipopy.py',
1313
]
1414
foreach example : python_examples
1515
install_data(

doc/gen/Doxyfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1006,8 +1006,8 @@ INPUT_FILE_ENCODING =
10061006

10071007
FILE_PATTERNS = *.dox \
10081008
*.h \
1009-
iguana-example-*.cc \
1010-
iguana-example-*.py \
1009+
iguana_ex_*.cc \
1010+
iguana_ex_*.py \
10111011
Bindings.cc \
10121012
*.f \
10131013
*.C

doc/gen/examples.dox

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,13 @@ Iguana usage examples, organized by language and use cases:
1313
Iguana usage examples in C++
1414

1515
See below for the list of examples.
16+
- If this is your first time using Iguana, start with the numbered examples
17+
first, proceeding in order; since the list below is alphabetized, you may
18+
start from the top.
19+
- Examples without a number are specific to this language, showing certain use cases
1620

1721
@see If you use build automation tools, here is guidance on how to include and link to Iguana in your C++ project;
18-
they each show how build `iguana-example-basic.cc`, which "consumes" Iguana and HIPO as dependencies:
22+
they each show how build `iguana_ex_cpp_00_run_functions.cc`, which "consumes" Iguana and HIPO as dependencies:
1923
- [**Meson consumer example**](https://github.com/JeffersonLab/iguana/tree/main/examples/build_with_meson)
2024
- [**CMake consumer example**](https://github.com/JeffersonLab/iguana/tree/main/examples/build_with_cmake)
2125
- [**Makefile consumer example**](https://github.com/JeffersonLab/iguana/tree/main/examples/build_with_make)
@@ -28,6 +32,10 @@ they each show how build `iguana-example-basic.cc`, which "consumes" Iguana and
2832
Iguana usage examples in Python
2933

3034
The examples here are analogous to the C++ examples
35+
- If this is your first time using Iguana, start with the numbered examples
36+
first, proceeding in order; since the list below is alphabetized, you may
37+
start from the top.
38+
- Examples without a number are specific to this language, showing certain use cases
3139

3240
@see @ref examples_cpp "C++ examples"
3341
*/

doc/gen/mainpage.md

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,13 @@ This documentation shows how to use the Iguana algorithms.
1111
For more documentation, see
1212
- [**Documentation Front Page**](https://github.com/JeffersonLab/iguana/blob/main/README.md)
1313

14-
## Example Analysis Code
14+
## Example Code in C++, Python, and Fortran
1515

1616
To see Iguana algorithms used in the context of analysis code, with **various languages** and **use cases**, see:
17-
1817
- \ref examples_frontpage "Examples of Analysis Code"
1918

19+
**NOTE:** If you're not familiar with Iguana, please read the sections below first.
20+
2021
## Algorithms
2122

2223
An Iguana algorithm is a function that maps input HIPO bank data to output data. The available algorithms are:
@@ -35,7 +36,7 @@ The algorithm types are defined based on what they do to HIPO bank data:
3536
Most algorithms are configurable:
3637
- [**Algorithm Configuration Guide**](https://github.com/JeffersonLab/iguana/blob/main/doc/configuration.md)
3738

38-
## Common Functions: for HIPO C++ Users
39+
### Algorithm Common Functions: for HIPO C++ Users
3940

4041
All algorithms have the following functions, which may be used in analysis code
4142
that uses [**the HIPO C++ API**](https://github.com/gavalian/hipo); for
@@ -47,7 +48,7 @@ analysis code that does not, skip to the **Action Functions** section.
4748
<tr><td> `iguana::Algorithm::Stop` </td><td> Run after event processing </td></tr>
4849
</table>
4950

50-
## Action Functions: for All Users
51+
### Algorithm Action Functions: for All Users
5152

5253
The action functions do the _real_ work of the algorithm, and are meant to be
5354
easily callable from _any_ analysis, even if HIPO banks are not directly used.
@@ -76,3 +77,4 @@ Inputs and outputs are scalar or vector quantities.
7677
To maximize compatibility with user analysis code, these functions are
7778
overloaded, _e.g._, for every scalar function there is a corresponding vector
7879
function that calls it on each element of its input vectors.
80+

0 commit comments

Comments
 (0)