-
Notifications
You must be signed in to change notification settings - Fork 156
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Move FlorisInterface .reinitialize() / .calculate_wake() to .set() / .run() #823
Conversation
… FlorisInterface.
# Conflicts: # tests/reg_tests/floris_interface_regression_test.py
Consider this flow for multiple calculations as implemented in #823: f = Floris.from_dict(...)
# Get power with non-zero yaw
f.set(wind_directions=..., wind_speeds=..., yaw_angles=...)
f.run()
yawed_power = f.get_farm_AEP()
# Get power with no yaw
f.reset_operation() # Sets all operating set-points to their default
f.run()
baseline_power = f.get_farm_AEP() This start to look like Floris is retaining memory, and this is the same paradigm we intended to remove in the shift from v2 to v3. In fact, @bayc I'm wondering whether you read this the same way, and if you have any feedback on this given our experience with v2 and the shift to v3. For my part, this flow feels like a backward step, but I think I'm stuck too much on the previous API's to give this a fair evaluation. |
@rafmudaf I noticed a test failing and traced it to a small issue in test_disabled_turbines and pushed up a fix |
These seems ready to merge from my point of view, only outstanding comment I see is a question on "TODO" item in the parellel_computing_interface, but that is really minor so I will approve |
@misi9170 It would be good to get your eyes here again when you have a chance. I think I've addressed the tests that we had discussed last week. |
I've now cleaned that up |
# Conflicts: # examples/34_wind_data.py
Adopt .set() / .run() flow for FlorisInterface workflows
Currently, the typical flow for using FlorisInterface is to build a workflow around the
.reinitialize()
and.calculate_wake()
functions. #801 suggests to add an additional step between these two for setting turbine operating conditions. In the subsequent discussion (see #801 (reply in thread)), the idea to refactor this workflow resulted in the following suggestion:This pull request implements the suggested workflow by adding
FlorisInterface.set()
andFlorisInterface.run()
and removingFlorisInterface.reinitialize()
andFlorisInterface.calculate_wake()
.The
FlorisInterface.set()
function allows for setting any of the supported inputs or operation settings individually or in batch:For any parameter that is part of the input (defined in the input file or input dictionary to
FlorisInterface
andFloris
), the.set()
function creates a newFloris
object with the setting changed. This matches the functionality of.reinitialize()
. Therefore, changes should be batched into one.set()
when possible to save the overhead of creating the new objects. In either case, the parameters that aren't provided as arguments to the function are not changed in Floris including the operation settings.If either
FlorisInterface.calculate_wake()
orFlorisInterface.reinitialize()
are used from v3, an error is raised pointing the user to the upgrade guide.RIP calculate_wake() 💀
Related issue
Related to #801
Impacted areas of the software
FlorisInterface
and any script or function that uses it.