Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Jul 17, 2023
1 parent 735eb15 commit 400d7dd
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 13 deletions.
2 changes: 1 addition & 1 deletion pvoutput/mapscraper.py
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,6 @@ def _convert_metadata_cols_to_numeric(df: pd.DataFrame) -> pd.DataFrame:


def _process_output_col(soup: BeautifulSoup, index: Optional[Iterable] = None) -> pd.Series:

# get all data
outputs_col = soup.find_all(text=re.compile(r"\d Days"))

Expand Down Expand Up @@ -350,6 +349,7 @@ def clean_soup(soup):
"""Function to clean scraped soup object.
Note that the downloaded soup could change over time.
Args:
soup: bs4.BeautifulSoup
Expand Down
1 change: 0 additions & 1 deletion pvoutput/prcoess.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ def process_system_status(pv_system_status_text, date) -> pd.DataFrame:
).sort_index()

except Exception as e:

# this can happen if there is only one data value and it doesnt contain all 5 columns.
# if there is many rows of data, then it seems fine
if pv_system_status_text.count(";") != 0:
Expand Down
4 changes: 1 addition & 3 deletions pvoutput/pvoutput.py
Original file line number Diff line number Diff line change
Expand Up @@ -340,7 +340,6 @@ def get_system_status(

pv_system_status = []
for pv_system_status_text in pv_systems_status_text:

try:
one_pv_system_status = process_system_status(
pv_system_status_text=pv_system_status_text, date=date
Expand Down Expand Up @@ -924,7 +923,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",
Expand Down Expand Up @@ -1193,7 +1192,6 @@ def check_pv_system_status(pv_system_status: pd.DataFrame, requested_date: date)
def _append_missing_date_range(
output_filename, pv_system_id, missing_start_date, missing_end_date, datetime_of_api_request
):

data = {
"missing_start_date_PV_localtime": pd.Timestamp(missing_start_date),
"missing_end_date_PV_localtime": pd.Timestamp(missing_end_date),
Expand Down
11 changes: 6 additions & 5 deletions scripts/fetch_pv_timeseries.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
2 changes: 0 additions & 2 deletions scripts/scrape_country_codes.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@


def get_country_name(manager: urllib3.PoolManager, code: int) -> str:

country_url = f"{COUNTRY_PAGES}{code}"

response = manager.request("GET", country_url)
Expand All @@ -25,7 +24,6 @@ def get_country_name(manager: urllib3.PoolManager, code: int) -> str:


def get_all_countries() -> None:

output_dict = {}

manager = urllib3.PoolManager()
Expand Down
1 change: 0 additions & 1 deletion tests/test_process.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ def test_process_system_status_2():


def test_process_system_status_none():

one_status = process_system_status(
pv_system_status_text="no status found", date=date(2022, 1, 1)
)
Expand Down

0 comments on commit 400d7dd

Please sign in to comment.