foxes 1.5__py3-none-any.whl → 1.5.2__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of foxes might be problematic. Click here for more details.

Files changed (38) hide show
  1. examples/abl_states/run.py +58 -56
  2. examples/dyn_wakes/run.py +110 -118
  3. examples/field_data_nc/run.py +22 -20
  4. examples/multi_height/run.py +8 -6
  5. examples/scan_row/run.py +89 -87
  6. examples/sector_management/run.py +40 -38
  7. examples/states_lookup_table/run.py +6 -4
  8. examples/streamline_wakes/run.py +8 -6
  9. examples/timelines/run.py +100 -98
  10. examples/timeseries/run.py +71 -76
  11. examples/wind_rose/run.py +27 -25
  12. examples/yawed_wake/run.py +82 -80
  13. foxes/core/algorithm.py +1 -0
  14. foxes/engines/pool.py +1 -0
  15. foxes/input/yaml/windio/read_attributes.py +8 -2
  16. foxes/input/yaml/windio/read_farm.py +20 -0
  17. foxes/input/yaml/windio/read_fields.py +3 -0
  18. foxes/input/yaml/windio/read_outputs.py +24 -12
  19. foxes/input/yaml/windio/read_site.py +33 -12
  20. foxes/input/yaml/windio/windio.py +1 -0
  21. foxes/models/farm_controllers/__init__.py +1 -0
  22. foxes/models/farm_controllers/op_flag.py +196 -0
  23. foxes/models/wake_models/induction/self_similar.py +22 -4
  24. foxes/models/wake_models/induction/self_similar2020.py +1 -1
  25. foxes/models/wake_models/ti/crespo_hernandez.py +1 -1
  26. foxes/models/wake_models/wind/bastankhah14.py +1 -1
  27. foxes/models/wake_models/wind/bastankhah16.py +1 -1
  28. foxes/models/wake_models/wind/turbopark.py +1 -1
  29. foxes/output/state_turbine_map.py +7 -4
  30. foxes/utils/xarray_utils.py +20 -12
  31. foxes/variables.py +8 -3
  32. {foxes-1.5.dist-info → foxes-1.5.2.dist-info}/METADATA +5 -6
  33. {foxes-1.5.dist-info → foxes-1.5.2.dist-info}/RECORD +38 -36
  34. tests/2_models/turbine_models/test_set_farm_vars.py +64 -0
  35. {foxes-1.5.dist-info → foxes-1.5.2.dist-info}/WHEEL +0 -0
  36. {foxes-1.5.dist-info → foxes-1.5.2.dist-info}/entry_points.txt +0 -0
  37. {foxes-1.5.dist-info → foxes-1.5.2.dist-info}/licenses/LICENSE +0 -0
  38. {foxes-1.5.dist-info → foxes-1.5.2.dist-info}/top_level.txt +0 -0
@@ -104,10 +104,6 @@ if __name__ == "__main__":
104
104
  wake_frame="rotor_wd",
105
105
  partial_wakes=args.pwakes,
106
106
  mbook=mbook,
107
- engine=args.engine,
108
- n_procs=args.n_cpus,
109
- chunk_size_states=args.chunksize_states,
110
- chunk_size_points=args.chunksize_points,
111
107
  )
112
108
 
113
109
  outputs = [
@@ -124,43 +120,49 @@ if __name__ == "__main__":
124
120
  FV.WEIGHT,
125
121
  ]
126
122
 
127
- time0 = time.time()
128
- farm_results = algo.calc_farm(outputs=outputs)
129
- time1 = time.time()
123
+ with foxes.Engine.new(
124
+ engine_type=args.engine,
125
+ n_procs=args.n_cpus,
126
+ chunk_size_states=args.chunksize_states,
127
+ chunk_size_points=args.chunksize_points,
128
+ ):
129
+ time0 = time.time()
130
+ farm_results = algo.calc_farm(outputs=outputs)
131
+ time1 = time.time()
130
132
 
131
- print("\nCalc time =", time1 - time0, "\n")
133
+ print("\nCalc time =", time1 - time0, "\n")
132
134
 
133
- print(farm_results)
135
+ print(farm_results)
134
136
 
135
- fr = farm_results.to_dataframe()
136
- sel = fr[FV.MAX_P].dropna().index
137
- fr = fr.loc[sel]
138
- print(fr)
137
+ fr = farm_results.to_dataframe()
138
+ sel = fr[FV.MAX_P].dropna().index
139
+ fr = fr.loc[sel]
140
+ print(fr)
139
141
 
140
- if not args.nofig:
141
- fig = plt.figure(figsize=(12, 4))
142
- ax1 = fig.add_subplot(121, polar=True)
143
- ax2 = fig.add_subplot(122, polar=True)
142
+ if not args.nofig:
143
+ fig = plt.figure(figsize=(12, 4))
144
+ ax1 = fig.add_subplot(121, polar=True)
145
+ ax2 = fig.add_subplot(122, polar=True)
144
146
 
145
- o = foxes.output.RosePlotOutput(farm_results)
146
- o.get_figure(
147
- 16,
148
- FV.P,
149
- [0, 100, 1000, 2000, 4000, 5001, 7000],
150
- turbine=0,
151
- title="Power turbine 0",
152
- fig=fig,
153
- ax=ax1,
154
- )
147
+ o = foxes.output.RosePlotOutput(farm_results)
148
+ o.get_figure(
149
+ 16,
150
+ FV.P,
151
+ [0, 100, 1000, 2000, 4000, 5001, 7000],
152
+ turbine=0,
153
+ title="Power turbine 0",
154
+ fig=fig,
155
+ ax=ax1,
156
+ )
155
157
 
156
- o = foxes.output.RosePlotOutput(farm_results)
157
- o.get_figure(
158
- 16,
159
- FV.P,
160
- [0, 100, 1000, 2000, 4000, 5001, 7000],
161
- turbine=1,
162
- title="Power turbine 1",
163
- fig=fig,
164
- ax=ax2,
165
- )
166
- plt.show()
158
+ o = foxes.output.RosePlotOutput(farm_results)
159
+ o.get_figure(
160
+ 16,
161
+ FV.P,
162
+ [0, 100, 1000, 2000, 4000, 5001, 7000],
163
+ turbine=1,
164
+ title="Power turbine 1",
165
+ fig=fig,
166
+ ax=ax2,
167
+ )
168
+ plt.show()
@@ -117,13 +117,15 @@ if __name__ == "__main__":
117
117
  wake_frame="rotor_wd",
118
118
  partial_wakes=args.pwakes,
119
119
  mbook=mbook,
120
- engine=args.engine,
120
+ )
121
+
122
+ with foxes.Engine.new(
123
+ engine_type=args.engine,
121
124
  n_procs=args.n_cpus,
122
125
  chunk_size_states=args.chunksize_states,
123
126
  chunk_size_points=args.chunksize_points,
124
- )
125
-
126
- farm_results = algo.calc_farm()
127
+ ):
128
+ farm_results = algo.calc_farm()
127
129
 
128
130
  fr = farm_results.to_dataframe()
129
131
  print(fr[[FV.WD, FV.H, FV.AMB_REWS, FV.REWS, FV.AMB_P, FV.P, FV.CT, FV.WEIGHT]])
@@ -129,15 +129,17 @@ if __name__ == "__main__":
129
129
  wake_deflection=args.deflection,
130
130
  partial_wakes=args.pwakes,
131
131
  mbook=mbook,
132
- engine=args.engine,
132
+ )
133
+
134
+ with foxes.Engine.new(
135
+ engine_type=args.engine,
133
136
  n_procs=args.n_cpus,
134
137
  chunk_size_states=args.chunksize_states,
135
138
  chunk_size_points=args.chunksize_points,
136
- )
137
-
138
- time0 = time.time()
139
- farm_results = algo.calc_farm()
140
- time1 = time.time()
139
+ ):
140
+ time0 = time.time()
141
+ farm_results = algo.calc_farm()
142
+ time1 = time.time()
141
143
 
142
144
  print("\nCalc time =", time1 - time0, "\n")
143
145
 
examples/timelines/run.py CHANGED
@@ -173,119 +173,121 @@ if __name__ == "__main__":
173
173
  wake_deflection=args.deflection,
174
174
  partial_wakes=args.pwakes,
175
175
  mbook=mbook,
176
- engine=args.engine,
177
- n_procs=args.n_cpus,
178
- chunk_size_states=args.chunksize_states,
179
- chunk_size_points=args.chunksize_points,
180
176
  verbosity=1,
181
177
  )
182
178
 
183
- time0 = time.time()
184
- farm_results = algo.calc_farm()
185
- time1 = time.time()
179
+ with foxes.Engine.new(
180
+ engine_type=args.engine,
181
+ n_procs=args.n_cpus,
182
+ chunk_size_states=args.chunksize_states,
183
+ chunk_size_points=args.chunksize_points,
184
+ ):
185
+ time0 = time.time()
186
+ farm_results = algo.calc_farm()
187
+ time1 = time.time()
186
188
 
187
- print("\nCalc time =", time1 - time0, "\n")
189
+ print("\nCalc time =", time1 - time0, "\n")
188
190
 
189
- o = foxes.output.FarmResultsEval(farm_results)
190
- o.add_capacity(algo)
191
- o.add_capacity(algo, ambient=True)
192
- o.add_efficiency()
191
+ o = foxes.output.FarmResultsEval(farm_results)
192
+ o.add_capacity(algo)
193
+ o.add_capacity(algo, ambient=True)
194
+ o.add_efficiency()
193
195
 
194
- print("\nFarm results:\n")
195
- print(farm_results)
196
+ print("\nFarm results:\n")
197
+ print(farm_results)
196
198
 
197
- # state-turbine results
198
- farm_df = farm_results.to_dataframe()
199
- print("\nFarm results data:\n")
200
- print(
201
- farm_df[
202
- [
203
- FV.X,
204
- FV.Y,
205
- FV.WD,
206
- FV.AMB_REWS,
207
- FV.REWS,
208
- FV.AMB_TI,
209
- FV.TI,
210
- FV.AMB_P,
211
- FV.P,
212
- FV.EFF,
199
+ # state-turbine results
200
+ farm_df = farm_results.to_dataframe()
201
+ print("\nFarm results data:\n")
202
+ print(
203
+ farm_df[
204
+ [
205
+ FV.X,
206
+ FV.Y,
207
+ FV.WD,
208
+ FV.AMB_REWS,
209
+ FV.REWS,
210
+ FV.AMB_TI,
211
+ FV.TI,
212
+ FV.AMB_P,
213
+ FV.P,
214
+ FV.EFF,
215
+ ]
213
216
  ]
214
- ]
215
- )
216
- print()
217
- print(farm_df[[FV.AMB_REWS, FV.REWS, FV.CT, FV.EFF]].describe())
217
+ )
218
+ print()
219
+ print(farm_df[[FV.AMB_REWS, FV.REWS, FV.CT, FV.EFF]].describe())
218
220
 
219
- # power results
220
- P0 = o.calc_mean_farm_power(ambient=True)
221
- P = o.calc_mean_farm_power()
222
- print(f"\nFarm power : {P / 1000:.1f} MW")
223
- print(f"Farm ambient power: {P0 / 1000:.1f} MW")
224
- print(f"Farm efficiency : {o.calc_farm_efficiency() * 100:.2f} %")
221
+ # power results
222
+ P0 = o.calc_mean_farm_power(ambient=True)
223
+ P = o.calc_mean_farm_power()
224
+ print(f"\nFarm power : {P / 1000:.1f} MW")
225
+ print(f"Farm ambient power: {P0 / 1000:.1f} MW")
226
+ print(f"Farm efficiency : {o.calc_farm_efficiency() * 100:.2f} %")
225
227
 
226
- if not args.nofig:
227
- sts = np.arange(farm_results.sizes["state"])
228
- plt.plot(sts, farm_results.REWS[:, 4], label="Turbine 4")
229
- plt.plot(sts, farm_results.REWS[:, 7], label="Turbine 7")
230
- plt.legend()
231
- plt.xlabel("State")
232
- plt.ylabel("REWS [m/s]")
233
- plt.show()
228
+ if not args.nofig:
229
+ sts = np.arange(farm_results.sizes["state"])
230
+ plt.plot(sts, farm_results.REWS[:, 4], label="Turbine 4")
231
+ plt.plot(sts, farm_results.REWS[:, 7], label="Turbine 7")
232
+ plt.legend()
233
+ plt.xlabel("State")
234
+ plt.ylabel("REWS [m/s]")
235
+ plt.show()
234
236
 
235
- if not args.nofig and args.animation:
236
- print("\nCalculating animation")
237
+ if not args.nofig and args.animation:
238
+ print("\nCalculating animation")
237
239
 
238
- fig, axs = plt.subplots(
239
- 2, 1, figsize=(5.2, 7), gridspec_kw={"height_ratios": [3, 1]}
240
- )
240
+ fig, axs = plt.subplots(
241
+ 2, 1, figsize=(5.2, 7), gridspec_kw={"height_ratios": [3, 1]}
242
+ )
241
243
 
242
- anim = foxes.output.Animator(fig)
243
- of = foxes.output.FlowPlots2D(algo, farm_results)
244
- anim.add_generator(
245
- of.gen_states_fig_xy(
246
- FV.WS,
247
- resolution=30,
248
- quiver_pars=dict(angles="xy", scale_units="xy", scale=0.013),
249
- quiver_n=35,
250
- xmax=5000,
251
- ymax=5000,
252
- vmin=0,
253
- fig=fig,
254
- ax=axs[0],
255
- ret_im=True,
256
- title=None,
257
- animated=True,
258
- rotor_color="red",
244
+ anim = foxes.output.Animator(fig)
245
+ of = foxes.output.FlowPlots2D(algo, farm_results)
246
+ anim.add_generator(
247
+ of.gen_states_fig_xy(
248
+ FV.WS,
249
+ resolution=30,
250
+ quiver_pars=dict(angles="xy", scale_units="xy", scale=0.013),
251
+ quiver_n=35,
252
+ xmax=5000,
253
+ ymax=5000,
254
+ vmin=0,
255
+ fig=fig,
256
+ ax=axs[0],
257
+ ret_im=True,
258
+ title=None,
259
+ animated=True,
260
+ rotor_color="red",
261
+ )
259
262
  )
260
- )
261
- anim.add_generator(
262
- o.gen_stdata(
263
- turbines=[4, 7],
264
- variable=FV.REWS,
265
- fig=fig,
266
- ax=axs[1],
267
- ret_im=True,
268
- legloc="upper left",
269
- animated=True,
263
+ anim.add_generator(
264
+ o.gen_stdata(
265
+ turbines=[4, 7],
266
+ variable=FV.REWS,
267
+ fig=fig,
268
+ ax=axs[1],
269
+ ret_im=True,
270
+ legloc="upper left",
271
+ animated=True,
272
+ )
270
273
  )
271
- )
272
274
 
273
- ani = anim.animate()
275
+ ani = anim.animate()
274
276
 
275
- lo = foxes.output.FarmLayoutOutput(farm)
276
- lo.get_figure(
277
- fig=fig,
278
- ax=axs[0],
279
- title="",
280
- annotate=1,
281
- anno_delx=-120,
282
- anno_dely=-60,
283
- alpha=0,
284
- )
277
+ lo = foxes.output.FarmLayoutOutput(farm)
278
+ lo.get_figure(
279
+ fig=fig,
280
+ ax=axs[0],
281
+ title="",
282
+ annotate=1,
283
+ anno_delx=-120,
284
+ anno_dely=-60,
285
+ alpha=0,
286
+ )
285
287
 
286
- fpath = Path(args.ani_file)
287
- print("Writing file", fpath)
288
- if fpath.suffix == ".gif":
289
- ani.save(filename=fpath, writer="pillow", fps=args.fps)
290
- else:
291
- ani.save(filename=fpath, writer="ffmpeg", fps=args.fps)
288
+ fpath = Path(args.ani_file)
289
+ print("Writing file", fpath)
290
+ if fpath.suffix == ".gif":
291
+ ani.save(filename=fpath, writer="pillow", fps=args.fps)
292
+ else:
293
+ ani.save(filename=fpath, writer="ffmpeg", fps=args.fps)
@@ -99,15 +99,6 @@ if __name__ == "__main__":
99
99
  plt.show()
100
100
  plt.close(ax.get_figure())
101
101
 
102
- engine = foxes.Engine.new(
103
- args.engine,
104
- n_procs=args.n_cpus,
105
- chunk_size_states=args.chunksize_states,
106
- chunk_size_points=args.chunksize_points,
107
- verbosity=1,
108
- )
109
- engine.initialize()
110
-
111
102
  Algo = foxes.algorithms.Iterative if args.iterative else foxes.algorithms.Downwind
112
103
  algo = Algo(
113
104
  farm,
@@ -120,71 +111,75 @@ if __name__ == "__main__":
120
111
  verbosity=1,
121
112
  )
122
113
 
123
- time0 = time.time()
124
- farm_results = algo.calc_farm()
125
- time1 = time.time()
126
-
127
- print("\nFarm results:\n")
128
- print(farm_results)
129
-
130
- print("\nCalc time =", time1 - time0, "\n")
131
-
132
- o = foxes.output.FarmResultsEval(farm_results)
133
- o.add_capacity(algo)
134
- o.add_capacity(algo, ambient=True)
135
- o.add_efficiency()
136
-
137
- print("\nFarm results:\n")
138
- print(farm_results)
139
-
140
- # state-turbine results
141
- farm_df = farm_results.to_dataframe()
142
- print("\nFarm results data:\n")
143
- print(
144
- farm_df[
145
- [
146
- FV.X,
147
- FV.WD,
148
- FV.AMB_REWS,
149
- FV.REWS,
150
- FV.AMB_TI,
151
- FV.TI,
152
- FV.AMB_P,
153
- FV.P,
154
- FV.EFF,
114
+ with foxes.Engine.new(
115
+ engine_type=args.engine,
116
+ n_procs=args.n_cpus,
117
+ chunk_size_states=args.chunksize_states,
118
+ chunk_size_points=args.chunksize_points,
119
+ ):
120
+ time0 = time.time()
121
+ farm_results = algo.calc_farm()
122
+ time1 = time.time()
123
+
124
+ print("\nFarm results:\n")
125
+ print(farm_results)
126
+
127
+ print("\nCalc time =", time1 - time0, "\n")
128
+
129
+ o = foxes.output.FarmResultsEval(farm_results)
130
+ o.add_capacity(algo)
131
+ o.add_capacity(algo, ambient=True)
132
+ o.add_efficiency()
133
+
134
+ print("\nFarm results:\n")
135
+ print(farm_results)
136
+
137
+ # state-turbine results
138
+ farm_df = farm_results.to_dataframe()
139
+ print("\nFarm results data:\n")
140
+ print(
141
+ farm_df[
142
+ [
143
+ FV.X,
144
+ FV.WD,
145
+ FV.AMB_REWS,
146
+ FV.REWS,
147
+ FV.AMB_TI,
148
+ FV.TI,
149
+ FV.AMB_P,
150
+ FV.P,
151
+ FV.EFF,
152
+ ]
155
153
  ]
156
- ]
157
- )
158
- print()
159
-
160
- # results by turbine
161
- turbine_results = o.reduce_states(
162
- {
163
- FV.AMB_P: "weights",
164
- FV.P: "weights",
165
- FV.AMB_CAP: "weights",
166
- FV.CAP: "weights",
167
- }
168
- )
169
- turbine_results[FV.AMB_YLD] = o.calc_turbine_yield(
170
- algo=algo, annual=True, ambient=True
171
- )
172
- turbine_results[FV.YLD] = o.calc_turbine_yield(algo=algo, annual=True)
173
- turbine_results[FV.EFF] = turbine_results[FV.P] / turbine_results[FV.AMB_P]
174
- print("\nResults by turbine:\n")
175
- print(turbine_results)
176
-
177
- # power results
178
- P0 = o.calc_mean_farm_power(ambient=True)
179
- P = o.calc_mean_farm_power()
180
- print(f"\nFarm power : {P / 1000:.1f} MW")
181
- print(f"Farm ambient power: {P0 / 1000:.1f} MW")
182
- print(f"Farm efficiency : {o.calc_farm_efficiency() * 100:.2f} %")
183
- print(f"Annual farm yield : {turbine_results[FV.YLD].sum():.2f} GWh")
184
-
185
- engine.finalize()
186
-
187
- if not args.nofig:
188
- o = foxes.output.StateTurbineMap(farm_results)
189
- ax = o.plot_map(FV.P, cmap="inferno", figsize=(6, 7))
190
- plt.show()
154
+ )
155
+ print()
156
+
157
+ # results by turbine
158
+ turbine_results = o.reduce_states(
159
+ {
160
+ FV.AMB_P: "weights",
161
+ FV.P: "weights",
162
+ FV.AMB_CAP: "weights",
163
+ FV.CAP: "weights",
164
+ }
165
+ )
166
+ turbine_results[FV.AMB_YLD] = o.calc_turbine_yield(
167
+ algo=algo, annual=True, ambient=True
168
+ )
169
+ turbine_results[FV.YLD] = o.calc_turbine_yield(algo=algo, annual=True)
170
+ turbine_results[FV.EFF] = turbine_results[FV.P] / turbine_results[FV.AMB_P]
171
+ print("\nResults by turbine:\n")
172
+ print(turbine_results)
173
+
174
+ # power results
175
+ P0 = o.calc_mean_farm_power(ambient=True)
176
+ P = o.calc_mean_farm_power()
177
+ print(f"\nFarm power : {P / 1000:.1f} MW")
178
+ print(f"Farm ambient power: {P0 / 1000:.1f} MW")
179
+ print(f"Farm efficiency : {o.calc_farm_efficiency() * 100:.2f} %")
180
+ print(f"Annual farm yield : {turbine_results[FV.YLD].sum():.2f} GWh")
181
+
182
+ if not args.nofig:
183
+ o = foxes.output.StateTurbineMap(farm_results)
184
+ ax = o.plot_map(FV.P, cmap="inferno", figsize=(6, 7))
185
+ plt.show()
examples/wind_rose/run.py CHANGED
@@ -105,37 +105,39 @@ if __name__ == "__main__":
105
105
  wake_frame="rotor_wd",
106
106
  partial_wakes=args.pwakes,
107
107
  mbook=mbook,
108
- engine=args.engine,
108
+ )
109
+
110
+ with foxes.Engine.new(
111
+ engine_type=args.engine,
109
112
  n_procs=args.n_cpus,
110
113
  chunk_size_states=args.chunksize_states,
111
114
  chunk_size_points=args.chunksize_points,
112
- )
115
+ ):
116
+ if not args.nofig:
117
+ o = foxes.output.StatesRosePlotOutput(states, point=[0.0, 0.0, 100.0])
118
+ o.get_figure(16, FV.AMB_WS, [0, 3.5, 6, 10, 15, 20], add_inf=True)
119
+ plt.show()
113
120
 
114
- if not args.nofig:
115
- o = foxes.output.StatesRosePlotOutput(states, point=[0.0, 0.0, 100.0])
116
- o.get_figure(16, FV.AMB_WS, [0, 3.5, 6, 10, 15, 20], add_inf=True)
117
- plt.show()
118
-
119
- time0 = time.time()
120
- farm_results = algo.calc_farm()
121
- time1 = time.time()
121
+ time0 = time.time()
122
+ farm_results = algo.calc_farm()
123
+ time1 = time.time()
122
124
 
123
- print("\nCalc time =", time1 - time0, "\n")
125
+ print("\nCalc time =", time1 - time0, "\n")
124
126
 
125
- print(farm_results)
127
+ print(farm_results)
126
128
 
127
- fr = farm_results.to_dataframe()
128
- print(fr[[FV.WD, FV.H, FV.AMB_REWS, FV.REWS, FV.AMB_P, FV.P, FV.WEIGHT]])
129
+ fr = farm_results.to_dataframe()
130
+ print(fr[[FV.WD, FV.H, FV.AMB_REWS, FV.REWS, FV.AMB_P, FV.P, FV.WEIGHT]])
129
131
 
130
- o = foxes.output.FarmResultsEval(farm_results)
131
- P0 = o.calc_mean_farm_power(ambient=True)
132
- P = o.calc_mean_farm_power()
133
- print(f"\nFarm power : {P / 1000:.1f} MW")
134
- print(f"Farm ambient power: {P0 / 1000:.1f} MW")
135
- print(f"Farm efficiency : {o.calc_farm_efficiency() * 100:.2f} %")
136
- print(f"Annual farm yield : {o.calc_farm_yield(algo=algo):.2f} GWh")
132
+ o = foxes.output.FarmResultsEval(farm_results)
133
+ P0 = o.calc_mean_farm_power(ambient=True)
134
+ P = o.calc_mean_farm_power()
135
+ print(f"\nFarm power : {P / 1000:.1f} MW")
136
+ print(f"Farm ambient power: {P0 / 1000:.1f} MW")
137
+ print(f"Farm efficiency : {o.calc_farm_efficiency() * 100:.2f} %")
138
+ print(f"Annual farm yield : {o.calc_farm_yield(algo=algo):.2f} GWh")
137
139
 
138
- if not args.nofig and args.calc_mean:
139
- o = foxes.output.FlowPlots2D(algo, farm_results)
140
- fig = o.get_mean_fig_xy(FV.WS, resolution=30)
141
- plt.show()
140
+ if not args.nofig and args.calc_mean:
141
+ o = foxes.output.FlowPlots2D(algo, farm_results)
142
+ fig = o.get_mean_fig_xy(FV.WS, resolution=30)
143
+ plt.show()