Skip to content

Commit 21cd19e

Browse files
committed
pymcnp/inp: updated namespace
1 parent 9ee10d3 commit 21cd19e

File tree

1,052 files changed

+38727
-51959
lines changed

Some content is hidden

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

1,052 files changed

+38727
-51959
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,9 @@ After instaling `pytest`, test the `pymcnp` package by calling the following com
4444

4545
## Metaprogramming
4646

47-
To regenerate the autogenerated files in `files/inp/cell_option`, `files/inp/data`, and `files/inp/surfaces`, run the following Python scripts:
47+
To regenerate the autogenerated, run the following Python script:
4848

49-
parallel python3 {} ::: scripts/build_cell_options.py scripts/build_surfaces.py scripts/build_data.py
49+
python3 src/pymcnp/_text.py
5050

5151
## Copyright and License
5252

docs/source/conf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
exclude_patterns = []
2626
autodoc_member_order = 'bysource'
2727

28-
# -- Options for HTML output -------------------------------------------------
28+
# -- Option_s for HTML output -------------------------------------------------
2929
# https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output
3030

3131
html_theme = 'sphinx_rtd_theme'

docs/source/examples.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ use the universal `modify` function.
1919
filename = "/path/to/data/input.i'
2020
data = pymcnp.read_input(filename)
2121

22-
pymcnp.modify(x.data._cards['nps'], npp=100_000)
22+
pymcnp.modify(x.data.card_s['nps'], npp=100_000)
2323

2424
data.to_mcnp_file('/path/to/data/new_file_name.i')
2525

docs/source/pymcnp-inp.rst

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,55 +1,55 @@
11
pymcnp.inp Subpackage
22
=====================
33

4-
Comment Card
4+
Comment Card_
55
------------
66

77
.. autoclass:: pymcnp.inp.Comment
88
:members:
99
:undoc-members:
1010
:show-inheritance:
1111

12-
Cell Card
12+
Cell Card_
1313
---------
1414

1515
.. autoclass:: pymcnp.inp.Cell
1616
:members:
1717
:undoc-members:
1818
:show-inheritance:
1919

20-
Surface Cards
20+
Surface Card_s
2121
-------------
2222

2323
.. autoclass:: pymcnp.inp.Surface
2424
:members:
2525
:undoc-members:
2626
:show-inheritance:
2727

28-
Data Cards
28+
Data Card_s
2929
----------
3030

3131
.. autoclass:: pymcnp.inp.Datum
3232
:members:
3333
:undoc-members:
3434
:show-inheritance:
3535

36-
Cell Card Block
36+
Cell Card_ Block
3737
---------------
3838

3939
.. autoclass:: pymcnp.inp.cells
4040
:members:
4141
:undoc-members:
4242
:show-inheritance:
4343

44-
Surface Card Block
44+
Surface Card_ Block
4545
------------------
4646

4747
.. autoclass:: pymcnp.inp.Surfaces
4848
:members:
4949
:undoc-members:
5050
:show-inheritance:
5151

52-
Data Card Block
52+
Data Card_ Block
5353
---------------
5454

5555
.. autoclass:: pymcnp.inp.Data

docs/source/pymcnp-ptrac.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
pymcnp.ptrac Subpackage
22
=======================
33

4-
Event Card
4+
Event Card_
55
----------
66

77
.. autoclass:: pymcnp.ptrac.Event

docs/source/supported-elements.rst

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -12,25 +12,25 @@ Syntax Element Support
1212
INP Partial
1313
INP.Cell Full
1414
INP.Cell.Geometry Partial
15-
INP.Cell.Option Full
16-
INP.Cell.Option.Importance Full
17-
INP.Cell.Option.Volume Full
18-
INP.Cell.Option.Proton Weight Full
19-
INP.Cell.Option.Exponential Transformation Full
20-
INP.Cell.Option.Forced Collision Full
21-
INP.Cell.Option.Weight Window Bounds Full
22-
INP.Cell.Option.Dxtran Contribution Full
23-
INP.Cell.Option.Fission Turnoff Full
24-
INP.Cell.Option.Detector Contribution Full
25-
INP.Cell.Option.Gas Thermal Temperature Full
26-
INP.Cell.Option.Universe Full
27-
INP.Cell.Option.Coordinate Transformation Full
28-
INP.Cell.Option.Lattice Full
29-
INP.Cell.Option.Fill Full
30-
INP.Cell.Option.EnergyCutoff Full
31-
INP.Cell.Option.Cosy Full
32-
INP.Cell.Option.Bfield Full
33-
INP.Cell.Option.Uncollided Secondaries Full
15+
INP.Cell.Option_ Full
16+
INP.Cell.Option_.Importance Full
17+
INP.Cell.Option_.Volume Full
18+
INP.Cell.Option_.Proton Weight Full
19+
INP.Cell.Option_.Exponential Transformation Full
20+
INP.Cell.Option_.Forced Collision Full
21+
INP.Cell.Option_.Weight Window Bounds Full
22+
INP.Cell.Option_.Dxtran Contribution Full
23+
INP.Cell.Option_.Fission Turnoff Full
24+
INP.Cell.Option_.Detector Contribution Full
25+
INP.Cell.Option_.Gas Thermal Temperature Full
26+
INP.Cell.Option_.Universe Full
27+
INP.Cell.Option_.Coordinate Transformation Full
28+
INP.Cell.Option_.Lattice Full
29+
INP.Cell.Option_.Fill Full
30+
INP.Cell.Option_.EnergyCutoff Full
31+
INP.Cell.Option_.Cosy Full
32+
INP.Cell.Option_.Bfield Full
33+
INP.Cell.Option_.Uncollided Secondaries Full
3434
INP.Surface Full
3535
INP.Surface.Plane Full
3636
INP.Surface.Sphere (Centered at Origin) Full
@@ -103,9 +103,9 @@ INP.Data.Fission Turnoff Full
103103
INP.Data.Atomic Weight Full
104104
INP.Data.Cross-Section File Full
105105
INP.Data.Material Void Full
106-
INP.Data.Multigroup Adjoint Transport Option None
106+
INP.Data.Multigroup Adjoint Transport Option_ None
107107
INP.Data.Discrete.Reaction Cross Section None
108-
INP.Data.Physics Options None
108+
INP.Data.Physics Option_s None
109109
INP.Data.Activation Control None
110110
INP.Data.Cutoffs None
111111
INP.Data.Cell Cutoffs None
@@ -117,7 +117,7 @@ INP.Data.Lcc None
117117
INP.Data.Lea None
118118
INP.Data.Leb None
119119
INP.Data.Multiplicity Constants None
120-
INP.Data.Transport Options None
120+
INP.Data.Transport Option_s None
121121
INP.Data.Uncollided Secondaries None
122122
INP.Data.Cosyp None
123123
INP.Data.Cosy None
@@ -133,7 +133,7 @@ INP.Data.Source Comment None
133133
INP.Data.Surface Source Write None
134134
INP.Data.Surface Source Read None
135135
INP.Data.Criticality Source None
136-
INP.Data.Criticaliy Calculations Options None
136+
INP.Data.Criticaliy Calculations Option_s None
137137
INP.Data.Mesh for Shannon Entropy None
138138
INP.Data.Depletion/Burnup None
139139
INP.Data.Source None

examples/example_box.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,19 @@
22

33

44
def get_inp(RADIUS_AIR, RADIUS_SHIELD, RADIUS_LEAD):
5-
BOX_AIR = pymcnp.inp.SurfaceOption_Rpp.from_mcnp(
5+
BOX_AIR = pymcnp.inp.SurfaceOption__Rpp.from_mcnp(
66
f'rpp {-RADIUS_AIR} {RADIUS_AIR} {-RADIUS_AIR} {RADIUS_AIR} {-RADIUS_AIR} {RADIUS_AIR}'
77
)
8-
BOX_SHIELD = pymcnp.inp.SurfaceOption_Rpp.from_mcnp(
8+
BOX_SHIELD = pymcnp.inp.SurfaceOption__Rpp.from_mcnp(
99
f'rpp {-RADIUS_SHIELD} {RADIUS_SHIELD} {-RADIUS_SHIELD} {RADIUS_SHIELD} {-RADIUS_SHIELD} {RADIUS_SHIELD}'
1010
)
11-
BOX_LEAD = pymcnp.inp.SurfaceOption_Rpp.from_mcnp(
11+
BOX_LEAD = pymcnp.inp.SurfaceOption__Rpp.from_mcnp(
1212
f'rpp {-RADIUS_LEAD} {RADIUS_LEAD} {-RADIUS_LEAD} {RADIUS_LEAD} {-RADIUS_LEAD} {RADIUS_LEAD}'
1313
)
1414

15-
MATERIAL_AIR = pymcnp.inp.DataOption_M.from_formula(1, {'N2': 0.8, 'O2': 0.2})
16-
MATERIAL_SHIELD = pymcnp.inp.DataOption_M.from_formula(2, {'TiO2': 0.5, 'PbO': 0.5})
17-
MATERIAL_LEAD = pymcnp.inp.DataOption_M.from_formula(3, {'Pb': 1})
15+
MATERIAL_AIR = pymcnp.inp.DataOption__M.from_formula(1, {'N2': 0.8, 'O2': 0.2})
16+
MATERIAL_SHIELD = pymcnp.inp.DataOption__M.from_formula(2, {'TiO2': 0.5, 'PbO': 0.5})
17+
MATERIAL_LEAD = pymcnp.inp.DataOption__M.from_formula(3, {'Pb': 1})
1818

1919
return f"""
2020
Box Example

src/mcnptools/mcnprun.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -176,12 +176,12 @@ def run_mcnp(input_file, out_dir=None, out_name=None, cores=1, clean=False):
176176
# set_mcnp_environment(DATAPATH, ISCDATA, MCNPPATH)
177177

178178

179-
# input_card = \
179+
# inputcard_ = \
180180
# r"""PUT YOUR MCNP INPUT CARD HERE
181181
# IT CAN HAVE {} for formatting the card with values filled in by params arg in run_mcnp
182182
# """
183183

184184
# # use run_mcnp in the following way as a context manager
185-
# with run_mcnp(input_card, cores=4, clean=False) as (run, out_dir):
185+
# with run_mcnp(inputcard_, cores=4, clean=False) as (run, out_dir):
186186
# print(run.stdout)
187187
# print(out_dir)

src/pymcnp/__init__.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,15 @@
22
from . import outp
33
from . import ptrac
44
from . import utils
5-
from .version import __version__
5+
from .Inp import Inp
66

7-
read_input = inp.Inp.from_mcnp_file
7+
read_input = Inp.from_mcnp_file
88
read_ptrac = ptrac.Ptrac.from_mcnp_file
99

1010
__all__ = [
1111
'inp',
1212
'outp',
1313
'ptrac',
1414
'utils',
15-
'read_input',
16-
'read_ptrac',
17-
'__version__',
15+
'Inp',
1816
]

0 commit comments

Comments
 (0)