Skip to content

Commit

Permalink
Input checks added to set_source
Browse files Browse the repository at this point in the history
  • Loading branch information
brunosorban committed Nov 12, 2023
1 parent f22cabc commit 93dacbc
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion rocketpy/mathutils/function.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ def set_source(self, source):
self : Function
"""
inputs, outputs, interpolation, extrapolation = self._check_user_input(
source, inputs, outputs, interpolation, extrapolation
source, self.__inputs__, self.__outputs__, self.__interpolation__, self.__extrapolation__
)
# If the source is a Function
if isinstance(source, Function):
Expand Down Expand Up @@ -2676,6 +2676,8 @@ def _check_user_input(
# check output type and dimensions
if isinstance(outputs, str):
outputs = [outputs]
if isinstance(inputs, str):
inputs = [inputs]

elif len(outputs) > 1:
raise ValueError(
Expand Down

0 comments on commit 93dacbc

Please sign in to comment.