foxes 1.2__py3-none-any.whl → 1.2.2__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 (57) hide show
  1. examples/abl_states/run.py +5 -5
  2. examples/induction/run.py +5 -5
  3. examples/random_timeseries/run.py +13 -13
  4. examples/scan_row/run.py +12 -7
  5. examples/sector_management/run.py +11 -7
  6. examples/single_state/run.py +5 -5
  7. examples/tab_file/run.py +1 -1
  8. examples/timeseries/run.py +5 -5
  9. examples/timeseries_slurm/run.py +5 -5
  10. examples/wind_rose/run.py +1 -1
  11. examples/yawed_wake/run.py +5 -5
  12. foxes/algorithms/downwind/downwind.py +15 -5
  13. foxes/algorithms/sequential/sequential.py +1 -1
  14. foxes/core/algorithm.py +24 -20
  15. foxes/core/axial_induction_model.py +18 -0
  16. foxes/core/engine.py +2 -14
  17. foxes/core/farm_controller.py +18 -0
  18. foxes/core/ground_model.py +19 -0
  19. foxes/core/partial_wakes_model.py +9 -21
  20. foxes/core/point_data_model.py +18 -0
  21. foxes/core/rotor_model.py +2 -18
  22. foxes/core/states.py +2 -17
  23. foxes/core/turbine_model.py +2 -18
  24. foxes/core/turbine_type.py +2 -18
  25. foxes/core/vertical_profile.py +8 -20
  26. foxes/core/wake_frame.py +2 -20
  27. foxes/core/wake_model.py +19 -20
  28. foxes/core/wake_superposition.py +19 -0
  29. foxes/input/states/__init__.py +1 -1
  30. foxes/input/states/field_data_nc.py +14 -1
  31. foxes/input/states/{scan_ws.py → scan.py} +39 -52
  32. foxes/input/yaml/__init__.py +1 -1
  33. foxes/input/yaml/dict.py +317 -50
  34. foxes/input/yaml/yaml.py +5 -5
  35. foxes/output/__init__.py +2 -1
  36. foxes/output/farm_results_eval.py +57 -35
  37. foxes/output/output.py +2 -18
  38. foxes/output/plt.py +19 -0
  39. foxes/output/rose_plot.py +413 -207
  40. foxes/utils/__init__.py +1 -2
  41. foxes/utils/subclasses.py +69 -0
  42. {foxes-1.2.dist-info → foxes-1.2.2.dist-info}/METADATA +1 -2
  43. {foxes-1.2.dist-info → foxes-1.2.2.dist-info}/RECORD +56 -56
  44. tests/0_consistency/iterative/test_iterative.py +1 -1
  45. tests/0_consistency/partial_wakes/test_partial_wakes.py +1 -1
  46. tests/1_verification/flappy_0_6/row_Jensen_linear_centre/test_row_Jensen_linear_centre.py +7 -2
  47. tests/1_verification/flappy_0_6/row_Jensen_linear_tophat/test_row_Jensen_linear_tophat.py +7 -2
  48. tests/1_verification/flappy_0_6/row_Jensen_linear_tophat_IECTI2005/test_row_Jensen_linear_tophat_IECTI_2005.py +7 -2
  49. tests/1_verification/flappy_0_6/row_Jensen_linear_tophat_IECTI2019/test_row_Jensen_linear_tophat_IECTI_2019.py +7 -2
  50. tests/1_verification/flappy_0_6/row_Jensen_quadratic_centre/test_row_Jensen_quadratic_centre.py +7 -2
  51. tests/1_verification/flappy_0_6_2/row_Bastankhah_Crespo/test_row_Bastankhah_Crespo.py +7 -3
  52. tests/1_verification/flappy_0_6_2/row_Bastankhah_linear_centre/test_row_Bastankhah_linear_centre.py +7 -2
  53. foxes/utils/windrose_plot.py +0 -152
  54. {foxes-1.2.dist-info → foxes-1.2.2.dist-info}/LICENSE +0 -0
  55. {foxes-1.2.dist-info → foxes-1.2.2.dist-info}/WHEEL +0 -0
  56. {foxes-1.2.dist-info → foxes-1.2.2.dist-info}/entry_points.txt +0 -0
  57. {foxes-1.2.dist-info → foxes-1.2.2.dist-info}/top_level.txt +0 -0
foxes/utils/__init__.py CHANGED
@@ -5,7 +5,7 @@ General utilities.
5
5
  from .wind_dir import wd2uv, wd2wdvec, wdvec2wd, uv2wd, delta_wd
6
6
  from .pandas_utils import PandasFileHelper
7
7
  from .xarray_utils import write_nc
8
- from .subclasses import all_subclasses
8
+ from .subclasses import all_subclasses, new_cls, new_instance
9
9
  from .dict import Dict
10
10
  from .factory import Factory, FDict, WakeKFactory
11
11
  from .data_book import DataBook
@@ -14,7 +14,6 @@ from .geopandas_utils import read_shp, shp2csv, read_shp_polygons, shp2geom2d
14
14
  from .load import import_module, load_module
15
15
  from .exec_python import exec_python
16
16
  from .regularize import sqrt_reg
17
- from .windrose_plot import TabWindroseAxes
18
17
  from .tab_files import read_tab_file
19
18
  from .random_xy import random_xy_square
20
19
  from .dev_utils import print_mem
foxes/utils/subclasses.py CHANGED
@@ -19,3 +19,72 @@ def all_subclasses(cls):
19
19
  return set(cls.__subclasses__()).union(
20
20
  [s for c in cls.__subclasses__() for s in all_subclasses(c)]
21
21
  )
22
+
23
+
24
+ def new_cls(base_cls, cls_name):
25
+ """
26
+ Run-time class selector.
27
+
28
+ Parameters
29
+ ----------
30
+ base_cls: object
31
+ The base class
32
+ cls_name: string
33
+ Name of the class
34
+
35
+ Returns
36
+ -------
37
+ cls: object
38
+ The derived class
39
+
40
+ :group: utils
41
+
42
+ """
43
+
44
+ if cls_name is None:
45
+ return None
46
+
47
+ allc = all_subclasses(base_cls)
48
+ found = cls_name in [scls.__name__ for scls in allc]
49
+
50
+ if found:
51
+ for scls in allc:
52
+ if scls.__name__ == cls_name:
53
+ return scls
54
+
55
+ else:
56
+ estr = "Class '{}' not found, available classes derived from '{}' are \n {}".format(
57
+ cls_name, base_cls.__name__, sorted([i.__name__ for i in allc])
58
+ )
59
+ raise KeyError(estr)
60
+
61
+
62
+ def new_instance(base_cls, cls_name, *args, **kwargs):
63
+ """
64
+ Run-time factory.
65
+
66
+ Parameters
67
+ ----------
68
+ base_cls: object
69
+ The base class
70
+ cls_name: string
71
+ Name of the class
72
+ args: tuple, optional
73
+ Additional parameters for the constructor
74
+ kwargs: dict, optional
75
+ Additional parameters for the constructor
76
+
77
+ Returns
78
+ -------
79
+ obj: object
80
+ The instance of the derived class
81
+
82
+ :group: utils
83
+
84
+ """
85
+
86
+ cls = new_cls(base_cls, cls_name)
87
+ if cls is None:
88
+ return None
89
+ else:
90
+ return cls(*args, **kwargs)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: foxes
3
- Version: 1.2
3
+ Version: 1.2.2
4
4
  Summary: Farm Optimization and eXtended yield Evaluation Software
5
5
  Author: Jonas Schulte
6
6
  Maintainer: Jonas Schulte
@@ -54,7 +54,6 @@ Requires-Dist: pandas
54
54
  Requires-Dist: xarray
55
55
  Requires-Dist: scipy
56
56
  Requires-Dist: netcdf4
57
- Requires-Dist: windrose
58
57
  Requires-Dist: cycler
59
58
  Requires-Dist: tqdm
60
59
  Requires-Dist: pyyaml
@@ -1,31 +1,31 @@
1
1
  docs/source/conf.py,sha256=72AHiaZYMAaEManz6F6WAN7TTfC01NfYlUzEWLDJVY4,12295
2
- examples/abl_states/run.py,sha256=_r74o2H8bZWE__faIQMlKOw_187MXh29femgLXhP8YM,4530
2
+ examples/abl_states/run.py,sha256=U6_XnVmG_76z91vHS1rOH8YjPDpichqzP8v-sTPEmGs,4594
3
3
  examples/compare_rotors_pwakes/run.py,sha256=EAODYtY4ZMJnmon4OSBmUBOle41OqUwaCPY3t-RZKEY,6643
4
4
  examples/compare_wakes/run.py,sha256=WFn74BBkPNOStdBvKR3mN3kv34M7u-SAmWTwtgqxUqA,7355
5
5
  examples/dyn_wakes/run.py,sha256=ApJgpdppzI35wOVGxDO5i1XeOw0HLOiyJt2aUWc5b0I,8698
6
6
  examples/field_data_nc/run.py,sha256=bGC2KAKy2vqPvHtus93wEuxEFd_TZl1VZgyVU3CQFQI,3484
7
- examples/induction/run.py,sha256=FnfzFJj5i3xB8myje2U8j1Sj7UfHjHwaPfi9VOvyqts,6270
7
+ examples/induction/run.py,sha256=eTxEdKJ_8MtYuxI0QNECqJ31x-zb9Zen5bUpwPtujPE,6334
8
8
  examples/multi_height/run.py,sha256=KsY5tN8z9QHitQQdxnTjHzPSPlYPn5pkcMskjd94D74,3288
9
9
  examples/power_mask/run.py,sha256=YK8RU0TLd7TgBJkPZQVrn8log-UQNZ7L3B3-yE8qu64,7584
10
- examples/random_timeseries/run.py,sha256=UMB8VQL3DlDoUO_zsU21e20o5fFtF2BOQNfq4BiBc-A,6130
11
- examples/scan_row/run.py,sha256=nWGm1M4yJzYaAoEe1PbxLCmQD6b34Xr2C-a4sCNUdmU,5700
12
- examples/sector_management/run.py,sha256=Lyu69rs4IxlBBPy2r3go8xHu443K-wV-AfbZVBZ7yb0,4368
10
+ examples/random_timeseries/run.py,sha256=bo-fLF647mc97we30ci9klw23kXISk4KtCBxRc1lIqA,6106
11
+ examples/scan_row/run.py,sha256=japzROlgEa71u2KYy03bQ8dBso-ejURUV3vZsg5m3AI,5844
12
+ examples/sector_management/run.py,sha256=WQvrHqtC7_u6JvZfbRsVSb3SPYDjCp-ZJpC-nZsQf5M,4451
13
13
  examples/sequential/run.py,sha256=CnNGrHp9OzijuQ0GFRN5FWW-RR4h9UBHvu5S9U3j0ac,5974
14
- examples/single_state/run.py,sha256=zdtFG_GuXI1dUJO0mbEBVxXhQiOG4zZP6h25ySx1KJU,6093
14
+ examples/single_state/run.py,sha256=MtqCJxkVZAOcAlu2BhJaq7AoOVAErgxbzHpmtmMs4As,6157
15
15
  examples/states_lookup_table/run.py,sha256=NE8Z_yOp7NWi8JHnxNoOUp6rF5Oq9dG5hWZA_7EXHuI,3916
16
16
  examples/streamline_wakes/run.py,sha256=MO-UPuQqG9P1pinTMZo9CSF8sYkcgJUrBy5HVtkKanI,4004
17
- examples/tab_file/run.py,sha256=eOr1oY_BuY77kXvvfy034D7TbVOROlAz72fSJ_BD4kE,4370
17
+ examples/tab_file/run.py,sha256=rMyNBIG30vreOUWD9NgUA0yBfJbmWofmsDpcs2m8v-s,4364
18
18
  examples/timelines/run.py,sha256=mYD7-bVstuxdO-7qCL2sRiItrBP5vK8vsNE0qppLfpg,7557
19
- examples/timeseries/run.py,sha256=DE1ZjXJbh3AVZZ4tyjkHX21px2Z6g1fWpqSVTV1Gqbk,5329
20
- examples/timeseries_slurm/run.py,sha256=GE3diBIMmKkm82CFu6tSL80EnrDQXrl7ISh-mi1o_ew,5517
21
- examples/wind_rose/run.py,sha256=3x3ZC8xkvWHlv67R0ffmh-pzD8lpYosmSyUhXyqi3Tc,4239
22
- examples/yawed_wake/run.py,sha256=66gJBuIoYMswa53jNG3HHiehdgAAmTW0kez-kZ4kOT0,6102
19
+ examples/timeseries/run.py,sha256=aCuEjWpwGXTeS1s9frOtAnpAHRnQoe4tu4Q0BHoPDys,5393
20
+ examples/timeseries_slurm/run.py,sha256=j-tJlCVDMp1FiPnfNTPcJhwV_MCmsvwi_umNTaDEG_Q,5581
21
+ examples/wind_rose/run.py,sha256=shKCX4-HOZwVBDrgnOaI0ycMpWLOBvhSw7SU_x7CzWo,4247
22
+ examples/yawed_wake/run.py,sha256=V_02HSuHQufzwhnVNGsJoQQpTgMlYtuZZVIDEaLU4U4,6166
23
23
  foxes/__init__.py,sha256=V0D5TDEqDNgZCcqm8kHaQdOksc2eUG-mql9YTL6HREs,1124
24
24
  foxes/constants.py,sha256=pgVQknBMsKYMGCDWlFsNK0er9CiJBGmm_WzoSt6Dtic,3201
25
25
  foxes/variables.py,sha256=bNebCA8eToDPA2Wh6AqkNkzor98nS1JVVMhd8gfakKc,5035
26
26
  foxes/algorithms/__init__.py,sha256=gCr5DK2wXhAAJf8eylkevN8yiwPdEC-pqY_LgjKzMv8,249
27
27
  foxes/algorithms/downwind/__init__.py,sha256=lyygq5GMc6NAPmH0b0mhGeccWyuC8JTOEMZl-UlmE5M,53
28
- foxes/algorithms/downwind/downwind.py,sha256=gS40bw0LQCj0mOFTSZKJ560b6X5sAZVb6tOdunlrC2I,24963
28
+ foxes/algorithms/downwind/downwind.py,sha256=9OS_uJwUhvu_L0zjPq4-GRW0mUMqBq2kNa3L9LtZH4o,25243
29
29
  foxes/algorithms/downwind/models/__init__.py,sha256=0ov8rjIQ02w3iB6yYCxaswPvHDlPM_8_di6xPh1TTkQ,300
30
30
  foxes/algorithms/downwind/models/farm_wakes_calc.py,sha256=IiO8_hhyT7aqPaMym2d__ZvwnjedoDgGj-x00muqOYg,5735
31
31
  foxes/algorithms/downwind/models/init_farm_data.py,sha256=KnDXy8NyStLXhQxeZsHMpds-lxisQu9BOBZeYtbJXLk,4108
@@ -40,34 +40,34 @@ foxes/algorithms/iterative/models/convergence.py,sha256=5fCeTMisYEhgvPRbLKMK0XYs
40
40
  foxes/algorithms/iterative/models/farm_wakes_calc.py,sha256=8xSDI9u5deiud80VKyFmXCOT_0THIKSIRPqnGK2wfr0,4946
41
41
  foxes/algorithms/iterative/models/urelax.py,sha256=412fHSpi_4MATE1qRzqcZDFff6iJpV1h3QIBL_7giQE,2076
42
42
  foxes/algorithms/sequential/__init__.py,sha256=2o05IH9XePnqxNEAn2Fr1qiCM6OooqmH2VtmdJXtK0c,94
43
- foxes/algorithms/sequential/sequential.py,sha256=W2il623cpL3bCyzY_sBgHiCqWaIuKO5tQ_joXY5W9B0,12389
43
+ foxes/algorithms/sequential/sequential.py,sha256=9S6eIIWKCD69Q5Ev8IA5h32L9RCQY_jIspd6EDE9xHU,12388
44
44
  foxes/algorithms/sequential/models/__init__.py,sha256=OneaRLxMPzVWLKL9cR3JIYHojfzVX_CQaPv-LP6mCZI,69
45
45
  foxes/algorithms/sequential/models/plugin.py,sha256=HhCeHM_YoJRMXuZKa8rXUJZDhWf5rNl28_UfDLSGWvA,1330
46
46
  foxes/algorithms/sequential/models/seq_state.py,sha256=J1PorBVV5xZFWobHvCrGDCD-q7Egz_Op1p4PDiacBy0,3654
47
47
  foxes/config/__init__.py,sha256=zXNgamapDTZJrrjkP5VMexyQP6Nwz7yGh4eVx-7HATA,62
48
48
  foxes/config/config.py,sha256=LIBem9YTKit2xDp5W_lwxqGF2jOucMWcQExTLCmE0N0,2645
49
49
  foxes/core/__init__.py,sha256=3dOuKrFeSM6fCMxfLxTbzUsBPVTZiRp0sFhnibniBko,1021
50
- foxes/core/algorithm.py,sha256=4G-ig1kN0d_HIEF7baWmGy6kFUAHQLe6HY5aD0h5gOc,27069
51
- foxes/core/axial_induction_model.py,sha256=U7g8vmdKBS4xVYXVpD-uNDnKUnpFXccRTWB5LOPDGaY,498
50
+ foxes/core/algorithm.py,sha256=wwI9KtncuW6gtS8UfCGbhZ88Ooj-WWZzsEu2_RIGXjA,27260
51
+ foxes/core/axial_induction_model.py,sha256=sGbTHFMjEYKiVjElLP_SCRulKatcK0wsEXf30zty2Vc,1023
52
52
  foxes/core/data.py,sha256=21hSiLzrrAKKVXjFbIF7oska0bR5qPB2XmxYUraNeIg,21931
53
53
  foxes/core/data_calc_model.py,sha256=Hhl2ZapafsIvq5z_YWlGqB3kkF64txohU_MHlfHAvpk,1334
54
- foxes/core/engine.py,sha256=Rz_w1PVxMeQTOlE0h6MlYFM23mjwABflr9Y2yGfgdP0,20054
55
- foxes/core/farm_controller.py,sha256=GamnHy2RjjTPj7stS12QiYvS4FPS5INEQ51sGymkMNM,12842
54
+ foxes/core/engine.py,sha256=lDaqIQz0C3INH9sX9AArnqZEYCvGrRLZiQ-WQ7G5vfg,19655
55
+ foxes/core/farm_controller.py,sha256=JMb2XttmeZLZLWOgh6WABHtVUZMfWvv9tGxxVJ6bgGU,13364
56
56
  foxes/core/farm_data_model.py,sha256=uEhPjtyNZqZsVT_ySRg0MjpTWLZ6gg_Em-wmYmFDz8s,7383
57
57
  foxes/core/farm_model.py,sha256=ogFahCjC2dIBcjnCMmy0cTGulKTDA2ufFUzODf0-KnI,265
58
- foxes/core/ground_model.py,sha256=SmOfNfGwyFGLFxbwYWEDhxIRiseXjvQULPrGDhN37ds,6803
58
+ foxes/core/ground_model.py,sha256=oRlgrTBAcYaIv8gf5BRccDBlz8GhmAMIlFiVnHt6sXQ,7311
59
59
  foxes/core/model.py,sha256=UgoT99BaBBNXKlhUDY87uGJ5WrJ5cpFDIhHcDDzWMvw,19660
60
- foxes/core/partial_wakes_model.py,sha256=iWbIoqZXwDeA43VbG_06PLmpS00pNPPaZUrUsHALxvk,5688
61
- foxes/core/point_data_model.py,sha256=frWXqv9kOwvsvgrdDUnP9AxCrd4BacrHTGMrqySJXnU,7066
62
- foxes/core/rotor_model.py,sha256=oOF6wu-SEya_id1zvFkXdmoxcYjYlbFKzTOV6RBqp74,13234
63
- foxes/core/states.py,sha256=otcz9VmlaFEJbVLVB4BBem5a66n927tCl_VM9L1YhH4,8764
60
+ foxes/core/partial_wakes_model.py,sha256=L_Wz0U1ps0suw6la-O9xwngYO9HxfGI9wjMGlpARVjA,5413
61
+ foxes/core/point_data_model.py,sha256=90AEIVHkmGP80RhptyPpQDA7wvOnZfF-0VD2dv3L718,7569
62
+ foxes/core/rotor_model.py,sha256=vGKFv_FSjSlxBJQUpbsHGK_q6h3Zd6ow8TzxjSFS_mQ,12772
63
+ foxes/core/states.py,sha256=4oqd_j42M9u91tghnmE89zf-QR5J2tINuBhlLq_Jt_0,8308
64
64
  foxes/core/turbine.py,sha256=P5qPKmV1qohZdAKW4lPiUerQkRDTxUOhsvBPQqy8mBo,3054
65
- foxes/core/turbine_model.py,sha256=IcsU848QNHbUhDN5oqd7VnVWKx_VM5UwRhlPsWK_njw,2049
66
- foxes/core/turbine_type.py,sha256=o1ILP_3BkbMxglKCmNtQiLTQYSRBdOANZoco01d1GTM,3635
67
- foxes/core/vertical_profile.py,sha256=pgjari78N2CHZOWnidQ_7KGsSs4lTFP9isn-w6e1Yro,1642
68
- foxes/core/wake_frame.py,sha256=3g5wCco5N176zYAtZuk3oJRa4UAKJFfVqFiJkFMQ4Z8,9741
69
- foxes/core/wake_model.py,sha256=2_JkeaiGR64tu0AoC70He1QqslysZRdjF2yELdl_HaE,8189
70
- foxes/core/wake_superposition.py,sha256=FKVMe2WpXgDmJbM-Sv1teEJLJs9dBZjajB9-r2LacLs,2812
65
+ foxes/core/turbine_model.py,sha256=I-t-2lNVDaifg_cHEurqan9Ko9kcI1k-VEkKS_nyX-o,1585
66
+ foxes/core/turbine_type.py,sha256=DbzDmSfSow7RPCyRlQ_WrzWJ7fPnIN0BBGVzWhhG8FU,3174
67
+ foxes/core/vertical_profile.py,sha256=5fRmvTc-9afFDfaDLt2UY7xATK36o8Jq2hxATueuelw,1364
68
+ foxes/core/wake_frame.py,sha256=h5yR2_dEVOvroAizhszexfYqDvU7E7TiFfETELMKkBs,9240
69
+ foxes/core/wake_model.py,sha256=JYQ-J7Cz1D68eBfOlQamj_mlHyFeICHVgyOFlcNprbY,8170
70
+ foxes/core/wake_superposition.py,sha256=4okhaQXDmcIOOrYiY2zzcxYy4lhw_IDQDBclXv4alrs,3324
71
71
  foxes/core/wind_farm.py,sha256=iYetYGFPaPz9Rh-2bLoeknOCiromXqlicZ4snRtSEIc,1755
72
72
  foxes/data/__init__.py,sha256=SJXiU6ynbvlhYyDg4mnwkBXyE5yWyI5QV_5HCfs1xf0,153
73
73
  foxes/data/parse.py,sha256=x71oWLyvVsMJ7XVL9VRQXZbflnTXqBaxyBdoMQdZExs,2947
@@ -109,20 +109,20 @@ foxes/input/farm_layout/from_random.py,sha256=6ZYKbdV6x11MbQRAHs5nVYBAG-1K295xsM
109
109
  foxes/input/farm_layout/grid.py,sha256=CsVIYfCPyznEhDLO_tsTxBPJ591x8l-axDg4M5yArg0,1492
110
110
  foxes/input/farm_layout/ring.py,sha256=ghfLkVVQciWDJJNqGs4jZVnM0XCII9ae3hAh9Wb4938,1455
111
111
  foxes/input/farm_layout/row.py,sha256=Bx9woFNkXbFXJg51GX2p2PbVgdxV3Ckxr-3TkB04PS4,1198
112
- foxes/input/states/__init__.py,sha256=Se7F2n3ZJZd6lsdwG0peIOJUKjoGPqKwfVI2gw1oHQY,564
113
- foxes/input/states/field_data_nc.py,sha256=l8zD2RLG8K2l8cm57RxVOesl9NOLay-YVc-Nz59TVDE,22682
112
+ foxes/input/states/__init__.py,sha256=zLABJvqiQ6ZUVNYfWe1uuyQDJN83_AOS3se5NCilWRM,565
113
+ foxes/input/states/field_data_nc.py,sha256=AzwbZAu1ZknZDDXukvH4kgavuj1_7lXPb4mfS37e6WA,23282
114
114
  foxes/input/states/multi_height.py,sha256=U7ZOEmrciVbrEdIXSywpcMbUGSxIpsbTDa-jEsB5wTo,23792
115
115
  foxes/input/states/one_point_flow.py,sha256=TuMYGSHz3nOwN3gdWxbQNRHzKmtVtV4AbnHTJ6dVceA,17787
116
- foxes/input/states/scan_ws.py,sha256=h_F8gTGEy7McLUu6t9mUxhWCsX4-FXMCfEIB6fYtz_c,6231
116
+ foxes/input/states/scan.py,sha256=43CnJl-iRUbRrJCtu-u6Na5DDY19_184myD6ScMfcFA,6101
117
117
  foxes/input/states/single.py,sha256=jwcZ2quljXS9cDyYbf3wgvbYUe6umqNfyfvRdylYbC0,6137
118
118
  foxes/input/states/slice_data_nc.py,sha256=ojgT0PuHMEFe5t6AltfR8lj0Si4H4ZIQ7HjlLPhHfuM,21807
119
119
  foxes/input/states/states_table.py,sha256=-y0vYGQ_OVNQUPMgU99da2FVBDEUvNUMzHN0HHkEbFA,20447
120
120
  foxes/input/states/create/__init__.py,sha256=Ocqzmr9SOefeAvGX5DgawsPXfNdGzWOZ2ssvtqEmtAo,134
121
121
  foxes/input/states/create/random_abl_states.py,sha256=7KD1q8pF0IQcv-AYq6tqw7jEd3D3Q3xSqOoF5WxMReU,3411
122
122
  foxes/input/states/create/random_timeseries.py,sha256=gJpaQ4nEXxOjI4hp3xjNcVbCsmZUm-brXUxoqDb63WE,1266
123
- foxes/input/yaml/__init__.py,sha256=8f7J8Fn7Ni9r6BpeeISss-P5x3eTLI_p4DRq3rQNZT8,109
124
- foxes/input/yaml/dict.py,sha256=0EdMc6N7m5gcHgu-k4w6gcLO2liGg7WwwjQ-pkInpw0,6846
125
- foxes/input/yaml/yaml.py,sha256=7oPZnqa66SGtDBNWcWpB2A0tVRCdG5c_CshClku_rRc,2736
123
+ foxes/input/yaml/__init__.py,sha256=1EIaXSaykZ3VnhXN_SgqnWkRLVkXsL_608_-f19Xk14,167
124
+ foxes/input/yaml/dict.py,sha256=yHkw_x81ZKQ7BlCaTchoTDDAeakfr_zNdtXZgLGZ-B8,13607
125
+ foxes/input/yaml/yaml.py,sha256=wVn6v-4g_Cz-MuNBJhVku9UXCIJrwd9fviLbvsokUcA,2704
126
126
  foxes/input/yaml/windio/__init__.py,sha256=h5zp7VDWYq7K4GVX91CkoEABhpYSTisFWiw-0YAq3eU,196
127
127
  foxes/input/yaml/windio/get_states.py,sha256=cl4ZMurwbUyZflaoC1TPdBc5VjS7s7zp4_FYp80hkX0,6081
128
128
  foxes/input/yaml/windio/read_attributes.py,sha256=ZcMaHTsD8IoF6AmIQ5imnQEnJ9oSuA_-kiOGklPIieQ,12830
@@ -224,15 +224,16 @@ foxes/models/wake_superpositions/ws_max.py,sha256=XzNbqa8bmkMwMkasnUml6x3j0-k4C5
224
224
  foxes/models/wake_superpositions/ws_pow.py,sha256=t2nAUjTK6hPstyGPNeJH9dqgbhOmQ91TXQPJDs1aDTw,9630
225
225
  foxes/models/wake_superpositions/ws_product.py,sha256=PGyz7CwMRR4T6R6IELugcdk0e3DCQYWejsgzgva820c,4635
226
226
  foxes/models/wake_superpositions/ws_quadratic.py,sha256=3pWDd-HSVD4_OKQ5YQaUX1RY1KZZu46Q1Xhvf9xp7Jc,9225
227
- foxes/output/__init__.py,sha256=HXIah5WbE_aBON9geFT_2IF2N1AQhlOPQro82I6OgUM,746
227
+ foxes/output/__init__.py,sha256=qsHSwE_6ok0ucKZU0XhbvQ9uhBjDP12OkLBN8h5shEs,784
228
228
  foxes/output/animation.py,sha256=zljekg6k2DjqVaBw0OamB4i3eopi6g2j0a12B9hx7VQ,2637
229
229
  foxes/output/calc_points.py,sha256=paFBNUCbg0Vw-VKsvoXygQcq-T3y10IvcVmSUoHb5Do,4567
230
230
  foxes/output/farm_layout.py,sha256=tTE1Ioozh4wU0eMqIpdUd6VLtM_xmXRM_l4iX6-jiIU,11595
231
- foxes/output/farm_results_eval.py,sha256=Rddl6dg-WlYf0MCoKYFNuu9vmD9a6p10bF2zaFK6_y4,17729
231
+ foxes/output/farm_results_eval.py,sha256=STGLAFqM06bO7SXcEo0APcmBWhLVo6VzENgqt4Q_JY4,18692
232
232
  foxes/output/grids.py,sha256=tjQjF3Q_OyI7iOUsbED_P625yDSvHGoIKbS4T_ZB8uI,22504
233
- foxes/output/output.py,sha256=XVG_R8Cs09B2JivXSVMPCvmR1QCPlyjmB1HIC89ktNs,3690
233
+ foxes/output/output.py,sha256=1hrhKGbC8ODe4RRAl4G1BAMNY5aFWMfublUZJ6VQlNM,3249
234
+ foxes/output/plt.py,sha256=6_4Zniv6iqVctNCbxFn2gMYE0aC0FqwNaaBJgIROlHI,356
234
235
  foxes/output/results_writer.py,sha256=zUlj7szylvudYmwLciD6TcStmv7gBcp4bE1xQQ5JL_s,5789
235
- foxes/output/rose_plot.py,sha256=HP3FoW_VmqB3wTjP2Ga4bKYRvAf9RVe0o4D99S-5AnA,11541
236
+ foxes/output/rose_plot.py,sha256=WIkK3vY6yyu7rG8Myr8fiI6gPnXGLFh0AGnqsF99LHs,17712
236
237
  foxes/output/rotor_point_plots.py,sha256=KW4t_2lCSc90BzvJDT9xBOAe6JXWSc75UDu4tlK3Se0,3276
237
238
  foxes/output/round.py,sha256=s8YcXciCtaMY14SnG3ebYccyjQ2IEln256SwN9oJnPI,351
238
239
  foxes/output/slice_data.py,sha256=ubLrNxY3FKheYqMsygYbo3LeixVhrq5_sLzfaV6cYN0,33798
@@ -245,7 +246,7 @@ foxes/output/flow_plots_2d/get_fig.py,sha256=gGMOfzNCukq_l0FZLmi3zSBl0ANkQi2WoKa
245
246
  foxes/output/seq_plugins/__init__.py,sha256=d6Tl5NBVV4MaZwXtPgyxBXBnh7uCBFTbNzRU6IXCmQQ,110
246
247
  foxes/output/seq_plugins/seq_flow_ani_plugin.py,sha256=yAC-ZA_rkIOCHc1TN3uQYW0Z1CbxLTgP84Lrfr4D8cI,3654
247
248
  foxes/output/seq_plugins/seq_wake_debug_plugin.py,sha256=oAijRu9XRjUL9X4lZF-V6jqOfv8omokRp7YMkL1I2_M,3969
248
- foxes/utils/__init__.py,sha256=Zgz1_iDPb4okUwfcxaMRvXmn3D3jamslFfiU6wk2EEo,764
249
+ foxes/utils/__init__.py,sha256=cVrVo5P9Ge-AxHAtc3_gMGmj1XL46xbfZY4okvIZNT8,744
249
250
  foxes/utils/cubic_roots.py,sha256=u2Pf-yHZ6EASpFONMfkv0mvldmd1E1VRZxj69YabDoc,3321
250
251
  foxes/utils/data_book.py,sha256=z96QUC9FI7mv1NEFJUkkTcxWqx5Fc9gPeyzPwbFbyoM,5301
251
252
  foxes/utils/dev_utils.py,sha256=6vryhcTg8lNXhtZOsQ0F8PTVpmUw250VNE-UyR0G70Y,1241
@@ -258,11 +259,10 @@ foxes/utils/pandas_helpers.py,sha256=Zk_PFTyKkJyeIc52K-KJ5Ab6Hv0PJw820vwPgnQmiko
258
259
  foxes/utils/pandas_utils.py,sha256=5r3RHjaGu-Vi7DGMBdCDxVeu9nZk46wtPlHRL4l_R_c,4630
259
260
  foxes/utils/random_xy.py,sha256=i0AZ04BLL6TxC3Lg1ZfwI_o4zJbHR6hm-BNd0Sydu_c,1376
260
261
  foxes/utils/regularize.py,sha256=OnJ88ZCSu289aLHgrOb96j1A9JVvg_7OjZ3lWZAnNHo,512
261
- foxes/utils/subclasses.py,sha256=bnlZaLgGjq9cQC9dvsxahUmLQQlSmmun35TjWYyX9CA,380
262
+ foxes/utils/subclasses.py,sha256=wCfhuialpBOQOPMwNbaplkVmf60vR9AIkY_o3tdkgXI,1737
262
263
  foxes/utils/tab_files.py,sha256=H50IpLaqffJn9A51orCGc4fOhCOzoNUYDUKek4OAayU,1811
263
264
  foxes/utils/two_circles.py,sha256=xkj-SA_x-VXY7KtmSU4lcV4gFdplyhU3sBAC9vTdkF4,2810
264
265
  foxes/utils/wind_dir.py,sha256=6W0njWDvnIdOOjwqcMr64MW9ApjdtFA75blVUxirPMo,2823
265
- foxes/utils/windrose_plot.py,sha256=O9zLrDzQXIgKdBwzqNkusyA_rMshbk-8ybloIwt8vuY,4589
266
266
  foxes/utils/xarray_utils.py,sha256=zAapAWYzKEBiM4h1oABNd4MvVcz-aO1gkymmhG7_uBg,1570
267
267
  foxes/utils/abl/__init__.py,sha256=ijn-ubLLlqqH6tTAXFRmBAxJZmVBlTEmtx1cdCCtG4I,135
268
268
  foxes/utils/abl/neutral.py,sha256=E4DEhvXvw74BPrYr1MjQjeIaoz6ZOTWVlqScKflm-0M,1358
@@ -276,34 +276,34 @@ foxes/utils/geom2d/example_intersection.py,sha256=4e6sjpZEk_bNc462YvwKPzwxdV1B90
276
276
  foxes/utils/geom2d/example_union.py,sha256=BKfLt1mtQcSto-qExeMQkq8tQ6kfFXVJ93Cc7DhOal8,1750
277
277
  foxes/utils/geom2d/half_plane.py,sha256=kzZD6pkZxZ03MK9WAboWzXb5Ws5dWLQY9GIahD4D9mA,6167
278
278
  foxes/utils/geom2d/polygon.py,sha256=Xj7triA5Pe4-48sNSAvGxEXlQGptV161LUpKKCf3YOY,5535
279
- tests/0_consistency/iterative/test_iterative.py,sha256=3RH3MqhB2LV9Bz4zadzPSLuvnV33Cf0JzCQqINEXYaU,2632
280
- tests/0_consistency/partial_wakes/test_partial_wakes.py,sha256=a0u_Fw2XDqAAOp8lKNhkgXqWjUm292rFI-YIibSmnBs,2547
279
+ tests/0_consistency/iterative/test_iterative.py,sha256=2hEMl9RyDORYMHYRioEpv2Qd8vWUzhkLHlCHuMsRUnk,2632
280
+ tests/0_consistency/partial_wakes/test_partial_wakes.py,sha256=_c9B3CjIk7A9B0gdTkH4h6ftkBBIMCIxCtnqRV8swSI,2547
281
281
  tests/1_verification/flappy_0_6/PCt_files/test_PCt_files.py,sha256=QyY1pKWyScruAk_N6zfumU-hwv0Nsqrow3MDvEoOlGc,2749
282
282
  tests/1_verification/flappy_0_6/PCt_files/flappy/run.py,sha256=wJLKFOKVxOjmncYRarK5EK12HNjpWEUuu3EKgdq-Cvw,2165
283
283
  tests/1_verification/flappy_0_6/abl_states/test_abl_states.py,sha256=MQkh6KdA1PfsflAsUCCicEouwOd1j5V6tQHhW5SjX4A,2278
284
284
  tests/1_verification/flappy_0_6/abl_states/flappy/run.py,sha256=hnPSO_wqk9vYgwNNMWXb_UaYZOCnlwScVlfZl7rriV4,2058
285
285
  tests/1_verification/flappy_0_6/partial_top_hat/test_partial_top_hat.py,sha256=TWdY4qP47KM9L39SeytPsmUzFDD4YObRESXL5iXtiWg,2125
286
286
  tests/1_verification/flappy_0_6/partial_top_hat/flappy/run.py,sha256=NMtLneJLk6J1DXE59FZ1JAGlh-zBwegtCAq8nB-p13I,1993
287
- tests/1_verification/flappy_0_6/row_Jensen_linear_centre/test_row_Jensen_linear_centre.py,sha256=CbA2ZhoyKUtXZQbUEzDr1fDN718Ulmmxq01QrwmBt6c,2332
287
+ tests/1_verification/flappy_0_6/row_Jensen_linear_centre/test_row_Jensen_linear_centre.py,sha256=RWEl9e_Wmr7fmdWwtWAQQVe_OD7VoQaR6z0_PJ_p4SQ,2412
288
288
  tests/1_verification/flappy_0_6/row_Jensen_linear_centre/flappy/run.py,sha256=xTBI8dssYiqy7WC0IlKonfHQVshUk2ROyCzmecW0hbI,2184
289
- tests/1_verification/flappy_0_6/row_Jensen_linear_tophat/test_row_Jensen_linear_tophat.py,sha256=HRdBcU0RNJeUEux6QhnNJxP0Q4mz4JudWzhpPrc1w3I,2371
289
+ tests/1_verification/flappy_0_6/row_Jensen_linear_tophat/test_row_Jensen_linear_tophat.py,sha256=MAL8Au5g4ZURcx8lVZScJjRc2BBHr0ALz_XgGDxMlIA,2451
290
290
  tests/1_verification/flappy_0_6/row_Jensen_linear_tophat/flappy/run.py,sha256=uhWgRbEbmM5t_ZdcG1U_719eo_2idWfML04wjFQhYL0,2180
291
- tests/1_verification/flappy_0_6/row_Jensen_linear_tophat_IECTI2005/test_row_Jensen_linear_tophat_IECTI_2005.py,sha256=RNOliNVjN0ePpstE0-1OV92poUh8mpTvdVuRQrEYTi0,2896
291
+ tests/1_verification/flappy_0_6/row_Jensen_linear_tophat_IECTI2005/test_row_Jensen_linear_tophat_IECTI_2005.py,sha256=oShokXyZWseHONSfbTzure4gXjUVQjZgICGXmtncApg,2978
292
292
  tests/1_verification/flappy_0_6/row_Jensen_linear_tophat_IECTI2005/flappy/run.py,sha256=84Vc_F4kZsluiPrKFX7WxWXKwfGZDNzW90npCsStJqQ,2259
293
- tests/1_verification/flappy_0_6/row_Jensen_linear_tophat_IECTI2019/test_row_Jensen_linear_tophat_IECTI_2019.py,sha256=_a7K2XI3FvoYbEDn8-_89kzoczrx-AhjSqR9-xQkyJ0,2896
293
+ tests/1_verification/flappy_0_6/row_Jensen_linear_tophat_IECTI2019/test_row_Jensen_linear_tophat_IECTI_2019.py,sha256=LmhXuo-g7pUDZD7_U3xdbDv0Kzdz_gxv1P5kQ6SpUsg,2978
294
294
  tests/1_verification/flappy_0_6/row_Jensen_linear_tophat_IECTI2019/flappy/run.py,sha256=cPLIXymqdzu3zxB6-B3g3CU_oDhiYf-TlgWqossDjUw,2259
295
- tests/1_verification/flappy_0_6/row_Jensen_quadratic_centre/test_row_Jensen_quadratic_centre.py,sha256=2BimeDW0HSHuU5PDwlStpD4VYLzf8w6MvN92SQ0_7RA,2371
295
+ tests/1_verification/flappy_0_6/row_Jensen_quadratic_centre/test_row_Jensen_quadratic_centre.py,sha256=SU8DWxbvgeP2vNNOpYgJ9cVK6wLlQ4NzMRry3W0VZFE,2451
296
296
  tests/1_verification/flappy_0_6/row_Jensen_quadratic_centre/flappy/run.py,sha256=u-LBBH_MVoqY4Gl__6_EuHUTXp7s-6xVU1OXkywrqrY,2187
297
297
  tests/1_verification/flappy_0_6_2/grid_rotors/test_grid_rotors.py,sha256=aaS_TRsix7snwt0DucCjHk_0uuHzWR8pmOVJcFIrMnM,3952
298
298
  tests/1_verification/flappy_0_6_2/grid_rotors/flappy/run.py,sha256=-TJAB5L9fj7UonqYILVH0i91PPD6KKd7bpJ2j0MDALk,2453
299
- tests/1_verification/flappy_0_6_2/row_Bastankhah_Crespo/test_row_Bastankhah_Crespo.py,sha256=7oCPhVpSQXDm_ABfPfAaRcUd8yYa6h7iSDxMDZKEY5Q,2901
299
+ tests/1_verification/flappy_0_6_2/row_Bastankhah_Crespo/test_row_Bastankhah_Crespo.py,sha256=1b6_mIWvWwAMKnDN_t-oWHfDwpU7l8TJdyf-aydQgpc,2951
300
300
  tests/1_verification/flappy_0_6_2/row_Bastankhah_Crespo/flappy/run.py,sha256=nwIyn20ZyYHhCKcPCnm02zjwNKMRzr9t0U8TjKK61QU,2213
301
- tests/1_verification/flappy_0_6_2/row_Bastankhah_linear_centre/test_row_Bastankhah_linear_centre.py,sha256=rSeda6eN1ztb8eVKcA9CGfGCdteKazbki3qca2yNaCw,2508
301
+ tests/1_verification/flappy_0_6_2/row_Bastankhah_linear_centre/test_row_Bastankhah_linear_centre.py,sha256=a7CQS-_Mnz3NynaTv1OY1CZ10iAqa7E3YxmkbDtoshw,2590
302
302
  tests/1_verification/flappy_0_6_2/row_Bastankhah_linear_centre/flappy/run.py,sha256=s6FbEdpiIdHYmdD8S85_NhLH-S3EOinXvw8RHmR2QOU,2122
303
303
  tests/3_examples/test_examples.py,sha256=rS2Dz04ktbS6v3TRDr96AkWGypr5u49jihqbEmGFmRU,694
304
- foxes-1.2.dist-info/LICENSE,sha256=bBCH6mYTPzSepk2s2UUZ3II_ZYXrn1bnSqB85-aZHxU,1071
305
- foxes-1.2.dist-info/METADATA,sha256=2aOrGLnVBR4JZ6c6z3cLRcDRZy98GecoXCk6p7wrMCU,8651
306
- foxes-1.2.dist-info/WHEEL,sha256=PZUExdf71Ui_so67QXpySuHtCi3-J3wvF4ORK6k_S8U,91
307
- foxes-1.2.dist-info/entry_points.txt,sha256=KuS44FRH5NnMw201A8Btr76eNRKr2UOoKHjejAsqKwE,123
308
- foxes-1.2.dist-info/top_level.txt,sha256=G7oHApEz5nc-iP__XsPcvjYe_NyXGmKMUMPHi3C3x6I,26
309
- foxes-1.2.dist-info/RECORD,,
304
+ foxes-1.2.2.dist-info/LICENSE,sha256=bBCH6mYTPzSepk2s2UUZ3II_ZYXrn1bnSqB85-aZHxU,1071
305
+ foxes-1.2.2.dist-info/METADATA,sha256=7dg2z1b6a9XZFlQCJRKBJ4sSfOkDAP4GJSGR8RLp7MA,8629
306
+ foxes-1.2.2.dist-info/WHEEL,sha256=PZUExdf71Ui_so67QXpySuHtCi3-J3wvF4ORK6k_S8U,91
307
+ foxes-1.2.2.dist-info/entry_points.txt,sha256=KuS44FRH5NnMw201A8Btr76eNRKr2UOoKHjejAsqKwE,123
308
+ foxes-1.2.2.dist-info/top_level.txt,sha256=G7oHApEz5nc-iP__XsPcvjYe_NyXGmKMUMPHi3C3x6I,26
309
+ foxes-1.2.2.dist-info/RECORD,,
@@ -21,7 +21,7 @@ def test():
21
21
  lims = {FV.REWS: 5e-7, FV.P: 5e-4}
22
22
 
23
23
  base_results = None
24
- with foxes.Engine.new("process", chunk_size_states=1000):
24
+ with foxes.Engine.new("threads", chunk_size_states=1000):
25
25
  for Algo, frame in cases:
26
26
  print(f"\nENTERING CASE {(Algo.__name__, frame)}\n")
27
27
 
@@ -24,7 +24,7 @@ def test():
24
24
  ]
25
25
 
26
26
  base_results = None
27
- with foxes.Engine.new("process", chunk_size_states=100):
27
+ with foxes.Engine.new("threads", chunk_size_states=100):
28
28
  for rotor, pwake, lim in cases:
29
29
  print(f"\nENTERING CASE {(rotor, pwake, lim)}\n")
30
30
 
@@ -23,8 +23,13 @@ def test():
23
23
  )
24
24
  mbook.turbine_types[ttype.name] = ttype
25
25
 
26
- states = foxes.input.states.ScanWS(
27
- ws_list=np.linspace(3.0, 30.0, n_s), wd=270.0, ti=0.08, rho=1.225
26
+ states = foxes.input.states.ScanStates(
27
+ {
28
+ FV.WS: np.linspace(3.0, 30.0, n_s),
29
+ FV.WD: [270],
30
+ FV.TI: [0.08],
31
+ FV.RHO: [1.225],
32
+ }
28
33
  )
29
34
 
30
35
  farm = foxes.WindFarm()
@@ -25,8 +25,13 @@ def test():
25
25
  )
26
26
  mbook.turbine_types[ttype.name] = ttype
27
27
 
28
- states = foxes.input.states.ScanWS(
29
- ws_list=np.linspace(3.0, 30.0, n_s), wd=270.0, ti=0.08, rho=1.225
28
+ states = foxes.input.states.ScanStates(
29
+ {
30
+ FV.WS: np.linspace(3.0, 30.0, n_s),
31
+ FV.WD: [270],
32
+ FV.TI: [0.08],
33
+ FV.RHO: [1.225],
34
+ }
30
35
  )
31
36
 
32
37
  farm = foxes.WindFarm()
@@ -28,8 +28,13 @@ def test():
28
28
  )
29
29
  mbook.turbine_types[ttype.name] = ttype
30
30
 
31
- states = foxes.input.states.ScanWS(
32
- ws_list=np.linspace(6.0, 16.0, n_s), wd=wd, ti=ti, rho=1.225
31
+ states = foxes.input.states.ScanStates(
32
+ {
33
+ FV.WS: np.linspace(6.0, 16.0, n_s),
34
+ FV.WD: [wd],
35
+ FV.TI: [ti],
36
+ FV.RHO: [1.225],
37
+ }
33
38
  )
34
39
 
35
40
  farm = foxes.WindFarm()
@@ -28,8 +28,13 @@ def test():
28
28
  )
29
29
  mbook.turbine_types[ttype.name] = ttype
30
30
 
31
- states = foxes.input.states.ScanWS(
32
- ws_list=np.linspace(6.0, 16.0, n_s), wd=wd, ti=ti, rho=1.225
31
+ states = foxes.input.states.ScanStates(
32
+ {
33
+ FV.WS: np.linspace(6.0, 16.0, n_s),
34
+ FV.WD: [wd],
35
+ FV.TI: [ti],
36
+ FV.RHO: [1.225],
37
+ }
33
38
  )
34
39
 
35
40
  farm = foxes.WindFarm()
@@ -25,8 +25,13 @@ def test():
25
25
  )
26
26
  mbook.turbine_types[ttype.name] = ttype
27
27
 
28
- states = foxes.input.states.ScanWS(
29
- ws_list=np.linspace(3.0, 30.0, n_s), wd=270.0, ti=0.08, rho=1.225
28
+ states = foxes.input.states.ScanStates(
29
+ {
30
+ FV.WS: np.linspace(3.0, 30.0, n_s),
31
+ FV.WD: [270],
32
+ FV.TI: [0.08],
33
+ FV.RHO: [1.225],
34
+ }
30
35
  )
31
36
 
32
37
  farm = foxes.WindFarm()
@@ -5,7 +5,6 @@ import inspect
5
5
 
6
6
  import foxes
7
7
  import foxes.variables as FV
8
- from foxes.config import config
9
8
 
10
9
  thisdir = Path(inspect.getfile(inspect.currentframe())).parent
11
10
 
@@ -35,8 +34,13 @@ def test():
35
34
  superposition="ti_max", induction="Betz"
36
35
  )
37
36
 
38
- states = foxes.input.states.ScanWS(
39
- ws_list=np.linspace(6.0, 16.0, n_s), wd=wd, ti=ti, rho=1.225
37
+ states = foxes.input.states.ScanStates(
38
+ {
39
+ FV.WS: np.linspace(6.0, 16.0, n_s),
40
+ FV.WD: [wd],
41
+ FV.TI: [ti],
42
+ FV.RHO: [1.225],
43
+ }
40
44
  )
41
45
 
42
46
  farm = foxes.WindFarm()
@@ -32,8 +32,13 @@ def test():
32
32
  sbeta_factor=0.25, superposition="ws_linear", induction="Betz"
33
33
  )
34
34
 
35
- states = foxes.input.states.ScanWS(
36
- ws_list=np.linspace(6.0, 16.0, n_s), wd=wd, ti=ti, rho=1.225
35
+ states = foxes.input.states.ScanStates(
36
+ {
37
+ FV.WS: np.linspace(6.0, 16.0, n_s),
38
+ FV.WD: [wd],
39
+ FV.TI: [ti],
40
+ FV.RHO: [1.225],
41
+ }
37
42
  )
38
43
 
39
44
  farm = foxes.WindFarm()
@@ -1,152 +0,0 @@
1
- import numpy as np
2
- import pandas as pd
3
- import matplotlib.pyplot as plt
4
- from windrose import WindroseAxes
5
-
6
- FIGSIZE_DEFAULT = (8, 8)
7
- DPI_DEFAULT = 80
8
-
9
-
10
- class TabWindroseAxes(WindroseAxes):
11
- """
12
- A derivate of the wind rose axes that runs
13
- on stochastic data (bins with weights) instead
14
- of time series data
15
-
16
- :group: utils
17
-
18
- """
19
-
20
- @staticmethod
21
- def from_ax(
22
- ax=None,
23
- fig=None,
24
- figsize=None,
25
- rect=None,
26
- *args,
27
- **kwargs,
28
- ):
29
- """
30
- Return a WindroseAxes object for the figure `fig`.
31
- """
32
- if ax is None:
33
- if fig is None:
34
- fig = plt.figure(
35
- figsize=FIGSIZE_DEFAULT if figsize is None else figsize,
36
- dpi=DPI_DEFAULT,
37
- facecolor="w",
38
- edgecolor="w",
39
- )
40
- if rect is None:
41
- rect = [0.1, 0.1, 0.8, 0.8]
42
- ax = TabWindroseAxes(fig, rect, *args, **kwargs)
43
- fig.add_axes(ax)
44
- return ax
45
- else:
46
- return ax
47
-
48
- def _init_plot(self, direction, var, **kwargs):
49
-
50
- # self.clear()
51
- kwargs.pop("zorder", None)
52
- weights = kwargs.pop("weights")
53
-
54
- # Init of the bins array if not set
55
- if "bin_min_var" in kwargs:
56
- bins = list(kwargs.pop("bin_min_var"))
57
- bins.append(max(kwargs.pop("bin_max_var")))
58
- else:
59
- bins = kwargs.pop("bins", None)
60
- if bins is None:
61
- bins = np.linspace(np.min(var), np.max(var), 6)
62
- if isinstance(bins, int):
63
- bins = np.linspace(np.min(var), np.max(var), bins)
64
- bins = np.asarray(bins).tolist()
65
- nbins = len(bins)
66
- bins.append(np.inf)
67
-
68
- # Sets the colors table based on the colormap or the "colors" argument
69
- colors = kwargs.pop("colors", None)
70
- cmap = kwargs.pop("cmap", None)
71
- if colors is not None:
72
- if isinstance(colors, str):
73
- colors = [colors] * nbins
74
- if isinstance(colors, (tuple, list)):
75
- if len(colors) != nbins:
76
- raise ValueError("colors and bins must have same length")
77
- else:
78
- if cmap is None:
79
- cmap = plt.get_cmap()
80
- colors = self._colors(cmap, nbins)
81
-
82
- if "bin_min_dir" in kwargs:
83
- angles = 90 - np.sort(np.unique(direction))
84
- angles[angles > 180] -= 360
85
- angles *= np.pi / 180
86
-
87
- dir_min = kwargs.pop("bin_min_dir")
88
- dir_edges = np.mod(dir_min, 360.0).tolist()
89
-
90
- dir_bins = dir_min.copy().tolist()
91
- if dir_bins[0] < 0:
92
- dir_bins.append(360 + dir_bins[0])
93
- dir_bins[0] = 0
94
- dir_bins.append(360 + dir_bins[1])
95
-
96
- nsector = len(angles)
97
-
98
- else:
99
- nsector = kwargs.pop("nsector", None)
100
- if nsector is None:
101
- nsector = 16
102
- angles = np.arange(0, -2 * np.pi, -2 * np.pi / nsector) + np.pi / 2
103
-
104
- angle = 360.0 / nsector
105
- dir_bins = np.arange(-angle / 2, 360.0 + angle, angle, dtype=float)
106
- dir_edges = dir_bins.tolist()
107
-
108
- dir_edges.pop(-1)
109
- dir_edges[0] = dir_edges.pop(-1)
110
- dir_bins[0] = 0.0
111
-
112
- table = np.histogram2d(
113
- x=var, y=direction, bins=[bins, dir_bins], density=False, weights=weights
114
- )[0]
115
- table[:, 0] = table[:, 0] + table[:, -1]
116
- table = table[:, :-1]
117
-
118
- self._info["dir"], self._info["bins"], self._info["table"] = (
119
- dir_edges,
120
- bins,
121
- table,
122
- )
123
- return bins, nbins, nsector, colors, angles, kwargs
124
-
125
- def legend(self, loc="upper right", *args, **kwargs):
126
- return super().legend(loc, *args, **kwargs)
127
-
128
-
129
- if __name__ == "__main__":
130
-
131
- import numpy as np
132
- import pandas as pd
133
- from foxes import StaticData, STATES
134
-
135
- sdata = StaticData()
136
- fpath = sdata.get_file_path(STATES, "wind_rose_bremen.csv")
137
- print(fpath)
138
- data = pd.read_csv(fpath, index_col=0)
139
- print(data)
140
-
141
- wd = data["wd"].to_numpy()
142
- ws = data["ws"].to_numpy()
143
- weights = data["weight"].to_numpy()
144
-
145
- ax = TabWindroseAxes.from_ax()
146
- # ax.contourf(wd, ws, weights=weights, bins=[0,3,8,13], cmap=plt.cm.Blues)
147
- # ax.contour(wd, ws, weights=weights, bins=[0,3,8,13], colors='black')
148
- ax.bar(
149
- wd, ws, weights=weights, bins=[0, 3, 5, 8, 10, 13, 16, 20], cmap=plt.cm.Blues
150
- )
151
- ax.set_legend()
152
- plt.show()
File without changes
File without changes