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 96f6499 commit 1004351
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions CADETProcess/processModel/componentSystem.py
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ def density(self) -> list[float | None]:
return [spec.density for spec in self.species]

def __str__(self) -> str:
"""String representation of the component."""
"""str: String representation of the component."""
return self.name

def __iter__(self):
Expand Down Expand Up @@ -432,11 +432,13 @@ def densities(self) -> list[float | None]:
return densities

def __repr__(self) -> str:
"""str: Representation of the system by class name and component names."""
return f'{self.__class__.__name__}({self.names})'

def __iter__(self):
"""Iterator over components in the system."""
yield from self.components

def __getitem__(self, item: int) -> Component:
"""Component: Retrieve a component by its index."""
return self._components[item]

0 comments on commit 1004351

Please sign in to comment.