Skip to content

Commit 820e5ea

Browse files
author
paulf81
authored
Merge pull request #248 from NREL/develop
FLASC v2.3
2 parents f3ed1c8 + 4417036 commit 820e5ea

4 files changed

Lines changed: 42 additions & 11 deletions

File tree

docs/index.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@
44

55
Welcome to the documentation of the NREL FLASC repository!
66

7+
```{note}
8+
FLASC v2.3 now requires `numpy` version 2, following the update in FLORIS v4.3. See the [numpy documentation for details](https://numpy.org/doc/stable/numpy_2_0_migration_guide.html).
9+
```
10+
711
FLASC provides a rich suite of analysis tools for SCADA data filtering &
812
analysis, wind farm model validation, field experiment design, and field
913
experiment monitoring. The repository is centrally built around NRELs

flasc/utilities/floris_tools.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -702,18 +702,18 @@ def yw_upper(x):
702702
y = (y0 + D[ii]) + (x - x0) * wake_slope
703703
if isinstance(y, (float, np.float64, np.float32)):
704704
if x < (x0 + 0.01):
705-
y = -np.Inf
705+
y = -np.inf
706706
else:
707-
y[x < x0 + 0.01] = -np.Inf
707+
y[x < x0 + 0.01] = -np.inf
708708
return y
709709

710710
def yw_lower(x):
711711
y = (y0 - D[ii]) - (x - x0) * wake_slope
712712
if isinstance(y, (float, np.float64, np.float32)):
713713
if x < (x0 + 0.01):
714-
y = -np.Inf
714+
y = -np.inf
715715
else:
716-
y[x < x0 + 0.01] = -np.Inf
716+
y[x < x0 + 0.01] = -np.inf
717717
return y
718718

719719
def is_in_wake(xt, yt):
@@ -804,18 +804,18 @@ def yw_upper(x):
804804
y = (y0 + D[ii]) + (x - x0) * wake_slope
805805
if isinstance(y, (float, np.float64, np.float32)):
806806
if x < (x0 + 0.01):
807-
y = -np.Inf
807+
y = -np.inf
808808
else:
809-
y[x < x0 + 0.01] = -np.Inf
809+
y[x < x0 + 0.01] = -np.inf
810810
return y
811811

812812
def yw_lower(x):
813813
y = (y0 - D[ii]) - (x - x0) * wake_slope
814814
if isinstance(y, (float, np.float64, np.float32)):
815815
if x < (x0 + 0.01):
816-
y = -np.Inf
816+
y = -np.inf
817817
else:
818-
y[x < x0 + 0.01] = -np.Inf
818+
y[x < x0 + 0.01] = -np.inf
819819
return y
820820

821821
def is_in_wake(xt, yt):

pyproject.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
44

55
[project]
66
name = "flasc"
7-
version = "2.2.1"
7+
version = "2.3"
88
description = "FLASC provides a rich suite of analysis tools for SCADA data filtering & analysis, wind farm model validation, field experiment design, and field experiment monitoring."
99
readme = "README.md"
1010
requires-python = ">=3.9"
@@ -24,11 +24,11 @@ classifiers = [
2424
]
2525
dependencies = [
2626
"bokeh>=2, <4",
27-
"floris~=4.0",
27+
"floris~=4.3",
2828
"feather-format~=0.0",
2929
"ipympl~=0.9",
3030
"matplotlib~=3.8",
31-
"numpy~=1.20",
31+
"numpy~=2.0",
3232
"pandas~=2.0",
3333
"SALib~=1.0",
3434
"scipy~=1.1",

tests/expected_power_analysis_test.py

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
import pandas as pd
55
import polars as pl
66
from polars.testing import assert_frame_equal
7+
from pytest import approx
78

89
from flasc.analysis.analysis_input import AnalysisInput
910
from flasc.analysis.expected_power_analysis import (
@@ -811,3 +812,29 @@ def test_uncertain_intervals():
811812
epao_standard_var.uplift_results["scada_uplift"]["energy_uplift_ub"]
812813
>= epao_standard_var.uplift_results["scada_uplift"]["energy_uplift_ctr"]
813814
)
815+
816+
817+
def test_expected_power_var_cov_option():
818+
"""Test uplift center and variance using cov option when dropping rows with missing vars."""
819+
a_in = load_data()
820+
821+
epao_standard_cov_or_var = total_uplift_expected_power(
822+
a_in=a_in,
823+
uplift_pairs=[("baseline", "wake_steering")],
824+
uplift_names=["scada_uplift"],
825+
test_turbines=[0, 1],
826+
use_predefined_wd=True,
827+
use_predefined_ws=True,
828+
wd_step=1.0,
829+
wd_min=0.5,
830+
ws_min=0.5,
831+
use_standard_error=True,
832+
cov_terms="cov",
833+
)
834+
835+
expected_uplift_var = (25 + 100 * (35 / 30) ** 2) / (30**2)
836+
837+
assert epao_standard_cov_or_var.uplift_results["scada_uplift"]["energy_uplift_ctr"] == 7 / 6
838+
assert epao_standard_cov_or_var.uplift_results["scada_uplift"]["energy_uplift_var"] == approx(
839+
expected_uplift_var
840+
)

0 commit comments

Comments
 (0)