-
Notifications
You must be signed in to change notification settings - Fork 18
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
Feature/add options on count #122
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a couple comments on the doc strings. Otherwise looks good.
flasc/energy_ratio/energy_ratio.py
Outdated
@@ -186,6 +193,10 @@ def _compute_energy_ratio_bootstrap(er_in, | |||
ws_min (float): The minimum wind speed to use. | |||
ws_max (float): The maximum wind speed to use. | |||
bin_cols_in (list[str]): A list of column names to use for the wind speed and wind direction bins. | |||
weight_by (str): How to weight the energy ratio, options are 'min', or 'sum'. 'min' means | |||
the minimum count across the dataframes is used to weight the energy ratio. 'mean' means the mean | |||
count across the dataframes is used to weight the energy ratio. 'sum' means the sum of the counts |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this line about 'mean' means the mean count across... should be removed. It doesn't seem like the 'mean' option is implemented anywhere.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed
@@ -58,6 +59,9 @@ def __init__(self, | |||
ws_min (float): The minimum wind speed value. | |||
ws_max (float): The maximum wind speed value. | |||
bin_cols_in (List[str]): TBD | |||
weight_by (str): How to weight the energy ratio, options are 'min', , or 'sum'. 'min' means |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
there's an extra comma
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed
Seems very useful! |
Ready to be merged
Feature or improvement description
This pull request changes the current behavior that assumes, when weighting wind speed bins in the energy ratio across dataframes, that we should use the minimum count (thus up-weighting the wind-speed bins that have the most points in the lesser case), allow an option to weight by sum. Minimum will stay the default but now an option to pass in 'sum' to a new weight_by variable.
The pull request includes a new test which shows and checks the functionality on a small problem
Finally, a small unrelated bug in energy_ratio_output (remove_all_bins used instead of remove_all_nulls is fixed) and the energy_ratio example for wake steering is cleaned up.
Additional supporting information
This is in support of functions to compute total uplift
Test results, if applicable
New test added test_alternative_weighting, all tests pass