Skip to content

Commit

Permalink
fixing datatype of value in wind_data; removing unnecessary AVP warni…
Browse files Browse the repository at this point in the history
…ng (#872)
  • Loading branch information
ejsimley authored Apr 5, 2024
1 parent f1e5324 commit 3c24a9c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 8 deletions.
6 changes: 1 addition & 5 deletions floris/floris_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -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."
Expand Down
6 changes: 3 additions & 3 deletions floris/wind_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
)
Expand Down Expand Up @@ -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
)
Expand Down Expand Up @@ -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
)
Expand Down

0 comments on commit 3c24a9c

Please sign in to comment.