foxes 1.2.4__py3-none-any.whl → 1.3__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of foxes might be problematic. Click here for more details.
- examples/quickstart/run.py +17 -0
- foxes/__init__.py +1 -1
- foxes/algorithms/downwind/downwind.py +9 -15
- foxes/algorithms/downwind/models/farm_wakes_calc.py +13 -7
- foxes/algorithms/downwind/models/init_farm_data.py +4 -4
- foxes/algorithms/downwind/models/reorder_farm_output.py +5 -1
- foxes/algorithms/downwind/models/set_amb_point_results.py +1 -1
- foxes/algorithms/iterative/models/farm_wakes_calc.py +6 -3
- foxes/algorithms/sequential/models/seq_state.py +0 -18
- foxes/algorithms/sequential/sequential.py +5 -18
- foxes/constants.py +6 -0
- foxes/core/data.py +44 -18
- foxes/core/engine.py +19 -1
- foxes/core/farm_data_model.py +1 -0
- foxes/core/rotor_model.py +42 -38
- foxes/core/states.py +2 -47
- foxes/input/states/__init__.py +1 -0
- foxes/input/states/field_data_nc.py +39 -61
- foxes/input/states/multi_height.py +35 -58
- foxes/input/states/one_point_flow.py +22 -21
- foxes/input/states/scan.py +6 -19
- foxes/input/states/single.py +5 -17
- foxes/input/states/states_table.py +19 -41
- foxes/input/states/wrg_states.py +301 -0
- foxes/models/partial_wakes/rotor_points.py +8 -2
- foxes/models/partial_wakes/segregated.py +9 -4
- foxes/models/rotor_models/centre.py +6 -4
- foxes/models/wake_frames/seq_dynamic_wakes.py +5 -2
- foxes/models/wake_frames/timelines.py +10 -0
- foxes/models/wake_models/induction/vortex_sheet.py +6 -9
- foxes/output/farm_layout.py +12 -4
- foxes/output/farm_results_eval.py +36 -12
- foxes/output/rose_plot.py +20 -2
- foxes/output/slice_data.py +16 -19
- foxes/utils/wrg_utils.py +84 -1
- {foxes-1.2.4.dist-info → foxes-1.3.dist-info}/METADATA +12 -8
- {foxes-1.2.4.dist-info → foxes-1.3.dist-info}/RECORD +54 -52
- {foxes-1.2.4.dist-info → foxes-1.3.dist-info}/WHEEL +1 -1
- tests/0_consistency/iterative/test_iterative.py +2 -3
- tests/0_consistency/partial_wakes/test_partial_wakes.py +2 -2
- tests/1_verification/flappy_0_6/PCt_files/test_PCt_files.py +48 -56
- tests/1_verification/flappy_0_6/abl_states/test_abl_states.py +33 -36
- tests/1_verification/flappy_0_6/row_Jensen_linear_centre/test_row_Jensen_linear_centre.py +3 -2
- tests/1_verification/flappy_0_6/row_Jensen_linear_tophat/test_row_Jensen_linear_tophat.py +3 -3
- tests/1_verification/flappy_0_6/row_Jensen_linear_tophat_IECTI2005/test_row_Jensen_linear_tophat_IECTI_2005.py +3 -3
- tests/1_verification/flappy_0_6/row_Jensen_linear_tophat_IECTI2019/test_row_Jensen_linear_tophat_IECTI_2019.py +3 -3
- tests/1_verification/flappy_0_6/row_Jensen_quadratic_centre/test_row_Jensen_quadratic_centre.py +3 -3
- tests/1_verification/flappy_0_6_2/grid_rotors/test_grid_rotors.py +3 -3
- tests/1_verification/flappy_0_6_2/row_Bastankhah_Crespo/test_row_Bastankhah_Crespo.py +3 -2
- tests/1_verification/flappy_0_6_2/row_Bastankhah_linear_centre/test_row_Bastankhah_linear_centre.py +3 -3
- tests/3_examples/test_examples.py +3 -2
- {foxes-1.2.4.dist-info → foxes-1.3.dist-info}/LICENSE +0 -0
- {foxes-1.2.4.dist-info → foxes-1.3.dist-info}/entry_points.txt +0 -0
- {foxes-1.2.4.dist-info → foxes-1.3.dist-info}/top_level.txt +0 -0
|
@@ -5,11 +5,11 @@ import inspect
|
|
|
5
5
|
import foxes
|
|
6
6
|
import foxes.variables as FV
|
|
7
7
|
|
|
8
|
-
thisdir = Path(inspect.getfile(inspect.currentframe())).parent
|
|
9
|
-
|
|
10
8
|
|
|
11
9
|
def test():
|
|
12
|
-
|
|
10
|
+
thisdir = Path(inspect.getabsfile(inspect.currentframe())).parent
|
|
11
|
+
print("TESTDIR:", thisdir)
|
|
12
|
+
|
|
13
13
|
cfile = thisdir / "flappy" / "results.csv.gz"
|
|
14
14
|
tfile = thisdir / "NREL-5MW-D126-H90.csv"
|
|
15
15
|
sfile = thisdir / "states.csv.gz"
|
|
@@ -40,47 +40,44 @@ def test():
|
|
|
40
40
|
verbosity=0,
|
|
41
41
|
)
|
|
42
42
|
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
verbosity=0,
|
|
54
|
-
)
|
|
43
|
+
algo = foxes.algorithms.Downwind(
|
|
44
|
+
farm,
|
|
45
|
+
states,
|
|
46
|
+
mbook=mbook,
|
|
47
|
+
rotor_model="centre",
|
|
48
|
+
wake_models=["Jensen_linear_k007"],
|
|
49
|
+
wake_frame="rotor_wd",
|
|
50
|
+
partial_wakes={"Jensen_linear_k007": "centre"},
|
|
51
|
+
verbosity=0,
|
|
52
|
+
)
|
|
55
53
|
|
|
54
|
+
with foxes.Engine.new("threads", chunk_size_states=2000):
|
|
56
55
|
data = algo.calc_farm()
|
|
57
56
|
|
|
58
|
-
|
|
59
|
-
[FV.AMB_WD, FV.WD, FV.AMB_REWS, FV.REWS, FV.AMB_P, FV.P]
|
|
60
|
-
]
|
|
57
|
+
df = data.to_dataframe()[[FV.AMB_WD, FV.WD, FV.AMB_REWS, FV.REWS, FV.AMB_P, FV.P]]
|
|
61
58
|
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
59
|
+
print()
|
|
60
|
+
print("TRESULTS\n")
|
|
61
|
+
print(df)
|
|
65
62
|
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
63
|
+
print("\nReading file", cfile)
|
|
64
|
+
fdata = pd.read_csv(cfile)
|
|
65
|
+
print(fdata)
|
|
69
66
|
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
67
|
+
print("\nVERIFYING\n")
|
|
68
|
+
df[FV.WS] = df["REWS"]
|
|
69
|
+
df[FV.AMB_WS] = df["AMB_REWS"]
|
|
73
70
|
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
71
|
+
delta = df.reset_index() - fdata
|
|
72
|
+
print(delta)
|
|
73
|
+
print(delta.max())
|
|
74
|
+
chk = delta[[FV.AMB_WS, FV.AMB_P, FV.WS, FV.P]].abs()
|
|
75
|
+
print(chk.max())
|
|
79
76
|
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
77
|
+
assert (chk[FV.AMB_WS] < 1e-5).all()
|
|
78
|
+
assert (chk[FV.AMB_P] < 1e-3).all()
|
|
79
|
+
assert (chk[FV.WS] < 1e-5).all()
|
|
80
|
+
assert (chk[FV.P] < 1e-3).all()
|
|
84
81
|
|
|
85
82
|
|
|
86
83
|
if __name__ == "__main__":
|
|
@@ -6,10 +6,11 @@ import inspect
|
|
|
6
6
|
import foxes
|
|
7
7
|
import foxes.variables as FV
|
|
8
8
|
|
|
9
|
-
thisdir = Path(inspect.getfile(inspect.currentframe())).parent
|
|
10
|
-
|
|
11
9
|
|
|
12
10
|
def test():
|
|
11
|
+
thisdir = Path(inspect.getabsfile(inspect.currentframe())).parent
|
|
12
|
+
print("TESTDIR:", thisdir)
|
|
13
|
+
|
|
13
14
|
n_s = 800
|
|
14
15
|
n_t = 76
|
|
15
16
|
p0 = np.array([0.0, 0.0])
|
|
@@ -5,12 +5,12 @@ import inspect
|
|
|
5
5
|
|
|
6
6
|
import foxes
|
|
7
7
|
import foxes.variables as FV
|
|
8
|
-
from foxes.config import config
|
|
9
|
-
|
|
10
|
-
thisdir = Path(inspect.getfile(inspect.currentframe())).parent
|
|
11
8
|
|
|
12
9
|
|
|
13
10
|
def test():
|
|
11
|
+
thisdir = Path(inspect.getabsfile(inspect.currentframe())).parent
|
|
12
|
+
print("TESTDIR:", thisdir)
|
|
13
|
+
|
|
14
14
|
n_s = 1000
|
|
15
15
|
n_t = 55
|
|
16
16
|
c = 1000
|
|
@@ -5,12 +5,12 @@ import inspect
|
|
|
5
5
|
|
|
6
6
|
import foxes
|
|
7
7
|
import foxes.variables as FV
|
|
8
|
-
from foxes.config import config
|
|
9
|
-
|
|
10
|
-
thisdir = Path(inspect.getfile(inspect.currentframe())).parent
|
|
11
8
|
|
|
12
9
|
|
|
13
10
|
def test():
|
|
11
|
+
thisdir = Path(inspect.getabsfile(inspect.currentframe())).parent
|
|
12
|
+
print("TESTDIR:", thisdir)
|
|
13
|
+
|
|
14
14
|
n_s = 30
|
|
15
15
|
n_t = 52
|
|
16
16
|
wd = 270.0
|
|
@@ -5,12 +5,12 @@ import inspect
|
|
|
5
5
|
|
|
6
6
|
import foxes
|
|
7
7
|
import foxes.variables as FV
|
|
8
|
-
from foxes.config import config
|
|
9
|
-
|
|
10
|
-
thisdir = Path(inspect.getfile(inspect.currentframe())).parent
|
|
11
8
|
|
|
12
9
|
|
|
13
10
|
def test():
|
|
11
|
+
thisdir = Path(inspect.getabsfile(inspect.currentframe())).parent
|
|
12
|
+
print("TESTDIR:", thisdir)
|
|
13
|
+
|
|
14
14
|
n_s = 30
|
|
15
15
|
n_t = 52
|
|
16
16
|
wd = 270.0
|
tests/1_verification/flappy_0_6/row_Jensen_quadratic_centre/test_row_Jensen_quadratic_centre.py
CHANGED
|
@@ -5,12 +5,12 @@ import inspect
|
|
|
5
5
|
|
|
6
6
|
import foxes
|
|
7
7
|
import foxes.variables as FV
|
|
8
|
-
from foxes.config import config
|
|
9
|
-
|
|
10
|
-
thisdir = Path(inspect.getfile(inspect.currentframe())).parent
|
|
11
8
|
|
|
12
9
|
|
|
13
10
|
def test():
|
|
11
|
+
thisdir = Path(inspect.getabsfile(inspect.currentframe())).parent
|
|
12
|
+
print("TESTDIR:", thisdir)
|
|
13
|
+
|
|
14
14
|
n_s = 800
|
|
15
15
|
n_t = 76
|
|
16
16
|
c = 1000
|
|
@@ -4,12 +4,12 @@ import inspect
|
|
|
4
4
|
|
|
5
5
|
import foxes
|
|
6
6
|
import foxes.variables as FV
|
|
7
|
-
from foxes.config import config
|
|
8
|
-
|
|
9
|
-
thisdir = Path(inspect.getfile(inspect.currentframe())).parent
|
|
10
7
|
|
|
11
8
|
|
|
12
9
|
def test():
|
|
10
|
+
thisdir = Path(inspect.getabsfile(inspect.currentframe())).parent
|
|
11
|
+
print("TESTDIR:", thisdir)
|
|
12
|
+
|
|
13
13
|
c = 500
|
|
14
14
|
cpath = thisdir / "flappy"
|
|
15
15
|
tfile = thisdir / "NREL-5MW-D126-H90.csv"
|
|
@@ -6,10 +6,11 @@ import inspect
|
|
|
6
6
|
import foxes
|
|
7
7
|
import foxes.variables as FV
|
|
8
8
|
|
|
9
|
-
thisdir = Path(inspect.getfile(inspect.currentframe())).parent
|
|
10
|
-
|
|
11
9
|
|
|
12
10
|
def test():
|
|
11
|
+
thisdir = Path(inspect.getabsfile(inspect.currentframe())).parent
|
|
12
|
+
print("TESTDIR:", thisdir)
|
|
13
|
+
|
|
13
14
|
n_s = 30
|
|
14
15
|
n_t = 52
|
|
15
16
|
wd = 270.0
|
tests/1_verification/flappy_0_6_2/row_Bastankhah_linear_centre/test_row_Bastankhah_linear_centre.py
CHANGED
|
@@ -5,12 +5,12 @@ import inspect
|
|
|
5
5
|
|
|
6
6
|
import foxes
|
|
7
7
|
import foxes.variables as FV
|
|
8
|
-
from foxes.config import config
|
|
9
|
-
|
|
10
|
-
thisdir = Path(inspect.getfile(inspect.currentframe())).parent
|
|
11
8
|
|
|
12
9
|
|
|
13
10
|
def test():
|
|
11
|
+
thisdir = Path(inspect.getabsfile(inspect.currentframe())).parent
|
|
12
|
+
print("TESTDIR:", thisdir)
|
|
13
|
+
|
|
14
14
|
n_s = 99
|
|
15
15
|
n_t = 84
|
|
16
16
|
wd = 88.1
|
|
@@ -5,10 +5,11 @@ import os
|
|
|
5
5
|
|
|
6
6
|
from foxes.utils import load_module
|
|
7
7
|
|
|
8
|
-
thisdir = Path(inspect.getfile(inspect.currentframe())).parent
|
|
9
|
-
|
|
10
8
|
|
|
11
9
|
def test():
|
|
10
|
+
thisdir = Path(inspect.getabsfile(inspect.currentframe())).parent
|
|
11
|
+
print("TESTDIR:", thisdir)
|
|
12
|
+
|
|
12
13
|
rdir = thisdir.parent.parent / "examples"
|
|
13
14
|
rpath = rdir / "run_all.py"
|
|
14
15
|
print(rpath)
|
|
File without changes
|
|
File without changes
|
|
File without changes
|