inpRWErrors¶
Module Contents¶
The inpRWErrors module contains the custom exception types used throughout inpRW.
- exception inpRWErrors.inpRWErrors(args=None)¶
Bases:
ExceptionThe base class for all custom Exception types used by
inpRW.- __init__(args=None)¶
Initializes the exception. args should be a
tuple.inpRWErrorsis meant to be subclassed, not used directly. It provides a common base class for the other exceptions in this module.Example usage:
>>> from inpRWErrors import inpRWErrors >>> raise inpRWErrors Traceback (most recent call last): ... inpRWErrors.inpRWErrors: None
- __weakref__¶
list of weak references to the object (if defined)
- exception inpRWErrors.KeywordNotFoundError(args=None)¶
Bases:
inpRWErrorsThis class is a blank Exception and is raised by
findKeyword()to break out of loops if the particular keyword cannot be found inkeywords.Example
>>> from inpRWErrors import KeywordNotFoundError >>> raise KeywordNotFoundError Traceback (most recent call last): ... inpRWErrors.KeywordNotFoundError: None
- exception inpRWErrors.DecimalInfError(args=None)¶
Bases:
inpRWErrorsThis class is a blank Exception and is raised by
__new__()if the input string is ‘INF’.Example
>>> from inpRWErrors import DecimalInfError >>> raise KeywordNotFoundError Traceback (most recent call last): ... inpRWErrors.KeywordNotFoundError: None
- exception inpRWErrors.ElementIncorrectNodeNumError(elementType, nodeNum)¶
Bases:
inpRWErrorsRaised when an element has been assigned the incorrect number of nodes for its element type.
- __init__(elementType, nodeNum)¶
Sets the arguments which will be used in the Error message.
Example
>>> from inpRWErrors import ElementIncorrectNodeNumError >>> raise ElementIncorrectNodeNumError('C3D8', 8) Traceback (most recent call last): ... inpRWErrors.ElementIncorrectNodeNumError: ERROR! An element of type C3D8 must have 8 nodes.
If this exception is raised without the proper arguments, a
TypeErrorwill instead be raised:>>> raise ElementIncorrectNodeNumError Traceback (most recent call last): ... TypeError: ...__init__() missing 2 required positional arguments: 'elementType' and 'nodeNum'
- __str__()¶
Produces the string error message.
- exception inpRWErrors.ElementTypeMismatchError(otherEltype, meshElementType)¶
Bases:
inpRWErrorsRaised when an
Elementis inserted into aMeshElementclass, andeltypeparameter does not matcheltypeparameter.- __init__(otherEltype, meshElementType)¶
Sets the arguments which will be used in the Error message.
Example:
>>> from inpRWErrors import ElementTypeMismatchError >>> raise ElementTypeMismatchError('C3D8R', 'C3D8') Traceback (most recent call last): ... inpRWErrors.ElementTypeMismatchError: ERROR! An element of type C3D8R cannot be added to a MeshElement with eltype C3D8
If this exception is raised without the proper arguments, a
TypeErrorwill instead be raised:>>> raise ElementTypeMismatchError Traceback (most recent call last): ... TypeError: ...__init__() missing 2 required positional arguments: 'otherEltype' and 'meshElementType'
- __str__()¶
Produces the string error message.