From 3372955988b64502c62c2bb3a8b7c17c55977e9f Mon Sep 17 00:00:00 2001 From: Hyeonsu Lyu Date: Wed, 17 May 2023 16:41:15 +0900 Subject: [PATCH 1/2] Change interpolate.interp2d into RegularGridInterpolator scipy.interpolate.interp2d will be deprecated in future scipy. --- .../env/balloon/acs.py | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/balloon_learning_environment/env/balloon/acs.py b/balloon_learning_environment/env/balloon/acs.py index ff9f513..a21ed82 100644 --- a/balloon_learning_environment/env/balloon/acs.py +++ b/balloon_learning_environment/env/balloon/acs.py @@ -27,17 +27,17 @@ np.array([100.0, 100.0, 300.0, 400.0, 400.0]), # power fill_value='extrapolate')) - + _PRESSURE_RATIO_POWER_TO_EFFICIENCY: interpolate.interp2d = ( - interpolate.interp2d( - np.linspace(1.05, 1.35, 13), # pressure_ratio - np.linspace(100.0, 400.0, 4), # power - np.array([0.4, 0.4, 0.3, 0.2, 0.2, 0.00000, 0.00000, 0.00000, 0.00000, - 0.00000, 0.00000, 0.00000, 0.00000, 0.4, 0.3, 0.3, 0.30, 0.25, - 0.23, 0.20, 0.15, 0.12, 0.10, 0.00000, 0.00000, 0.00000, - 0.00000, 0.3, 0.25, 0.25, 0.25, 0.20, 0.20, 0.20, 0.2, 0.15, - 0.13, 0.12, 0.11, 0.00000, 0.23, 0.23, 0.23, 0.23, 0.23, 0.20, - 0.20, 0.20, 0.18, 0.16, 0.15, 0.13]), # efficiency + interpolate.RegularGridInterpolator( + (np.linspace(1.05, 1.35, 13), # pressure_ratio + np.linspace(100.0, 400.0, 4)), # power + np.array([0.4, 0.4, 0.3, 0.2, 0.2, 0.00000, 0.00000, 0.00000, 0.00000], + [0.00000, 0.00000, 0.00000, 0.00000, 0.4, 0.3, 0.3, 0.30, 0.25], + [0.23, 0.20, 0.15, 0.12, 0.10, 0.00000, 0.00000, 0.00000], + [0.00000, 0.3, 0.25, 0.25, 0.25, 0.20, 0.20, 0.20, 0.2, 0.15], + [0.13, 0.12, 0.11, 0.00000, 0.23, 0.23, 0.23, 0.23, 0.23, 0.20], + [0.20, 0.20, 0.18, 0.16, 0.15, 0.13]]), # efficiency fill_value=None)) From 0ec2b9f67d6e4c80ea5116e97c3dd8532aba12cb Mon Sep 17 00:00:00 2001 From: Hyeonsu Lyu Date: Wed, 17 May 2023 16:46:05 +0900 Subject: [PATCH 2/2] Change interpolate.interp2d() into RegularGridInterpolator(). scipy.interpolate.interp2d will be deprecated in future scipy. --- balloon_learning_environment/env/balloon/acs.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/balloon_learning_environment/env/balloon/acs.py b/balloon_learning_environment/env/balloon/acs.py index a21ed82..7a672c4 100644 --- a/balloon_learning_environment/env/balloon/acs.py +++ b/balloon_learning_environment/env/balloon/acs.py @@ -32,12 +32,12 @@ interpolate.RegularGridInterpolator( (np.linspace(1.05, 1.35, 13), # pressure_ratio np.linspace(100.0, 400.0, 4)), # power - np.array([0.4, 0.4, 0.3, 0.2, 0.2, 0.00000, 0.00000, 0.00000, 0.00000], - [0.00000, 0.00000, 0.00000, 0.00000, 0.4, 0.3, 0.3, 0.30, 0.25], - [0.23, 0.20, 0.15, 0.12, 0.10, 0.00000, 0.00000, 0.00000], - [0.00000, 0.3, 0.25, 0.25, 0.25, 0.20, 0.20, 0.20, 0.2, 0.15], - [0.13, 0.12, 0.11, 0.00000, 0.23, 0.23, 0.23, 0.23, 0.23, 0.20], - [0.20, 0.20, 0.18, 0.16, 0.15, 0.13]]), # efficiency + np.array([0.4, 0.4, 0.3, 0.2, 0.2, 0.00000, 0.00000, 0.00000, 0.00000, + 0.00000, 0.00000, 0.00000, 0.00000, 0.4, 0.3, 0.3, 0.30, 0.25, + 0.23, 0.20, 0.15, 0.12, 0.10, 0.00000, 0.00000, 0.00000, + 0.00000, 0.3, 0.25, 0.25, 0.25, 0.20, 0.20, 0.20, 0.2, 0.15, + 0.13, 0.12, 0.11, 0.00000, 0.23, 0.23, 0.23, 0.23, 0.23, 0.20, + 0.20, 0.20, 0.18, 0.16, 0.15, 0.13]).reshape(13, 4), # efficiency fill_value=None))