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 Oct 29, 2024
1 parent 147c03f commit c161e59
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 7 deletions.
8 changes: 7 additions & 1 deletion scripts/build_demand_profiles.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,13 @@
import pypsa
import scipy.sparse as sparse
import xarray as xr
from _helpers import configure_logging, create_logger, read_csv_nafix, read_osm_config, BASE_DIR
from _helpers import (
BASE_DIR,
configure_logging,
create_logger,
read_csv_nafix,
read_osm_config,
)
from shapely.prepared import prep
from shapely.validation import make_valid

Expand Down
2 changes: 1 addition & 1 deletion scripts/build_renewable_profiles.py
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@
import pandas as pd
import progressbar as pgb
import xarray as xr
from _helpers import configure_logging, create_logger, BASE_DIR
from _helpers import BASE_DIR, configure_logging, create_logger
from add_electricity import load_powerplants
from dask.distributed import Client
from pypsa.geo import haversine
Expand Down
6 changes: 4 additions & 2 deletions scripts/download_osm_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
import shutil
from pathlib import Path

from _helpers import configure_logging, create_logger, read_osm_config, BASE_DIR
from _helpers import BASE_DIR, configure_logging, create_logger, read_osm_config
from earth_osm import eo

logger = create_logger(__name__)
Expand Down Expand Up @@ -99,7 +99,9 @@ def convert_iso_to_geofk(

run = snakemake.config.get("run", {})
RDIR = run["name"] + "/" if run.get("name") else ""
store_path_resources = Path.joinpath(Path(BASE_DIR), "resources", RDIR, "osm", "raw")
store_path_resources = Path.joinpath(
Path(BASE_DIR), "resources", RDIR, "osm", "raw"
)
store_path_data = Path.joinpath(Path(BASE_DIR), "data", "osm")
country_list = country_list_to_geofk(snakemake.params.countries)

Expand Down
7 changes: 5 additions & 2 deletions scripts/prepare_network.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@
import pandas as pd
import pypsa
import requests
from _helpers import configure_logging, create_logger, BASE_DIR
from _helpers import BASE_DIR, configure_logging, create_logger
from add_electricity import load_costs, update_transmission_costs

idx = pd.IndexSlice
Expand All @@ -89,7 +89,10 @@ def download_emission_data():
file.write(rq.content)
file_path = os.path.join(BASE_DIR, "data/co2.zip")
with ZipFile(file_path, "r") as zipObj:
zipObj.extract("v60_CO2_excl_short-cycle_org_C_1970_2018.xls", os.path.join(BASE_DIR, "data"))
zipObj.extract(
"v60_CO2_excl_short-cycle_org_C_1970_2018.xls",
os.path.join(BASE_DIR, "data"),
)
os.remove(file_path)
return "v60_CO2_excl_short-cycle_org_C_1970_2018.xls"
except:
Expand Down
2 changes: 1 addition & 1 deletion scripts/retrieve_databundle_light.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,11 +89,11 @@
import pandas as pd
import yaml
from _helpers import (
BASE_DIR,
configure_logging,
create_country_list,
create_logger,
progress_retrieve,
BASE_DIR
)
from google_drive_downloader import GoogleDriveDownloader as gdd
from tqdm import tqdm
Expand Down

0 comments on commit c161e59

Please sign in to comment.