ReactionBase#
module wntr.msx.base
- class ReactionBase[source]#
Bases:
ABC
Water quality reaction class.
This is an abstract class for water quality reactions with partial concrete attribute and method definitions. All parameters and methods documented here must be defined by a subclass except for the following:
Concrete attributes
The
__init__()
method defines the following attributes concretely. Thus, a subclass should callsuper().__init__(species_name, note=note)
at the beginning of its own initialization._species_name
Protected name of the species
Optional note regarding the reaction (see
NoteType
)Concrete properties
The species name is protected, and a reaction cannot be manually assigned a new species. Therefore, the following property is defined concretely.
Name of the species that has a reaction being defined.
Concrete methods
The following methods are concretely defined, but can be overridden.
__str__
Return the name of the species and the reaction type, indicated by an arrow.
__repr__
Return a representation of the reaction from the dictionary representation - see
to_dict()