From afac8ef8bc963c67a39f07966b11562ade8bb466 Mon Sep 17 00:00:00 2001 From: giovaniceotto Date: Tue, 28 Nov 2023 15:12:47 -0300 Subject: [PATCH 1/4] FIX: correctly define y_data for N-dimensional functions in set_get_value_opt --- rocketpy/mathutils/function.py | 1 + 1 file changed, 1 insertion(+) diff --git a/rocketpy/mathutils/function.py b/rocketpy/mathutils/function.py index e52fbb2fb..1c02a3da1 100644 --- a/rocketpy/mathutils/function.py +++ b/rocketpy/mathutils/function.py @@ -480,6 +480,7 @@ def get_value_opt(x): elif self.__interpolation__ == "shepard": x_data = self.source[:, 0:-1] # Support for N-Dimensions + y_data = self.source[:, -1] len_y_data = len(y_data) # A little speed up # change the function's name to avoid mypy's error From b296a0f2b02ec6d9812d2c1fba7322b8d8d9e6c4 Mon Sep 17 00:00:00 2001 From: giovaniceotto Date: Tue, 28 Nov 2023 15:23:49 -0300 Subject: [PATCH 2/4] TST: adjust getters test to capture get_value_opt N-D bug --- tests/test_function.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/test_function.py b/tests/test_function.py index c67a21b30..5727f146e 100644 --- a/tests/test_function.py +++ b/tests/test_function.py @@ -73,8 +73,8 @@ def test_getters(func_from_csv, func_2d_from_csv): assert func_2d_from_csv.get_outputs() == ["Scalar"] assert func_2d_from_csv.get_interpolation_method() == "shepard" assert func_2d_from_csv.get_extrapolation_method() == "natural" - assert np.isclose(func_2d_from_csv.get_value(0, 0), 0.0, atol=1e-6) - assert np.isclose(func_2d_from_csv.get_value_opt(0, 0), 0.0, atol=1e-6) + assert np.isclose(func_2d_from_csv.get_value(0.1, 0.8), 0.058, atol=1e-6) + assert np.isclose(func_2d_from_csv.get_value_opt(0.1, 0.8), 0.058, atol=1e-6) def test_setters(func_from_csv, func_2d_from_csv): From caf27159da3ca9acc0fb3e6e6deb00e040ea13ac Mon Sep 17 00:00:00 2001 From: MateusStano Date: Wed, 29 Nov 2023 23:28:14 +0100 Subject: [PATCH 3/4] REL: bump version to 1.1.3 --- docs/conf.py | 2 +- docs/user/installation.rst | 2 +- setup.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/conf.py b/docs/conf.py index 9a056cbcc..820d3f347 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -24,7 +24,7 @@ author = "RocketPy Team" # The full version, including alpha/beta/rc tags -release = "1.1.2" +release = "1.1.3" # -- General configuration --------------------------------------------------- diff --git a/docs/user/installation.rst b/docs/user/installation.rst index 1945af799..ab6b0c9d9 100644 --- a/docs/user/installation.rst +++ b/docs/user/installation.rst @@ -19,7 +19,7 @@ If you want to choose a specific version to guarantee compatibility, you may ins .. code-block:: shell - pip install rocketpy==1.1.2 + pip install rocketpy==1.1.3 Optional Installation Method: ``conda`` diff --git a/setup.py b/setup.py index 4632bd009..b2e475b26 100644 --- a/setup.py +++ b/setup.py @@ -23,7 +23,7 @@ setuptools.setup( name="rocketpy", - version="1.1.2", + version="1.1.3", install_requires=necessary_require, extras_require={ "env_analysis": env_analysis_require, From 8d6f2442354cd6fb005c746ae36757abb6b9a05c Mon Sep 17 00:00:00 2001 From: MateusStano Date: Wed, 29 Nov 2023 23:30:35 +0100 Subject: [PATCH 4/4] MNT: update changelog --- CHANGELOG.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 311189757..ed80182ab 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -42,6 +42,15 @@ straightforward as possible. - +## [v1.1.3] - 2023-11-29 + +Here we write upgrading notes for brands. It's a team effort to make them as +straightforward as possible. + +### Fixed + +- FIX: Broken Function.get_value_opt for N-Dimensional Functions [#492](https://github.com/RocketPy-Team/RocketPy/pull/492/files) + ## [v1.1.2] - 2023-11-25 You can install this version by running `pip install rocketpy==1.1.2`