Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BUG: Fix find_input() Function to Return a Single Value #471

Merged
merged 1 commit into from
Nov 19, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion rocketpy/mathutils/function.py
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@
):
self.set_extrapolation("natural")
else:
raise ValueError(

Check warning on line 262 in rocketpy/mathutils/function.py

View check run for this annotation

Codecov / codecov/patch

rocketpy/mathutils/function.py#L262

Added line #L262 was not covered by tests
"Multidimensional datasets only support natural extrapolation."
)

Expand All @@ -270,7 +270,7 @@
):
self.set_interpolation("shepard")
else:
raise ValueError(

Check warning on line 273 in rocketpy/mathutils/function.py

View check run for this annotation

Codecov / codecov/patch

rocketpy/mathutils/function.py#L273

Added line #L273 was not covered by tests
"Multidimensional datasets only support shepard interpolation."
)

Expand Down Expand Up @@ -2648,7 +2648,7 @@
The value of the input which gives the output closest to val.
"""
return optimize.root(
lambda x: self.get_value(x) - val,
lambda x: self.get_value(x)[0] - val,
start,
tol=tol,
).x[0]
Expand Down
Loading