From b2867a1b80e6df2d16fe3c5ccb4e5b926880dcd3 Mon Sep 17 00:00:00 2001 From: shubh Date: Mon, 17 Mar 2025 12:18:04 +0100 Subject: [PATCH 1/2] hotfix in df --- codegreen_core/data/offline.py | 2 +- pyproject.toml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/codegreen_core/data/offline.py b/codegreen_core/data/offline.py index d55a371..b80b357 100644 --- a/codegreen_core/data/offline.py +++ b/codegreen_core/data/offline.py @@ -111,7 +111,7 @@ def _sync_offline_file(country): print("Files do not exist. Gathering new data.") try: data = _gather_energy_data(country, start_time, end_time) - if data : + if not data.empty : data.to_csv(csv_file_path, index=False) first_start_time1 = data.iloc[0]["startTime"] last_start_time1 = data.iloc[-1]["startTime"] diff --git a/pyproject.toml b/pyproject.toml index 5791065..5ba5ad5 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "codegreen_core" -version = "0.0.7" +version = "0.0.8" description = "This package helps you become aware of the carbon footprint of your computation" authors = ["Anne Hartebrodt ","Shubh Vardhan Jain "] readme = "README.md" From b20687ad9b89571b68aaeb6a7ddf9f7603328d4a Mon Sep 17 00:00:00 2001 From: shubh Date: Mon, 17 Mar 2025 12:33:48 +0100 Subject: [PATCH 2/2] test fixed --- tests/test_entsoe.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/test_entsoe.py b/tests/test_entsoe.py index bc5e732..b8a9d05 100644 --- a/tests/test_entsoe.py +++ b/tests/test_entsoe.py @@ -39,7 +39,7 @@ def test_actual_invalid_date_range3(self): def test_forecast_time_interval_60(self): - data = get_forecast_percent_renewable("DE",datetime.now()-timedelta(hours=2),datetime.now()+timedelta(hours=5)) + data = get_forecast_percent_renewable("FR",datetime.now()-timedelta(hours=2),datetime.now()+timedelta(hours=5)) assert data["time_interval"] == 60 and data["data_available"] == True