From 2680148b9e42ffe0e17007c9abfa991e7683aded Mon Sep 17 00:00:00 2001 From: peterdudfield Date: Tue, 3 Dec 2024 16:35:01 +0000 Subject: [PATCH 1/6] update to use sheffield_solar_static_data/table_data --- pvconsumer/solar_sheffield_passiv.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pvconsumer/solar_sheffield_passiv.py b/pvconsumer/solar_sheffield_passiv.py index c3df4fb..4dd5e52 100644 --- a/pvconsumer/solar_sheffield_passiv.py +++ b/pvconsumer/solar_sheffield_passiv.py @@ -37,9 +37,9 @@ def get_all_systems_from_solar_sheffield(pv_system_ids: List[int] = None) -> pd. """ logger.debug("Getting all pv systems") - full_url = f"{url}owner_system_params_rounded?user_id={user_id}&key={key}" + full_url = f"{url}sheffield_solar_static_data/table_data?user_id={user_id}&key={key}" response = requests.get(full_url) - assert response.status_code == 200, f"Cant get data from {url}owner_system_params_rounded" + assert response.status_code == 200, f"Cant get data from {url}sheffield_solar_static_data/table_data" data_df = raw_to_dataframe(response=response) From dfe7be78013def31111a9956d82b18a3fb9c0385 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Tue, 3 Dec 2024 16:37:48 +0000 Subject: [PATCH 2/6] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- pvconsumer/solar_sheffield_passiv.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pvconsumer/solar_sheffield_passiv.py b/pvconsumer/solar_sheffield_passiv.py index 4dd5e52..1cedfe0 100644 --- a/pvconsumer/solar_sheffield_passiv.py +++ b/pvconsumer/solar_sheffield_passiv.py @@ -39,7 +39,9 @@ def get_all_systems_from_solar_sheffield(pv_system_ids: List[int] = None) -> pd. full_url = f"{url}sheffield_solar_static_data/table_data?user_id={user_id}&key={key}" response = requests.get(full_url) - assert response.status_code == 200, f"Cant get data from {url}sheffield_solar_static_data/table_data" + assert ( + response.status_code == 200 + ), f"Cant get data from {url}sheffield_solar_static_data/table_data" data_df = raw_to_dataframe(response=response) From b9fc7c04e8e16c0e2830e058d533c3d799bda5b8 Mon Sep 17 00:00:00 2001 From: peterdudfield Date: Tue, 3 Dec 2024 16:37:52 +0000 Subject: [PATCH 3/6] lint --- pvconsumer/solar_sheffield_passiv.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pvconsumer/solar_sheffield_passiv.py b/pvconsumer/solar_sheffield_passiv.py index 4dd5e52..1cedfe0 100644 --- a/pvconsumer/solar_sheffield_passiv.py +++ b/pvconsumer/solar_sheffield_passiv.py @@ -39,7 +39,9 @@ def get_all_systems_from_solar_sheffield(pv_system_ids: List[int] = None) -> pd. full_url = f"{url}sheffield_solar_static_data/table_data?user_id={user_id}&key={key}" response = requests.get(full_url) - assert response.status_code == 200, f"Cant get data from {url}sheffield_solar_static_data/table_data" + assert ( + response.status_code == 200 + ), f"Cant get data from {url}sheffield_solar_static_data/table_data" data_df = raw_to_dataframe(response=response) From d97ca85e726ea2080e63a23a74b0b973feb30439 Mon Sep 17 00:00:00 2001 From: peterdudfield Date: Wed, 4 Dec 2024 13:49:33 +0000 Subject: [PATCH 4/6] move bk --- pvconsumer/solar_sheffield_passiv.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pvconsumer/solar_sheffield_passiv.py b/pvconsumer/solar_sheffield_passiv.py index 1cedfe0..4a35618 100644 --- a/pvconsumer/solar_sheffield_passiv.py +++ b/pvconsumer/solar_sheffield_passiv.py @@ -37,11 +37,11 @@ def get_all_systems_from_solar_sheffield(pv_system_ids: List[int] = None) -> pd. """ logger.debug("Getting all pv systems") - full_url = f"{url}sheffield_solar_static_data/table_data?user_id={user_id}&key={key}" + full_url = f"{url}owner_system_params_rounded?user_id={user_id}&key={key}" response = requests.get(full_url) assert ( response.status_code == 200 - ), f"Cant get data from {url}sheffield_solar_static_data/table_data" + ), f"Cant get data from {url}owner_system_params_rounded" data_df = raw_to_dataframe(response=response) From 64f9195646935427315c6f75777f7e31ebf12d10 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Wed, 4 Dec 2024 13:51:54 +0000 Subject: [PATCH 5/6] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- pvconsumer/solar_sheffield_passiv.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/pvconsumer/solar_sheffield_passiv.py b/pvconsumer/solar_sheffield_passiv.py index 4a35618..c3df4fb 100644 --- a/pvconsumer/solar_sheffield_passiv.py +++ b/pvconsumer/solar_sheffield_passiv.py @@ -39,9 +39,7 @@ def get_all_systems_from_solar_sheffield(pv_system_ids: List[int] = None) -> pd. full_url = f"{url}owner_system_params_rounded?user_id={user_id}&key={key}" response = requests.get(full_url) - assert ( - response.status_code == 200 - ), f"Cant get data from {url}owner_system_params_rounded" + assert response.status_code == 200, f"Cant get data from {url}owner_system_params_rounded" data_df = raw_to_dataframe(response=response) From 95a0cf005496e0c8569029ada63fc197b75dd209 Mon Sep 17 00:00:00 2001 From: peterdudfield Date: Wed, 4 Dec 2024 14:54:30 +0000 Subject: [PATCH 6/6] fix tests --- tests/intergration/test_app.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/intergration/test_app.py b/tests/intergration/test_app.py index dd099bf..2f1365b 100644 --- a/tests/intergration/test_app.py +++ b/tests/intergration/test_app.py @@ -67,4 +67,4 @@ def test_app_ss(db_connection, filename_solar_sheffield, sites): # make sure there valyes in the generation table too pv_yields = session.query(GenerationSQL).all() - assert len(pv_yields) >= 9 + assert len(pv_yields) >= 8