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

add wedowind example #26

Merged
merged 17 commits into from
Sep 16, 2024
Merged

add wedowind example #26

merged 17 commits into from
Sep 16, 2024

Conversation

aclerc
Copy link
Contributor

@aclerc aclerc commented Sep 8, 2024

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 in wind_up/pp_analysis.py to help with upgrades affecting rated power

aclerc and others added 4 commits August 16, 2024 14:54
* 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>
@aclerc aclerc marked this pull request as draft September 8, 2024 09:03
@samuelwnaylor samuelwnaylor force-pushed the wedowind-example branch 2 times, most recently from 754b5f6 to a2d75db Compare September 12, 2024 14:31
- 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
@aclerc aclerc marked this pull request as ready for review September 13, 2024 12:45
Copy link
Collaborator

@samuelwnaylor samuelwnaylor left a 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:
Copy link
Collaborator

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

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

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

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

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

@samuelwnaylor samuelwnaylor merged commit c314a57 into main Sep 16, 2024
2 checks passed
@samuelwnaylor samuelwnaylor deleted the wedowind-example branch September 16, 2024 09:49
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