foxes 1.1.1__tar.gz → 1.2__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 (339) hide show
  1. {foxes-1.1.1 → foxes-1.2}/MANIFEST.in +0 -1
  2. {foxes-1.1.1/foxes.egg-info → foxes-1.2}/PKG-INFO +2 -1
  3. {foxes-1.1.1 → foxes-1.2}/README.md +1 -0
  4. {foxes-1.1.1 → foxes-1.2}/docs/source/conf.py +3 -1
  5. {foxes-1.1.1 → foxes-1.2}/examples/dyn_wakes/run.py +2 -2
  6. {foxes-1.1.1 → foxes-1.2}/examples/timelines/run.py +1 -1
  7. foxes-1.2/foxes/__init__.py +37 -0
  8. {foxes-1.1.1 → foxes-1.2}/foxes/algorithms/downwind/downwind.py +6 -1
  9. {foxes-1.1.1 → foxes-1.2}/foxes/algorithms/downwind/models/init_farm_data.py +5 -2
  10. {foxes-1.1.1 → foxes-1.2}/foxes/algorithms/downwind/models/point_wakes_calc.py +0 -1
  11. {foxes-1.1.1 → foxes-1.2}/foxes/algorithms/iterative/iterative.py +1 -1
  12. {foxes-1.1.1 → foxes-1.2}/foxes/algorithms/sequential/sequential.py +4 -3
  13. foxes-1.2/foxes/config/__init__.py +1 -0
  14. foxes-1.2/foxes/config/config.py +134 -0
  15. {foxes-1.1.1 → foxes-1.2}/foxes/constants.py +15 -6
  16. {foxes-1.1.1 → foxes-1.2}/foxes/core/algorithm.py +22 -10
  17. {foxes-1.1.1 → foxes-1.2}/foxes/core/data.py +2 -1
  18. {foxes-1.1.1 → foxes-1.2}/foxes/core/engine.py +40 -34
  19. {foxes-1.1.1 → foxes-1.2}/foxes/core/farm_controller.py +4 -3
  20. {foxes-1.1.1 → foxes-1.2}/foxes/core/farm_data_model.py +6 -2
  21. {foxes-1.1.1 → foxes-1.2}/foxes/core/model.py +2 -1
  22. {foxes-1.1.1 → foxes-1.2}/foxes/core/point_data_model.py +4 -2
  23. {foxes-1.1.1 → foxes-1.2}/foxes/core/rotor_model.py +8 -4
  24. {foxes-1.1.1 → foxes-1.2}/foxes/core/wake_frame.py +7 -5
  25. {foxes-1.1.1 → foxes-1.2}/foxes/core/wake_model.py +6 -1
  26. {foxes-1.1.1 → foxes-1.2}/foxes/data/__init__.py +1 -1
  27. {foxes-1.1.1 → foxes-1.2}/foxes/data/static_data.py +0 -7
  28. {foxes-1.1.1 → foxes-1.2}/foxes/engines/dask.py +4 -3
  29. {foxes-1.1.1 → foxes-1.2}/foxes/input/__init__.py +1 -1
  30. {foxes-1.1.1 → foxes-1.2}/foxes/input/farm_layout/from_csv.py +3 -1
  31. {foxes-1.1.1 → foxes-1.2}/foxes/input/farm_layout/from_file.py +10 -10
  32. {foxes-1.1.1 → foxes-1.2}/foxes/input/farm_layout/from_json.py +4 -3
  33. {foxes-1.1.1 → foxes-1.2}/foxes/input/farm_layout/grid.py +3 -3
  34. {foxes-1.1.1 → foxes-1.2}/foxes/input/states/create/random_abl_states.py +5 -3
  35. {foxes-1.1.1 → foxes-1.2}/foxes/input/states/field_data_nc.py +22 -14
  36. {foxes-1.1.1 → foxes-1.2}/foxes/input/states/multi_height.py +26 -15
  37. {foxes-1.1.1 → foxes-1.2}/foxes/input/states/one_point_flow.py +6 -5
  38. {foxes-1.1.1 → foxes-1.2}/foxes/input/states/scan_ws.py +4 -1
  39. {foxes-1.1.1 → foxes-1.2}/foxes/input/states/single.py +15 -6
  40. {foxes-1.1.1 → foxes-1.2}/foxes/input/states/slice_data_nc.py +18 -12
  41. {foxes-1.1.1 → foxes-1.2}/foxes/input/states/states_table.py +17 -10
  42. foxes-1.2/foxes/input/yaml/__init__.py +3 -0
  43. foxes-1.2/foxes/input/yaml/dict.py +210 -0
  44. foxes-1.2/foxes/input/yaml/windio/__init__.py +4 -0
  45. {foxes-1.1.1/foxes/input → foxes-1.2/foxes/input/yaml}/windio/get_states.py +7 -7
  46. {foxes-1.1.1/foxes/input → foxes-1.2/foxes/input/yaml}/windio/read_attributes.py +61 -40
  47. {foxes-1.1.1/foxes/input → foxes-1.2/foxes/input/yaml}/windio/read_farm.py +34 -43
  48. {foxes-1.1.1/foxes/input → foxes-1.2/foxes/input/yaml}/windio/read_fields.py +11 -10
  49. foxes-1.2/foxes/input/yaml/windio/read_outputs.py +147 -0
  50. foxes-1.2/foxes/input/yaml/windio/windio.py +269 -0
  51. foxes-1.2/foxes/input/yaml/yaml.py +103 -0
  52. {foxes-1.1.1 → foxes-1.2}/foxes/models/partial_wakes/axiwake.py +7 -6
  53. {foxes-1.1.1 → foxes-1.2}/foxes/models/partial_wakes/centre.py +3 -2
  54. {foxes-1.1.1 → foxes-1.2}/foxes/models/partial_wakes/segregated.py +5 -2
  55. {foxes-1.1.1 → foxes-1.2}/foxes/models/point_models/set_uniform_data.py +5 -3
  56. {foxes-1.1.1 → foxes-1.2}/foxes/models/rotor_models/centre.py +2 -2
  57. {foxes-1.1.1 → foxes-1.2}/foxes/models/rotor_models/grid.py +5 -5
  58. {foxes-1.1.1 → foxes-1.2}/foxes/models/rotor_models/levels.py +6 -6
  59. {foxes-1.1.1 → foxes-1.2}/foxes/models/turbine_models/kTI_model.py +3 -1
  60. {foxes-1.1.1 → foxes-1.2}/foxes/models/turbine_models/lookup_table.py +7 -4
  61. {foxes-1.1.1 → foxes-1.2}/foxes/models/turbine_models/power_mask.py +14 -8
  62. {foxes-1.1.1 → foxes-1.2}/foxes/models/turbine_models/sector_management.py +4 -2
  63. {foxes-1.1.1 → foxes-1.2}/foxes/models/turbine_models/set_farm_vars.py +53 -23
  64. {foxes-1.1.1 → foxes-1.2}/foxes/models/turbine_models/table_factors.py +8 -7
  65. {foxes-1.1.1 → foxes-1.2}/foxes/models/turbine_models/yaw2yawm.py +0 -1
  66. {foxes-1.1.1 → foxes-1.2}/foxes/models/turbine_models/yawm2yaw.py +0 -1
  67. {foxes-1.1.1 → foxes-1.2}/foxes/models/turbine_types/CpCt_file.py +6 -3
  68. {foxes-1.1.1 → foxes-1.2}/foxes/models/turbine_types/CpCt_from_two.py +6 -3
  69. {foxes-1.1.1 → foxes-1.2}/foxes/models/turbine_types/PCt_file.py +7 -6
  70. {foxes-1.1.1 → foxes-1.2}/foxes/models/turbine_types/PCt_from_two.py +11 -2
  71. {foxes-1.1.1 → foxes-1.2}/foxes/models/turbine_types/TBL_file.py +3 -4
  72. {foxes-1.1.1 → foxes-1.2}/foxes/models/turbine_types/wsrho2PCt_from_two.py +19 -11
  73. {foxes-1.1.1 → foxes-1.2}/foxes/models/turbine_types/wsti2PCt_from_two.py +19 -11
  74. {foxes-1.1.1 → foxes-1.2}/foxes/models/wake_frames/dynamic_wakes.py +17 -9
  75. {foxes-1.1.1 → foxes-1.2}/foxes/models/wake_frames/farm_order.py +4 -3
  76. {foxes-1.1.1 → foxes-1.2}/foxes/models/wake_frames/rotor_wd.py +3 -1
  77. {foxes-1.1.1 → foxes-1.2}/foxes/models/wake_frames/seq_dynamic_wakes.py +14 -7
  78. {foxes-1.1.1 → foxes-1.2}/foxes/models/wake_frames/streamlines.py +9 -6
  79. {foxes-1.1.1 → foxes-1.2}/foxes/models/wake_frames/timelines.py +21 -14
  80. {foxes-1.1.1 → foxes-1.2}/foxes/models/wake_frames/yawed_wakes.py +3 -1
  81. {foxes-1.1.1 → foxes-1.2}/foxes/models/wake_models/induction/vortex_sheet.py +0 -1
  82. {foxes-1.1.1 → foxes-1.2}/foxes/models/wake_models/ti/crespo_hernandez.py +2 -1
  83. {foxes-1.1.1 → foxes-1.2}/foxes/models/wake_models/wind/bastankhah14.py +3 -2
  84. {foxes-1.1.1 → foxes-1.2}/foxes/models/wake_models/wind/bastankhah16.py +2 -1
  85. {foxes-1.1.1 → foxes-1.2}/foxes/models/wake_models/wind/turbopark.py +9 -7
  86. {foxes-1.1.1 → foxes-1.2}/foxes/models/wake_superpositions/ws_product.py +0 -1
  87. {foxes-1.1.1 → foxes-1.2}/foxes/output/calc_points.py +7 -4
  88. {foxes-1.1.1 → foxes-1.2}/foxes/output/farm_layout.py +30 -18
  89. {foxes-1.1.1 → foxes-1.2}/foxes/output/farm_results_eval.py +4 -3
  90. {foxes-1.1.1 → foxes-1.2}/foxes/output/grids.py +8 -7
  91. {foxes-1.1.1 → foxes-1.2}/foxes/output/output.py +7 -2
  92. {foxes-1.1.1 → foxes-1.2}/foxes/output/results_writer.py +10 -11
  93. {foxes-1.1.1 → foxes-1.2}/foxes/output/rose_plot.py +38 -20
  94. {foxes-1.1.1 → foxes-1.2}/foxes/output/rotor_point_plots.py +7 -3
  95. {foxes-1.1.1 → foxes-1.2}/foxes/output/state_turbine_map.py +5 -1
  96. {foxes-1.1.1 → foxes-1.2}/foxes/output/state_turbine_table.py +7 -3
  97. {foxes-1.1.1 → foxes-1.2}/foxes/output/turbine_type_curves.py +7 -2
  98. foxes-1.2/foxes/utils/dict.py +164 -0
  99. {foxes-1.1.1 → foxes-1.2}/foxes/utils/geopandas_utils.py +3 -2
  100. {foxes-1.1.1 → foxes-1.2/foxes.egg-info}/PKG-INFO +2 -1
  101. {foxes-1.1.1 → foxes-1.2}/foxes.egg-info/SOURCES.txt +13 -13
  102. foxes-1.2/foxes.egg-info/entry_points.txt +3 -0
  103. {foxes-1.1.1 → foxes-1.2}/pyproject.toml +5 -1
  104. foxes-1.2/tests/0_consistency/iterative/test_iterative.py +90 -0
  105. foxes-1.2/tests/0_consistency/partial_wakes/test_partial_wakes.py +87 -0
  106. foxes-1.2/tests/1_verification/flappy_0_6/PCt_files/test_PCt_files.py +106 -0
  107. {foxes-1.1.1 → foxes-1.2}/tests/1_verification/flappy_0_6/abl_states/test_abl_states.py +41 -41
  108. foxes-1.2/tests/1_verification/flappy_0_6/partial_top_hat/test_partial_top_hat.py +82 -0
  109. foxes-1.2/tests/1_verification/flappy_0_6/row_Jensen_linear_centre/test_row_Jensen_linear_centre.py +93 -0
  110. foxes-1.2/tests/1_verification/flappy_0_6/row_Jensen_linear_tophat/test_row_Jensen_linear_tophat.py +95 -0
  111. foxes-1.2/tests/1_verification/flappy_0_6/row_Jensen_linear_tophat_IECTI2005/test_row_Jensen_linear_tophat_IECTI_2005.py +121 -0
  112. foxes-1.2/tests/1_verification/flappy_0_6/row_Jensen_linear_tophat_IECTI2019/test_row_Jensen_linear_tophat_IECTI_2019.py +121 -0
  113. foxes-1.2/tests/1_verification/flappy_0_6/row_Jensen_quadratic_centre/test_row_Jensen_quadratic_centre.py +95 -0
  114. foxes-1.2/tests/1_verification/flappy_0_6_2/grid_rotors/test_grid_rotors.py +128 -0
  115. foxes-1.2/tests/1_verification/flappy_0_6_2/row_Bastankhah_Crespo/test_row_Bastankhah_Crespo.py +115 -0
  116. foxes-1.2/tests/1_verification/flappy_0_6_2/row_Bastankhah_linear_centre/test_row_Bastankhah_linear_centre.py +98 -0
  117. foxes-1.1.1/examples/windio/run.py +0 -29
  118. foxes-1.1.1/foxes/__init__.py +0 -26
  119. foxes-1.1.1/foxes/data/states/windio_timeseries_5000.nc +0 -0
  120. foxes-1.1.1/foxes/data/windio/DTU_10MW_turbine.yaml +0 -10
  121. foxes-1.1.1/foxes/data/windio/__init__.py +0 -0
  122. foxes-1.1.1/foxes/data/windio/windio_5turbines_timeseries.yaml +0 -79
  123. foxes-1.1.1/foxes/input/windio/__init__.py +0 -11
  124. foxes-1.1.1/foxes/input/windio/read_outputs.py +0 -172
  125. foxes-1.1.1/foxes/input/windio/runner.py +0 -183
  126. foxes-1.1.1/foxes/input/windio/windio.py +0 -193
  127. foxes-1.1.1/foxes/utils/dict.py +0 -60
  128. foxes-1.1.1/tests/0_consistency/iterative/test_iterative.py +0 -92
  129. foxes-1.1.1/tests/0_consistency/partial_wakes/test_partial_wakes.py +0 -90
  130. foxes-1.1.1/tests/1_verification/flappy_0_6/PCt_files/test_PCt_files.py +0 -103
  131. foxes-1.1.1/tests/1_verification/flappy_0_6/partial_top_hat/test_partial_top_hat.py +0 -82
  132. foxes-1.1.1/tests/1_verification/flappy_0_6/row_Jensen_linear_centre/test_row_Jensen_linear_centre.py +0 -93
  133. foxes-1.1.1/tests/1_verification/flappy_0_6/row_Jensen_linear_tophat/test_row_Jensen_linear_tophat.py +0 -96
  134. foxes-1.1.1/tests/1_verification/flappy_0_6/row_Jensen_linear_tophat_IECTI2005/test_row_Jensen_linear_tophat_IECTI_2005.py +0 -122
  135. foxes-1.1.1/tests/1_verification/flappy_0_6/row_Jensen_linear_tophat_IECTI2019/test_row_Jensen_linear_tophat_IECTI_2019.py +0 -122
  136. foxes-1.1.1/tests/1_verification/flappy_0_6/row_Jensen_quadratic_centre/test_row_Jensen_quadratic_centre.py +0 -93
  137. foxes-1.1.1/tests/1_verification/flappy_0_6_2/grid_rotors/test_grid_rotors.py +0 -130
  138. foxes-1.1.1/tests/1_verification/flappy_0_6_2/row_Bastankhah_Crespo/test_row_Bastankhah_Crespo.py +0 -116
  139. foxes-1.1.1/tests/1_verification/flappy_0_6_2/row_Bastankhah_linear_centre/test_row_Bastankhah_linear_centre.py +0 -99
  140. {foxes-1.1.1 → foxes-1.2}/LICENSE +0 -0
  141. {foxes-1.1.1 → foxes-1.2}/Logo_FOXES.svg +0 -0
  142. {foxes-1.1.1 → foxes-1.2}/examples/abl_states/run.py +0 -0
  143. {foxes-1.1.1 → foxes-1.2}/examples/compare_rotors_pwakes/run.py +0 -0
  144. {foxes-1.1.1 → foxes-1.2}/examples/compare_wakes/run.py +0 -0
  145. {foxes-1.1.1 → foxes-1.2}/examples/field_data_nc/run.py +0 -0
  146. {foxes-1.1.1 → foxes-1.2}/examples/induction/run.py +0 -0
  147. {foxes-1.1.1 → foxes-1.2}/examples/multi_height/run.py +0 -0
  148. {foxes-1.1.1 → foxes-1.2}/examples/power_mask/run.py +0 -0
  149. {foxes-1.1.1 → foxes-1.2}/examples/random_timeseries/run.py +0 -0
  150. {foxes-1.1.1 → foxes-1.2}/examples/scan_row/run.py +0 -0
  151. {foxes-1.1.1 → foxes-1.2}/examples/sector_management/run.py +0 -0
  152. {foxes-1.1.1 → foxes-1.2}/examples/sequential/run.py +0 -0
  153. {foxes-1.1.1 → foxes-1.2}/examples/single_state/run.py +0 -0
  154. {foxes-1.1.1 → foxes-1.2}/examples/states_lookup_table/run.py +0 -0
  155. {foxes-1.1.1 → foxes-1.2}/examples/streamline_wakes/run.py +0 -0
  156. {foxes-1.1.1 → foxes-1.2}/examples/tab_file/run.py +0 -0
  157. {foxes-1.1.1 → foxes-1.2}/examples/timeseries/run.py +0 -0
  158. {foxes-1.1.1 → foxes-1.2}/examples/timeseries_slurm/run.py +0 -0
  159. {foxes-1.1.1 → foxes-1.2}/examples/wind_rose/run.py +0 -0
  160. {foxes-1.1.1 → foxes-1.2}/examples/yawed_wake/run.py +0 -0
  161. {foxes-1.1.1 → foxes-1.2}/foxes/algorithms/__init__.py +0 -0
  162. {foxes-1.1.1 → foxes-1.2}/foxes/algorithms/downwind/__init__.py +0 -0
  163. {foxes-1.1.1 → foxes-1.2}/foxes/algorithms/downwind/models/__init__.py +0 -0
  164. {foxes-1.1.1 → foxes-1.2}/foxes/algorithms/downwind/models/farm_wakes_calc.py +0 -0
  165. {foxes-1.1.1 → foxes-1.2}/foxes/algorithms/downwind/models/reorder_farm_output.py +0 -0
  166. {foxes-1.1.1 → foxes-1.2}/foxes/algorithms/downwind/models/set_amb_farm_results.py +0 -0
  167. {foxes-1.1.1 → foxes-1.2}/foxes/algorithms/downwind/models/set_amb_point_results.py +0 -0
  168. {foxes-1.1.1 → foxes-1.2}/foxes/algorithms/iterative/__init__.py +0 -0
  169. {foxes-1.1.1 → foxes-1.2}/foxes/algorithms/iterative/models/__init__.py +0 -0
  170. {foxes-1.1.1 → foxes-1.2}/foxes/algorithms/iterative/models/convergence.py +0 -0
  171. {foxes-1.1.1 → foxes-1.2}/foxes/algorithms/iterative/models/farm_wakes_calc.py +0 -0
  172. {foxes-1.1.1 → foxes-1.2}/foxes/algorithms/iterative/models/urelax.py +0 -0
  173. {foxes-1.1.1 → foxes-1.2}/foxes/algorithms/sequential/__init__.py +0 -0
  174. {foxes-1.1.1 → foxes-1.2}/foxes/algorithms/sequential/models/__init__.py +0 -0
  175. {foxes-1.1.1 → foxes-1.2}/foxes/algorithms/sequential/models/plugin.py +0 -0
  176. {foxes-1.1.1 → foxes-1.2}/foxes/algorithms/sequential/models/seq_state.py +0 -0
  177. {foxes-1.1.1 → foxes-1.2}/foxes/core/__init__.py +0 -0
  178. {foxes-1.1.1 → foxes-1.2}/foxes/core/axial_induction_model.py +0 -0
  179. {foxes-1.1.1 → foxes-1.2}/foxes/core/data_calc_model.py +0 -0
  180. {foxes-1.1.1 → foxes-1.2}/foxes/core/farm_model.py +0 -0
  181. {foxes-1.1.1 → foxes-1.2}/foxes/core/ground_model.py +0 -0
  182. {foxes-1.1.1 → foxes-1.2}/foxes/core/partial_wakes_model.py +0 -0
  183. {foxes-1.1.1 → foxes-1.2}/foxes/core/states.py +0 -0
  184. {foxes-1.1.1 → foxes-1.2}/foxes/core/turbine.py +0 -0
  185. {foxes-1.1.1 → foxes-1.2}/foxes/core/turbine_model.py +0 -0
  186. {foxes-1.1.1 → foxes-1.2}/foxes/core/turbine_type.py +1 -1
  187. {foxes-1.1.1 → foxes-1.2}/foxes/core/vertical_profile.py +0 -0
  188. {foxes-1.1.1 → foxes-1.2}/foxes/core/wake_superposition.py +0 -0
  189. {foxes-1.1.1 → foxes-1.2}/foxes/core/wind_farm.py +0 -0
  190. {foxes-1.1.1 → foxes-1.2}/foxes/data/farms/__init__.py +0 -0
  191. {foxes-1.1.1 → foxes-1.2}/foxes/data/farms/test_farm_67.csv +0 -0
  192. {foxes-1.1.1 → foxes-1.2}/foxes/data/parse.py +0 -0
  193. {foxes-1.1.1 → foxes-1.2}/foxes/data/power_ct_curves/DTU-10MW-D178d3-H119.csv +0 -0
  194. {foxes-1.1.1 → foxes-1.2}/foxes/data/power_ct_curves/IEA-15MW-D240-H150.csv +0 -0
  195. {foxes-1.1.1 → foxes-1.2}/foxes/data/power_ct_curves/IWT-7d5MW-D164-H100.csv +0 -0
  196. {foxes-1.1.1 → foxes-1.2}/foxes/data/power_ct_curves/NREL-5MW-D126-H90.csv +0 -0
  197. {foxes-1.1.1 → foxes-1.2}/foxes/data/power_ct_curves/__init__.py +0 -0
  198. {foxes-1.1.1 → foxes-1.2}/foxes/data/states/WRF-Timeseries-3000.nc +0 -0
  199. {foxes-1.1.1 → foxes-1.2}/foxes/data/states/WRF-Timeseries-4464.csv.gz +0 -0
  200. {foxes-1.1.1 → foxes-1.2}/foxes/data/states/__init__.py +0 -0
  201. {foxes-1.1.1 → foxes-1.2}/foxes/data/states/abl_states_6000.csv.gz +0 -0
  202. {foxes-1.1.1 → foxes-1.2}/foxes/data/states/timeseries_100.csv.gz +0 -0
  203. {foxes-1.1.1 → foxes-1.2}/foxes/data/states/timeseries_3000.csv.gz +0 -0
  204. {foxes-1.1.1 → foxes-1.2}/foxes/data/states/timeseries_8000.csv.gz +0 -0
  205. {foxes-1.1.1 → foxes-1.2}/foxes/data/states/wind_rose_bremen.csv +0 -0
  206. {foxes-1.1.1 → foxes-1.2}/foxes/data/states/wind_rotation.nc +0 -0
  207. {foxes-1.1.1 → foxes-1.2}/foxes/data/states/winds100.tab +0 -0
  208. {foxes-1.1.1 → foxes-1.2}/foxes/engines/__init__.py +0 -0
  209. {foxes-1.1.1 → foxes-1.2}/foxes/engines/default.py +0 -0
  210. {foxes-1.1.1 → foxes-1.2}/foxes/engines/futures.py +0 -0
  211. {foxes-1.1.1 → foxes-1.2}/foxes/engines/mpi.py +0 -0
  212. {foxes-1.1.1 → foxes-1.2}/foxes/engines/multiprocess.py +0 -0
  213. {foxes-1.1.1 → foxes-1.2}/foxes/engines/numpy.py +0 -0
  214. {foxes-1.1.1 → foxes-1.2}/foxes/engines/pool.py +0 -0
  215. {foxes-1.1.1 → foxes-1.2}/foxes/engines/ray.py +0 -0
  216. {foxes-1.1.1 → foxes-1.2}/foxes/engines/single.py +1 -1
  217. {foxes-1.1.1 → foxes-1.2}/foxes/input/farm_layout/__init__.py +0 -0
  218. {foxes-1.1.1 → foxes-1.2}/foxes/input/farm_layout/from_df.py +0 -0
  219. {foxes-1.1.1 → foxes-1.2}/foxes/input/farm_layout/from_random.py +0 -0
  220. {foxes-1.1.1 → foxes-1.2}/foxes/input/farm_layout/ring.py +0 -0
  221. {foxes-1.1.1 → foxes-1.2}/foxes/input/farm_layout/row.py +0 -0
  222. {foxes-1.1.1 → foxes-1.2}/foxes/input/states/__init__.py +0 -0
  223. {foxes-1.1.1 → foxes-1.2}/foxes/input/states/create/__init__.py +0 -0
  224. {foxes-1.1.1 → foxes-1.2}/foxes/input/states/create/random_timeseries.py +0 -0
  225. {foxes-1.1.1 → foxes-1.2}/foxes/models/__init__.py +0 -0
  226. {foxes-1.1.1 → foxes-1.2}/foxes/models/axial_induction/__init__.py +0 -0
  227. {foxes-1.1.1 → foxes-1.2}/foxes/models/axial_induction/betz.py +0 -0
  228. {foxes-1.1.1 → foxes-1.2}/foxes/models/axial_induction/madsen.py +0 -0
  229. {foxes-1.1.1 → foxes-1.2}/foxes/models/farm_controllers/__init__.py +0 -0
  230. {foxes-1.1.1 → foxes-1.2}/foxes/models/farm_controllers/basic.py +0 -0
  231. {foxes-1.1.1 → foxes-1.2}/foxes/models/farm_models/__init__.py +0 -0
  232. {foxes-1.1.1 → foxes-1.2}/foxes/models/farm_models/turbine2farm.py +0 -0
  233. {foxes-1.1.1 → foxes-1.2}/foxes/models/ground_models/__init__.py +0 -0
  234. {foxes-1.1.1 → foxes-1.2}/foxes/models/ground_models/no_ground.py +0 -0
  235. {foxes-1.1.1 → foxes-1.2}/foxes/models/ground_models/wake_mirror.py +0 -0
  236. {foxes-1.1.1 → foxes-1.2}/foxes/models/model_book.py +0 -0
  237. {foxes-1.1.1 → foxes-1.2}/foxes/models/partial_wakes/__init__.py +0 -0
  238. {foxes-1.1.1 → foxes-1.2}/foxes/models/partial_wakes/grid.py +0 -0
  239. {foxes-1.1.1 → foxes-1.2}/foxes/models/partial_wakes/rotor_points.py +0 -0
  240. {foxes-1.1.1 → foxes-1.2}/foxes/models/partial_wakes/top_hat.py +0 -0
  241. {foxes-1.1.1 → foxes-1.2}/foxes/models/point_models/__init__.py +0 -0
  242. {foxes-1.1.1 → foxes-1.2}/foxes/models/point_models/tke2ti.py +0 -0
  243. {foxes-1.1.1 → foxes-1.2}/foxes/models/point_models/wake_deltas.py +0 -0
  244. {foxes-1.1.1 → foxes-1.2}/foxes/models/rotor_models/__init__.py +0 -0
  245. {foxes-1.1.1 → foxes-1.2}/foxes/models/turbine_models/__init__.py +0 -0
  246. {foxes-1.1.1 → foxes-1.2}/foxes/models/turbine_models/calculator.py +0 -0
  247. {foxes-1.1.1 → foxes-1.2}/foxes/models/turbine_models/rotor_centre_calc.py +0 -0
  248. {foxes-1.1.1 → foxes-1.2}/foxes/models/turbine_models/thrust2ct.py +0 -0
  249. {foxes-1.1.1 → foxes-1.2}/foxes/models/turbine_types/__init__.py +0 -0
  250. {foxes-1.1.1 → foxes-1.2}/foxes/models/turbine_types/lookup.py +0 -0
  251. {foxes-1.1.1 → foxes-1.2}/foxes/models/turbine_types/null_type.py +0 -0
  252. {foxes-1.1.1 → foxes-1.2}/foxes/models/vertical_profiles/__init__.py +0 -0
  253. {foxes-1.1.1 → foxes-1.2}/foxes/models/vertical_profiles/abl_log_neutral_ws.py +1 -1
  254. {foxes-1.1.1 → foxes-1.2}/foxes/models/vertical_profiles/abl_log_stable_ws.py +1 -1
  255. {foxes-1.1.1 → foxes-1.2}/foxes/models/vertical_profiles/abl_log_unstable_ws.py +1 -1
  256. {foxes-1.1.1 → foxes-1.2}/foxes/models/vertical_profiles/abl_log_ws.py +1 -1
  257. {foxes-1.1.1 → foxes-1.2}/foxes/models/vertical_profiles/data_profile.py +0 -0
  258. {foxes-1.1.1 → foxes-1.2}/foxes/models/vertical_profiles/sheared_ws.py +0 -0
  259. {foxes-1.1.1 → foxes-1.2}/foxes/models/vertical_profiles/uniform.py +0 -0
  260. {foxes-1.1.1 → foxes-1.2}/foxes/models/wake_frames/__init__.py +0 -0
  261. {foxes-1.1.1 → foxes-1.2}/foxes/models/wake_models/__init__.py +0 -0
  262. {foxes-1.1.1 → foxes-1.2}/foxes/models/wake_models/axisymmetric.py +0 -0
  263. {foxes-1.1.1 → foxes-1.2}/foxes/models/wake_models/dist_sliced.py +0 -0
  264. {foxes-1.1.1 → foxes-1.2}/foxes/models/wake_models/gaussian.py +0 -0
  265. {foxes-1.1.1 → foxes-1.2}/foxes/models/wake_models/induction/__init__.py +0 -0
  266. {foxes-1.1.1 → foxes-1.2}/foxes/models/wake_models/induction/rankine_half_body.py +0 -0
  267. {foxes-1.1.1 → foxes-1.2}/foxes/models/wake_models/induction/rathmann.py +0 -0
  268. {foxes-1.1.1 → foxes-1.2}/foxes/models/wake_models/induction/self_similar.py +0 -0
  269. {foxes-1.1.1 → foxes-1.2}/foxes/models/wake_models/induction/self_similar2020.py +0 -0
  270. {foxes-1.1.1 → foxes-1.2}/foxes/models/wake_models/ti/__init__.py +0 -0
  271. {foxes-1.1.1 → foxes-1.2}/foxes/models/wake_models/ti/iec_ti.py +0 -0
  272. {foxes-1.1.1 → foxes-1.2}/foxes/models/wake_models/top_hat.py +0 -0
  273. {foxes-1.1.1 → foxes-1.2}/foxes/models/wake_models/wind/__init__.py +0 -0
  274. {foxes-1.1.1 → foxes-1.2}/foxes/models/wake_models/wind/jensen.py +0 -0
  275. {foxes-1.1.1 → foxes-1.2}/foxes/models/wake_superpositions/__init__.py +0 -0
  276. {foxes-1.1.1 → foxes-1.2}/foxes/models/wake_superpositions/ti_linear.py +0 -0
  277. {foxes-1.1.1 → foxes-1.2}/foxes/models/wake_superpositions/ti_max.py +0 -0
  278. {foxes-1.1.1 → foxes-1.2}/foxes/models/wake_superpositions/ti_pow.py +0 -0
  279. {foxes-1.1.1 → foxes-1.2}/foxes/models/wake_superpositions/ti_quadratic.py +0 -0
  280. {foxes-1.1.1 → foxes-1.2}/foxes/models/wake_superpositions/ws_linear.py +0 -0
  281. {foxes-1.1.1 → foxes-1.2}/foxes/models/wake_superpositions/ws_max.py +0 -0
  282. {foxes-1.1.1 → foxes-1.2}/foxes/models/wake_superpositions/ws_pow.py +0 -0
  283. {foxes-1.1.1 → foxes-1.2}/foxes/models/wake_superpositions/ws_quadratic.py +0 -0
  284. {foxes-1.1.1 → foxes-1.2}/foxes/output/__init__.py +0 -0
  285. {foxes-1.1.1 → foxes-1.2}/foxes/output/animation.py +0 -0
  286. {foxes-1.1.1 → foxes-1.2}/foxes/output/flow_plots_2d/__init__.py +0 -0
  287. {foxes-1.1.1 → foxes-1.2}/foxes/output/flow_plots_2d/flow_plots.py +0 -0
  288. {foxes-1.1.1 → foxes-1.2}/foxes/output/flow_plots_2d/get_fig.py +0 -0
  289. {foxes-1.1.1 → foxes-1.2}/foxes/output/round.py +0 -0
  290. {foxes-1.1.1 → foxes-1.2}/foxes/output/seq_plugins/__init__.py +0 -0
  291. {foxes-1.1.1 → foxes-1.2}/foxes/output/seq_plugins/seq_flow_ani_plugin.py +0 -0
  292. {foxes-1.1.1 → foxes-1.2}/foxes/output/seq_plugins/seq_wake_debug_plugin.py +0 -0
  293. {foxes-1.1.1 → foxes-1.2}/foxes/output/slice_data.py +1 -1
  294. {foxes-1.1.1 → foxes-1.2}/foxes/utils/__init__.py +0 -0
  295. {foxes-1.1.1 → foxes-1.2}/foxes/utils/abl/__init__.py +0 -0
  296. {foxes-1.1.1 → foxes-1.2}/foxes/utils/abl/neutral.py +0 -0
  297. {foxes-1.1.1 → foxes-1.2}/foxes/utils/abl/sheared.py +0 -0
  298. {foxes-1.1.1 → foxes-1.2}/foxes/utils/abl/stable.py +0 -0
  299. {foxes-1.1.1 → foxes-1.2}/foxes/utils/abl/unstable.py +0 -0
  300. {foxes-1.1.1 → foxes-1.2}/foxes/utils/cubic_roots.py +0 -0
  301. {foxes-1.1.1 → foxes-1.2}/foxes/utils/data_book.py +0 -0
  302. {foxes-1.1.1 → foxes-1.2}/foxes/utils/dev_utils.py +0 -0
  303. {foxes-1.1.1 → foxes-1.2}/foxes/utils/exec_python.py +0 -0
  304. {foxes-1.1.1 → foxes-1.2}/foxes/utils/factory.py +0 -0
  305. {foxes-1.1.1 → foxes-1.2}/foxes/utils/geom2d/__init__.py +0 -0
  306. {foxes-1.1.1 → foxes-1.2}/foxes/utils/geom2d/area_geometry.py +0 -0
  307. {foxes-1.1.1 → foxes-1.2}/foxes/utils/geom2d/circle.py +0 -0
  308. {foxes-1.1.1 → foxes-1.2}/foxes/utils/geom2d/example_intersection.py +0 -0
  309. {foxes-1.1.1 → foxes-1.2}/foxes/utils/geom2d/example_union.py +0 -0
  310. {foxes-1.1.1 → foxes-1.2}/foxes/utils/geom2d/half_plane.py +0 -0
  311. {foxes-1.1.1 → foxes-1.2}/foxes/utils/geom2d/polygon.py +0 -0
  312. {foxes-1.1.1 → foxes-1.2}/foxes/utils/load.py +0 -0
  313. {foxes-1.1.1 → foxes-1.2}/foxes/utils/pandas_helpers.py +0 -0
  314. {foxes-1.1.1 → foxes-1.2}/foxes/utils/pandas_utils.py +0 -0
  315. {foxes-1.1.1 → foxes-1.2}/foxes/utils/random_xy.py +0 -0
  316. {foxes-1.1.1 → foxes-1.2}/foxes/utils/regularize.py +0 -0
  317. {foxes-1.1.1 → foxes-1.2}/foxes/utils/subclasses.py +0 -0
  318. {foxes-1.1.1 → foxes-1.2}/foxes/utils/tab_files.py +0 -0
  319. {foxes-1.1.1 → foxes-1.2}/foxes/utils/two_circles.py +0 -0
  320. {foxes-1.1.1 → foxes-1.2}/foxes/utils/wind_dir.py +0 -0
  321. {foxes-1.1.1 → foxes-1.2}/foxes/utils/windrose_plot.py +0 -0
  322. {foxes-1.1.1 → foxes-1.2}/foxes/utils/xarray_utils.py +0 -0
  323. {foxes-1.1.1 → foxes-1.2}/foxes/variables.py +0 -0
  324. {foxes-1.1.1 → foxes-1.2}/foxes.egg-info/dependency_links.txt +0 -0
  325. {foxes-1.1.1 → foxes-1.2}/foxes.egg-info/requires.txt +0 -0
  326. {foxes-1.1.1 → foxes-1.2}/foxes.egg-info/top_level.txt +0 -0
  327. {foxes-1.1.1 → foxes-1.2}/setup.cfg +0 -0
  328. {foxes-1.1.1 → foxes-1.2}/tests/1_verification/flappy_0_6/PCt_files/flappy/run.py +0 -0
  329. {foxes-1.1.1 → foxes-1.2}/tests/1_verification/flappy_0_6/abl_states/flappy/run.py +0 -0
  330. {foxes-1.1.1 → foxes-1.2}/tests/1_verification/flappy_0_6/partial_top_hat/flappy/run.py +0 -0
  331. {foxes-1.1.1 → foxes-1.2}/tests/1_verification/flappy_0_6/row_Jensen_linear_centre/flappy/run.py +0 -0
  332. {foxes-1.1.1 → foxes-1.2}/tests/1_verification/flappy_0_6/row_Jensen_linear_tophat/flappy/run.py +0 -0
  333. {foxes-1.1.1 → foxes-1.2}/tests/1_verification/flappy_0_6/row_Jensen_linear_tophat_IECTI2005/flappy/run.py +0 -0
  334. {foxes-1.1.1 → foxes-1.2}/tests/1_verification/flappy_0_6/row_Jensen_linear_tophat_IECTI2019/flappy/run.py +0 -0
  335. {foxes-1.1.1 → foxes-1.2}/tests/1_verification/flappy_0_6/row_Jensen_quadratic_centre/flappy/run.py +0 -0
  336. {foxes-1.1.1 → foxes-1.2}/tests/1_verification/flappy_0_6_2/grid_rotors/flappy/run.py +0 -0
  337. {foxes-1.1.1 → foxes-1.2}/tests/1_verification/flappy_0_6_2/row_Bastankhah_Crespo/flappy/run.py +0 -0
  338. {foxes-1.1.1 → foxes-1.2}/tests/1_verification/flappy_0_6_2/row_Bastankhah_linear_centre/flappy/run.py +0 -0
  339. {foxes-1.1.1 → foxes-1.2}/tests/3_examples/test_examples.py +0 -0
@@ -5,4 +5,3 @@ include foxes/data/states/*.csv.gz
5
5
  include foxes/data/states/*.nc
6
6
  include foxes/data/states/*.tab
7
7
  include foxes/data/farms/*.csv
8
- include foxes/data/windio/*.yaml
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: foxes
3
- Version: 1.1.1
3
+ Version: 1.2
4
4
  Summary: Farm Optimization and eXtended yield Evaluation Software
5
5
  Author: Jonas Schulte
6
6
  Maintainer: Jonas Schulte
@@ -163,6 +163,7 @@ The supported Python versions are:
163
163
  - `Python 3.10`
164
164
  - `Python 3.11`
165
165
  - `Python 3.12`
166
+ - `Python 3.13`
166
167
 
167
168
  ## Installation
168
169
 
@@ -63,6 +63,7 @@ The supported Python versions are:
63
63
  - `Python 3.10`
64
64
  - `Python 3.11`
65
65
  - `Python 3.12`
66
+ - `Python 3.13`
66
67
 
67
68
  ## Installation
68
69
 
@@ -314,13 +314,15 @@ python_apigen_modules = {
314
314
  "foxes.algorithms.iterative.models": "_foxes/algorithms/iterative/models/",
315
315
  "foxes.algorithms.sequential": "_foxes/algorithms/sequential/",
316
316
  "foxes.algorithms.sequential.models": "_foxes/algorithms/sequential/models/",
317
+ "foxes.config": "_foxes/config/",
317
318
  "foxes.core": "_foxes/core/",
318
319
  "foxes.data": "_foxes/data/",
319
320
  "foxes.engines": "_foxes/engines/",
320
321
  "foxes.input.farm_layout": "_foxes/input/farm_layout/",
321
322
  "foxes.input.states": "_foxes/input/states/",
322
323
  "foxes.input.states.create": "_foxes/input/states/create/",
323
- "foxes.input.windio": "_foxes/input/windio/",
324
+ "foxes.input.yaml": "_foxes/input/yaml/",
325
+ "foxes.input.yaml.windio": "_foxes/input/yaml/windio/",
324
326
  "foxes.output": "_foxes/output/",
325
327
  "foxes.output.flow_plots_2d": "_foxes/output/flow_plots_2d/",
326
328
  "foxes.output.seq_plugins": "_foxes/output/seq_plugins/",
@@ -99,14 +99,14 @@ if __name__ == "__main__":
99
99
  "-c",
100
100
  "--chunksize_states",
101
101
  help="The chunk size for states",
102
- default=None,
102
+ default=20,
103
103
  type=int,
104
104
  )
105
105
  parser.add_argument(
106
106
  "-C",
107
107
  "--chunksize_points",
108
108
  help="The chunk size for points",
109
- default=5000,
109
+ default=None,
110
110
  type=int,
111
111
  )
112
112
  parser.add_argument(
@@ -92,7 +92,7 @@ if __name__ == "__main__":
92
92
  "-c",
93
93
  "--chunksize_states",
94
94
  help="The chunk size for states",
95
- default=None,
95
+ default=20,
96
96
  type=int,
97
97
  )
98
98
  parser.add_argument(
@@ -0,0 +1,37 @@
1
+ """
2
+ Farm Optimization and eXtended yield Evaluation Software
3
+
4
+ """
5
+
6
+ from .config import config, get_path # noqa: F401
7
+ from .core import Engine, WindFarm, Turbine, get_engine, reset_engine # noqa: F401
8
+ from .models import ModelBook # noqa: F401
9
+ from .data import (
10
+ parse_Pct_file_name,
11
+ parse_Pct_two_files,
12
+ FARM,
13
+ STATES,
14
+ PCTCURVE,
15
+ StaticData,
16
+ ) # noqa: F401
17
+
18
+ from . import algorithms # noqa: F401
19
+ from . import engines # noqa: F401
20
+ from . import models # noqa: F401
21
+ from . import input # noqa: F401
22
+ from . import output # noqa: F401
23
+ from . import utils # noqa: F401
24
+
25
+ import importlib
26
+ from pathlib import Path
27
+
28
+ try:
29
+ tomllib = importlib.import_module("tomllib")
30
+ source_location = Path(__file__).parent
31
+ if (source_location.parent / "pyproject.toml").exists():
32
+ with open(source_location.parent / "pyproject.toml", "rb") as f:
33
+ __version__ = tomllib.load(f)["project"]["version"]
34
+ else:
35
+ __version__ = importlib.metadata.version(__package__ or __name__)
36
+ except ModuleNotFoundError:
37
+ __version__ = importlib.metadata.version(__package__ or __name__)
@@ -1,8 +1,12 @@
1
+ import numpy as np
2
+
1
3
  from foxes.core import Algorithm, FarmDataModelList, get_engine
2
4
  from foxes.core import PointDataModel, PointDataModelList, FarmController
5
+ from foxes.config import config
3
6
  import foxes.models as fm
4
7
  import foxes.variables as FV
5
8
  import foxes.constants as FC
9
+
6
10
  from . import models as mdls
7
11
 
8
12
 
@@ -570,7 +574,7 @@ class Downwind(Algorithm):
570
574
  farm_results[FC.TNAME] = ((FC.TURBINE,), self.farm.turbine_names)
571
575
  for v in [FV.ORDER, FV.ORDER_SSEL, FV.ORDER_INV]:
572
576
  if v in farm_results:
573
- farm_results[v] = farm_results[v].astype(FC.ITYPE)
577
+ farm_results[v] = farm_results[v].astype(config.dtype_int)
574
578
  del model_data
575
579
 
576
580
  # finalize models:
@@ -742,6 +746,7 @@ class Downwind(Algorithm):
742
746
  )
743
747
 
744
748
  # welcome:
749
+ points = np.asarray(points)
745
750
  self._print_deco("calc_points", n_points=points.shape[1])
746
751
 
747
752
  # collect models and initialize:
@@ -3,6 +3,7 @@ import numpy as np
3
3
  from foxes.core import FarmDataModel, TData
4
4
  import foxes.variables as FV
5
5
  import foxes.constants as FC
6
+ from foxes.config import config
6
7
 
7
8
 
8
9
  class InitFarmData(FarmDataModel):
@@ -75,14 +76,16 @@ class InitFarmData(FarmDataModel):
75
76
  n_turbines = algo.n_turbines
76
77
 
77
78
  # define FV.TXYH as vector [X, Y, H]:
78
- fdata[FV.TXYH] = np.full((n_states, n_turbines, 3), np.nan, dtype=FC.DTYPE)
79
+ fdata[FV.TXYH] = np.full(
80
+ (n_states, n_turbines, 3), np.nan, dtype=config.dtype_double
81
+ )
79
82
  fdata.dims[FV.TXYH] = (FC.STATE, FC.TURBINE, FC.XYH)
80
83
  for i, v in enumerate([FV.X, FV.Y, FV.H]):
81
84
  fdata[v] = fdata[FV.TXYH][..., i]
82
85
  fdata.dims[v] = (FC.STATE, FC.TURBINE)
83
86
 
84
87
  # set X, Y, H, D:
85
- fdata[FV.D] = np.zeros((n_states, n_turbines), dtype=FC.DTYPE)
88
+ fdata[FV.D] = np.zeros((n_states, n_turbines), dtype=config.dtype_double)
86
89
  for ti, t in enumerate(algo.farm.turbines):
87
90
 
88
91
  if len(t.xy.shape) == 1:
@@ -1,5 +1,4 @@
1
1
  from foxes.core import PointDataModel
2
- import foxes.variables as FV
3
2
 
4
3
 
5
4
  class PointWakesCalculation(PointDataModel):
@@ -2,7 +2,7 @@ from foxes.algorithms.downwind.downwind import Downwind
2
2
 
3
3
  from foxes.core import FarmDataModelList
4
4
  from foxes.utils import Dict
5
- import foxes.variables as FV
5
+
6
6
  from . import models as mdls
7
7
 
8
8
 
@@ -2,9 +2,10 @@ import numpy as np
2
2
  from xarray import Dataset
3
3
 
4
4
  from foxes.algorithms import Iterative
5
- import foxes.constants as FC
6
- import foxes.variables as FV
5
+ from foxes.config import config
7
6
  from foxes.core import get_engine
7
+ import foxes.variables as FV
8
+ import foxes.constants as FC
8
9
 
9
10
  from . import models as mdls
10
11
 
@@ -170,7 +171,7 @@ class Sequential(Iterative):
170
171
  self._farm_results[FC.TNAME] = ((FC.TURBINE,), self.farm.turbine_names)
171
172
  if FV.ORDER in self._farm_results:
172
173
  self._farm_results[FV.ORDER] = self._farm_results[FV.ORDER].astype(
173
- FC.ITYPE
174
+ config.dtype_int
174
175
  )
175
176
  self._farm_results_dwnd = self._farm_results.copy(deep=True)
176
177
 
@@ -0,0 +1 @@
1
+ from .config import Config, config, get_path, get_output_path
@@ -0,0 +1,134 @@
1
+ import numpy as np
2
+ from pathlib import Path
3
+
4
+ from foxes.utils.dict import Dict
5
+ import foxes.constants as FC
6
+
7
+
8
+ class Config(Dict):
9
+ """
10
+ Container for configurational data
11
+
12
+ :group: foxes.config
13
+ """
14
+
15
+ def __init__(self):
16
+ """Constructor"""
17
+ super().__init__(
18
+ {
19
+ FC.DTYPE: np.float64,
20
+ FC.ITYPE: np.int64,
21
+ FC.WORK_DIR: Path("."),
22
+ FC.OUT_DIR: Path("."),
23
+ },
24
+ name="config",
25
+ )
26
+
27
+ @property
28
+ def dtype_double(self):
29
+ """
30
+ The default double data type
31
+
32
+ Returns
33
+ -------
34
+ dtp: type
35
+ The default double data type
36
+
37
+ """
38
+ return self.get_item(FC.DTYPE)
39
+
40
+ @property
41
+ def dtype_int(self):
42
+ """
43
+ The default int data type
44
+
45
+ Returns
46
+ -------
47
+ dtp: type
48
+ The default integer data type
49
+
50
+ """
51
+ return self.get_item(FC.ITYPE)
52
+
53
+ @property
54
+ def work_dir(self):
55
+ """
56
+ The foxes working directory
57
+
58
+ Returns
59
+ -------
60
+ pth: pathlib.Path
61
+ Path to the foxes working directory
62
+
63
+ """
64
+ pth = self.get_item(FC.WORK_DIR)
65
+ if not isinstance(pth, Path):
66
+ self[FC.WORK_DIR] = Path(pth)
67
+ return self[FC.WORK_DIR]
68
+
69
+ @property
70
+ def out_dir(self):
71
+ """
72
+ The default output directory
73
+
74
+ Returns
75
+ -------
76
+ pth: pathlib.Path
77
+ Path to the default output directory
78
+
79
+ """
80
+ return get_path(self.get_item(FC.OUT_DIR))
81
+
82
+
83
+ config = Config()
84
+ """Foxes configurational data object
85
+ :group: foxes.config
86
+ """
87
+
88
+
89
+ def get_path(pth):
90
+ """
91
+ Gets path object, respecting the configurations
92
+ work directory
93
+
94
+ Parameters
95
+ ----------
96
+ pth: str or pathlib.Path
97
+ The path, optionally relative
98
+
99
+ Returns
100
+ -------
101
+ out: pathlib.Path
102
+ The path, absolute or relative to working directory
103
+ from config
104
+
105
+ :group: foxes.config
106
+
107
+ """
108
+ if not isinstance(pth, Path):
109
+ pth = Path(pth)
110
+ return pth if pth.is_absolute() else config.work_dir / pth
111
+
112
+
113
+ def get_output_path(pth):
114
+ """
115
+ Gets path object, respecting the configurations
116
+ output directory
117
+
118
+ Parameters
119
+ ----------
120
+ pth: str or pathlib.Path
121
+ The path, optionally relative
122
+
123
+ Returns
124
+ -------
125
+ out: pathlib.Path
126
+ The path, absolute or relative to output directory
127
+ from config
128
+
129
+ :group: foxes.config
130
+
131
+ """
132
+ if not isinstance(pth, Path):
133
+ pth = Path(pth)
134
+ return pth if pth.is_absolute() else config.out_dir / pth
@@ -1,5 +1,3 @@
1
- import numpy as np
2
-
3
1
  XYH = "xyh"
4
2
  """ The vector (x, y, height)
5
3
  :group: foxes.variables
@@ -126,13 +124,13 @@ STATE_SOURCE_ORDERI = "state-source-orderi"
126
124
  :group: foxes.constants
127
125
  """
128
126
 
129
- DTYPE = np.float64
130
- """ Default data type for floats
127
+ DTYPE = "DTYPE"
128
+ """Identifier for default double data type
131
129
  :group: foxes.constants
132
130
  """
133
131
 
134
- ITYPE = np.int64
135
- """ Default data type for int
132
+ ITYPE = "ITYPE"
133
+ """Identifier for default integer data type
136
134
  :group: foxes.constants
137
135
  """
138
136
 
@@ -184,3 +182,14 @@ POP = "pop"
184
182
  """ Population identifier
185
183
  :group: foxes.constants
186
184
  """
185
+
186
+
187
+ WORK_DIR = "work_dir"
188
+ """Identifier for the working directory
189
+ :group: foxes.constants
190
+ """
191
+
192
+ OUT_DIR = "out_dir"
193
+ """Identifier for the default output directory
194
+ :group: foxes.constants
195
+ """
@@ -5,6 +5,7 @@ from abc import abstractmethod
5
5
  from .model import Model
6
6
  from foxes.data import StaticData
7
7
  from foxes.utils import Dict, all_subclasses
8
+ from foxes.config import config
8
9
  import foxes.constants as FC
9
10
 
10
11
  from .engine import Engine
@@ -33,7 +34,6 @@ class Algorithm(Model):
33
34
  farm,
34
35
  verbosity=1,
35
36
  dbook=None,
36
- engine=None,
37
37
  **engine_pars,
38
38
  ):
39
39
  """
@@ -49,8 +49,6 @@ class Algorithm(Model):
49
49
  The verbosity level, 0 means silent
50
50
  dbook: foxes.DataBook, optional
51
51
  The data book, or None for default
52
- engine: str
53
- The engine class name
54
52
  engine_pars: dict, optional
55
53
  Parameters for the engine constructor
56
54
 
@@ -68,14 +66,22 @@ class Algorithm(Model):
68
66
  self.__idata_mem = Dict(name="idata_mem")
69
67
  self.__chunk_store = Dict(name="chunk_store")
70
68
 
71
- if engine is not None:
72
- e = Engine.new(engine_type=engine, verbosity=verbosity, **engine_pars)
69
+ if len(engine_pars):
70
+ if "engine_type" in engine_pars:
71
+ if "engine" in engine_pars:
72
+ raise KeyError(
73
+ f"{self.name}: Expecting either 'engine' or 'engine_type', not both"
74
+ )
75
+ elif "engine" in engine_pars:
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
73
83
  self.print(f"Algorithm '{self.name}': Selecting engine '{e}'")
74
84
  e.initialize()
75
- elif len(engine_pars):
76
- self.print(
77
- f"Algorithm '{self.name}': Parameter 'engine' is None; ignoring engine parameters {engine_pars}"
78
- )
79
85
 
80
86
  @property
81
87
  def farm(self):
@@ -375,6 +381,12 @@ class Algorithm(Model):
375
381
  else:
376
382
  idata = {"coords": {FC.STATE: states_indices}, "data_vars": {}}
377
383
 
384
+ if len(points.shape) == 2 and points.shape[1] == 3:
385
+ pts = np.zeros((n_states,) + points.shape, dtype=config.dtype_double)
386
+ pts[:] = points[None]
387
+ points = pts
388
+ del pts
389
+
378
390
  if (
379
391
  len(points.shape) != 3
380
392
  or points.shape[0] != n_states
@@ -389,7 +401,7 @@ class Algorithm(Model):
389
401
  )
390
402
  idata["data_vars"][FC.TWEIGHTS] = (
391
403
  (FC.TPOINT,),
392
- np.array([1.0], dtype=FC.DTYPE),
404
+ np.array([1.0], dtype=config.dtype_double),
393
405
  )
394
406
 
395
407
  return xr.Dataset(**idata)
@@ -1,6 +1,7 @@
1
1
  import numpy as np
2
2
 
3
3
  from foxes.utils import Dict
4
+ from foxes.config import config
4
5
  import foxes.variables as FV
5
6
  import foxes.constants as FC
6
7
 
@@ -620,7 +621,7 @@ class TData(Data):
620
621
  )
621
622
  data[FC.TARGETS] = points[:, :, None, :]
622
623
  dims[FC.TARGETS] = (FC.STATE, FC.TARGET, FC.TPOINT, FC.XYH)
623
- data[FC.TWEIGHTS] = np.array([1], dtype=FC.DTYPE)
624
+ data[FC.TWEIGHTS] = np.array([1], dtype=config.dtype_double)
624
625
  dims[FC.TWEIGHTS] = (FC.TPOINT,)
625
626
  return cls(data, dims, [FC.STATE, FC.TARGET], name=name, **kwargs)
626
627
 
@@ -6,6 +6,7 @@ from xarray import Dataset
6
6
 
7
7
  from foxes.core import MData, FData, TData
8
8
  from foxes.utils import all_subclasses
9
+ from foxes.config import config
9
10
  import foxes.constants as FC
10
11
 
11
12
  __global_engine_data__ = dict(
@@ -246,26 +247,21 @@ class Engine(ABC):
246
247
  if int(n_states / n_chunks_states) > chunk_size_states:
247
248
  n_chunks_states += 1
248
249
  chunk_size_states = int(n_states / n_chunks_states)
249
- chunk_sizes_states = np.full(n_chunks_states, chunk_size_states)
250
- extra = n_states - n_chunks_states * chunk_size_states
251
- if extra > 0:
252
- chunk_sizes_states[-extra:] += 1
253
-
254
- s = np.sum(chunk_sizes_states)
255
- assert (
256
- s == n_states
257
- ), f"States count mismatch: Expecting {n_states}, chunks sum is {s}. Chunks: {[int(c) for c in chunk_sizes_states]}"
258
250
 
259
251
  # determine points chunks:
260
252
  chunk_sizes_targets = [n_targets]
261
253
  if n_targets > 1:
262
254
  if self.chunk_size_points is None:
263
- if n_chunks_states == 1:
264
- n_chunks_targets = min(self.n_procs, n_targets)
265
- chunk_size_targets = max(int(n_targets / self.n_procs), 1)
266
- else:
255
+ if n_targets < max(n_states, 1000):
267
256
  chunk_size_targets = n_targets
268
257
  n_chunks_targets = 1
258
+ else:
259
+ n_chunks_targets = min(self.n_procs, n_targets)
260
+ chunk_size_targets = max(int(n_targets / self.n_procs), 1)
261
+ if self.chunk_size_states is None and n_chunks_states > 1:
262
+ while chunk_size_states * chunk_size_targets > n_targets:
263
+ n_chunks_states += 1
264
+ chunk_size_states = int(n_states / n_chunks_states)
269
265
  else:
270
266
  chunk_size_targets = min(n_targets, self.chunk_size_points)
271
267
  n_chunks_targets = max(int(n_targets / chunk_size_targets), 1)
@@ -282,6 +278,16 @@ class Engine(ABC):
282
278
  s == n_targets
283
279
  ), f"Targets count mismatch: Expecting {n_targets}, chunks sum is {s}. Chunks: {[int(c) for c in chunk_sizes_targets]}"
284
280
 
281
+ chunk_sizes_states = np.full(n_chunks_states, chunk_size_states)
282
+ extra = n_states - n_chunks_states * chunk_size_states
283
+ if extra > 0:
284
+ chunk_sizes_states[-extra:] += 1
285
+
286
+ s = np.sum(chunk_sizes_states)
287
+ assert (
288
+ s == n_states
289
+ ), f"States count mismatch: Expecting {n_states}, chunks sum is {s}. Chunks: {[int(c) for c in chunk_sizes_states]}"
290
+
285
291
  return chunk_sizes_states, chunk_sizes_targets
286
292
 
287
293
  def get_chunk_input_data(
@@ -342,7 +348,7 @@ class Engine(ABC):
342
348
  n_states = i1_states - i0_states
343
349
  for o in set(out_vars).difference(data.keys()):
344
350
  data[o] = np.full(
345
- (n_states, algo.n_turbines), np.nan, dtype=FC.DTYPE
351
+ (n_states, algo.n_turbines), np.nan, dtype=config.dtype_double
346
352
  )
347
353
  dims[o] = (FC.STATE, FC.TURBINE)
348
354
 
@@ -366,7 +372,9 @@ class Engine(ABC):
366
372
  n_states = i1_states - i0_states
367
373
  n_targets = i1_targets - i0_targets
368
374
  for o in set(out_vars).difference(data.keys()):
369
- data[o] = np.full((n_states, n_targets, 1), np.nan, dtype=FC.DTYPE)
375
+ data[o] = np.full(
376
+ (n_states, n_targets, 1), np.nan, dtype=config.dtype_double
377
+ )
370
378
  dims[o] = (FC.STATE, FC.TARGET, FC.TPOINT)
371
379
 
372
380
  tdata = TData.from_dataset(
@@ -538,22 +546,22 @@ class Engine(ABC):
538
546
  """
539
547
 
540
548
  if engine_type is None:
541
- return None
542
- else:
543
- engine_type = dict(
544
- default="DefaultEngine",
545
- threads="ThreadsEngine",
546
- process="ProcessEngine",
547
- xarray="XArrayEngine",
548
- dask="DaskEngine",
549
- multiprocess="MultiprocessEngine",
550
- local_cluster="LocalClusterEngine",
551
- slurm_cluster="SlurmClusterEngine",
552
- mpi="MPIEngine",
553
- ray="RayEngine",
554
- numpy="NumpyEngine",
555
- single="SingleChunkEngine",
556
- ).get(engine_type, engine_type)
549
+ engine_type = "default"
550
+
551
+ engine_type = dict(
552
+ default="DefaultEngine",
553
+ threads="ThreadsEngine",
554
+ process="ProcessEngine",
555
+ xarray="XArrayEngine",
556
+ dask="DaskEngine",
557
+ multiprocess="MultiprocessEngine",
558
+ local_cluster="LocalClusterEngine",
559
+ slurm_cluster="SlurmClusterEngine",
560
+ mpi="MPIEngine",
561
+ ray="RayEngine",
562
+ numpy="NumpyEngine",
563
+ single="SingleChunkEngine",
564
+ ).get(engine_type, engine_type)
557
565
 
558
566
  allc = all_subclasses(cls)
559
567
  found = engine_type in [scls.__name__ for scls in allc]
@@ -602,9 +610,7 @@ def get_engine(error=True, default=True):
602
610
  default.initialize()
603
611
  return default
604
612
  elif isinstance(default, bool) and default:
605
- engine = Engine.new(
606
- engine_type="DefaultEngine", chunk_size_points=20000, verbosity=0
607
- )
613
+ engine = Engine.new(engine_type="DefaultEngine", verbosity=1)
608
614
  print(f"Selecting '{engine}'")
609
615
  engine.initialize()
610
616
  return engine
@@ -1,10 +1,11 @@
1
1
  import numpy as np
2
2
 
3
+ from foxes.config import config
4
+ import foxes.constants as FC
5
+
3
6
  from .farm_data_model import FarmDataModelList, FarmDataModel
4
7
  from .turbine_model import TurbineModel
5
8
  from .turbine_type import TurbineType
6
- import foxes.constants as FC
7
- import foxes.variables as FV
8
9
 
9
10
 
10
11
  class FarmController(FarmDataModel):
@@ -122,7 +123,7 @@ class FarmController(FarmDataModel):
122
123
  tmodels = []
123
124
  tmsels = []
124
125
  mnames = [[m.name for m in mlist] for mlist in models]
125
- tmis = np.zeros(algo.n_turbines, dtype=FC.ITYPE)
126
+ tmis = np.zeros(algo.n_turbines, dtype=config.dtype_int)
126
127
  news = True
127
128
  while news:
128
129
  news = False
@@ -1,9 +1,11 @@
1
1
  from abc import abstractmethod
2
2
  import numpy as np
3
3
 
4
- from .data_calc_model import DataCalcModel
4
+ from foxes.config import config
5
5
  import foxes.constants as FC
6
6
 
7
+ from .data_calc_model import DataCalcModel
8
+
7
9
 
8
10
  class FarmDataModel(DataCalcModel):
9
11
  """
@@ -82,7 +84,9 @@ class FarmDataModel(DataCalcModel):
82
84
  n_turbines = fdata.n_turbines
83
85
  for v in self.output_farm_vars(algo):
84
86
  if v not in fdata:
85
- fdata[v] = np.full((n_states, n_turbines), np.nan, dtype=FC.DTYPE)
87
+ fdata[v] = np.full(
88
+ (n_states, n_turbines), np.nan, dtype=config.dtype_double
89
+ )
86
90
  fdata.dims[v] = (FC.STATE, FC.TURBINE)
87
91
 
88
92
  @abstractmethod
@@ -2,6 +2,7 @@ import numpy as np
2
2
  from abc import ABC
3
3
  from itertools import count
4
4
 
5
+ from foxes.config import config
5
6
  import foxes.constants as FC
6
7
 
7
8
 
@@ -522,7 +523,7 @@ class Model(ABC):
522
523
  if target == FC.STATE_TARGET and tdata.n_tpoints != 1:
523
524
  # find the mean index and round it to nearest integer:
524
525
  sts = tdata.tpoint_mean(FC.STATES_SEL)[:, :, None]
525
- sts = (sts + 0.5).astype(FC.ITYPE)
526
+ sts = (sts + 0.5).astype(config.dtype_int)
526
527
  sel = sts < i0
527
528
  if np.any(sel):
528
529
  if not hasattr(algo, "farm_results_downwind"):