You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
Feature request.
Describe the solution you'd like
Requesting a clear error message when the user forgets to call calculate_wake before calling get_farm_power or get_turbine_powers in the FlorisInterface class.
Describe alternatives you've considered
N/A
Additional context
This the current error message the user gets:
Exception has occurred: AttributeError (note: full exception trace is shown but execution is paused at: <module>)
'Farm' object has no attribute 'turbine_type_map'
File "/home/bartdoekemeijer/python_scripts/floris/floris/tools/floris_interface.py", line 573, in get_turbine_powers
turbine_type_map=self.floris.farm.turbine_type_map,
File "/home/bartdoekemeijer/python_scripts/floris/examples/04_sweep_wind_directions.py", line 61, in <module> (Current frame)
turbine_powers = fi.get_turbine_powers() / 1E3 # In kW
File "/usr/lib/python3.9/runpy.py", line 87, in _run_code
exec(code, run_globals)
Which can take a while to trace back to the actual problem.
The text was updated successfully, but these errors were encountered:
@paulf81 I think that's good! Perhaps check_calc_wake_run can become a private function, _check_calc_wake_run, and we would also need to raise the warning in get_farm_power, and perhaps another couple functions?
>>$ python 01_opening_floris_computing_power.py
Traceback (most recent call last):
File "removed /floris/examples/01_opening_floris_computing_power.py", line 9, in <module>
turbine_powers = fi.get_turbine_powers()
File "removed /floris/floris/tools/floris_interface.py", line 594, in get_turbine_powers
raise RuntimeError(
RuntimeError: Can't run function `FlorisInterface.get_turbine_powers` without first running `FlorisInterface.calculate_wake`.
Is your feature request related to a problem? Please describe.
Feature request.
Describe the solution you'd like
Requesting a clear error message when the user forgets to call
calculate_wake
before callingget_farm_power
orget_turbine_powers
in theFlorisInterface
class.Describe alternatives you've considered
N/A
Additional context
This the current error message the user gets:
Which can take a while to trace back to the actual problem.
The text was updated successfully, but these errors were encountered: