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

Quantify wind speed shift #42

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open

Conversation

samuelwnaylor
Copy link
Collaborator

No description provided.

- Moves Operational Curve shift calculations into their own module
- Refactor into separate curve specific functions
  (with underlying more generic private functions)

This change improves readability and ease of adding further curve shift
calculations.
In similar way that power curve, rpm and pitch shifts are already
calculated, this change adds wind speed shift to the ops curve shift
module
Display the sign (+/-) of the curve shift value in the log warning
message for clarity of the actual shift rather than just displaying the
abs() value that is used when determining whether to raise a log warning
@samuelwnaylor samuelwnaylor marked this pull request as ready for review November 19, 2024 10:53
Copy link
Contributor

@aclerc aclerc left a comment

Choose a reason for hiding this comment

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

I am seeing some differences in integration tests, will email you with further detail. I might have found the reasons (see comments) but not totally sure. Apologies there were not unit tests for the original check_for_ops_curve_shift function you are replacing

wind_up/ops_curve_shift.py Outdated Show resolved Hide resolved
wind_up/ops_curve_shift.py Outdated Show resolved Hide resolved
Comment on lines -417 to -422
if abs(results_dict[descr]) > warn_thresh:
if warning_msg is None:
warning_msg = f"{wtg_name} check_for_ops_curve_shift warnings:"
warning_msg += f" abs({descr}) > {warn_thresh}: {abs(results_dict[descr]):.3f}"
if warning_msg is not None:
result_manager.warning(warning_msg)
Copy link
Contributor

Choose a reason for hiding this comment

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

this logic is valuable to keep so that ops curve shifts result in a single consolidated warning, please port it to ops_curve_shift.py

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

wind_up/ops_curve_shift.py Outdated Show resolved Hide resolved
Comment on lines -397 to -398
pre_dropna_df = pre_df.dropna(subset=[scada_ws_col, pw_col, pt_col, rpm_col]).copy()
post_dropna_df = post_df.dropna(subset=[scada_ws_col, pw_col, pt_col, rpm_col]).copy()
Copy link
Contributor

Choose a reason for hiding this comment

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

I am not completely sure but I think this dropna logic is missing in the new ops_curve_shift.py

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I am not completely sure but I think this dropna logic is missing in the new ops_curve_shift.py

This logic is here now

self.pre_df = self.pre_df.dropna(subset=list(required_cols)).copy()

I've added NaN handling to the tests too...

NaN included in df and the assertion in a test

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants