Skip to content

Commit 48e8bb4

Browse files
committed
examples: updated output documentation
1 parent 2124c70 commit 48e8bb4

File tree

19 files changed

+381
-69
lines changed

19 files changed

+381
-69
lines changed

docs/source/conf.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,3 @@
1-
# Configuration file for the Sphinx documentation builder.
2-
#
3-
# For the full list of built-in configuration values, see the documentation:
4-
# https://www.sphinx-doc.org/en/master/usage/configuration.html
5-
61
# -- Project information -----------------------------------------------------
72
# https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information
83

docs/source/examples.md

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

33
```{eval-rst}
4-
.. warning::
4+
.. note::
55
Some examples overwrite or create files or directories. If running in the PyMCNP/examples directory, run the following command to clean the
66
directory:
77

docs/source/examples/create.md

Lines changed: 17 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ Code:
1313

1414
Output:
1515

16+
INP cell created using `__init__`:
1617
1 1 0.5 #(99:3) imp:n 1.0
1718

1819
## Creating Material Cards
@@ -40,6 +41,7 @@ Code:
4041

4142
Output:
4243

44+
INP surface created using `__init__`:
4345
1 so 2
4446

4547
## Creating INP Files
@@ -53,23 +55,22 @@ Code:
5355

5456
Output:
5557

58+
INP file created using `__init__`:
5659
Create `Inp`
5760

58-
1 21 0.5 11
59-
2 22 0.5 12:11
60-
3 23 0.5 13:12
61-
4 0 14
61+
1 0 -1
62+
1 1 0.5 +1:-1
63+
1 1 0.5 -1 +1:-1
64+
1 0 +1
6265

63-
11 rpp -60 60 -60 60 -60 60
64-
11 rpp -5 5 -5 5 -5 5
65-
11 rpp -1 1 -1 1 -1 1
66-
99 so 67
66+
1 rpp -50 50 -50 50 -50 50
67+
1 rpp -10 10 -10 10 -10 10
68+
1 so 100
69+
70+
m1 007014 -0.797088 008016 -0.199514
71+
m1 082204 -0.014 082206 -0.241 082207 -0.221 082208 -0.524
72+
sdef pos 0 0 0 erg 14.4 par 1
73+
f4:n 2
74+
nps 100000.0
75+
rand seed 1232209489
6776

68-
m21 007014 -0.797088 008016 -0.199514
69-
m22 008016 -0.19984179019595494 022046 -0.02472289143502082 022047 &
70-
-0.02229555300321877 022048 -0.22091776443511935 022049 &
71-
-0.016212223353146985 022050 -0.015522979107079737 008016 &
72-
-0.03575396279808631 082206 -0.11186230536770471 082207 &
73-
-0.10257912649901553 082208 -0.24321928635965673
74-
m23 082204 -0.014 082206 -0.241 082207 -0.221 082208 -0.524
75-

docs/source/examples/do.md

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,24 +4,49 @@ PyMCNP enables common workflows using `pyvista`, `pandas`, `subprocesss`, `matpl
44

55
## Checking INP Files
66

7+
```{eval-rst}
8+
.. note::
9+
This example requires `example_00.inp <https://github.com/FSIBT/PyMCNP/blob/master/files/inp/example_00.inp>`_.
10+
```
11+
712
Code:
813

914
```{eval-rst}
1015
.. literalinclude:: ../../../examples/do_check.py
1116
:language: python
1217
```
1318

19+
Output:
20+
21+
Checking INP file: `PyMCNP/files/inp/example_00.inp`
22+
Fixing and writing to INP file: `PyMCNP/files/inp/example_00.inp`
23+
1424
## Converting OUTP Files
1525

26+
```{eval-rst}
27+
.. note::
28+
This example requires `example_00.outp <https://github.com/FSIBT/PyMCNP/blob/master/files/outp/example_00.outp>`_.
29+
```
30+
1631
Code:
1732

1833
```{eval-rst}
1934
.. literalinclude:: ../../../examples/do_convert.py
2035
:language: python
2136
```
2237

38+
Output:
39+
40+
Converting tally #1 from `PyMCNP/files/outp/example_00.outp` to `example_00-1.csv`
41+
Converting tally #1 from `PyMCNP/files/outp/example_00.outp` to `example_00-1.parquet`
42+
2343
## Plotting OUTP Files
2444

45+
```{eval-rst}
46+
.. note::
47+
This example requires `example_00.outp <https://github.com/FSIBT/PyMCNP/blob/master/files/outp/example_00.outp>`_.
48+
```
49+
2550
Code:
2651

2752
```{eval-rst}
@@ -31,19 +56,50 @@ Code:
3156

3257
Output:
3358

59+
Plotting tally #1 from files/outp/example_00.outp.
60+
Writing plots tally #1 from files/outp/example_00.outp to `example_00-1.pdf`.
61+
3462
![do_plot_0](../images/do_plot_0.png)
63+
![do_plot_1](../images/do_plot_1.png)
64+
![do_plot_2](../images/do_plot_2.png)
65+
![do_plot_3](../images/do_plot_3.png)
3566

3667
## Running INP Files
3768

69+
```{eval-rst}
70+
.. note::
71+
This example requires `example_00.inp <https://github.com/FSIBT/PyMCNP/blob/master/files/inp/example_00.inp>`_, `example_01.inp <https://github.com/FSIBT/PyMCNP/blob/master/files/inp/example_01.inp>`_, and `example_02.inp <https://github.com/FSIBT/PyMCNP/blob/master/files/inp/example_02.inp>`_.
72+
```
73+
3874
Code:
3975

4076
```{eval-rst}
4177
.. literalinclude:: ../../../examples/do_run.py
4278
:language: python
4379
```
4480

81+
Output:
82+
83+
Running `echo` in the current working directory:
84+
Calling `prehook_batch` pymcnp-2025-08-22--01-12-44
85+
Calling `prehook_file` pymcnp-2025-08-22--01-12-44/run-0 0
86+
inp=pymcnp-2025-08-22--01-12-44/run-0/run-0.inp outp=pymcnp-2025-08-22--01-12-44/run-0/run-0.outp ptrac=pymcnp-2025-08-22--01-12-44/run-0/run-0.ptrac
87+
Calling `prehook_file` pymcnp-2025-08-22--01-12-44/run-1 1
88+
inp=pymcnp-2025-08-22--01-12-44/run-1/run-1.inp outp=pymcnp-2025-08-22--01-12-44/run-1/run-1.outp ptrac=pymcnp-2025-08-22--01-12-44/run-1/run-1.ptrac
89+
Calling `prehook_file` pymcnp-2025-08-22--01-12-44/run-2 2
90+
Calling `posthook_file` pymcnp-2025-08-22--01-12-44/run-0 0
91+
Calling `posthook_file` pymcnp-2025-08-22--01-12-44/run-1 1
92+
inp=pymcnp-2025-08-22--01-12-44/run-2/run-2.inp outp=pymcnp-2025-08-22--01-12-44/run-2/run-2.outp ptrac=pymcnp-2025-08-22--01-12-44/run-2/run-2.ptrac
93+
Calling `posthook_file` pymcnp-2025-08-22--01-12-44/run-2 2
94+
Calling `posthook_batch` pymcnp-2025-08-22--01-12-44
95+
4596
## Visualizing INP Files
4697

98+
```{eval-rst}
99+
.. note::
100+
This example requires `valid_29.inp <https://github.com/FSIBT/PyMCNP/blob/master/files/inp/valid_29.inp>`_.
101+
```
102+
47103
Code:
48104

49105
```{eval-rst}
@@ -53,13 +109,37 @@ Code:
53109

54110
Output:
55111

112+
Visualizing all surfaces from `PyMCNP/files/inp/valid_29.inp`.
113+
Writing visualizations of all surfaces from `PyMCNP/files/inp/valid_29.inp` to `valid_29-surfaces.pdf`
114+
56115
![do_visualize](../images/do_visualize.png)
57116

58117
## Parameter Scan
59118

119+
```{eval-rst}
120+
.. note::
121+
This example requires `example_01.outp <https://github.com/FSIBT/PyMCNP/blob/master/files/outp/example_01.outp>`_ and `example_04.inp <https://github.com/FSIBT/PyMCNP/blob/master/files/inp/example_04.inp>`_.
122+
```
123+
60124
Code:
61125

62126
```{eval-rst}
63127
.. literalinclude:: ../../../examples/do_parameter_scan.py
64128
:language: python
65129
```
130+
131+
Output:
132+
133+
Running parameter scan `echo` in the current working directory:
134+
inp=pymcnp-2025-08-22--01-52-15/run-0/run-0.inp outp=pymcnp-2025-08-22--01-52-15/run-0/run-0.outp ptrac=pymcnp-2025-08-22--01-52-15/run-0/run-0.ptrac
135+
inp=pymcnp-2025-08-22--01-52-15/run-1/run-1.inp outp=pymcnp-2025-08-22--01-52-15/run-1/run-1.outp ptrac=pymcnp-2025-08-22--01-52-15/run-1/run-1.ptrac
136+
inp=pymcnp-2025-08-22--01-52-15/run-2/run-2.inp outp=pymcnp-2025-08-22--01-52-15/run-2/run-2.outp ptrac=pymcnp-2025-08-22--01-52-15/run-2/run-2.ptrac
137+
inp=pymcnp-2025-08-22--01-52-15/run-3/run-3.inp outp=pymcnp-2025-08-22--01-52-15/run-3/run-3.outp ptrac=pymcnp-2025-08-22--01-52-15/run-3/run-3.ptrac
138+
inp=pymcnp-2025-08-22--01-52-15/run-4/run-4.inp outp=pymcnp-2025-08-22--01-52-15/run-4/run-4.outp ptrac=pymcnp-2025-08-22--01-52-15/run-4/run-4.ptrac
139+
DONE! :)
140+
141+
![do_parameter_scan_0](../images/do_parameter_scan_0.png)
142+
![do_parameter_scan_1](../images/do_parameter_scan_1.png)
143+
![do_parameter_scan_2](../images/do_parameter_scan_2.png)
144+
![do_parameter_scan_3](../images/do_parameter_scan_3.png)
145+
![do_parameter_scan_4](../images/do_parameter_scan_4.png)

0 commit comments

Comments
 (0)