Skip to content

Commit

Permalink
Corrected INP Error Handeling
Browse files Browse the repository at this point in the history
  • Loading branch information
BitterB0NG0 committed Aug 10, 2024
1 parent 05a7cd6 commit 6530c82
Show file tree
Hide file tree
Showing 10 changed files with 587 additions and 485 deletions.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ authors = [
]
description = "Python-based MCNP tools."
version = "0.0.0"
requires-python = ">=3.8"
requires-python = ">=3.10"

[project.urls]
"Homepage" = "https://github.com/mauricioAyllon/MCNP-tools"
Expand Down
22 changes: 21 additions & 1 deletion src/pymcnp/files/_utils/errors.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@ class MCNPSyntaxCodes(Enum):
# CELL
TOOFEW_CELL_GEOMETRY = -1
TOOLONG_CELL_GEOMETRY = 1
TOOFEW_CELL_PARAMETERS = -2
TOOLONG_CELL_PARAMETERS = 2
TOOFEW_CELL = -3
TOOLONG_CELL = 3


class MCNPSemanticCodes(Enum):
Expand All @@ -38,7 +42,23 @@ class MCNPSemanticCodes(Enum):
"""

# INP
INVALID_INP_TITLE = 0
INVALID_MCNP_DESIGNATOR = 0
INVALID_INP_TITLE = 1

INVALID_PARAMETER_KEYWORD = 2
INVALID_PARAMETER_SUFFIX = 3
INVALID_PARAMETER_VALUE = 4

INVALID_CELL_NUMBER = 5
INVALID_CELL_MATERIAL = 6
INVALID_CELL_DENSITY = 7
INVALID_CELL_GEOMETRY = 8
INVALID_CELL_PARAMETERS = 9

INVALID_SURFACE_NUMBER = 10
INVALID_SURFACE_MNEMONIC = 11
INVALID_SURFACE_TRANSFORMPERIODIC = 12
INVALID_SURFACE_PARAMETER = 13


class MCNPSyntaxError(Exception):
Expand Down
Loading

0 comments on commit 6530c82

Please sign in to comment.