From 98f9dd3ad0b2fded3d2f21c20bbc55fd5a16afa0 Mon Sep 17 00:00:00 2001 From: Sumana Sree Angajala <110307215+sumana-2705@users.noreply.github.com> Date: Fri, 25 Oct 2024 19:28:33 +0530 Subject: [PATCH] simplified the steps in Readme file (#208) * simplified the steps in Readme file Signed-off-by: sumana sree * Copied forecast_csv.py file into scripts directory Signed-off-by: sumana sree * added the specific code to the forecast_csv.py file Signed-off-by: sumana sree * removed lines from quartz_solar_forecast/utils/forecast_csv.py files Signed-off-by: sumana sree --------- Signed-off-by: sumana sree --- README.md | 10 ++-------- quartz_solar_forecast/utils/forecast_csv.py | 12 ------------ scripts/forecast_csv.py | 11 +++++++++++ 3 files changed, 13 insertions(+), 20 deletions(-) create mode 100644 scripts/forecast_csv.py diff --git a/README.md b/README.md index b1fd94ae..11402ff2 100644 --- a/README.md +++ b/README.md @@ -35,16 +35,10 @@ A colab notebook providing some examples can be found [here](https://colab.resea To generate solar forecasts and save them into a CSV file, follow these steps: -1. Navigate to the scripts directory +- Run the forecast_csv.py script with desired inputs ```bash -cd scripts -``` - -2. Run the forecast_csv.py script with desired inputs - -```bash -python forecast_csv.py +python scripts/forecast_csv.py ``` Replace the --init_time_freq, --start_datetime, --end_datetime, and --site_name with your desired forecast initialization frequency (in hours), start datetime, end datetime, and the name of the forecast or site, respectively. diff --git a/quartz_solar_forecast/utils/forecast_csv.py b/quartz_solar_forecast/utils/forecast_csv.py index 7bfdf1be..8d0c28e6 100644 --- a/quartz_solar_forecast/utils/forecast_csv.py +++ b/quartz_solar_forecast/utils/forecast_csv.py @@ -68,18 +68,6 @@ def write_out_forecasts(init_time_freq, start_datetime, end_datetime, site_name, all_forecasts.to_csv(output_file_path, index=False) print(f"Forecasts saved to {output_file_path}") -if __name__ == "__main__": - # please change the site name, start_datetime and end_datetime, latitude, longitude and capacity_kwp as per your requirement - write_out_forecasts( - init_time_freq=6, - start_datetime="2024-03-10 00:00:00", - end_datetime="2024-03-11 00:00:00", - site_name="Test", - latitude=51.75, - longitude=-1.25, - capacity_kwp=1.25 - ) - class TestGenerateForecast(unittest.TestCase): def setUp(self): self.site_name = "TestCase" diff --git a/scripts/forecast_csv.py b/scripts/forecast_csv.py new file mode 100644 index 00000000..4d10fa13 --- /dev/null +++ b/scripts/forecast_csv.py @@ -0,0 +1,11 @@ +if __name__ == "__main__": + # please change the site name, start_datetime and end_datetime, latitude, longitude and capacity_kwp as per your requirement + write_out_forecasts( + init_time_freq=6, + start_datetime="2024-03-10 00:00:00", + end_datetime="2024-03-11 00:00:00", + site_name="Test", + latitude=51.75, + longitude=-1.25, + capacity_kwp=1.25 + ) \ No newline at end of file