From 9f41139ef92dd9999967472b2a370524b6c757bc Mon Sep 17 00:00:00 2001 From: daklauss Date: Fri, 6 Dec 2024 10:03:45 +0100 Subject: [PATCH] Fix Annotations Fix annotations and Remove unused annotations --- CADETProcess/processModel/componentSystem.py | 36 ++++++++++++++++---- 1 file changed, 29 insertions(+), 7 deletions(-) diff --git a/CADETProcess/processModel/componentSystem.py b/CADETProcess/processModel/componentSystem.py index 90deea11..fd93dd88 100644 --- a/CADETProcess/processModel/componentSystem.py +++ b/CADETProcess/processModel/componentSystem.py @@ -1,6 +1,6 @@ from collections import defaultdict from functools import wraps -from typing import Optional, Union, List, Dict as TypingDict +from typing import List, Dict as TypingDict from addict import Dict @@ -212,11 +212,33 @@ def __init__( self, components: int | List[str | Component | None] = None, name: str | None = None, - charges: List[int | None | None] = None, - molecular_weights: List[float | None | None] = None, - densities: List[float | None | None] = None + charges: List[int | None] = None, + molecular_weights: List[float | None] = None, + densities: List[float | None] = None ) -> None: - """Initialize the ComponentSystem object.""" + """Initialize the ComponentSystem object. + + Parameters + ---------- + components : int, list, 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, None + The charges of each component. + molecular_weights : list, None + The molecular weights of each component. + densities : list, None + The densities of each component. + + Raises + ------ + CADETProcessError + If the `components` argument is neither an int nor a list. + + """ + self.name: str | None = name self._components: List[Component] = [] @@ -278,8 +300,8 @@ def n_species(self) -> int: def add_component( self, component: str | Component, - *args: int | float | None, - **kwargs: int | float | None + *args: list, + **kwargs: dict ) -> None: """ Add a component to the system.