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
Added script to generate and run multiple forecasts #82
base: main
Are you sure you want to change the base?
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #82 +/- ##
==========================================
+ Coverage 79.82% 79.94% +0.11%
==========================================
Files 12 12
Lines 352 354 +2
==========================================
+ Hits 281 283 +2
Misses 71 71 ☔ View full report in Codecov by Sentry. |
forecasts.csv
Outdated
@@ -0,0 +1,193 @@ | |||
power_wh |
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 would be best not upload the output from the forecasts. Also their appears to be only the "power_wh" column?
"latitude", | ||
"longitude", | ||
"capacity_kwp", | ||
"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.
Make sure that the init_time is saved i.e: the time at which the forecast was made. And also the time in which the forecast represents
|
||
def test_generate_forecasts(): | ||
# Generate 100 random PV IDs between 1 and 50000 | ||
pv_ids = [random.randint(1, 50000) for _ in range(100)] |
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.
How are you passing in the metadata such as latitude, longitude to be used in the function? I would create 2/3 dummy sites to use instead.
), "forecast.csv doesn't exist" | ||
|
||
# Load the output file | ||
df = pd.read_csv("quartz_solar_forecast/dataset/forecasts.csv") |
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 add some screen shots to the PR of this test passing? The current forecasts.csv doesn't exist in this location.
I revised the scripts. Now, a new csv is generated for each individual forecast, screenshot in the PR. Let me know if this is what you wanted. |
Hi @liamjdavis, I tested out the script and have attached images of the results. It looks like you are saving multiple copies of the same thing. A couple of changes to avoid this! |
Notice, the pv_id in all of the saved csvs is the same. |
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.
A couple of changes then it should be good to go! Thanks for you hard work on this!
|
||
|
||
# write to a new csv | ||
csv_df.to_csv( |
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.
Maybe take this csv saving outside of the for loop as its saving multiple copies of the same thing
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.
and call it something like, "forecast_multiple_sites_{INSERT FORECAST CREATION TIME}.csv
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.
please include the forecast creation time in the csv 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.
A couple of changes. Some updates should be made to the documentation. When I pulled the code and ran it locally, it could not find the dataset folder when following the instructions in the readme
|
||
3. Run | ||
```bash | ||
python generate_multiple_forecasts.py |
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.
This currently wont run, it needs to be python scripts/generate_multiple_forecasts.py
otherwise it can't find the dataset folder its trying to save the csvs into.
|
||
|
||
# write to a new csv | ||
csv_df.to_csv( |
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.
please include the forecast creation time in the csv name
Hi @liamjdavis, do you plan on making these changes? |
Pull Request
Description
Fixes #77
How Has This Been Tested?
The script's testing script is tests/test_generate_multiple_forecasts.py, which runs the program with dummy sites.
Example CSV created while testing
If your changes affect data processing, have you plotted any changes? i.e. have you done a quick sanity check?
Checklist: