Exceptions
IncompleteReactionClassifierError
Raised by user-defined classification functions when a reaction cannot be classified due to incomplete rules.
Users should raise this exception at branches that are expected to be unreachable.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
reaction
|
Reaction
|
The reaction that could not be classified. |
required |
error_id
|
str
|
Identifier to distinguish multiple raise points within the same classification function. |
None
|
Examples:
>>> def classify_reaction(reaction):
... if reaction.leaving_kind == 'X':
... if reaction.entering_kind == 'L':
... return '1f'
... else:
... raise IncompleteReactionClassifierError(
... reaction, error_id="case_X_other"
... )
... else:
... raise IncompleteReactionClassifierError(
... reaction, error_id="case_not_X"
... )