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.

Files changed (54) hide show
  1. examples/quickstart/run.py +17 -0
  2. foxes/__init__.py +1 -1
  3. foxes/algorithms/downwind/downwind.py +9 -15
  4. foxes/algorithms/downwind/models/farm_wakes_calc.py +13 -7
  5. foxes/algorithms/downwind/models/init_farm_data.py +4 -4
  6. foxes/algorithms/downwind/models/reorder_farm_output.py +5 -1
  7. foxes/algorithms/downwind/models/set_amb_point_results.py +1 -1
  8. foxes/algorithms/iterative/models/farm_wakes_calc.py +6 -3
  9. foxes/algorithms/sequential/models/seq_state.py +0 -18
  10. foxes/algorithms/sequential/sequential.py +5 -18
  11. foxes/constants.py +6 -0
  12. foxes/core/data.py +44 -18
  13. foxes/core/engine.py +19 -1
  14. foxes/core/farm_data_model.py +1 -0
  15. foxes/core/rotor_model.py +42 -38
  16. foxes/core/states.py +2 -47
  17. foxes/input/states/__init__.py +1 -0
  18. foxes/input/states/field_data_nc.py +39 -61
  19. foxes/input/states/multi_height.py +35 -58
  20. foxes/input/states/one_point_flow.py +22 -21
  21. foxes/input/states/scan.py +6 -19
  22. foxes/input/states/single.py +5 -17
  23. foxes/input/states/states_table.py +19 -41
  24. foxes/input/states/wrg_states.py +301 -0
  25. foxes/models/partial_wakes/rotor_points.py +8 -2
  26. foxes/models/partial_wakes/segregated.py +9 -4
  27. foxes/models/rotor_models/centre.py +6 -4
  28. foxes/models/wake_frames/seq_dynamic_wakes.py +5 -2
  29. foxes/models/wake_frames/timelines.py +10 -0
  30. foxes/models/wake_models/induction/vortex_sheet.py +6 -9
  31. foxes/output/farm_layout.py +12 -4
  32. foxes/output/farm_results_eval.py +36 -12
  33. foxes/output/rose_plot.py +20 -2
  34. foxes/output/slice_data.py +16 -19
  35. foxes/utils/wrg_utils.py +84 -1
  36. {foxes-1.2.4.dist-info → foxes-1.3.dist-info}/METADATA +12 -8
  37. {foxes-1.2.4.dist-info → foxes-1.3.dist-info}/RECORD +54 -52
  38. {foxes-1.2.4.dist-info → foxes-1.3.dist-info}/WHEEL +1 -1
  39. tests/0_consistency/iterative/test_iterative.py +2 -3
  40. tests/0_consistency/partial_wakes/test_partial_wakes.py +2 -2
  41. tests/1_verification/flappy_0_6/PCt_files/test_PCt_files.py +48 -56
  42. tests/1_verification/flappy_0_6/abl_states/test_abl_states.py +33 -36
  43. tests/1_verification/flappy_0_6/row_Jensen_linear_centre/test_row_Jensen_linear_centre.py +3 -2
  44. tests/1_verification/flappy_0_6/row_Jensen_linear_tophat/test_row_Jensen_linear_tophat.py +3 -3
  45. tests/1_verification/flappy_0_6/row_Jensen_linear_tophat_IECTI2005/test_row_Jensen_linear_tophat_IECTI_2005.py +3 -3
  46. tests/1_verification/flappy_0_6/row_Jensen_linear_tophat_IECTI2019/test_row_Jensen_linear_tophat_IECTI_2019.py +3 -3
  47. tests/1_verification/flappy_0_6/row_Jensen_quadratic_centre/test_row_Jensen_quadratic_centre.py +3 -3
  48. tests/1_verification/flappy_0_6_2/grid_rotors/test_grid_rotors.py +3 -3
  49. tests/1_verification/flappy_0_6_2/row_Bastankhah_Crespo/test_row_Bastankhah_Crespo.py +3 -2
  50. tests/1_verification/flappy_0_6_2/row_Bastankhah_linear_centre/test_row_Bastankhah_linear_centre.py +3 -3
  51. tests/3_examples/test_examples.py +3 -2
  52. {foxes-1.2.4.dist-info → foxes-1.3.dist-info}/LICENSE +0 -0
  53. {foxes-1.2.4.dist-info → foxes-1.3.dist-info}/entry_points.txt +0 -0
  54. {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
- c = 2000
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
- with foxes.Engine.new("threads", chunk_size_states=c):
44
-
45
- algo = foxes.algorithms.Downwind(
46
- farm,
47
- states,
48
- mbook=mbook,
49
- rotor_model="centre",
50
- wake_models=["Jensen_linear_k007"],
51
- wake_frame="rotor_wd",
52
- partial_wakes={"Jensen_linear_k007": "centre"},
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
- df = data.to_dataframe()[
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
- print()
63
- print("TRESULTS\n")
64
- print(df)
59
+ print()
60
+ print("TRESULTS\n")
61
+ print(df)
65
62
 
66
- print("\nReading file", cfile)
67
- fdata = pd.read_csv(cfile)
68
- print(fdata)
63
+ print("\nReading file", cfile)
64
+ fdata = pd.read_csv(cfile)
65
+ print(fdata)
69
66
 
70
- print("\nVERIFYING\n")
71
- df[FV.WS] = df["REWS"]
72
- df[FV.AMB_WS] = df["AMB_REWS"]
67
+ print("\nVERIFYING\n")
68
+ df[FV.WS] = df["REWS"]
69
+ df[FV.AMB_WS] = df["AMB_REWS"]
73
70
 
74
- delta = df.reset_index() - fdata
75
- print(delta)
76
- print(delta.max())
77
- chk = delta[[FV.AMB_WS, FV.AMB_P, FV.WS, FV.P]].abs()
78
- print(chk.max())
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
- assert (chk[FV.AMB_WS] < 1e-5).all()
81
- assert (chk[FV.AMB_P] < 1e-3).all()
82
- assert (chk[FV.WS] < 1e-5).all()
83
- assert (chk[FV.P] < 1e-3).all()
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
@@ -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
@@ -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