Skip to content

Commit

Permalink
fixup! Add type annotations
Browse files Browse the repository at this point in the history
  • Loading branch information
daklauss committed Dec 6, 2024
1 parent 2195e8e commit 2b4b3de
Showing 1 changed file with 29 additions and 24 deletions.
53 changes: 29 additions & 24 deletions CADETProcess/processModel/componentSystem.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@
__all__ = ['ComponentSystem', 'Component', 'Species']

class Species(Structure):
"""Species class.
"""
Species class.
Represent a species in a chemical system.
Expand All @@ -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).
Expand Down Expand Up @@ -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).
Expand Down Expand Up @@ -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.
"""

Expand Down Expand Up @@ -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
----------
Expand Down

0 comments on commit 2b4b3de

Please sign in to comment.