-
Notifications
You must be signed in to change notification settings - Fork 3
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
add wedowind example #26
Conversation
* Update smarteole_example.ipynb fix issue, CACHE_SUBDIR is missing if data has never been downloaded * Update smarteole_example.ipynb fix ruff issue * Update smarteole_example.ipynb try to fix ruff issue * fix issues after updating ruff * Fix plotconfig mkdir (#16) * remove make_plots_dir * Update main_analysis.py fix missing dir issue * bump version * Update smarteole_example.ipynb * Update smarteole_example.ipynb filter SmallSampleWarning * Update smarteole_example.ipynb fix ruff issue * Create wind-up uplift validation methodology.pdf * Cleanup requests dependency and move to examples group (#19) * Cleanup requests dependency and move to examples group * Jupyter group moved to examples and all group added * Update pyproject.toml define all using other groups --------- Co-authored-by: Alex Clerc <alex.clerc@res-group.com> * support Python 3.9 (#17) * try Python 3.9 in workflow * Update lint-and-test.yaml * try from __future__ import annotations * Update conftest.py * add eval-type-backport * more from __future__ import annotations * remove TypeAlias * replace zip with strict_zip * ignore 3.9 mypy issues * fix bug in backporting.py * Update lint-and-test.yaml * Update lint-and-test.yaml * Update pyproject.toml move types-requests to dev * Update smarteole_example.ipynb * Update smarteole_example.ipynb * Update smarteole_example.ipynb * Define supported python (#23) * add badge to README * Update pyproject.toml * Update lint-and-test.yaml * update classifiers * Update lint-and-test.yaml * Update README.md * Update smarteole_example.ipynb * Update lint-and-test.yaml * Update README.md * Update smarteole_example.ipynb * fix methodology link --------- Co-authored-by: Gorkem Kacar <139143704+izofat@users.noreply.github.com>
Organise code into function to improve readability and demonstrate usage in ipynb
754b5f6
to
a2d75db
Compare
- Support both Pitch Angle Pair and Vortex Generator Pair WeDoWind datasets - Support not clipping rated power - Improve readability and replace some hard-coded column name strings
a2d75db
to
accd4d6
Compare
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.
Looks good, thanks @aclerc !
Some of the abbreviated names could be elaborated on (perhaps using the full name instead) to improve readability.
] | ||
] | ||
|
||
def _convert_frc_cols_to_pct(input_df: pd.DataFrame, dp: int = 1) -> pd.DataFrame: |
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.
Nice private function here. I like longer more descriptive names for readability, e.g. _convert_fraction_cols_to_percentage
, but that is only a personal preference
) | ||
print_df["mean power toggle on"] = print_df["mean power toggle on"].round(0).astype("int64") | ||
print_df_for_tabulate = ( | ||
print_df[["turbine", "reference", "energy uplift", "uplift P95", "uplift P5", "valid hours toggle on"]] |
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.
Could put these hard-coded strings into an Enum
class and use that here and above in the renaming columns.
showindex=False, | ||
) | ||
print(results_table) | ||
return print_df |
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.
It feels like maybe the naming of results_table
and print_df
could be swapped? Because currently results_table
is being printed and print_df
being returned.
showindex=False, | ||
) | ||
print(results_table) | ||
print_df = format_and_print_results_table(results_per_test_ref_df, print_small_table=print_small_table) |
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.
Nice refactor
ref_wd_filter: list[int] = Field( | ||
description="directions to include in power performance analysis", default=[0, 360] | ||
) | ||
clip_rated_power_pp: bool |
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.
We could add a description to this attribute
Add
examples/wedowind_example.py
for the WeDoWind Turbine Performance Quantification Collaboration.This PR also adds two new settings to
WindUpConfig
which can activate new logic inwind_up/pp_analysis.py
to help with upgrades affecting rated power