Skip to content

Commit 8eae5d2

Browse files
committed
BUG: keep extrapolation when adding discrete Function to constant value
1 parent 8993108 commit 8eae5d2

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

rocketpy/mathutils/function.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1734,8 +1734,11 @@ def __add__(self, other):
17341734
outputs = self.__outputs__[0] + " + " + str(other)
17351735
outputs = "(" + outputs + ")"
17361736
interpolation = self.__interpolation__
1737+
extrapolation = self.__extrapolation__
17371738
# Create new Function object
1738-
return Function(source, inputs, outputs, interpolation)
1739+
return Function(
1740+
source, inputs, outputs, interpolation, extrapolation
1741+
)
17391742
else:
17401743
return Function(lambda x: (self.get_value(x) + other))
17411744
# Or if it is just a callable

0 commit comments

Comments
 (0)