Skip to content
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

Merged
merged 7 commits into from
Sep 11, 2023

Conversation

paulf81
Copy link
Collaborator

@paulf81 paulf81 commented Sep 8, 2023

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

@paulf81 paulf81 added the enhancement An improvement of an existing feature label Sep 8, 2023
@paulf81 paulf81 added this to the v1.4 milestone Sep 8, 2023
@paulf81 paulf81 self-assigned this Sep 8, 2023
Copy link
Collaborator

@ejsimley ejsimley left a 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.

@@ -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
Copy link
Collaborator

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.

Copy link
Collaborator Author

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
Copy link
Collaborator

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

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed

@Bartdoekemeijer
Copy link
Collaborator

Seems very useful!

@paulf81 paulf81 merged commit 7c08af9 into NREL:develop Sep 11, 2023
2 checks passed
@paulf81 paulf81 deleted the feature/add_options_on_count branch September 11, 2023 18:24
@misi9170 misi9170 mentioned this pull request Oct 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement An improvement of an existing feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants