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 basic API #195

Merged
merged 12 commits into from
Jan 27, 2025
Merged

Add basic API #195

merged 12 commits into from
Jan 27, 2025

Conversation

crookp
Copy link
Contributor

@crookp crookp commented Dec 18, 2024

Create a basic API to allow LandBOSSE to be called more easily from other tools, and to return results as objects rather than writing to excel files.

The new LandBOSSERunner class recreates the existing function calls for running LandBOSSE, but without writing to Excel.
The LandBOSSEResult class is a simple container for the results that LandBOSSE generates.

The input to the new API is now a yaml file, but it still requires an excel input file as well. Most of the contents of that yaml file are basic inputs (e.g. number of turbines), however one entry is a filepath to an excel sheet containing additional tabular input data. Rather than having all the inputs in yaml file(s), the inputs are split between a yaml file and an excel file. The idea is, the yaml file contains those inputs which are changed regularly when iterating on parameter values, whereas the excel file contains structured input tables that are unlikely to be modified with any regularity.

Also includes some refactoring of existing LandBOSSE modules to avoid deprecation warnings and avoid repeated use of pd.concat to create dataframes row by row.

Currently the LandBOSSERunner class requires a weather dataframe input with wind speed timeseries data to calculate wind delays. If running LandBOSSE using the old input method, this data must be in the input excel file. It would be possible to have the LandBOSSERunner class download Wind Toolkit data if no weather dataframe is provided, but this is not currently implemented (and would require an API, as well as inputs on the location and time period of the weather data).

"""
NUM_BLADES = 3

component_param = project_parameters.pop("component")

Choose a reason for hiding this comment

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

Should the data be being removed from proejct_parameters? Even though this is happening inside this method, it will be directly modifying whatever is passed to project_parameters and want to be sure that's the intended behavior.

@crookp crookp marked this pull request as ready for review January 24, 2025 22:18
Copy link

@RHammond2 RHammond2 left a comment

Choose a reason for hiding this comment

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

Thanks for getting this all squared away, this should be good to go now!

@crookp crookp merged commit 872e555 into WISDEM:develop Jan 27, 2025
0 of 12 checks passed
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