Skip to content

Commit 48366de

Browse files
committed
jz - add docstring to _handle_operation_list in damage_model
1 parent 1cefb1c commit 48366de

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

pelicun/model/damage_model.py

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -909,6 +909,23 @@ def _handle_operation( # noqa: PLR6301
909909
def _handle_operation_list(
910910
self, initial_value: float, operations: list[tuple[str, float]]
911911
) -> np.ndarray:
912+
"""
913+
Apply a list of operations to an initial value and return the results as a numpy array.
914+
915+
Parameters.
916+
----------
917+
initial_value : float
918+
The initial value to which the operations will be applied.
919+
operations : list of tuple
920+
A list of operations where each operation is represented as a tuple.
921+
The first element of the tuple is a string representing the operation type,
922+
and the second element is a float representing the value to be used in the operation.
923+
924+
Returns
925+
-------
926+
np.ndarray
927+
An array of results after applying each operation to the initial value.
928+
"""
912929
if len(operations) == 1:
913930
return np.array(
914931
[

0 commit comments

Comments
 (0)