Skip to content

Commit 565cebd

Browse files
author
Morgan Thomas
committed
Merge remote-tracking branch 'upstream/develop' into enh/monte-carlo-callback
2 parents 97f8146 + 9d34c7e commit 565cebd

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

rocketpy/mathutils/function.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3171,7 +3171,7 @@ def savetxt(
31713171
)
31723172
# Generate the data points using the callable
31733173
x = np.linspace(lower, upper, samples)
3174-
data_points = np.column_stack((x, self.source(x)))
3174+
data_points = np.column_stack((x, self(x)))
31753175
else:
31763176
# If the source is already an array, use it as is
31773177
data_points = self.source
@@ -3247,12 +3247,12 @@ def __validate_source(self, source): # pylint: disable=too-many-statements
32473247
)
32483248

32493249
source_len, source_dim = source.shape
3250-
3251-
if source_len < source_dim:
3252-
raise ValueError(
3253-
"Too few data points to define a domain. The number of rows "
3254-
"must be greater than or equal to the number of columns."
3255-
)
3250+
if not source_len == 1: # do not check for one point Functions
3251+
if source_len < source_dim:
3252+
raise ValueError(
3253+
"Too few data points to define a domain. The number of rows "
3254+
"must be greater than or equal to the number of columns."
3255+
)
32563256

32573257
return source
32583258

0 commit comments

Comments
 (0)