foxes 1.2.2__tar.gz → 1.2.3__tar.gz

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 (322) hide show
  1. {foxes-1.2.2/foxes.egg-info → foxes-1.2.3}/PKG-INFO +6 -2
  2. {foxes-1.2.2 → foxes-1.2.3}/examples/field_data_nc/run.py +11 -4
  3. {foxes-1.2.2 → foxes-1.2.3}/examples/streamline_wakes/run.py +6 -3
  4. {foxes-1.2.2 → foxes-1.2.3}/foxes/algorithms/downwind/downwind.py +1 -0
  5. foxes-1.2.3/foxes/config/__init__.py +1 -0
  6. {foxes-1.2.2 → foxes-1.2.3}/foxes/config/config.py +80 -14
  7. {foxes-1.2.2 → foxes-1.2.3}/foxes/constants.py +12 -1
  8. {foxes-1.2.2 → foxes-1.2.3}/foxes/core/algorithm.py +13 -8
  9. {foxes-1.2.2 → foxes-1.2.3}/foxes/core/engine.py +30 -0
  10. {foxes-1.2.2 → foxes-1.2.3}/foxes/core/farm_controller.py +41 -24
  11. {foxes-1.2.2 → foxes-1.2.3}/foxes/core/states.py +1 -1
  12. foxes-1.2.3/foxes/core/wind_farm.py +187 -0
  13. {foxes-1.2.2 → foxes-1.2.3}/foxes/engines/dask.py +88 -4
  14. {foxes-1.2.2 → foxes-1.2.3}/foxes/engines/default.py +45 -2
  15. {foxes-1.2.2 → foxes-1.2.3}/foxes/engines/mpi.py +5 -16
  16. {foxes-1.2.2 → foxes-1.2.3}/foxes/engines/multiprocess.py +1 -10
  17. {foxes-1.2.2 → foxes-1.2.3}/foxes/engines/numpy.py +30 -0
  18. {foxes-1.2.2 → foxes-1.2.3}/foxes/engines/pool.py +48 -0
  19. {foxes-1.2.2 → foxes-1.2.3}/foxes/engines/ray.py +1 -1
  20. {foxes-1.2.2 → foxes-1.2.3}/foxes/engines/single.py +30 -0
  21. {foxes-1.2.2 → foxes-1.2.3}/foxes/input/farm_layout/from_csv.py +2 -2
  22. {foxes-1.2.2 → foxes-1.2.3}/foxes/input/farm_layout/from_file.py +2 -2
  23. {foxes-1.2.2 → foxes-1.2.3}/foxes/input/farm_layout/from_json.py +2 -2
  24. {foxes-1.2.2 → foxes-1.2.3}/foxes/input/states/__init__.py +0 -1
  25. {foxes-1.2.2 → foxes-1.2.3}/foxes/input/states/create/random_abl_states.py +2 -2
  26. {foxes-1.2.2 → foxes-1.2.3}/foxes/input/states/field_data_nc.py +286 -141
  27. {foxes-1.2.2 → foxes-1.2.3}/foxes/input/states/multi_height.py +3 -3
  28. {foxes-1.2.2 → foxes-1.2.3}/foxes/input/states/states_table.py +3 -3
  29. {foxes-1.2.2 → foxes-1.2.3}/foxes/input/yaml/dict.py +83 -46
  30. {foxes-1.2.2 → foxes-1.2.3}/foxes/input/yaml/windio/__init__.py +2 -1
  31. {foxes-1.2.2 → foxes-1.2.3}/foxes/input/yaml/windio/read_attributes.py +17 -34
  32. {foxes-1.2.2 → foxes-1.2.3}/foxes/input/yaml/windio/read_farm.py +57 -3
  33. foxes-1.2.3/foxes/input/yaml/windio/read_outputs.py +207 -0
  34. foxes-1.2.2/foxes/input/yaml/windio/get_states.py → foxes-1.2.3/foxes/input/yaml/windio/read_site.py +69 -0
  35. foxes-1.2.3/foxes/input/yaml/windio/windio.py +192 -0
  36. {foxes-1.2.2 → foxes-1.2.3}/foxes/input/yaml/yaml.py +3 -3
  37. {foxes-1.2.2 → foxes-1.2.3}/foxes/models/model_book.py +1 -0
  38. {foxes-1.2.2 → foxes-1.2.3}/foxes/models/point_models/__init__.py +1 -0
  39. foxes-1.2.3/foxes/models/point_models/ustar2ti.py +84 -0
  40. {foxes-1.2.2 → foxes-1.2.3}/foxes/models/turbine_models/lookup_table.py +2 -2
  41. {foxes-1.2.2 → foxes-1.2.3}/foxes/models/turbine_models/sector_management.py +2 -2
  42. {foxes-1.2.2 → foxes-1.2.3}/foxes/models/turbine_models/table_factors.py +2 -2
  43. {foxes-1.2.2 → foxes-1.2.3}/foxes/models/turbine_types/CpCt_file.py +2 -2
  44. {foxes-1.2.2 → foxes-1.2.3}/foxes/models/turbine_types/CpCt_from_two.py +3 -3
  45. {foxes-1.2.2 → foxes-1.2.3}/foxes/models/turbine_types/PCt_file.py +2 -2
  46. {foxes-1.2.2 → foxes-1.2.3}/foxes/models/turbine_types/PCt_from_two.py +3 -3
  47. {foxes-1.2.2 → foxes-1.2.3}/foxes/models/turbine_types/TBL_file.py +2 -2
  48. {foxes-1.2.2 → foxes-1.2.3}/foxes/models/turbine_types/wsrho2PCt_from_two.py +3 -3
  49. {foxes-1.2.2 → foxes-1.2.3}/foxes/models/turbine_types/wsti2PCt_from_two.py +3 -3
  50. {foxes-1.2.2 → foxes-1.2.3}/foxes/output/__init__.py +1 -0
  51. {foxes-1.2.2 → foxes-1.2.3}/foxes/output/output.py +5 -3
  52. {foxes-1.2.2 → foxes-1.2.3}/foxes/output/slice_data.py +1 -1
  53. foxes-1.2.3/foxes/output/slices_data.py +323 -0
  54. {foxes-1.2.2 → foxes-1.2.3}/foxes/output/state_turbine_table.py +11 -0
  55. {foxes-1.2.2 → foxes-1.2.3}/foxes/utils/load.py +12 -4
  56. {foxes-1.2.2 → foxes-1.2.3}/foxes/utils/xarray_utils.py +14 -3
  57. {foxes-1.2.2 → foxes-1.2.3}/foxes/variables.py +5 -0
  58. {foxes-1.2.2 → foxes-1.2.3/foxes.egg-info}/PKG-INFO +6 -2
  59. {foxes-1.2.2 → foxes-1.2.3}/foxes.egg-info/SOURCES.txt +3 -2
  60. {foxes-1.2.2 → foxes-1.2.3}/foxes.egg-info/requires.txt +5 -1
  61. {foxes-1.2.2 → foxes-1.2.3}/pyproject.toml +6 -2
  62. foxes-1.2.2/foxes/config/__init__.py +0 -1
  63. foxes-1.2.2/foxes/core/wind_farm.py +0 -78
  64. foxes-1.2.2/foxes/input/states/slice_data_nc.py +0 -687
  65. foxes-1.2.2/foxes/input/yaml/windio/read_outputs.py +0 -147
  66. foxes-1.2.2/foxes/input/yaml/windio/windio.py +0 -269
  67. {foxes-1.2.2 → foxes-1.2.3}/LICENSE +0 -0
  68. {foxes-1.2.2 → foxes-1.2.3}/Logo_FOXES.svg +0 -0
  69. {foxes-1.2.2 → foxes-1.2.3}/MANIFEST.in +0 -0
  70. {foxes-1.2.2 → foxes-1.2.3}/README.md +0 -0
  71. {foxes-1.2.2 → foxes-1.2.3}/docs/source/conf.py +0 -0
  72. {foxes-1.2.2 → foxes-1.2.3}/examples/abl_states/run.py +0 -0
  73. {foxes-1.2.2 → foxes-1.2.3}/examples/compare_rotors_pwakes/run.py +0 -0
  74. {foxes-1.2.2 → foxes-1.2.3}/examples/compare_wakes/run.py +0 -0
  75. {foxes-1.2.2 → foxes-1.2.3}/examples/dyn_wakes/run.py +0 -0
  76. {foxes-1.2.2 → foxes-1.2.3}/examples/induction/run.py +0 -0
  77. {foxes-1.2.2 → foxes-1.2.3}/examples/multi_height/run.py +0 -0
  78. {foxes-1.2.2 → foxes-1.2.3}/examples/power_mask/run.py +0 -0
  79. {foxes-1.2.2 → foxes-1.2.3}/examples/random_timeseries/run.py +0 -0
  80. {foxes-1.2.2 → foxes-1.2.3}/examples/scan_row/run.py +0 -0
  81. {foxes-1.2.2 → foxes-1.2.3}/examples/sector_management/run.py +0 -0
  82. {foxes-1.2.2 → foxes-1.2.3}/examples/sequential/run.py +0 -0
  83. {foxes-1.2.2 → foxes-1.2.3}/examples/single_state/run.py +0 -0
  84. {foxes-1.2.2 → foxes-1.2.3}/examples/states_lookup_table/run.py +0 -0
  85. {foxes-1.2.2 → foxes-1.2.3}/examples/tab_file/run.py +0 -0
  86. {foxes-1.2.2 → foxes-1.2.3}/examples/timelines/run.py +0 -0
  87. {foxes-1.2.2 → foxes-1.2.3}/examples/timeseries/run.py +0 -0
  88. {foxes-1.2.2 → foxes-1.2.3}/examples/timeseries_slurm/run.py +0 -0
  89. {foxes-1.2.2 → foxes-1.2.3}/examples/wind_rose/run.py +0 -0
  90. {foxes-1.2.2 → foxes-1.2.3}/examples/yawed_wake/run.py +0 -0
  91. {foxes-1.2.2 → foxes-1.2.3}/foxes/__init__.py +0 -0
  92. {foxes-1.2.2 → foxes-1.2.3}/foxes/algorithms/__init__.py +0 -0
  93. {foxes-1.2.2 → foxes-1.2.3}/foxes/algorithms/downwind/__init__.py +0 -0
  94. {foxes-1.2.2 → foxes-1.2.3}/foxes/algorithms/downwind/models/__init__.py +0 -0
  95. {foxes-1.2.2 → foxes-1.2.3}/foxes/algorithms/downwind/models/farm_wakes_calc.py +0 -0
  96. {foxes-1.2.2 → foxes-1.2.3}/foxes/algorithms/downwind/models/init_farm_data.py +0 -0
  97. {foxes-1.2.2 → foxes-1.2.3}/foxes/algorithms/downwind/models/point_wakes_calc.py +0 -0
  98. {foxes-1.2.2 → foxes-1.2.3}/foxes/algorithms/downwind/models/reorder_farm_output.py +0 -0
  99. {foxes-1.2.2 → foxes-1.2.3}/foxes/algorithms/downwind/models/set_amb_farm_results.py +0 -0
  100. {foxes-1.2.2 → foxes-1.2.3}/foxes/algorithms/downwind/models/set_amb_point_results.py +0 -0
  101. {foxes-1.2.2 → foxes-1.2.3}/foxes/algorithms/iterative/__init__.py +0 -0
  102. {foxes-1.2.2 → foxes-1.2.3}/foxes/algorithms/iterative/iterative.py +0 -0
  103. {foxes-1.2.2 → foxes-1.2.3}/foxes/algorithms/iterative/models/__init__.py +0 -0
  104. {foxes-1.2.2 → foxes-1.2.3}/foxes/algorithms/iterative/models/convergence.py +0 -0
  105. {foxes-1.2.2 → foxes-1.2.3}/foxes/algorithms/iterative/models/farm_wakes_calc.py +0 -0
  106. {foxes-1.2.2 → foxes-1.2.3}/foxes/algorithms/iterative/models/urelax.py +0 -0
  107. {foxes-1.2.2 → foxes-1.2.3}/foxes/algorithms/sequential/__init__.py +0 -0
  108. {foxes-1.2.2 → foxes-1.2.3}/foxes/algorithms/sequential/models/__init__.py +0 -0
  109. {foxes-1.2.2 → foxes-1.2.3}/foxes/algorithms/sequential/models/plugin.py +0 -0
  110. {foxes-1.2.2 → foxes-1.2.3}/foxes/algorithms/sequential/models/seq_state.py +0 -0
  111. {foxes-1.2.2 → foxes-1.2.3}/foxes/algorithms/sequential/sequential.py +0 -0
  112. {foxes-1.2.2 → foxes-1.2.3}/foxes/core/__init__.py +0 -0
  113. {foxes-1.2.2 → foxes-1.2.3}/foxes/core/axial_induction_model.py +0 -0
  114. {foxes-1.2.2 → foxes-1.2.3}/foxes/core/data.py +0 -0
  115. {foxes-1.2.2 → foxes-1.2.3}/foxes/core/data_calc_model.py +0 -0
  116. {foxes-1.2.2 → foxes-1.2.3}/foxes/core/farm_data_model.py +0 -0
  117. {foxes-1.2.2 → foxes-1.2.3}/foxes/core/farm_model.py +0 -0
  118. {foxes-1.2.2 → foxes-1.2.3}/foxes/core/ground_model.py +0 -0
  119. {foxes-1.2.2 → foxes-1.2.3}/foxes/core/model.py +0 -0
  120. {foxes-1.2.2 → foxes-1.2.3}/foxes/core/partial_wakes_model.py +0 -0
  121. {foxes-1.2.2 → foxes-1.2.3}/foxes/core/point_data_model.py +0 -0
  122. {foxes-1.2.2 → foxes-1.2.3}/foxes/core/rotor_model.py +0 -0
  123. {foxes-1.2.2 → foxes-1.2.3}/foxes/core/turbine.py +0 -0
  124. {foxes-1.2.2 → foxes-1.2.3}/foxes/core/turbine_model.py +0 -0
  125. {foxes-1.2.2 → foxes-1.2.3}/foxes/core/turbine_type.py +0 -0
  126. {foxes-1.2.2 → foxes-1.2.3}/foxes/core/vertical_profile.py +0 -0
  127. {foxes-1.2.2 → foxes-1.2.3}/foxes/core/wake_frame.py +0 -0
  128. {foxes-1.2.2 → foxes-1.2.3}/foxes/core/wake_model.py +0 -0
  129. {foxes-1.2.2 → foxes-1.2.3}/foxes/core/wake_superposition.py +0 -0
  130. {foxes-1.2.2 → foxes-1.2.3}/foxes/data/__init__.py +0 -0
  131. {foxes-1.2.2 → foxes-1.2.3}/foxes/data/farms/__init__.py +0 -0
  132. {foxes-1.2.2 → foxes-1.2.3}/foxes/data/farms/test_farm_67.csv +0 -0
  133. {foxes-1.2.2 → foxes-1.2.3}/foxes/data/parse.py +0 -0
  134. {foxes-1.2.2 → foxes-1.2.3}/foxes/data/power_ct_curves/DTU-10MW-D178d3-H119.csv +0 -0
  135. {foxes-1.2.2 → foxes-1.2.3}/foxes/data/power_ct_curves/IEA-15MW-D240-H150.csv +0 -0
  136. {foxes-1.2.2 → foxes-1.2.3}/foxes/data/power_ct_curves/IWT-7d5MW-D164-H100.csv +0 -0
  137. {foxes-1.2.2 → foxes-1.2.3}/foxes/data/power_ct_curves/NREL-5MW-D126-H90.csv +0 -0
  138. {foxes-1.2.2 → foxes-1.2.3}/foxes/data/power_ct_curves/__init__.py +0 -0
  139. {foxes-1.2.2 → foxes-1.2.3}/foxes/data/states/WRF-Timeseries-3000.nc +0 -0
  140. {foxes-1.2.2 → foxes-1.2.3}/foxes/data/states/WRF-Timeseries-4464.csv.gz +0 -0
  141. {foxes-1.2.2 → foxes-1.2.3}/foxes/data/states/__init__.py +0 -0
  142. {foxes-1.2.2 → foxes-1.2.3}/foxes/data/states/abl_states_6000.csv.gz +0 -0
  143. {foxes-1.2.2 → foxes-1.2.3}/foxes/data/states/timeseries_100.csv.gz +0 -0
  144. {foxes-1.2.2 → foxes-1.2.3}/foxes/data/states/timeseries_3000.csv.gz +0 -0
  145. {foxes-1.2.2 → foxes-1.2.3}/foxes/data/states/timeseries_8000.csv.gz +0 -0
  146. {foxes-1.2.2 → foxes-1.2.3}/foxes/data/states/wind_rose_bremen.csv +0 -0
  147. {foxes-1.2.2 → foxes-1.2.3}/foxes/data/states/wind_rotation.nc +0 -0
  148. {foxes-1.2.2 → foxes-1.2.3}/foxes/data/states/winds100.tab +0 -0
  149. {foxes-1.2.2 → foxes-1.2.3}/foxes/data/static_data.py +0 -0
  150. {foxes-1.2.2 → foxes-1.2.3}/foxes/engines/__init__.py +0 -0
  151. {foxes-1.2.2 → foxes-1.2.3}/foxes/engines/futures.py +0 -0
  152. {foxes-1.2.2 → foxes-1.2.3}/foxes/input/__init__.py +0 -0
  153. {foxes-1.2.2 → foxes-1.2.3}/foxes/input/farm_layout/__init__.py +0 -0
  154. {foxes-1.2.2 → foxes-1.2.3}/foxes/input/farm_layout/from_df.py +0 -0
  155. {foxes-1.2.2 → foxes-1.2.3}/foxes/input/farm_layout/from_random.py +0 -0
  156. {foxes-1.2.2 → foxes-1.2.3}/foxes/input/farm_layout/grid.py +0 -0
  157. {foxes-1.2.2 → foxes-1.2.3}/foxes/input/farm_layout/ring.py +0 -0
  158. {foxes-1.2.2 → foxes-1.2.3}/foxes/input/farm_layout/row.py +0 -0
  159. {foxes-1.2.2 → foxes-1.2.3}/foxes/input/states/create/__init__.py +0 -0
  160. {foxes-1.2.2 → foxes-1.2.3}/foxes/input/states/create/random_timeseries.py +0 -0
  161. {foxes-1.2.2 → foxes-1.2.3}/foxes/input/states/one_point_flow.py +0 -0
  162. {foxes-1.2.2 → foxes-1.2.3}/foxes/input/states/scan.py +0 -0
  163. {foxes-1.2.2 → foxes-1.2.3}/foxes/input/states/single.py +0 -0
  164. {foxes-1.2.2 → foxes-1.2.3}/foxes/input/yaml/__init__.py +0 -0
  165. {foxes-1.2.2 → foxes-1.2.3}/foxes/input/yaml/windio/read_fields.py +0 -0
  166. {foxes-1.2.2 → foxes-1.2.3}/foxes/models/__init__.py +0 -0
  167. {foxes-1.2.2 → foxes-1.2.3}/foxes/models/axial_induction/__init__.py +0 -0
  168. {foxes-1.2.2 → foxes-1.2.3}/foxes/models/axial_induction/betz.py +0 -0
  169. {foxes-1.2.2 → foxes-1.2.3}/foxes/models/axial_induction/madsen.py +0 -0
  170. {foxes-1.2.2 → foxes-1.2.3}/foxes/models/farm_controllers/__init__.py +0 -0
  171. {foxes-1.2.2 → foxes-1.2.3}/foxes/models/farm_controllers/basic.py +0 -0
  172. {foxes-1.2.2 → foxes-1.2.3}/foxes/models/farm_models/__init__.py +0 -0
  173. {foxes-1.2.2 → foxes-1.2.3}/foxes/models/farm_models/turbine2farm.py +0 -0
  174. {foxes-1.2.2 → foxes-1.2.3}/foxes/models/ground_models/__init__.py +0 -0
  175. {foxes-1.2.2 → foxes-1.2.3}/foxes/models/ground_models/no_ground.py +0 -0
  176. {foxes-1.2.2 → foxes-1.2.3}/foxes/models/ground_models/wake_mirror.py +0 -0
  177. {foxes-1.2.2 → foxes-1.2.3}/foxes/models/partial_wakes/__init__.py +0 -0
  178. {foxes-1.2.2 → foxes-1.2.3}/foxes/models/partial_wakes/axiwake.py +0 -0
  179. {foxes-1.2.2 → foxes-1.2.3}/foxes/models/partial_wakes/centre.py +0 -0
  180. {foxes-1.2.2 → foxes-1.2.3}/foxes/models/partial_wakes/grid.py +0 -0
  181. {foxes-1.2.2 → foxes-1.2.3}/foxes/models/partial_wakes/rotor_points.py +0 -0
  182. {foxes-1.2.2 → foxes-1.2.3}/foxes/models/partial_wakes/segregated.py +0 -0
  183. {foxes-1.2.2 → foxes-1.2.3}/foxes/models/partial_wakes/top_hat.py +0 -0
  184. {foxes-1.2.2 → foxes-1.2.3}/foxes/models/point_models/set_uniform_data.py +0 -0
  185. {foxes-1.2.2 → foxes-1.2.3}/foxes/models/point_models/tke2ti.py +0 -0
  186. {foxes-1.2.2 → foxes-1.2.3}/foxes/models/point_models/wake_deltas.py +0 -0
  187. {foxes-1.2.2 → foxes-1.2.3}/foxes/models/rotor_models/__init__.py +0 -0
  188. {foxes-1.2.2 → foxes-1.2.3}/foxes/models/rotor_models/centre.py +0 -0
  189. {foxes-1.2.2 → foxes-1.2.3}/foxes/models/rotor_models/grid.py +0 -0
  190. {foxes-1.2.2 → foxes-1.2.3}/foxes/models/rotor_models/levels.py +0 -0
  191. {foxes-1.2.2 → foxes-1.2.3}/foxes/models/turbine_models/__init__.py +0 -0
  192. {foxes-1.2.2 → foxes-1.2.3}/foxes/models/turbine_models/calculator.py +0 -0
  193. {foxes-1.2.2 → foxes-1.2.3}/foxes/models/turbine_models/kTI_model.py +0 -0
  194. {foxes-1.2.2 → foxes-1.2.3}/foxes/models/turbine_models/power_mask.py +0 -0
  195. {foxes-1.2.2 → foxes-1.2.3}/foxes/models/turbine_models/rotor_centre_calc.py +0 -0
  196. {foxes-1.2.2 → foxes-1.2.3}/foxes/models/turbine_models/set_farm_vars.py +0 -0
  197. {foxes-1.2.2 → foxes-1.2.3}/foxes/models/turbine_models/thrust2ct.py +0 -0
  198. {foxes-1.2.2 → foxes-1.2.3}/foxes/models/turbine_models/yaw2yawm.py +0 -0
  199. {foxes-1.2.2 → foxes-1.2.3}/foxes/models/turbine_models/yawm2yaw.py +0 -0
  200. {foxes-1.2.2 → foxes-1.2.3}/foxes/models/turbine_types/__init__.py +0 -0
  201. {foxes-1.2.2 → foxes-1.2.3}/foxes/models/turbine_types/lookup.py +0 -0
  202. {foxes-1.2.2 → foxes-1.2.3}/foxes/models/turbine_types/null_type.py +0 -0
  203. {foxes-1.2.2 → foxes-1.2.3}/foxes/models/vertical_profiles/__init__.py +0 -0
  204. {foxes-1.2.2 → foxes-1.2.3}/foxes/models/vertical_profiles/abl_log_neutral_ws.py +0 -0
  205. {foxes-1.2.2 → foxes-1.2.3}/foxes/models/vertical_profiles/abl_log_stable_ws.py +0 -0
  206. {foxes-1.2.2 → foxes-1.2.3}/foxes/models/vertical_profiles/abl_log_unstable_ws.py +0 -0
  207. {foxes-1.2.2 → foxes-1.2.3}/foxes/models/vertical_profiles/abl_log_ws.py +0 -0
  208. {foxes-1.2.2 → foxes-1.2.3}/foxes/models/vertical_profiles/data_profile.py +0 -0
  209. {foxes-1.2.2 → foxes-1.2.3}/foxes/models/vertical_profiles/sheared_ws.py +0 -0
  210. {foxes-1.2.2 → foxes-1.2.3}/foxes/models/vertical_profiles/uniform.py +0 -0
  211. {foxes-1.2.2 → foxes-1.2.3}/foxes/models/wake_frames/__init__.py +0 -0
  212. {foxes-1.2.2 → foxes-1.2.3}/foxes/models/wake_frames/dynamic_wakes.py +0 -0
  213. {foxes-1.2.2 → foxes-1.2.3}/foxes/models/wake_frames/farm_order.py +0 -0
  214. {foxes-1.2.2 → foxes-1.2.3}/foxes/models/wake_frames/rotor_wd.py +0 -0
  215. {foxes-1.2.2 → foxes-1.2.3}/foxes/models/wake_frames/seq_dynamic_wakes.py +0 -0
  216. {foxes-1.2.2 → foxes-1.2.3}/foxes/models/wake_frames/streamlines.py +0 -0
  217. {foxes-1.2.2 → foxes-1.2.3}/foxes/models/wake_frames/timelines.py +0 -0
  218. {foxes-1.2.2 → foxes-1.2.3}/foxes/models/wake_frames/yawed_wakes.py +0 -0
  219. {foxes-1.2.2 → foxes-1.2.3}/foxes/models/wake_models/__init__.py +0 -0
  220. {foxes-1.2.2 → foxes-1.2.3}/foxes/models/wake_models/axisymmetric.py +0 -0
  221. {foxes-1.2.2 → foxes-1.2.3}/foxes/models/wake_models/dist_sliced.py +0 -0
  222. {foxes-1.2.2 → foxes-1.2.3}/foxes/models/wake_models/gaussian.py +0 -0
  223. {foxes-1.2.2 → foxes-1.2.3}/foxes/models/wake_models/induction/__init__.py +0 -0
  224. {foxes-1.2.2 → foxes-1.2.3}/foxes/models/wake_models/induction/rankine_half_body.py +0 -0
  225. {foxes-1.2.2 → foxes-1.2.3}/foxes/models/wake_models/induction/rathmann.py +0 -0
  226. {foxes-1.2.2 → foxes-1.2.3}/foxes/models/wake_models/induction/self_similar.py +0 -0
  227. {foxes-1.2.2 → foxes-1.2.3}/foxes/models/wake_models/induction/self_similar2020.py +0 -0
  228. {foxes-1.2.2 → foxes-1.2.3}/foxes/models/wake_models/induction/vortex_sheet.py +0 -0
  229. {foxes-1.2.2 → foxes-1.2.3}/foxes/models/wake_models/ti/__init__.py +0 -0
  230. {foxes-1.2.2 → foxes-1.2.3}/foxes/models/wake_models/ti/crespo_hernandez.py +0 -0
  231. {foxes-1.2.2 → foxes-1.2.3}/foxes/models/wake_models/ti/iec_ti.py +0 -0
  232. {foxes-1.2.2 → foxes-1.2.3}/foxes/models/wake_models/top_hat.py +0 -0
  233. {foxes-1.2.2 → foxes-1.2.3}/foxes/models/wake_models/wind/__init__.py +0 -0
  234. {foxes-1.2.2 → foxes-1.2.3}/foxes/models/wake_models/wind/bastankhah14.py +0 -0
  235. {foxes-1.2.2 → foxes-1.2.3}/foxes/models/wake_models/wind/bastankhah16.py +0 -0
  236. {foxes-1.2.2 → foxes-1.2.3}/foxes/models/wake_models/wind/jensen.py +0 -0
  237. {foxes-1.2.2 → foxes-1.2.3}/foxes/models/wake_models/wind/turbopark.py +0 -0
  238. {foxes-1.2.2 → foxes-1.2.3}/foxes/models/wake_superpositions/__init__.py +0 -0
  239. {foxes-1.2.2 → foxes-1.2.3}/foxes/models/wake_superpositions/ti_linear.py +0 -0
  240. {foxes-1.2.2 → foxes-1.2.3}/foxes/models/wake_superpositions/ti_max.py +0 -0
  241. {foxes-1.2.2 → foxes-1.2.3}/foxes/models/wake_superpositions/ti_pow.py +0 -0
  242. {foxes-1.2.2 → foxes-1.2.3}/foxes/models/wake_superpositions/ti_quadratic.py +0 -0
  243. {foxes-1.2.2 → foxes-1.2.3}/foxes/models/wake_superpositions/ws_linear.py +0 -0
  244. {foxes-1.2.2 → foxes-1.2.3}/foxes/models/wake_superpositions/ws_max.py +0 -0
  245. {foxes-1.2.2 → foxes-1.2.3}/foxes/models/wake_superpositions/ws_pow.py +0 -0
  246. {foxes-1.2.2 → foxes-1.2.3}/foxes/models/wake_superpositions/ws_product.py +0 -0
  247. {foxes-1.2.2 → foxes-1.2.3}/foxes/models/wake_superpositions/ws_quadratic.py +0 -0
  248. {foxes-1.2.2 → foxes-1.2.3}/foxes/output/animation.py +0 -0
  249. {foxes-1.2.2 → foxes-1.2.3}/foxes/output/calc_points.py +0 -0
  250. {foxes-1.2.2 → foxes-1.2.3}/foxes/output/farm_layout.py +0 -0
  251. {foxes-1.2.2 → foxes-1.2.3}/foxes/output/farm_results_eval.py +0 -0
  252. {foxes-1.2.2 → foxes-1.2.3}/foxes/output/flow_plots_2d/__init__.py +0 -0
  253. {foxes-1.2.2 → foxes-1.2.3}/foxes/output/flow_plots_2d/flow_plots.py +0 -0
  254. {foxes-1.2.2 → foxes-1.2.3}/foxes/output/flow_plots_2d/get_fig.py +0 -0
  255. {foxes-1.2.2 → foxes-1.2.3}/foxes/output/grids.py +0 -0
  256. {foxes-1.2.2 → foxes-1.2.3}/foxes/output/plt.py +0 -0
  257. {foxes-1.2.2 → foxes-1.2.3}/foxes/output/results_writer.py +0 -0
  258. {foxes-1.2.2 → foxes-1.2.3}/foxes/output/rose_plot.py +0 -0
  259. {foxes-1.2.2 → foxes-1.2.3}/foxes/output/rotor_point_plots.py +0 -0
  260. {foxes-1.2.2 → foxes-1.2.3}/foxes/output/round.py +0 -0
  261. {foxes-1.2.2 → foxes-1.2.3}/foxes/output/seq_plugins/__init__.py +0 -0
  262. {foxes-1.2.2 → foxes-1.2.3}/foxes/output/seq_plugins/seq_flow_ani_plugin.py +0 -0
  263. {foxes-1.2.2 → foxes-1.2.3}/foxes/output/seq_plugins/seq_wake_debug_plugin.py +0 -0
  264. {foxes-1.2.2 → foxes-1.2.3}/foxes/output/state_turbine_map.py +0 -0
  265. {foxes-1.2.2 → foxes-1.2.3}/foxes/output/turbine_type_curves.py +0 -0
  266. {foxes-1.2.2 → foxes-1.2.3}/foxes/utils/__init__.py +0 -0
  267. {foxes-1.2.2 → foxes-1.2.3}/foxes/utils/abl/__init__.py +0 -0
  268. {foxes-1.2.2 → foxes-1.2.3}/foxes/utils/abl/neutral.py +0 -0
  269. {foxes-1.2.2 → foxes-1.2.3}/foxes/utils/abl/sheared.py +0 -0
  270. {foxes-1.2.2 → foxes-1.2.3}/foxes/utils/abl/stable.py +0 -0
  271. {foxes-1.2.2 → foxes-1.2.3}/foxes/utils/abl/unstable.py +0 -0
  272. {foxes-1.2.2 → foxes-1.2.3}/foxes/utils/cubic_roots.py +0 -0
  273. {foxes-1.2.2 → foxes-1.2.3}/foxes/utils/data_book.py +0 -0
  274. {foxes-1.2.2 → foxes-1.2.3}/foxes/utils/dev_utils.py +0 -0
  275. {foxes-1.2.2 → foxes-1.2.3}/foxes/utils/dict.py +0 -0
  276. {foxes-1.2.2 → foxes-1.2.3}/foxes/utils/exec_python.py +0 -0
  277. {foxes-1.2.2 → foxes-1.2.3}/foxes/utils/factory.py +0 -0
  278. {foxes-1.2.2 → foxes-1.2.3}/foxes/utils/geom2d/__init__.py +0 -0
  279. {foxes-1.2.2 → foxes-1.2.3}/foxes/utils/geom2d/area_geometry.py +0 -0
  280. {foxes-1.2.2 → foxes-1.2.3}/foxes/utils/geom2d/circle.py +0 -0
  281. {foxes-1.2.2 → foxes-1.2.3}/foxes/utils/geom2d/example_intersection.py +0 -0
  282. {foxes-1.2.2 → foxes-1.2.3}/foxes/utils/geom2d/example_union.py +0 -0
  283. {foxes-1.2.2 → foxes-1.2.3}/foxes/utils/geom2d/half_plane.py +0 -0
  284. {foxes-1.2.2 → foxes-1.2.3}/foxes/utils/geom2d/polygon.py +0 -0
  285. {foxes-1.2.2 → foxes-1.2.3}/foxes/utils/geopandas_utils.py +0 -0
  286. {foxes-1.2.2 → foxes-1.2.3}/foxes/utils/pandas_helpers.py +0 -0
  287. {foxes-1.2.2 → foxes-1.2.3}/foxes/utils/pandas_utils.py +0 -0
  288. {foxes-1.2.2 → foxes-1.2.3}/foxes/utils/random_xy.py +0 -0
  289. {foxes-1.2.2 → foxes-1.2.3}/foxes/utils/regularize.py +0 -0
  290. {foxes-1.2.2 → foxes-1.2.3}/foxes/utils/subclasses.py +0 -0
  291. {foxes-1.2.2 → foxes-1.2.3}/foxes/utils/tab_files.py +0 -0
  292. {foxes-1.2.2 → foxes-1.2.3}/foxes/utils/two_circles.py +0 -0
  293. {foxes-1.2.2 → foxes-1.2.3}/foxes/utils/wind_dir.py +0 -0
  294. {foxes-1.2.2 → foxes-1.2.3}/foxes.egg-info/dependency_links.txt +0 -0
  295. {foxes-1.2.2 → foxes-1.2.3}/foxes.egg-info/entry_points.txt +0 -0
  296. {foxes-1.2.2 → foxes-1.2.3}/foxes.egg-info/top_level.txt +0 -0
  297. {foxes-1.2.2 → foxes-1.2.3}/setup.cfg +0 -0
  298. {foxes-1.2.2 → foxes-1.2.3}/tests/0_consistency/iterative/test_iterative.py +0 -0
  299. {foxes-1.2.2 → foxes-1.2.3}/tests/0_consistency/partial_wakes/test_partial_wakes.py +0 -0
  300. {foxes-1.2.2 → foxes-1.2.3}/tests/1_verification/flappy_0_6/PCt_files/flappy/run.py +0 -0
  301. {foxes-1.2.2 → foxes-1.2.3}/tests/1_verification/flappy_0_6/PCt_files/test_PCt_files.py +0 -0
  302. {foxes-1.2.2 → foxes-1.2.3}/tests/1_verification/flappy_0_6/abl_states/flappy/run.py +0 -0
  303. {foxes-1.2.2 → foxes-1.2.3}/tests/1_verification/flappy_0_6/abl_states/test_abl_states.py +0 -0
  304. {foxes-1.2.2 → foxes-1.2.3}/tests/1_verification/flappy_0_6/partial_top_hat/flappy/run.py +0 -0
  305. {foxes-1.2.2 → foxes-1.2.3}/tests/1_verification/flappy_0_6/partial_top_hat/test_partial_top_hat.py +0 -0
  306. {foxes-1.2.2 → foxes-1.2.3}/tests/1_verification/flappy_0_6/row_Jensen_linear_centre/flappy/run.py +0 -0
  307. {foxes-1.2.2 → foxes-1.2.3}/tests/1_verification/flappy_0_6/row_Jensen_linear_centre/test_row_Jensen_linear_centre.py +0 -0
  308. {foxes-1.2.2 → foxes-1.2.3}/tests/1_verification/flappy_0_6/row_Jensen_linear_tophat/flappy/run.py +0 -0
  309. {foxes-1.2.2 → foxes-1.2.3}/tests/1_verification/flappy_0_6/row_Jensen_linear_tophat/test_row_Jensen_linear_tophat.py +0 -0
  310. {foxes-1.2.2 → foxes-1.2.3}/tests/1_verification/flappy_0_6/row_Jensen_linear_tophat_IECTI2005/flappy/run.py +0 -0
  311. {foxes-1.2.2 → foxes-1.2.3}/tests/1_verification/flappy_0_6/row_Jensen_linear_tophat_IECTI2005/test_row_Jensen_linear_tophat_IECTI_2005.py +0 -0
  312. {foxes-1.2.2 → foxes-1.2.3}/tests/1_verification/flappy_0_6/row_Jensen_linear_tophat_IECTI2019/flappy/run.py +0 -0
  313. {foxes-1.2.2 → foxes-1.2.3}/tests/1_verification/flappy_0_6/row_Jensen_linear_tophat_IECTI2019/test_row_Jensen_linear_tophat_IECTI_2019.py +0 -0
  314. {foxes-1.2.2 → foxes-1.2.3}/tests/1_verification/flappy_0_6/row_Jensen_quadratic_centre/flappy/run.py +0 -0
  315. {foxes-1.2.2 → foxes-1.2.3}/tests/1_verification/flappy_0_6/row_Jensen_quadratic_centre/test_row_Jensen_quadratic_centre.py +0 -0
  316. {foxes-1.2.2 → foxes-1.2.3}/tests/1_verification/flappy_0_6_2/grid_rotors/flappy/run.py +0 -0
  317. {foxes-1.2.2 → foxes-1.2.3}/tests/1_verification/flappy_0_6_2/grid_rotors/test_grid_rotors.py +0 -0
  318. {foxes-1.2.2 → foxes-1.2.3}/tests/1_verification/flappy_0_6_2/row_Bastankhah_Crespo/flappy/run.py +0 -0
  319. {foxes-1.2.2 → foxes-1.2.3}/tests/1_verification/flappy_0_6_2/row_Bastankhah_Crespo/test_row_Bastankhah_Crespo.py +0 -0
  320. {foxes-1.2.2 → foxes-1.2.3}/tests/1_verification/flappy_0_6_2/row_Bastankhah_linear_centre/flappy/run.py +0 -0
  321. {foxes-1.2.2 → foxes-1.2.3}/tests/1_verification/flappy_0_6_2/row_Bastankhah_linear_centre/test_row_Bastankhah_linear_centre.py +0 -0
  322. {foxes-1.2.2 → foxes-1.2.3}/tests/3_examples/test_examples.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: foxes
3
- Version: 1.2.2
3
+ Version: 1.2.3
4
4
  Summary: Farm Optimization and eXtended yield Evaluation Software
5
5
  Author: Jonas Schulte
6
6
  Maintainer: Jonas Schulte
@@ -53,18 +53,19 @@ Requires-Dist: numpy
53
53
  Requires-Dist: pandas
54
54
  Requires-Dist: xarray
55
55
  Requires-Dist: scipy
56
- Requires-Dist: netcdf4
57
56
  Requires-Dist: cycler
58
57
  Requires-Dist: tqdm
59
58
  Requires-Dist: pyyaml
60
59
  Provides-Extra: opt
61
60
  Requires-Dist: foxes-opt; extra == "opt"
62
61
  Provides-Extra: dask
62
+ Requires-Dist: h5netcdf; extra == "dask"
63
63
  Requires-Dist: dask; extra == "dask"
64
64
  Requires-Dist: distributed; extra == "dask"
65
65
  Requires-Dist: dask-jobqueue; extra == "dask"
66
66
  Requires-Dist: setuptools; extra == "dask"
67
67
  Provides-Extra: eng
68
+ Requires-Dist: h5netcdf; extra == "eng"
68
69
  Requires-Dist: multiprocess; extra == "eng"
69
70
  Requires-Dist: dask; extra == "eng"
70
71
  Requires-Dist: distributed; extra == "eng"
@@ -73,6 +74,7 @@ Requires-Dist: setuptools; extra == "eng"
73
74
  Requires-Dist: mpi4py; extra == "eng"
74
75
  Requires-Dist: ray; extra == "eng"
75
76
  Provides-Extra: eng0
77
+ Requires-Dist: h5netcdf; extra == "eng0"
76
78
  Requires-Dist: multiprocess; extra == "eng0"
77
79
  Requires-Dist: dask; extra == "eng0"
78
80
  Requires-Dist: distributed; extra == "eng0"
@@ -82,7 +84,9 @@ Requires-Dist: ray; extra == "eng0"
82
84
  Provides-Extra: test
83
85
  Requires-Dist: flake8; extra == "test"
84
86
  Requires-Dist: pytest; extra == "test"
87
+ Requires-Dist: h5netcdf; extra == "test"
85
88
  Provides-Extra: doc
89
+ Requires-Dist: setuptools; extra == "doc"
86
90
  Requires-Dist: sphinx; extra == "doc"
87
91
  Requires-Dist: sphinx-immaterial; extra == "doc"
88
92
  Requires-Dist: nbsphinx; extra == "doc"
@@ -60,7 +60,10 @@ if __name__ == "__main__":
60
60
  type=int,
61
61
  )
62
62
  parser.add_argument(
63
- "-npl", "--no_pre_load", help="Do not pre-load data", action="store_true"
63
+ "-lm",
64
+ "--load_mode",
65
+ help="Do load mode",
66
+ default="preload",
64
67
  )
65
68
  parser.add_argument(
66
69
  "-nf", "--nofig", help="Do not show figures", action="store_true"
@@ -70,9 +73,7 @@ if __name__ == "__main__":
70
73
  states = foxes.input.states.FieldDataNC(
71
74
  args.file_pattern,
72
75
  output_vars=[FV.WS, FV.WD, FV.TI, FV.RHO],
73
- # var2ncvar={FV.WS: "ws", FV.WD: "wd", FV.TI: "ti"},
74
- fixed_vars={FV.RHO: 1.225},
75
- pre_load=not args.no_pre_load,
76
+ load_mode=args.load_mode,
76
77
  )
77
78
 
78
79
  mbook = foxes.models.ModelBook()
@@ -115,6 +116,12 @@ if __name__ == "__main__":
115
116
  fr = farm_results.to_dataframe()
116
117
  print(fr[[FV.WD, FV.AMB_REWS, FV.REWS, FV.AMB_P, FV.P]])
117
118
 
119
+ o = foxes.output.SlicesData(algo, farm_results)
120
+ ds = o.get_states_data_xy(
121
+ z_list=[90, 100], variables=[FV.WS], resolution=50, verbosity=1
122
+ )
123
+ print(ds)
124
+
118
125
  if not args.nofig:
119
126
  o = foxes.output.FlowPlots2D(algo, farm_results)
120
127
  o.get_mean_fig_xy(FV.WS, resolution=10)
@@ -43,9 +43,12 @@ if __name__ == "__main__":
43
43
  "-nt", "--n_turbines", help="The number of turbines", default=9, type=int
44
44
  )
45
45
  parser.add_argument(
46
- "-npl", "--no_pre_load", help="Pre-load the nc data", action="store_true"
46
+ "-lm",
47
+ "--load_mode",
48
+ help="Do load mode",
49
+ default="preload",
47
50
  )
48
- parser.add_argument("-e", "--engine", help="The engine", default=None)
51
+ parser.add_argument("-e", "--engine", help="The engine", default="process")
49
52
  parser.add_argument(
50
53
  "-n", "--n_cpus", help="The number of cpus", default=None, type=int
51
54
  )
@@ -82,7 +85,7 @@ if __name__ == "__main__":
82
85
  output_vars=[FV.WS, FV.WD, FV.TI, FV.RHO],
83
86
  var2ncvar={FV.WS: "ws", FV.WD: "wd"},
84
87
  fixed_vars={FV.RHO: 1.225, FV.TI: 0.1},
85
- pre_load=not args.no_pre_load,
88
+ load_mode=args.load_mode,
86
89
  bounds_error=False,
87
90
  )
88
91
 
@@ -188,6 +188,7 @@ class Downwind(Algorithm):
188
188
 
189
189
  self.__farm_controller = self.mbook.farm_controllers.get_item(farm_controller)
190
190
  self.farm_controller.name = farm_controller
191
+ self.farm_controller.find_turbine_types(self)
191
192
 
192
193
  @property
193
194
  def states(self):
@@ -0,0 +1 @@
1
+ from .config import Config, config, get_path, get_input_path, get_output_path
@@ -1,7 +1,7 @@
1
1
  import numpy as np
2
2
  from pathlib import Path
3
3
 
4
- from foxes.utils.dict import Dict
4
+ from foxes.utils import Dict, import_module
5
5
  import foxes.constants as FC
6
6
 
7
7
 
@@ -19,7 +19,9 @@ class Config(Dict):
19
19
  FC.DTYPE: np.float64,
20
20
  FC.ITYPE: np.int64,
21
21
  FC.WORK_DIR: Path("."),
22
- FC.OUT_DIR: Path("."),
22
+ FC.INPUT_DIR: None,
23
+ FC.OUTPUT_DIR: None,
24
+ FC.NC_ENGINE: "h5netcdf",
23
25
  },
24
26
  name="config",
25
27
  )
@@ -62,12 +64,33 @@ class Config(Dict):
62
64
 
63
65
  """
64
66
  pth = self.get_item(FC.WORK_DIR)
65
- if not isinstance(pth, Path):
67
+ if self[FC.WORK_DIR] is None:
68
+ self[FC.WORK_DIR] = Path(".")
69
+ elif not isinstance(pth, Path):
66
70
  self[FC.WORK_DIR] = Path(pth)
67
71
  return self[FC.WORK_DIR]
68
72
 
69
73
  @property
70
- def out_dir(self):
74
+ def input_dir(self):
75
+ """
76
+ The input base directory
77
+
78
+ Returns
79
+ -------
80
+ pth: pathlib.Path
81
+ Path to the input base directory
82
+
83
+ """
84
+ if self[FC.INPUT_DIR] is None:
85
+ return self.work_dir
86
+ else:
87
+ pth = self.get_item(FC.INPUT_DIR)
88
+ if not isinstance(pth, Path):
89
+ self[FC.INPUT_DIR] = Path(pth)
90
+ return self[FC.INPUT_DIR]
91
+
92
+ @property
93
+ def output_dir(self):
71
94
  """
72
95
  The default output directory
73
96
 
@@ -77,7 +100,27 @@ class Config(Dict):
77
100
  Path to the default output directory
78
101
 
79
102
  """
80
- return get_path(self.get_item(FC.OUT_DIR))
103
+ if self[FC.OUTPUT_DIR] is None:
104
+ return self.work_dir
105
+ else:
106
+ pth = self.get_item(FC.OUTPUT_DIR)
107
+ if not isinstance(pth, Path):
108
+ self[FC.OUTPUT_DIR] = Path(pth)
109
+ return self[FC.OUTPUT_DIR]
110
+
111
+ @property
112
+ def nc_engine(self):
113
+ """
114
+ The NetCDF engine
115
+
116
+ Returns
117
+ -------
118
+ nce: str
119
+ The NetCDF engine
120
+
121
+ """
122
+ import_module(self[FC.NC_ENGINE])
123
+ return self[FC.NC_ENGINE]
81
124
 
82
125
 
83
126
  config = Config()
@@ -86,10 +129,37 @@ config = Config()
86
129
  """
87
130
 
88
131
 
89
- def get_path(pth):
132
+ def get_path(pth, base):
133
+ """
134
+ Gets path object, respecting the base directory
135
+
136
+ Parameters
137
+ ----------
138
+ pth: str or pathlib.Path
139
+ The path, optionally relative to base
140
+ base: pathlib.Path
141
+ The base directory
142
+
143
+ Returns
144
+ -------
145
+ out: pathlib.Path
146
+ The path, absolute or relative to base directory
147
+
148
+ :group: foxes.config
149
+
150
+ """
151
+ if not isinstance(pth, Path):
152
+ pth = Path(pth)
153
+ if pth.is_absolute():
154
+ return pth
155
+ else:
156
+ return base / pth
157
+
158
+
159
+ def get_input_path(pth):
90
160
  """
91
161
  Gets path object, respecting the configurations
92
- work directory
162
+ input directory
93
163
 
94
164
  Parameters
95
165
  ----------
@@ -99,15 +169,13 @@ def get_path(pth):
99
169
  Returns
100
170
  -------
101
171
  out: pathlib.Path
102
- The path, absolute or relative to working directory
172
+ The path, absolute or relative to input directory
103
173
  from config
104
174
 
105
175
  :group: foxes.config
106
176
 
107
177
  """
108
- if not isinstance(pth, Path):
109
- pth = Path(pth)
110
- return pth if pth.is_absolute() else config.work_dir / pth
178
+ return get_path(pth, base=config.input_dir)
111
179
 
112
180
 
113
181
  def get_output_path(pth):
@@ -129,6 +197,4 @@ def get_output_path(pth):
129
197
  :group: foxes.config
130
198
 
131
199
  """
132
- if not isinstance(pth, Path):
133
- pth = Path(pth)
134
- return pth if pth.is_absolute() else config.out_dir / pth
200
+ return get_path(pth, base=config.output_dir)
@@ -189,7 +189,18 @@ WORK_DIR = "work_dir"
189
189
  :group: foxes.constants
190
190
  """
191
191
 
192
- OUT_DIR = "out_dir"
192
+ INPUT_DIR = "in_dir"
193
+ """Identifier for the input base directory
194
+ :group: foxes.constants
195
+ """
196
+
197
+ OUTPUT_DIR = "out_dir"
193
198
  """Identifier for the default output directory
194
199
  :group: foxes.constants
195
200
  """
201
+
202
+
203
+ NC_ENGINE = "nc_engine"
204
+ """Identifier for the NetCDF engine
205
+ :group: foxes.constants
206
+ """
@@ -74,14 +74,19 @@ class Algorithm(Model):
74
74
  )
75
75
  elif "engine" in engine_pars:
76
76
  engine_pars["engine_type"] = engine_pars.pop("engine")
77
- v = engine_pars.pop("verbosity", verbosity)
78
- try:
79
- e = Engine.new(verbosity=v, **engine_pars)
80
- except TypeError as e:
81
- print(f"\nError while interpreting engine_pars {engine_pars}\n")
82
- raise e
83
- self.print(f"Algorithm '{self.name}': Selecting engine '{e}'")
84
- e.initialize()
77
+
78
+ if "engine_type" in engine_pars:
79
+ try:
80
+ e = Engine.new(verbosity=verbosity, **engine_pars)
81
+ except TypeError as e:
82
+ print(f"\nError while interpreting engine_pars {engine_pars}\n")
83
+ raise e
84
+ self.print(f"Algorithm '{self.name}': Selecting engine '{e}'")
85
+ e.initialize()
86
+ else:
87
+ raise KeyError(
88
+ f"{self.name}: Found unsupported parameters {list(engine_pars.keys())}"
89
+ )
85
90
 
86
91
  @property
87
92
  def farm(self):
@@ -157,6 +157,36 @@ class Engine(ABC):
157
157
  if self.verbosity >= level:
158
158
  print(*args, **kwargs)
159
159
 
160
+ def map(
161
+ self,
162
+ func,
163
+ inputs,
164
+ *args,
165
+ **kwargs,
166
+ ):
167
+ """
168
+ Runs a function on a list of files
169
+
170
+ Parameters
171
+ ----------
172
+ func: Callable
173
+ Function to be called on each file,
174
+ func(input, *args, **kwargs) -> data
175
+ inputs: array-like
176
+ The input data list
177
+ args: tuple, optional
178
+ Arguments for func
179
+ kwargs: dict, optional
180
+ Keyword arguments for func
181
+
182
+ Returns
183
+ -------
184
+ results: list
185
+ The list of results
186
+
187
+ """
188
+ raise NotImplementedError
189
+
160
190
  @property
161
191
  def loop_dims(self):
162
192
  """
@@ -176,6 +176,39 @@ class FarmController(FarmDataModel):
176
176
 
177
177
  return [m.name for m in tmodels], tmsels
178
178
 
179
+ def find_turbine_types(self, algo):
180
+ """
181
+ Collects the turbine types.
182
+
183
+ Parameters
184
+ ----------
185
+ algo: foxes.core.Algorithm
186
+ The algorithm
187
+
188
+ """
189
+
190
+ # check turbine models, and find turbine types and pre/post-rotor models:
191
+ self.turbine_types = [None for t in algo.farm.turbines]
192
+ for ti, t in enumerate(algo.farm.turbines):
193
+ for mname in t.models:
194
+ if mname in algo.mbook.turbine_types:
195
+ m = algo.mbook.turbine_types[mname]
196
+ if not isinstance(m, TurbineType):
197
+ raise TypeError(
198
+ f"Model {mname} type {type(m).__name__} is not derived from {TurbineType.__name__}"
199
+ )
200
+ if self.turbine_types[ti] is not None:
201
+ raise TypeError(
202
+ f"Two turbine type models found for turbine {ti}: {self.turbine_types[ti].name} and {mname}"
203
+ )
204
+ m.name = mname
205
+ self.turbine_types[ti] = m
206
+
207
+ if self.turbine_types[ti] is None:
208
+ raise ValueError(
209
+ f"Turbine {ti}, {t.name}: Missing a turbine type model among models {t.models}"
210
+ )
211
+
179
212
  def collect_models(self, algo):
180
213
  """
181
214
  Analyze and gather turbine models, based on the
@@ -188,22 +221,18 @@ class FarmController(FarmDataModel):
188
221
 
189
222
  """
190
223
 
224
+ if self.turbine_types is None:
225
+ self.find_turbine_types(algo)
226
+
191
227
  # check turbine models, and find turbine types and pre/post-rotor models:
192
- self.turbine_types = [None for t in algo.farm.turbines]
193
228
  prer_models = [[] for t in algo.farm.turbines]
194
229
  postr_models = [[] for t in algo.farm.turbines]
230
+ ttypes = {m.name: m for m in self.turbine_types}
195
231
  for ti, t in enumerate(algo.farm.turbines):
196
232
  prer = None
197
233
  for mi, mname in enumerate(t.models):
198
- istype = False
199
- if mname in algo.mbook.turbine_types:
200
- m = algo.mbook.turbine_types[mname]
201
- if not isinstance(m, TurbineType):
202
- raise TypeError(
203
- f"Model {mname} type {type(m).__name__} is not derived from {TurbineType.__name__}"
204
- )
205
- models = [m]
206
- istype = True
234
+ if mname in ttypes:
235
+ models = [ttypes[mname]]
207
236
  elif mname in algo.mbook.turbine_models:
208
237
  m = algo.mbook.turbine_models[mname]
209
238
  models = m.models if isinstance(m, FarmDataModelList) else [m]
@@ -212,21 +241,14 @@ class FarmController(FarmDataModel):
212
241
  raise TypeError(
213
242
  f"Model {mname} type {type(mm).__name__} is not derived from {TurbineModel.__name__}"
214
243
  )
244
+ m.name = mname
215
245
  else:
216
246
  raise KeyError(
217
247
  f"Model {mname} not found in model book types or models"
218
248
  )
219
249
 
220
- if istype:
221
- if self.turbine_types[ti] is None:
222
- self.turbine_types[ti] = m
223
- else:
224
- raise ValueError(
225
- f"Turbine {ti}, {t.name}: Multiple turbine types found in self.turbine_models list, {self.turbine_types[ti].name} and {mname}"
226
- )
227
-
250
+ prer = None
228
251
  for m in models:
229
- m.name = mname
230
252
  if prer is None:
231
253
  prer = m.pre_rotor
232
254
  elif not prer and m.pre_rotor:
@@ -238,11 +260,6 @@ class FarmController(FarmDataModel):
238
260
  else:
239
261
  postr_models[ti].append(m)
240
262
 
241
- if self.turbine_types[ti] is None:
242
- raise ValueError(
243
- f"Turbine {ti}, {t.name}: Missing a turbine type model among models {t.models}"
244
- )
245
-
246
263
  # analyze models:
247
264
  mnames_pre, tmsels_pre = self._analyze_models(
248
265
  algo, pre_rotor=True, models=prer_models
@@ -277,7 +277,7 @@ class ExtendedStates(States):
277
277
  The output variable names
278
278
 
279
279
  """
280
- return self.states.output_point_vars(algo)
280
+ return self.pmodels.output_point_vars(algo)
281
281
 
282
282
  def calculate(self, algo, mdata, fdata, tdata):
283
283
  """
@@ -0,0 +1,187 @@
1
+ import numpy as np
2
+
3
+ from foxes.config import config
4
+
5
+
6
+ class WindFarm:
7
+ """
8
+ The wind farm.
9
+
10
+ Attributes
11
+ ----------
12
+ name: str
13
+ The wind farm name
14
+ turbines: list of foxes.core.Turbine
15
+ The wind turbines
16
+ boundary: foxes.utils.geom2d.AreaGeometry, optional
17
+ The wind farm boundary
18
+
19
+ :group: core
20
+
21
+ """
22
+
23
+ def __init__(self, name="wind_farm", boundary=None):
24
+ """
25
+ Constructor.
26
+
27
+ Parameters
28
+ ----------
29
+ name: str
30
+ The wind farm name
31
+
32
+ """
33
+ self.name = name
34
+ self.turbines = []
35
+ self.boundary = boundary
36
+
37
+ def add_turbine(self, turbine, verbosity=1):
38
+ """
39
+ Add a wind turbine to the list.
40
+
41
+ Parameters
42
+ ----------
43
+ turbine: foxes.core.Turbine
44
+ The wind turbine
45
+ verbosity: int
46
+ The output verbosity, 0 = silent
47
+
48
+ """
49
+ if turbine.index is None:
50
+ turbine.index = len(self.turbines)
51
+ if turbine.name is None:
52
+ turbine.name = f"T{turbine.index}"
53
+ self.turbines.append(turbine)
54
+ if verbosity > 0:
55
+ print(
56
+ f"Turbine {turbine.index}, {turbine.name}: xy=({turbine.xy[0]:.2f}, {turbine.xy[1]:.2f}), {', '.join(turbine.models)}"
57
+ )
58
+
59
+ @property
60
+ def n_turbines(self):
61
+ """
62
+ The number of turbines in the wind farm
63
+
64
+ Returns
65
+ -------
66
+ n_turbines: int
67
+ The total number of turbines
68
+
69
+ """
70
+ return len(self.turbines)
71
+
72
+ @property
73
+ def turbine_names(self):
74
+ """
75
+ The list of names of all turbines
76
+
77
+ Returns
78
+ -------
79
+ names: list of str
80
+ The names of all turbines
81
+
82
+ """
83
+ return [t.name for t in self.turbines]
84
+
85
+ @property
86
+ def xy_array(self):
87
+ """
88
+ Returns an array of the wind farm ground points
89
+
90
+ Returns
91
+ -------
92
+ xya: numpy.ndarray
93
+ The turbine ground positions, shape: (n_turbines, 2)
94
+
95
+ """
96
+ return np.array([t.xy for t in self.turbines], dtype=config.dtype_double)
97
+
98
+ def get_xy_bounds(self, extra_space=None, algo=None):
99
+ """
100
+ Returns min max points of the wind farm ground points
101
+
102
+ Parameters
103
+ ----------
104
+ extra_space: float or str, optional
105
+ The extra space, either float in m,
106
+ or str for units of D, e.g. '2.5D'
107
+ algo: foxes.core.Algorithm, optional
108
+ The algorithm
109
+
110
+ Returns
111
+ -------
112
+ x_mima: numpy.ndarray
113
+ The (x_min, x_max) point
114
+ y_mima: numpy.ndarray
115
+ The (y_min, y_max) point
116
+
117
+ """
118
+ if self.boundary is not None:
119
+ xy = None
120
+ p_min, p_max = self.boundary.p_min(), self.boundary.p_max()
121
+ else:
122
+ xy = self.xy_array
123
+ p_min, p_max = np.min(xy, axis=0), np.max(xy, axis=0)
124
+
125
+ if extra_space is not None:
126
+ if isinstance(extra_space, str):
127
+ assert (
128
+ algo is not None
129
+ ), f"WindFarm: require algo argument for extra_space '{extra_space}'"
130
+ assert (
131
+ len(extra_space) > 1 and extra_space[-1] == "D"
132
+ ), f"Expecting float or str like '2.5D', got extra_space = '{extra_space}'"
133
+ extra_space = float(extra_space[:-1])
134
+ rds = self.get_rotor_diameters(algo)
135
+ if xy is None:
136
+ extra_space *= np.max(rds)
137
+ else:
138
+ p_min = np.min(xy - extra_space * rds[:, None], axis=0)
139
+ p_max = np.max(xy + extra_space * rds[:, None], axis=0)
140
+ return p_min, p_max
141
+
142
+ p_min -= extra_space
143
+ p_max += extra_space
144
+
145
+ return p_min, p_max
146
+
147
+ def get_rotor_diameters(self, algo):
148
+ """
149
+ Gets the rotor diameters
150
+
151
+ Parameters
152
+ ----------
153
+ algo: foxes.core.Algorithm
154
+ The algorithm
155
+
156
+ Returns
157
+ -------
158
+ rds: numpy.ndarray
159
+ The rotor diameters, shape: (n_turbienes,)
160
+
161
+ """
162
+ rds = [
163
+ t.D if t.D is not None else algo.farm_controller.turbine_types[i].D
164
+ for i, t in enumerate(self.turbines)
165
+ ]
166
+ return np.array(rds, dtype=config.dtype_double)
167
+
168
+ def get_hub_heights(self, algo):
169
+ """
170
+ Gets the hub heights
171
+
172
+ Parameters
173
+ ----------
174
+ algo: foxes.core.Algorithm
175
+ The algorithm
176
+
177
+ Returns
178
+ -------
179
+ hhs: numpy.ndarray
180
+ The hub heights, shape: (n_turbienes,)
181
+
182
+ """
183
+ hhs = [
184
+ t.H if t.H is not None else algo.farm_controller.turbine_types[i].H
185
+ for i, t in enumerate(self.turbines)
186
+ ]
187
+ return np.array(hhs, dtype=config.dtype_double)