Skip to content

Commit

Permalink
datum/mphys: fix parsing physics model
Browse files Browse the repository at this point in the history
  • Loading branch information
Arun Persaud committed Nov 14, 2024
1 parent e5211f1 commit b173e94
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
3 changes: 1 addition & 2 deletions src/pymcnp/files/inp/datum/factory.py
Original file line number Diff line number Diff line change
Expand Up @@ -616,11 +616,10 @@ def create_datum_from_mcnp(source: str, line: types.McnpInteger = None):

case DatumMnemonic.MODEL_PHYSICS_CONTROL:
tokens.popl()

if tokens:
ModelPhysicsControl(tokens.popl())
else:
datum = ModelPhysicsControl('no')
datum = ModelPhysicsControl('off')

case DatumMnemonic.LCA:
tokens.popl()
Expand Down
2 changes: 1 addition & 1 deletion src/pymcnp/files/inp/datum/model_physics_control.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ def __init__(self, setting: str):
setting: On/Off.
"""

if setting is None or setting not in {'yes', 'no'}:
if setting is None or setting not in {'on', 'off'}:
raise errors.MCNPSemanticError(errors.MCNPSemanticCodes.INVALID_DATUM_PARAMETERS)

_card.Card.__init__(self, 'mphys')
Expand Down

0 comments on commit b173e94

Please sign in to comment.