foxes 1.3__py3-none-any.whl → 1.5__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 (228) hide show
  1. docs/source/conf.py +3 -3
  2. examples/abl_states/run.py +2 -2
  3. examples/compare_rotors_pwakes/run.py +1 -1
  4. examples/compare_wakes/run.py +1 -2
  5. examples/dyn_wakes/run.py +29 -6
  6. examples/field_data_nc/run.py +1 -1
  7. examples/induction/run.py +3 -3
  8. examples/multi_height/run.py +1 -1
  9. examples/power_mask/run.py +2 -2
  10. examples/quickstart/run.py +0 -1
  11. examples/random_timeseries/run.py +3 -4
  12. examples/scan_row/run.py +3 -3
  13. examples/sequential/run.py +33 -10
  14. examples/single_state/run.py +3 -4
  15. examples/states_lookup_table/run.py +3 -3
  16. examples/streamline_wakes/run.py +29 -6
  17. examples/tab_file/run.py +3 -3
  18. examples/timelines/run.py +29 -5
  19. examples/timeseries/run.py +3 -3
  20. examples/timeseries_slurm/run.py +3 -3
  21. examples/wind_rose/run.py +3 -3
  22. examples/yawed_wake/run.py +19 -9
  23. foxes/__init__.py +21 -17
  24. foxes/algorithms/__init__.py +6 -6
  25. foxes/algorithms/downwind/__init__.py +2 -2
  26. foxes/algorithms/downwind/downwind.py +49 -17
  27. foxes/algorithms/downwind/models/__init__.py +6 -6
  28. foxes/algorithms/downwind/models/farm_wakes_calc.py +11 -9
  29. foxes/algorithms/downwind/models/init_farm_data.py +58 -29
  30. foxes/algorithms/downwind/models/point_wakes_calc.py +7 -13
  31. foxes/algorithms/downwind/models/set_amb_farm_results.py +1 -1
  32. foxes/algorithms/downwind/models/set_amb_point_results.py +6 -6
  33. foxes/algorithms/iterative/__init__.py +7 -3
  34. foxes/algorithms/iterative/iterative.py +1 -2
  35. foxes/algorithms/iterative/models/__init__.py +7 -3
  36. foxes/algorithms/iterative/models/farm_wakes_calc.py +9 -5
  37. foxes/algorithms/sequential/__init__.py +3 -3
  38. foxes/algorithms/sequential/models/__init__.py +2 -2
  39. foxes/algorithms/sequential/sequential.py +3 -4
  40. foxes/config/__init__.py +5 -1
  41. foxes/constants.py +16 -0
  42. foxes/core/__init__.py +45 -22
  43. foxes/core/algorithm.py +5 -6
  44. foxes/core/data.py +94 -22
  45. foxes/core/data_calc_model.py +4 -2
  46. foxes/core/engine.py +42 -53
  47. foxes/core/farm_controller.py +2 -2
  48. foxes/core/farm_data_model.py +16 -13
  49. foxes/core/ground_model.py +4 -13
  50. foxes/core/model.py +24 -6
  51. foxes/core/partial_wakes_model.py +147 -10
  52. foxes/core/point_data_model.py +21 -17
  53. foxes/core/rotor_model.py +4 -3
  54. foxes/core/states.py +2 -3
  55. foxes/core/turbine.py +2 -1
  56. foxes/core/wake_deflection.py +130 -0
  57. foxes/core/wake_model.py +222 -9
  58. foxes/core/wake_superposition.py +122 -4
  59. foxes/core/wind_farm.py +6 -6
  60. foxes/data/__init__.py +7 -2
  61. foxes/data/states/point_cloud_100.nc +0 -0
  62. foxes/data/states/weibull_cloud_4.nc +0 -0
  63. foxes/data/states/weibull_grid.nc +0 -0
  64. foxes/data/states/weibull_sectors_12.csv +13 -0
  65. foxes/data/states/weibull_sectors_12.nc +0 -0
  66. foxes/engines/__init__.py +14 -15
  67. foxes/engines/dask.py +42 -20
  68. foxes/engines/default.py +2 -2
  69. foxes/engines/numpy.py +11 -13
  70. foxes/engines/pool.py +20 -11
  71. foxes/engines/single.py +8 -6
  72. foxes/input/__init__.py +3 -3
  73. foxes/input/farm_layout/__init__.py +9 -8
  74. foxes/input/farm_layout/from_arrays.py +68 -0
  75. foxes/input/farm_layout/from_csv.py +1 -1
  76. foxes/input/farm_layout/ring.py +0 -1
  77. foxes/input/states/__init__.py +28 -12
  78. foxes/input/states/create/__init__.py +3 -2
  79. foxes/input/states/dataset_states.py +710 -0
  80. foxes/input/states/field_data.py +531 -0
  81. foxes/input/states/multi_height.py +11 -6
  82. foxes/input/states/one_point_flow.py +1 -4
  83. foxes/input/states/point_cloud_data.py +618 -0
  84. foxes/input/states/scan.py +2 -0
  85. foxes/input/states/single.py +3 -1
  86. foxes/input/states/states_table.py +23 -30
  87. foxes/input/states/weibull_sectors.py +330 -0
  88. foxes/input/states/wrg_states.py +8 -6
  89. foxes/input/yaml/__init__.py +9 -3
  90. foxes/input/yaml/dict.py +42 -41
  91. foxes/input/yaml/windio/__init__.py +10 -5
  92. foxes/input/yaml/windio/read_attributes.py +42 -29
  93. foxes/input/yaml/windio/read_farm.py +17 -15
  94. foxes/input/yaml/windio/read_fields.py +4 -2
  95. foxes/input/yaml/windio/read_outputs.py +25 -15
  96. foxes/input/yaml/windio/read_site.py +172 -11
  97. foxes/input/yaml/windio/windio.py +23 -11
  98. foxes/input/yaml/yaml.py +1 -0
  99. foxes/models/__init__.py +15 -14
  100. foxes/models/axial_induction/__init__.py +2 -2
  101. foxes/models/farm_controllers/__init__.py +1 -1
  102. foxes/models/farm_models/__init__.py +1 -1
  103. foxes/models/ground_models/__init__.py +3 -2
  104. foxes/models/ground_models/wake_mirror.py +3 -3
  105. foxes/models/model_book.py +190 -63
  106. foxes/models/partial_wakes/__init__.py +6 -6
  107. foxes/models/partial_wakes/axiwake.py +30 -5
  108. foxes/models/partial_wakes/centre.py +47 -0
  109. foxes/models/partial_wakes/rotor_points.py +41 -11
  110. foxes/models/partial_wakes/segregated.py +2 -25
  111. foxes/models/partial_wakes/top_hat.py +27 -2
  112. foxes/models/point_models/__init__.py +4 -4
  113. foxes/models/rotor_models/__init__.py +4 -3
  114. foxes/models/rotor_models/centre.py +1 -1
  115. foxes/models/rotor_models/direct_infusion.py +241 -0
  116. foxes/models/turbine_models/__init__.py +11 -11
  117. foxes/models/turbine_models/calculator.py +16 -3
  118. foxes/models/turbine_models/kTI_model.py +1 -0
  119. foxes/models/turbine_models/lookup_table.py +2 -0
  120. foxes/models/turbine_models/power_mask.py +1 -0
  121. foxes/models/turbine_models/rotor_centre_calc.py +2 -0
  122. foxes/models/turbine_models/sector_management.py +1 -0
  123. foxes/models/turbine_models/set_farm_vars.py +3 -9
  124. foxes/models/turbine_models/table_factors.py +2 -0
  125. foxes/models/turbine_models/thrust2ct.py +1 -0
  126. foxes/models/turbine_models/yaw2yawm.py +2 -0
  127. foxes/models/turbine_models/yawm2yaw.py +2 -0
  128. foxes/models/turbine_types/PCt_file.py +2 -6
  129. foxes/models/turbine_types/PCt_from_two.py +1 -2
  130. foxes/models/turbine_types/__init__.py +10 -9
  131. foxes/models/turbine_types/calculator_type.py +123 -0
  132. foxes/models/turbine_types/null_type.py +1 -0
  133. foxes/models/turbine_types/wsrho2PCt_from_two.py +2 -0
  134. foxes/models/turbine_types/wsti2PCt_from_two.py +3 -1
  135. foxes/models/vertical_profiles/__init__.py +7 -7
  136. foxes/models/wake_deflections/__init__.py +3 -0
  137. foxes/models/{wake_frames/yawed_wakes.py → wake_deflections/bastankhah2016.py} +32 -111
  138. foxes/models/wake_deflections/jimenez.py +277 -0
  139. foxes/models/wake_deflections/no_deflection.py +94 -0
  140. foxes/models/wake_frames/__init__.py +6 -7
  141. foxes/models/wake_frames/dynamic_wakes.py +12 -3
  142. foxes/models/wake_frames/rotor_wd.py +3 -1
  143. foxes/models/wake_frames/seq_dynamic_wakes.py +41 -7
  144. foxes/models/wake_frames/streamlines.py +8 -6
  145. foxes/models/wake_frames/timelines.py +9 -3
  146. foxes/models/wake_models/__init__.py +7 -7
  147. foxes/models/wake_models/dist_sliced.py +50 -84
  148. foxes/models/wake_models/gaussian.py +20 -0
  149. foxes/models/wake_models/induction/__init__.py +5 -5
  150. foxes/models/wake_models/induction/rankine_half_body.py +30 -71
  151. foxes/models/wake_models/induction/rathmann.py +65 -64
  152. foxes/models/wake_models/induction/self_similar.py +65 -68
  153. foxes/models/wake_models/induction/self_similar2020.py +0 -3
  154. foxes/models/wake_models/induction/vortex_sheet.py +71 -75
  155. foxes/models/wake_models/ti/__init__.py +2 -2
  156. foxes/models/wake_models/ti/crespo_hernandez.py +5 -3
  157. foxes/models/wake_models/ti/iec_ti.py +6 -4
  158. foxes/models/wake_models/top_hat.py +58 -7
  159. foxes/models/wake_models/wind/__init__.py +6 -4
  160. foxes/models/wake_models/wind/bastankhah14.py +25 -7
  161. foxes/models/wake_models/wind/bastankhah16.py +35 -3
  162. foxes/models/wake_models/wind/jensen.py +15 -2
  163. foxes/models/wake_models/wind/turbopark.py +28 -2
  164. foxes/models/wake_superpositions/__init__.py +18 -9
  165. foxes/models/wake_superpositions/ti_linear.py +4 -4
  166. foxes/models/wake_superpositions/ti_max.py +4 -4
  167. foxes/models/wake_superpositions/ti_pow.py +4 -4
  168. foxes/models/wake_superpositions/ti_quadratic.py +4 -4
  169. foxes/models/wake_superpositions/wind_vector.py +257 -0
  170. foxes/models/wake_superpositions/ws_linear.py +9 -10
  171. foxes/models/wake_superpositions/ws_max.py +8 -8
  172. foxes/models/wake_superpositions/ws_pow.py +8 -8
  173. foxes/models/wake_superpositions/ws_product.py +4 -4
  174. foxes/models/wake_superpositions/ws_quadratic.py +8 -8
  175. foxes/output/__init__.py +21 -19
  176. foxes/output/farm_layout.py +4 -2
  177. foxes/output/farm_results_eval.py +19 -16
  178. foxes/output/flow_plots_2d/__init__.py +2 -2
  179. foxes/output/flow_plots_2d/flow_plots.py +18 -0
  180. foxes/output/flow_plots_2d/get_fig.py +5 -2
  181. foxes/output/output.py +6 -1
  182. foxes/output/results_writer.py +1 -1
  183. foxes/output/rose_plot.py +13 -3
  184. foxes/output/rotor_point_plots.py +3 -0
  185. foxes/output/seq_plugins/__init__.py +2 -2
  186. foxes/output/seq_plugins/seq_flow_ani_plugin.py +0 -3
  187. foxes/output/seq_plugins/seq_wake_debug_plugin.py +0 -1
  188. foxes/output/state_turbine_map.py +3 -0
  189. foxes/output/turbine_type_curves.py +10 -8
  190. foxes/utils/__init__.py +37 -19
  191. foxes/utils/abl/__init__.py +4 -4
  192. foxes/utils/cubic_roots.py +1 -1
  193. foxes/utils/data_book.py +4 -3
  194. foxes/utils/dict.py +49 -37
  195. foxes/utils/exec_python.py +5 -5
  196. foxes/utils/factory.py +3 -5
  197. foxes/utils/geom2d/__init__.py +7 -5
  198. foxes/utils/geopandas_utils.py +2 -2
  199. foxes/utils/pandas_utils.py +4 -3
  200. foxes/utils/tab_files.py +0 -1
  201. foxes/utils/weibull.py +28 -0
  202. foxes/utils/wrg_utils.py +3 -1
  203. foxes/utils/xarray_utils.py +9 -2
  204. foxes/variables.py +67 -9
  205. {foxes-1.3.dist-info → foxes-1.5.dist-info}/METADATA +34 -63
  206. foxes-1.5.dist-info/RECORD +328 -0
  207. {foxes-1.3.dist-info → foxes-1.5.dist-info}/WHEEL +1 -1
  208. tests/1_verification/flappy_0_6/PCt_files/flappy/run.py +2 -3
  209. tests/1_verification/flappy_0_6/PCt_files/test_PCt_files.py +1 -1
  210. tests/1_verification/flappy_0_6/abl_states/flappy/run.py +0 -1
  211. tests/1_verification/flappy_0_6/partial_top_hat/flappy/run.py +0 -1
  212. tests/1_verification/flappy_0_6/partial_top_hat/test_partial_top_hat.py +0 -2
  213. tests/1_verification/flappy_0_6/row_Jensen_linear_centre/test_row_Jensen_linear_centre.py +0 -1
  214. tests/1_verification/flappy_0_6/row_Jensen_linear_tophat/test_row_Jensen_linear_tophat.py +0 -1
  215. tests/1_verification/flappy_0_6/row_Jensen_linear_tophat_IECTI2005/test_row_Jensen_linear_tophat_IECTI_2005.py +0 -1
  216. tests/1_verification/flappy_0_6/row_Jensen_linear_tophat_IECTI2019/test_row_Jensen_linear_tophat_IECTI_2019.py +0 -1
  217. tests/1_verification/flappy_0_6/row_Jensen_quadratic_centre/test_row_Jensen_quadratic_centre.py +0 -1
  218. tests/1_verification/flappy_0_6_2/grid_rotors/flappy/run.py +0 -2
  219. tests/1_verification/flappy_0_6_2/row_Bastankhah_Crespo/test_row_Bastankhah_Crespo.py +0 -1
  220. tests/1_verification/flappy_0_6_2/row_Bastankhah_linear_centre/flappy/run.py +0 -1
  221. tests/1_verification/flappy_0_6_2/row_Bastankhah_linear_centre/test_row_Bastankhah_linear_centre.py +0 -1
  222. foxes/input/states/field_data_nc.py +0 -847
  223. foxes/output/round.py +0 -10
  224. foxes/utils/pandas_helpers.py +0 -178
  225. foxes-1.3.dist-info/RECORD +0 -313
  226. {foxes-1.3.dist-info → foxes-1.5.dist-info}/entry_points.txt +0 -0
  227. {foxes-1.3.dist-info → foxes-1.5.dist-info/licenses}/LICENSE +0 -0
  228. {foxes-1.3.dist-info → foxes-1.5.dist-info}/top_level.txt +0 -0
foxes/engines/numpy.py CHANGED
@@ -1,6 +1,5 @@
1
1
  from tqdm import tqdm
2
2
  from xarray import Dataset
3
- from tqdm import tqdm
4
3
 
5
4
  from foxes.core import Engine
6
5
  import foxes.constants as FC
@@ -50,7 +49,7 @@ class NumpyEngine(Engine):
50
49
  self,
51
50
  algo,
52
51
  model,
53
- model_data=None,
52
+ model_data,
54
53
  farm_data=None,
55
54
  point_data=None,
56
55
  out_vars=[],
@@ -72,9 +71,9 @@ class NumpyEngine(Engine):
72
71
  should be run
73
72
  model_data: xarray.Dataset
74
73
  The initial model data
75
- farm_data: xarray.Dataset
74
+ farm_data: xarray.Dataset, optional
76
75
  The initial farm data
77
- point_data: xarray.Dataset
76
+ point_data: xarray.Dataset, optional
78
77
  The initial point data
79
78
  out_vars: list of str, optional
80
79
  Names of the output variables
@@ -109,9 +108,6 @@ class NumpyEngine(Engine):
109
108
  coords = {}
110
109
  if FC.STATE in out_coords and FC.STATE in model_data.coords:
111
110
  coords[FC.STATE] = model_data[FC.STATE].to_numpy()
112
- if farm_data is None:
113
- farm_data = Dataset()
114
- goal_data = farm_data if point_data is None else point_data
115
111
 
116
112
  # DEBUG objec mem sizes:
117
113
  # from foxes.utils import print_mem
@@ -146,8 +142,6 @@ class NumpyEngine(Engine):
146
142
  for chunki_points in range(n_chunks_targets):
147
143
  i1_targets = i0_targets + chunk_sizes_targets[chunki_points]
148
144
 
149
- i = chunki_states * n_chunks_targets + chunki_points
150
-
151
145
  # get this chunk's data:
152
146
  data = self.get_chunk_input_data(
153
147
  algo=algo,
@@ -164,10 +158,10 @@ class NumpyEngine(Engine):
164
158
  results[key] = _run(
165
159
  algo,
166
160
  model,
167
- data,
168
- iterative,
169
- chunk_store,
170
- (i0_states, i0_targets),
161
+ *data,
162
+ iterative=iterative,
163
+ chunk_store=chunk_store,
164
+ i0_t0=(i0_states, i0_targets),
171
165
  **calc_pars,
172
166
  )
173
167
  chunk_store.update(results[key][1])
@@ -180,7 +174,11 @@ class NumpyEngine(Engine):
180
174
 
181
175
  i0_states = i1_states
182
176
 
177
+ if farm_data is None:
178
+ farm_data = Dataset()
179
+ goal_data = farm_data if point_data is None else point_data
183
180
  del calc_pars, farm_data, point_data
181
+
184
182
  if pbar is not None:
185
183
  pbar.close()
186
184
 
foxes/engines/pool.py CHANGED
@@ -7,7 +7,15 @@ from foxes.core import Engine
7
7
  import foxes.constants as FC
8
8
 
9
9
 
10
- def _run(algo, model, data, iterative, chunk_store, i0_t0, **cpars):
10
+ def _run(
11
+ algo,
12
+ model,
13
+ *data,
14
+ iterative,
15
+ chunk_store,
16
+ i0_t0,
17
+ **cpars,
18
+ ):
11
19
  """Helper function for running in a single process"""
12
20
  algo.reset_chunk_store(chunk_store)
13
21
  results = model.calculate(algo, *data, **cpars)
@@ -134,7 +142,7 @@ class PoolEngine(Engine):
134
142
  self,
135
143
  algo,
136
144
  model,
137
- model_data=None,
145
+ model_data,
138
146
  farm_data=None,
139
147
  point_data=None,
140
148
  out_vars=[],
@@ -156,9 +164,9 @@ class PoolEngine(Engine):
156
164
  should be run
157
165
  model_data: xarray.Dataset
158
166
  The initial model data
159
- farm_data: xarray.Dataset
167
+ farm_data: xarray.Dataset, optional
160
168
  The initial farm data
161
- point_data: xarray.Dataset
169
+ point_data: xarray.Dataset, optional
162
170
  The initial point data
163
171
  out_vars: list of str, optional
164
172
  Names of the output variables
@@ -193,9 +201,6 @@ class PoolEngine(Engine):
193
201
  coords = {}
194
202
  if FC.STATE in out_coords and FC.STATE in model_data.coords:
195
203
  coords[FC.STATE] = model_data[FC.STATE].to_numpy()
196
- if farm_data is None:
197
- farm_data = xr.Dataset()
198
- goal_data = farm_data if point_data is None else point_data
199
204
 
200
205
  # DEBUG objec mem sizes:
201
206
  # from foxes.utils import print_mem
@@ -245,10 +250,10 @@ class PoolEngine(Engine):
245
250
  _run,
246
251
  algo,
247
252
  model,
248
- data,
249
- iterative,
250
- chunk_store,
251
- (i0_states, i0_targets),
253
+ *data,
254
+ iterative=iterative,
255
+ chunk_store=chunk_store,
256
+ i0_t0=(i0_states, i0_targets),
252
257
  **calc_pars,
253
258
  )
254
259
  del data
@@ -260,6 +265,10 @@ class PoolEngine(Engine):
260
265
 
261
266
  i0_states = i1_states
262
267
 
268
+ if farm_data is None:
269
+ farm_data = xr.Dataset()
270
+ goal_data = farm_data if point_data is None else point_data
271
+
263
272
  del calc_pars, farm_data, point_data
264
273
  if pbar is not None:
265
274
  pbar.close()
foxes/engines/single.py CHANGED
@@ -73,7 +73,7 @@ class SingleChunkEngine(Engine):
73
73
  self,
74
74
  algo,
75
75
  model,
76
- model_data=None,
76
+ model_data,
77
77
  farm_data=None,
78
78
  point_data=None,
79
79
  out_vars=[],
@@ -95,9 +95,9 @@ class SingleChunkEngine(Engine):
95
95
  should be run
96
96
  model_data: xarray.Dataset
97
97
  The initial model data
98
- farm_data: xarray.Dataset
98
+ farm_data: xarray.Dataset, optional
99
99
  The initial farm data
100
- point_data: xarray.Dataset
100
+ point_data: xarray.Dataset, optional
101
101
  The initial point data
102
102
  out_vars: list of str, optional
103
103
  Names of the output variables
@@ -133,9 +133,6 @@ class SingleChunkEngine(Engine):
133
133
  coords = {}
134
134
  if FC.STATE in out_coords and FC.STATE in model_data.coords:
135
135
  coords[FC.STATE] = model_data[FC.STATE].to_numpy()
136
- if farm_data is None:
137
- farm_data = Dataset()
138
- goal_data = farm_data if point_data is None else point_data
139
136
  algo.reset_chunk_store(chunk_store)
140
137
 
141
138
  # calculate:
@@ -157,6 +154,11 @@ class SingleChunkEngine(Engine):
157
154
 
158
155
  results = {}
159
156
  results[(0, 0)] = (model.calculate(algo, *data, **calc_pars), algo.chunk_store)
157
+ del data
158
+
159
+ if farm_data is None:
160
+ farm_data = Dataset()
161
+ goal_data = farm_data if point_data is None else point_data
160
162
 
161
163
  return self.combine_results(
162
164
  algo=algo,
foxes/input/__init__.py CHANGED
@@ -2,6 +2,6 @@
2
2
  Functions and classes for input data definition.
3
3
  """
4
4
 
5
- from . import farm_layout
6
- from . import states
7
- from . import yaml
5
+ from . import farm_layout as farm_layout
6
+ from . import states as states
7
+ from . import yaml as yaml
@@ -2,11 +2,12 @@
2
2
  Functions for adding turbines to the wind farm.
3
3
  """
4
4
 
5
- from .row import add_row
6
- from .grid import add_grid
7
- from .from_json import add_from_json
8
- from .from_csv import add_from_csv
9
- from .from_file import add_from_file
10
- from .from_df import add_from_df
11
- from .from_random import add_random
12
- from .ring import add_ring
5
+ from .row import add_row as add_row
6
+ from .grid import add_grid as add_grid
7
+ from .from_json import add_from_json as add_from_json
8
+ from .from_csv import add_from_csv as add_from_csv
9
+ from .from_file import add_from_file as add_from_file
10
+ from .from_df import add_from_df as add_from_df
11
+ from .from_random import add_random as add_random
12
+ from .ring import add_ring as add_ring
13
+ from .from_arrays import add_from_arrays as add_from_arrays
@@ -0,0 +1,68 @@
1
+ from foxes.core import Turbine
2
+
3
+
4
+ def add_from_arrays(
5
+ farm,
6
+ x,
7
+ y,
8
+ heights=None,
9
+ diameters=None,
10
+ ids=None,
11
+ names=None,
12
+ turbine_base_name="T",
13
+ turbine_base_name_count_shift=False,
14
+ verbosity=1,
15
+ **turbine_parameters,
16
+ ):
17
+ """
18
+ Add turbines to wind farm from direct one dimensional data arrays.
19
+
20
+ Parameters
21
+ ----------
22
+ farm: foxes.WindFarm
23
+ The wind farm
24
+ x: list or numpy.ndarray
25
+ The x-coordinates of the turbines
26
+ y: list or numpy.ndarray
27
+ The y-coordinates of the turbines
28
+ heights: list or numpy.ndarray, optional
29
+ The hub heights of the turbines, or None
30
+ diameters: list or numpy.ndarray, optional
31
+ The rotor diameters of the turbines, or None
32
+ ids: list or numpy.ndarray, optional
33
+ The ids of the turbines, or None
34
+ names: list or numpy.ndarray, optional
35
+ The names of the turbines, or None
36
+ turbine_base_name: str, optional
37
+ The turbine base name, only used
38
+ if col_name is None
39
+ turbine_base_name_count_shift: bool, optional
40
+ Start turbine names by 1 instead of 0
41
+ verbosity: int
42
+ The verbosity level, 0 = silent
43
+ turbine_parameters: dict, optional
44
+ Additional parameters are forwarded to the WindFarm.add_turbine().
45
+
46
+ :group: input.farm_layout
47
+
48
+ """
49
+ tmodels = turbine_parameters.pop("turbine_models", [])
50
+ H = turbine_parameters.pop("H", None)
51
+ D = turbine_parameters.pop("D", None)
52
+
53
+ for i in range(len(x)):
54
+ s = 1 if turbine_base_name_count_shift else 0
55
+ tname = f"{turbine_base_name}{i + s}" if names is None else names[i]
56
+
57
+ farm.add_turbine(
58
+ Turbine(
59
+ name=tname,
60
+ index=ids[i] if ids is not None else i,
61
+ xy=[x[i], y[i]],
62
+ H=heights[i] if heights is not None else H,
63
+ D=diameters[i] if diameters is not None else D,
64
+ turbine_models=tmodels,
65
+ **turbine_parameters,
66
+ ),
67
+ verbosity=verbosity,
68
+ )
@@ -86,7 +86,7 @@ def add_from_csv(
86
86
  for i in data.index:
87
87
  s = 1 if turbine_base_name_count_shift else 0
88
88
  tname = (
89
- f"{turbine_base_name}{i+s}" if col_name is None else data.loc[i, col_name]
89
+ f"{turbine_base_name}{i + s}" if col_name is None else data.loc[i, col_name]
90
90
  )
91
91
  txy = data.loc[i, [col_x, col_y]].values
92
92
 
@@ -49,7 +49,6 @@ def add_ring(
49
49
  da = 360 / n_turbines
50
50
 
51
51
  for i in range(n_turbines):
52
-
53
52
  n = wd2wdvec(a)[0]
54
53
 
55
54
  farm.add_turbine(
@@ -2,18 +2,34 @@
2
2
  Atmospheric input states.
3
3
  """
4
4
 
5
- from .single import SingleStateStates
6
- from .scan import ScanStates
7
- from .states_table import StatesTable, Timeseries, TabStates
8
- from .field_data_nc import FieldDataNC
9
- from .multi_height import MultiHeightStates, MultiHeightTimeseries
10
- from .multi_height import MultiHeightNCStates, MultiHeightNCTimeseries
5
+ from .single import SingleStateStates as SingleStateStates
6
+ from .scan import ScanStates as ScanStates
7
+ from .wrg_states import WRGStates as WRGStates
8
+ from .weibull_sectors import WeibullSectors as WeibullSectors
9
+ from .dataset_states import DatasetStates as DatasetStates
10
+
11
+ from .states_table import StatesTable as StatesTable
12
+ from .states_table import Timeseries as Timeseries
13
+ from .states_table import TabStates as TabStates
14
+
15
+ from .field_data import FieldData as FieldData
16
+ from .field_data import WeibullField as WeibullField
17
+
18
+ from .point_cloud_data import WeibullPointCloud as WeibullPointCloud
19
+ from .point_cloud_data import PointCloudData as PointCloudData
20
+
21
+ from .multi_height import MultiHeightStates as MultiHeightStates
22
+ from .multi_height import MultiHeightTimeseries as MultiHeightTimeseries
23
+ from .multi_height import MultiHeightNCStates as MultiHeightNCStates
24
+ from .multi_height import MultiHeightNCTimeseries as MultiHeightNCTimeseries
25
+
26
+ from .one_point_flow import OnePointFlowStates as OnePointFlowStates
27
+ from .one_point_flow import OnePointFlowTimeseries as OnePointFlowTimeseries
28
+ from .one_point_flow import (
29
+ OnePointFlowMultiHeightTimeseries as OnePointFlowMultiHeightTimeseries,
30
+ )
11
31
  from .one_point_flow import (
12
- OnePointFlowStates,
13
- OnePointFlowTimeseries,
14
- OnePointFlowMultiHeightTimeseries,
15
- OnePointFlowMultiHeightNCTimeseries,
32
+ OnePointFlowMultiHeightNCTimeseries as OnePointFlowMultiHeightNCTimeseries,
16
33
  )
17
- from .wrg_states import WRGStates
18
34
 
19
- from . import create
35
+ from . import create as create
@@ -1,2 +1,3 @@
1
- from .random_abl_states import create_random_abl_states, write_random_abl_states
2
- from .random_timeseries import random_timseries_data
1
+ from .random_abl_states import create_random_abl_states as create_random_abl_states
2
+ from .random_abl_states import write_random_abl_states as write_random_abl_states
3
+ from .random_timeseries import random_timseries_data as random_timseries_data