Polars change in enforcing non-NaN measurements for all turbines #119
Replies: 3 comments 1 reply
-
Hi @Bartdoekemeijer, thanks for pointing this out. I agree with you, that requiring all reference (test) turbines to have a numerical value is overly restrictive, and we should at least have the option to require only that at least one of the reference (test) values is valid. In terms of what the default behavior should be, I guess I could go either way:
I don't imagine that this change should be too difficult; presumably we can use some sort of combination of |
Beta Was this translation helpful? Give feedback.
-
Opened Issue #120 |
Beta Was this translation helpful? Give feedback.
-
Thank you, both! Closing this discussion and continuing the conversation in #120. |
Beta Was this translation helpful? Give feedback.
-
The recent Polars merge in
develop
has added a specific change to how NaNs are dealt with.When FLASC relied on Pandas, we defined
pow_ref
as thenanmean
of the reference turbines, thus where NaNs were ignored and we just took the average of all non-NaN values. The same holds forpow_test
. This means that if one reference/test turbine had a NaN value, that turbine would just be ignored and the power reference/test was just calculated with the remaining turbines.Now with Polars, FLASC enforces that the measurements of all reference turbines must be valid. The same thing holds for all test turbines. This is achieved in
energy_ratio.py
and inenergy_ratio_output.py
through the command:flasc/flasc/energy_ratio/energy_ratio.py
Line 72 in 685871d
I think this is particularly (and unnecessarily) restrictive. Note that it's fine to keep NaNs in our energy ratio analysis, so as long as those NaNs are mirrored in the FLORIS predictions, so that we're still comparing apples to apples. This in the case by default in
interpolate_floris_from_df_approx
, see:flasc/flasc/floris_tools.py
Line 89 in 88330a7
My solution to this would be to either remove the
is_not_null()
filter command inenergy_ratio.py
and inenergy_ratio_output.py
, or just turn it into an option that is disabled by default (my preference). I could probably be persuaded to enable it by default.What do you think, @paulf81, @misi9170?
Beta Was this translation helpful? Give feedback.
All reactions