montepy.errors module#
- exception montepy.errors.BrokenObjectLinkError(parent_type, parent_number, child_type, child_number)#
Bases:
MalformedInputError
Raised when the referenced object does not exist in the input file.
- add_note()#
Exception.add_note(note) – add a note to the exception
- args#
- with_traceback()#
Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.
- exception montepy.errors.IllegalState(message)#
Bases:
ValueError
Raised when an object can’t be printed out due to an illegal state.
- add_note()#
Exception.add_note(note) – add a note to the exception
- args#
- with_traceback()#
Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.
- exception montepy.errors.LineExpansionWarning(message)#
Bases:
Warning
Warning for when a field or line expands that may damage user formatting.
- add_note()#
Exception.add_note(note) – add a note to the exception
- args#
- with_traceback()#
Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.
- exception montepy.errors.LineOverRunWarning(message)#
Bases:
UserWarning
Raised when non-comment inputs exceed the allowed line length in an input.
- add_note()#
Exception.add_note(note) – add a note to the exception
- args#
- with_traceback()#
Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.
- exception montepy.errors.MalformedInputError(input, message)#
Bases:
ValueError
Raised when there is an error with the MCNP input not related to the parser.
- add_note()#
Exception.add_note(note) – add a note to the exception
- args#
- with_traceback()#
Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.
- exception montepy.errors.NumberConflictError(message)#
Bases:
Exception
Raised when there is a conflict in number spaces
- add_note()#
Exception.add_note(note) – add a note to the exception
- args#
- with_traceback()#
Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.
- exception montepy.errors.ParsingError(input, message, error_queue)#
Bases:
MalformedInputError
Raised when there is an error parsing the MCNP input at the SLY parsing layer.
- add_note()#
Exception.add_note(note) – add a note to the exception
- args#
- with_traceback()#
Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.
- exception montepy.errors.ParticleTypeNotInCell(message)#
Bases:
ValueError
Raised when data for importance data for a particle in the problem is not provided for a cell.
- add_note()#
Exception.add_note(note) – add a note to the exception
- args#
- with_traceback()#
Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.
- exception montepy.errors.ParticleTypeNotInProblem(message)#
Bases:
ValueError
Raised when data are set for a particle type not in the problem’s mode.
- add_note()#
Exception.add_note(note) – add a note to the exception
- args#
- with_traceback()#
Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.
- exception montepy.errors.RedundantParameterSpecification(key, new_value)#
Bases:
ValueError
Raised when multiple conflicting parameters are given.
e.g.,
1 0 -1 imp:n=5 imp:n=0
- add_note()#
Exception.add_note(note) – add a note to the exception
- args#
- with_traceback()#
Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.
- exception montepy.errors.UnknownElement(missing_val)#
Bases:
ValueError
Raised when an undefined element is used.
- add_note()#
Exception.add_note(note) – add a note to the exception
- args#
- with_traceback()#
Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.
- exception montepy.errors.UnsupportedFeature(message)#
Bases:
NotImplementedError
Raised when MCNP syntax that is not supported is found
- add_note()#
Exception.add_note(note) – add a note to the exception
- args#
- with_traceback()#
Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.
- montepy.errors.add_line_number_to_exception(error, broken_robot)#
Adds additional context to an Exception raised by an
MCNP_Object
.This will add the line, file name, and the input lines to the error.
- Parameters:
error (Exception) – The error that was raised.
broken_robot (MCNP_Object) – The parent object that had the error raised.
- Raises:
Exception – … that’s the whole point.