From a49b7748a4edd1c23a50f0fb4ac6c6f20fc582ad Mon Sep 17 00:00:00 2001 From: MateusStano Date: Tue, 1 Oct 2024 21:59:40 +0200 Subject: [PATCH] BUG: allow for single point functions to be defined --- rocketpy/mathutils/function.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/rocketpy/mathutils/function.py b/rocketpy/mathutils/function.py index d9d49d2b9..ba05636a5 100644 --- a/rocketpy/mathutils/function.py +++ b/rocketpy/mathutils/function.py @@ -3247,12 +3247,12 @@ def __validate_source(self, source): # pylint: disable=too-many-statements ) source_len, source_dim = source.shape - - if source_len < source_dim: - raise ValueError( - "Too few data points to define a domain. The number of rows " - "must be greater than or equal to the number of columns." - ) + if not source_len == 1: # do not check for one point Functions + if source_len < source_dim: + raise ValueError( + "Too few data points to define a domain. The number of rows " + "must be greater than or equal to the number of columns." + ) return source