From 51edb5058ede7bf86ce73132d76c833b3c9c318b Mon Sep 17 00:00:00 2001 From: Rachel Tipton Date: Wed, 25 Oct 2023 14:41:58 +0200 Subject: [PATCH 1/2] update panda time converter --- pvoutput/pvoutput.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pvoutput/pvoutput.py b/pvoutput/pvoutput.py index 0e4ea35..1c79e42 100644 --- a/pvoutput/pvoutput.py +++ b/pvoutput/pvoutput.py @@ -1049,7 +1049,7 @@ def _set_rate_limit_params(self, headers): setattr(self, param_name, header_value) self.rate_limit_reset_time = pd.Timestamp.utcfromtimestamp(self.rate_limit_reset_time) - self.rate_limit_reset_time = self.rate_limit_reset_time.tz_localize("utc") + self.rate_limit_reset_time = self.rate_limit_reset_time.tz_convert("utc") _LOG.debug("%s", self.rate_limit_info()) From 0aa33a5acca0ff48ef2ca5c49a14050000ae7e9d Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Wed, 25 Oct 2023 12:49:49 +0000 Subject: [PATCH 2/2] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- pvoutput/mapscraper.py | 1 + pvoutput/pvoutput.py | 2 +- scripts/fetch_pv_timeseries.py | 11 ++++++----- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/pvoutput/mapscraper.py b/pvoutput/mapscraper.py index c64f1f1..9c0c8d1 100644 --- a/pvoutput/mapscraper.py +++ b/pvoutput/mapscraper.py @@ -350,6 +350,7 @@ def clean_soup(soup): """Function to clean scraped soup object. Note that the downloaded soup could change over time. + Args: soup: bs4.BeautifulSoup diff --git a/pvoutput/pvoutput.py b/pvoutput/pvoutput.py index 1c79e42..5ea89cd 100644 --- a/pvoutput/pvoutput.py +++ b/pvoutput/pvoutput.py @@ -924,7 +924,7 @@ def _download_multiple_worker( ) else: total_rows += len(timeseries) - _LOG.info(f'Adding timezone {timezone} to {total_rows} rows') + _LOG.info(f"Adding timezone {timezone} to {total_rows} rows") timeseries = timeseries.tz_localize(timezone) _LOG.info( "system_id: %d: %d rows retrieved: %s to %s", diff --git a/scripts/fetch_pv_timeseries.py b/scripts/fetch_pv_timeseries.py index ac7d4a6..39b6eda 100644 --- a/scripts/fetch_pv_timeseries.py +++ b/scripts/fetch_pv_timeseries.py @@ -21,14 +21,15 @@ or create and use a ~/.pvoutput.yml file as described in the PVOutput library documentation """ -from pvoutput import * - -import click as cl import datetime as dt +import logging +import pathlib import sys + +import click as cl import pandas as pd -import pathlib -import logging + +from pvoutput import * @cl.command()