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
feat: add generate_forecasts script #99
base: main
Are you sure you want to change the base?
Conversation
This commit introduces a new script named generate_forecasts.py that generates solar power forecasts for multiple photovoltaic (PV) sites. The script contains a function called generate_forecasts that takes a list of site information tuples and a forecast date as input. For each site, it creates a PVSite object, runs the forecast using the run_forecast function from the quartz_solar_forecast module, and generates a DataFrame containing the site's latitude, longitude, capacity, and power forecast values. The script then concatenates all the site DataFrames into a single DataFrame and returns it. The resulting DataFrame has columns for each site's latitude, longitude, capacity, and power forecast, with a column name in the format "{pv_id} Power". The index of the DataFrame is set to the forecast dates. The script also includes an example usage section that demonstrates how to call the generate_forecasts function with sample site information and a forecast date. The generated forecasts are then saved to a CSV file named pv_forecasts.csv. This script can be used to generate solar power forecasts for multiple PV sites, which can be useful for various applications, such as energy management, grid integration, and financial analysis.
Hi @JadeVexo! Thanks for working on this. |
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! Could you also change the name of the script to mention that this is for multiple sites? Then should be good to go.
scripts/generate_forecasts.py
Outdated
# Add more sites as needed, with format (pv_id, latitude, longitude, capacity) | ||
] | ||
forecast_date = "2023-11-01" # Forecast date | ||
output_file = "pv_forecasts.csv" # Output file name |
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 you change the output file name to include the forecast_date, and also mention that is for multiple sites. Maybe "multiple_pv_forecasts_{forecast_date}"?
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.
Ok. Have had my finals this week. Will have the changes pushed by tonight
I have made the changes as requested. Anything else to be done? |
Could the output file include the forecast data? ("multiple_pv_forecasts_{forecast_date}"?) |
Then happy to merge |
Pull Request
Description
This commit introduces a new script named generate_forecasts.py that generates solar power forecasts for multiple photovoltaic (PV) sites.
The script contains a function called generate_forecasts that takes a list of site information tuples and a forecast date as input. For each site, it creates a PVSite object, runs the forecast using the run_forecast function from the quartz_solar_forecast module, and generates a DataFrame containing the site's latitude, longitude, capacity, and power forecast values.
The script then concatenates all the site DataFrames into a single DataFrame and returns it. The resulting DataFrame has columns for each site's latitude, longitude, capacity, and power forecast, with a column name in the format "{pv_id} Power". The index of the DataFrame is set to the forecast dates.
The script also includes an example usage section that demonstrates how to call the generate_forecasts function with sample site information and a forecast date. The generated forecasts are then saved to a CSV file named pv_forecasts.csv.
This script can be used to generate solar power forecasts for multiple PV sites.
How Has This Been Tested?
Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce.
Please also list any relevant details for your test configuration
If your changes affect data processing, have you plotted any changes? i.e. have you done a quick sanity check?
Checklist: