-
Notifications
You must be signed in to change notification settings - Fork 27
Preprocessing Tool for Turbine Model Files #379
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
Conversation
genevievestarke
left a comment
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 great! It's awesome that the floris and pysam formatting tools are in the turbine-library package!
|
|
||
| @define | ||
| class FlorisTurbineDefaults(BaseConfig): | ||
| """Config class to specify default turbine parameters that are required by FLORIS. |
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 these look like good defaults. The wind_speeds and wind_directions parameters may need defaults to run, as well. These are then overwritten by the time series data, but I'm not sure if it will run without them defined.
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.
Thanks for the heads up, this will be easier to fix once the Floris turbine wrapper is pulled in
johnjasa
left a comment
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 like this PR a lot! It's fun to give users more tools for success.
I left a quick note on the function you explicitly asked about. Everything else looks pretty nice to me. The only blocking change I'd ask for is the inclusion of a .ipynb doc file that uses and explains the preprocessing steps you've introduced here. It'd be both documentation and testing, as it would get run when the docs build. Feel free to call me if you want to talk through what I'm picturing here!
h2integrate/core/utilities.py
Outdated
| yaml.dump(instance, f) | ||
|
|
||
|
|
||
| def write_yaml_readable(instance: dict, foutput: str | Path): |
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.
Would write_readable_yaml flow better? I accept it as-is, too. I like the function and what it does! Would love to see it in a doc page.
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.
Updated the function name to write_readable_yaml and will include in the doc page
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.
@johnjasa I added a doc page to docs/misc_resources/turbine_models_library_preprocessing.ipynb that highlights specifically how to use the new functions with PySAM models.
|
Check out this pull request on See visual diffs & provide feedback on Jupyter Notebooks. Powered by ReviewNB |
Ok, this was a local environment/kernel issue! All good now! |
johnjasa
left a comment
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.
Thanks for your changes and patience! I love this and expect it to be a useful basis for other preprocessing utilities.


Preprocessing Tool for Turbine Model Files
Added pre-processing methods/tools that can be used to assist making input files (for wind performance models) for running H2I. The methods in this PR utilize some functionality in the turbine-models library package.
Note: the PySAM wind plant model does not allow for rotor diameter or hub-height to be input in the pysam_options dictionary. So - these parameters have to be removed from the pysam_options dictionary and moved to a higher level in the config. I am unsure whether the function
export_turbine_to_pysam_format()should include this reformatting/reorganizing or not (it currently does not!). How to use this function with the PySAM Windpower wrapper is highlighted in the testh2integrate/preprocess/test/test_wind_turbine_file_tools.py::test_pysam_turbine_export.If possible, this PR should include some added tests once PR #372 is merged in.
Notes for reviewers:
FlorisTurbineDefaultsinexport_turbine_to_floris_format()write_yaml_readable()(and whether it should have a different name), I'd also be curious if you think that the new pre-processing functions need to be integrated into an existing or new example.Type of Contribution
General PR Checklist
CHANGELOG.mdhas been updated to describe the changes made in this PRdocs/files are up-to-date, or added when necessaryNew Technology Checklist
test_all_examples.pyexamples/README.mddocs/technology_models/docs/technology_models/technology_overview.mdsupported_models.pycreate_financial_modelinh2integrate_model.pydocs/developer_guide/coding_guidelines.mdRelated issues
Impacted areas of the software
pyproject.toml: added turbine-models dependencyh2integrate/core/utilities.pywrite_yaml_readable(): similar towrite_yaml()but usesyamllibrary instead ofruamel.yaml libraryh2integrate/preprocess/wind_turbine_file_tools.pyexport_turbine_to_pysam_format(): method that takes in a turbine name and write a .yaml file of the turbine model parameters formatted for PySAM.WindpowerFlorisTurbineDefaults: config class to specify default turbine parameters that are needed for FLORIS turbine models but that don't likely exist in the turbine-models library.export_turbine_to_floris_format(): method that takes in a turbine name and write a .yaml file of the turbine model parameters formatted for FLORISh2integrate/preprocess/test/test_wind_turbine_file_tools.pytest_turbine_export_error: test that error is thrown if turbine name is invalidtest_pysam_turbine_export: tests thatexport_turbine_to_pysam_format()writes a file and that the file can be used with thePYSAMWindPlantPerformanceModeltest_floris_turbine_export: tests thatexport_turbine_to_floris_format()writes a file. Will be tested for compatibility with FLORIS once PR Added FLORIS wind plant model #372 is merged in.docs/misc_resources/turbine_models_library_preprocessing.ipynb: doc file that shows example usage of the turbine models preprocessing toolsAdditional supporting information
Test results, if applicable