Skip to content

Commit 22bb07b

Browse files
authored
Merge pull request #492 from RocketPy-Team/bug/fix-N-dimensional-get-value-opt
FIX: Broken Function.get_value_opt for N-Dimensional Functions
2 parents 0ef9849 + 8d6f244 commit 22bb07b

File tree

6 files changed

+15
-5
lines changed

6 files changed

+15
-5
lines changed

CHANGELOG.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,15 @@ straightforward as possible.
4242

4343
-
4444

45+
## [v1.1.3] - 2023-11-29
46+
47+
Here we write upgrading notes for brands. It's a team effort to make them as
48+
straightforward as possible.
49+
50+
### Fixed
51+
52+
- FIX: Broken Function.get_value_opt for N-Dimensional Functions [#492](https://github.com/RocketPy-Team/RocketPy/pull/492/files)
53+
4554
## [v1.1.2] - 2023-11-25
4655

4756
You can install this version by running `pip install rocketpy==1.1.2`

docs/conf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
author = "RocketPy Team"
2525

2626
# The full version, including alpha/beta/rc tags
27-
release = "1.1.2"
27+
release = "1.1.3"
2828

2929

3030
# -- General configuration ---------------------------------------------------

docs/user/installation.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ If you want to choose a specific version to guarantee compatibility, you may ins
1919

2020
.. code-block:: shell
2121
22-
pip install rocketpy==1.1.2
22+
pip install rocketpy==1.1.3
2323
2424
2525
Optional Installation Method: ``conda``

rocketpy/mathutils/function.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -480,6 +480,7 @@ def get_value_opt(x):
480480

481481
elif self.__interpolation__ == "shepard":
482482
x_data = self.source[:, 0:-1] # Support for N-Dimensions
483+
y_data = self.source[:, -1]
483484
len_y_data = len(y_data) # A little speed up
484485

485486
# change the function's name to avoid mypy's error

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323

2424
setuptools.setup(
2525
name="rocketpy",
26-
version="1.1.2",
26+
version="1.1.3",
2727
install_requires=necessary_require,
2828
extras_require={
2929
"env_analysis": env_analysis_require,

tests/test_function.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,8 +73,8 @@ def test_getters(func_from_csv, func_2d_from_csv):
7373
assert func_2d_from_csv.get_outputs() == ["Scalar"]
7474
assert func_2d_from_csv.get_interpolation_method() == "shepard"
7575
assert func_2d_from_csv.get_extrapolation_method() == "natural"
76-
assert np.isclose(func_2d_from_csv.get_value(0, 0), 0.0, atol=1e-6)
77-
assert np.isclose(func_2d_from_csv.get_value_opt(0, 0), 0.0, atol=1e-6)
76+
assert np.isclose(func_2d_from_csv.get_value(0.1, 0.8), 0.058, atol=1e-6)
77+
assert np.isclose(func_2d_from_csv.get_value_opt(0.1, 0.8), 0.058, atol=1e-6)
7878

7979

8080
def test_setters(func_from_csv, func_2d_from_csv):

0 commit comments

Comments
 (0)