Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixing datatype of value in WindData objects #872

Merged
merged 1 commit into from
Apr 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading