From 3c24a9cfe07364a32eb7213d8c8664024c814669 Mon Sep 17 00:00:00 2001 From: ejsimley <40040961+ejsimley@users.noreply.github.com> Date: Fri, 5 Apr 2024 14:17:08 -0600 Subject: [PATCH] fixing datatype of value in wind_data; removing unnecessary AVP warning (#872) --- floris/floris_model.py | 6 +----- floris/wind_data.py | 6 +++--- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/floris/floris_model.py b/floris/floris_model.py index 3745eeb19..78f60ae5f 100644 --- a/floris/floris_model.py +++ b/floris/floris_model.py @@ -843,11 +843,7 @@ def get_farm_AVP( "operation." ) - if ( - values is None - and not isinstance(self.wind_data, WindRose) - and not isinstance(self.wind_data, WindTIRose) - ): + if values is None and self.wind_data is None: self.logger.warning( "Computing AVP with uniform value equal to 1. Results will be equivalent to " "annual energy production." diff --git a/floris/wind_data.py b/floris/wind_data.py index 6ac81f7aa..2579fd3e0 100644 --- a/floris/wind_data.py +++ b/floris/wind_data.py @@ -592,7 +592,7 @@ def assign_value_piecewise_linear( """ def piecewise_linear_value_func(wind_directions, wind_speeds): - value = np.zeros_like(wind_speeds) + value = np.zeros_like(wind_speeds, dtype=float) value[wind_speeds < ws_knee] = ( slope_1 * wind_speeds[wind_speeds < ws_knee] + value_zero_ws ) @@ -1146,7 +1146,7 @@ def assign_value_piecewise_linear( """ def piecewise_linear_value_func(wind_directions, wind_speeds, turbulence_intensities): - value = np.zeros_like(wind_speeds) + value = np.zeros_like(wind_speeds, dtype=float) value[wind_speeds < ws_knee] = ( slope_1 * wind_speeds[wind_speeds < ws_knee] + value_zero_ws ) @@ -1550,7 +1550,7 @@ def assign_value_piecewise_linear( """ def piecewise_linear_value_func(wind_directions, wind_speeds): - value = np.zeros_like(wind_speeds) + value = np.zeros_like(wind_speeds, dtype=float) value[wind_speeds < ws_knee] = ( slope_1 * wind_speeds[wind_speeds < ws_knee] + value_zero_ws )