Developer’s Reference#
MontePy can be thought of as having two layers: the syntax, and the semantic layers. The syntax layers handle the boring syntax things: like multi-line cards, and comments, etc. The semantic layer takes this information and makes sense of it, like what the material number in a cell card is.
Note
Punchcards are dead. For this reason MontePy refrains from using antiquated terminology like “cards” and “decks”. Instead MontePy refers to “inputs”, and “files” or “problems”.
Note
Demo code is based on tests/inputs/test.imcnp. You can load this with:
import montepy problem = montepy.read_input("tests/inputs/test.imcnp")
Package Structure#
Top Level#
The top level of the package is reserved for only a select few objects.
All children of NumberedObjectCollection can live here.
The other allowed classes are: Exceptions, MCNP_Object, MCNP_Problem, Cell,
Particle, and Universe.
Utility functions are allowed at this level as well.
input_parser#
The montepy.input_parser contains all functions and classes involved in syntax parsing.
Generally this is all invoked through read_input(),
which returns an MCNP_Problem instance.
data_inputs#
This package is for all MCNP_Object children that should exist
in the data block in an MCNP input.
For example Material lives here.
surfaces#
This package contains all surface classes.
All classes need to be children of Surface.
Nearly all classes that are necessary are now implemented.