From 2b4b3ded96802c306fcd7bff4c6efa8c4345d80f Mon Sep 17 00:00:00 2001 From: daklauss Date: Fri, 6 Dec 2024 12:15:06 +0100 Subject: [PATCH] fixup! Add type annotations --- CADETProcess/processModel/componentSystem.py | 53 +++++++++++--------- 1 file changed, 29 insertions(+), 24 deletions(-) diff --git a/CADETProcess/processModel/componentSystem.py b/CADETProcess/processModel/componentSystem.py index 4625c05c..6573cdb3 100644 --- a/CADETProcess/processModel/componentSystem.py +++ b/CADETProcess/processModel/componentSystem.py @@ -11,7 +11,8 @@ __all__ = ['ComponentSystem', 'Component', 'Species'] class Species(Structure): - """Species class. + """ + Species class. Represent a species in a chemical system. @@ -34,7 +35,8 @@ class Species(Structure): class Component(Structure): - """Information about single component. + """ + Information about single component. A component can contain subspecies (e.g. differently charged variants). @@ -171,7 +173,8 @@ def __iter__(self): class ComponentSystem(Structure): - """Information about components in system. + """ + Information about components in system. A component can contain subspecies (e.g. differently charged variants). @@ -216,26 +219,27 @@ def __init__( molecular_weights: list[float | None] = None, densities: list[float | None] = None ) -> None: - """Initialize the ComponentSystem object. - - Parameters - ---------- - components : int | list[str | Component | None] - The number of components or the list of components to be added. - If None, no components are added. - name : str | None - The name of the ComponentSystem. - charges : list[int | None] - The charges of each component. - molecular_weights : list[float | None] - The molecular weights of each component. - densities : list[float | None] - The densities of each component. - - Raises - ------ - CADETProcessError - If the `components` argument is neither an int nor a list. + """ + Initialize the ComponentSystem object. + + Parameters + ---------- + components : int | list[str | Component | None] + The number of components or the list of components to be added. + If None, no components are added. + name : str | None + The name of the ComponentSystem. + charges : list[int | None] + The charges of each component. + molecular_weights : list[float | None] + The molecular weights of each component. + densities : list[float | None] + The densities of each component. + + Raises + ------ + CADETProcessError + If the `components` argument is neither an int nor a list. """ @@ -328,7 +332,8 @@ def add_component( self._components.append(component) def remove_component(self, component: str | Component) -> NoReturn: - """Remove a component from the system. + """ + Remove a component from the system. Parameters ----------