From 19ca784f713010fa83138c53d462f30441ff17f2 Mon Sep 17 00:00:00 2001 From: BalzaniEdoardo Date: Thu, 14 Sep 2023 12:40:34 -0400 Subject: [PATCH] added Raises to docstrings when empty samples or n_samples<=0 is passed --- src/neurostatslib/basis.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/neurostatslib/basis.py b/src/neurostatslib/basis.py index ad860bc4..cd9f4d8d 100644 --- a/src/neurostatslib/basis.py +++ b/src/neurostatslib/basis.py @@ -101,6 +101,7 @@ def evaluate(self, *xi: ArrayLike) -> NDArray: ValueError - If the time point number is inconsistent between inputs. - If the number of inputs doesn't match what the Basis object requires. + - At least one of the samples is empty. """ # check that the input is array-like if any( @@ -145,12 +146,12 @@ def evaluate_on_grid(self, *n_samples: int) -> Tuple[Tuple[NDArray], NDArray]: The basis function evaluated at the samples, shape (n_samples[0], ... , n_samples[n], number of basis). - Raises ------ ValueError - If the time point number is inconsistent between inputs or if the number of inputs doesn't match what + - If the time point number is inconsistent between inputs or if the number of inputs doesn't match what the Basis object requires. + - If one of the n_samples is <= 0. Notes -----