[BUGFIX] Address reference wind height warnings raised unnecessarily #1017
+64
−17
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
#1000 introduced a warning that is raised when
turbine_type
is set without setting thereference_wind_height
, to let users know that the reference wind height had not been updated. This was pointed out by @cfrontin and also something I ran into recently while working on other aspects of the FLORIS code.While this works as intended, the warning is now raised in some places (particularly
set_operation_model
) where theturbine_type
is set implicitly (without direct input from the user). This pull request addresses the unnecessary warning raised by explicitly setting thereference_wind_height
(to be the same as it was) whenset_operation_model
is called.I've also updated some examples to add the reference wind height when the turbine model is set, as well as the
calculate_horizontal_plane_with_turbines()
function (which also implicitly sets theturbine_type
). The following examples are updated:Note that examples_turbine/001_check_turbine.py also raises the warning; however, in that case, the warning is raised appropriately, and the
assign_hub_height_to_ref_height()
method is then called to "correct" the problem. I therefore left this example as is.In making the fixes, I also have created a
@property
for thereference_wind_height
at theFlorisModel
level to make it easy for users to access.