From 900ecc2fe57b2f6925f03d331d040ff47ed9d7d8 Mon Sep 17 00:00:00 2001 From: Benjamin Maier Date: Tue, 10 Oct 2023 17:28:13 +0200 Subject: [PATCH] Add docstrings Signed-off-by: Benjamin Maier --- src/pylife/materiallaws/notch_approximation_law.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/pylife/materiallaws/notch_approximation_law.py b/src/pylife/materiallaws/notch_approximation_law.py index 6ab35c95..fb7f4d29 100644 --- a/src/pylife/materiallaws/notch_approximation_law.py +++ b/src/pylife/materiallaws/notch_approximation_law.py @@ -454,15 +454,14 @@ class Binned: """ def __init__(self, notch_approximation_law, maximum_absolute_load, number_of_bins=100): - self._notch_approximation_law = notch_approximation_law self._maximum_absolute_load = maximum_absolute_load self._number_of_bins = number_of_bins self._create_bins() def _create_bins(self): - - + """Initialize the lookup tables by precomputing the notch approximation law values. + """ # for multiple assessment points at once use a DataFrame with MultiIndex if isinstance(self._maximum_absolute_load, pd.DataFrame): assert self._maximum_absolute_load.index.name == "node_id" @@ -475,6 +474,8 @@ def _create_bins(self): def _create_bins_single_assessment_point(self): + """Initialize the lookup tables by precomputing the notch approximation law values, + for the case of scalar variables, i.e., only a single assessment point.""" # create look-up table (lut) for the primary branch values, named PFAD in FKM nonlinear self._lut_primary_branch = pd.DataFrame(0, @@ -509,6 +510,8 @@ def _create_bins_single_assessment_point(self): self._lut_secondary_branch.delta_stress, self._lut_secondary_branch.delta_load) def _create_bins_multiple_assessment_points(self): + """Initialize the lookup tables by precomputing the notch approximation law values, + for the case of vector-valued variables caused by an assessment on multiple points at once.""" # name column "max_abs_load" self._maximum_absolute_load.rename(columns={self._maximum_absolute_load.columns[0]: "max_abs_load"}, inplace=True)