Skip to content

Commit cd2b335

Browse files
committed
fix: pre-commit
1 parent 0e27284 commit cd2b335

File tree

3 files changed

+15
-18
lines changed

3 files changed

+15
-18
lines changed

.pre-commit-config.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1+
exclude: "^LICENSES"
2+
13
ci:
24
autoupdate_schedule: quarterly
35

4-
exclude: "^LICENSES"
5-
66
repos:
77
- repo: https://github.com/pre-commit/pre-commit-hooks
88
rev: v5.0.0

scripts/pypsa-de/add_district_heating_subnodes.py

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,6 @@
11
import logging
2-
3-
logger = logging.getLogger(__name__)
4-
52
import os
63
import sys
7-
from typing import Dict, List
84

95
import geopandas as gpd
106
import pandas as pd
@@ -20,6 +16,8 @@
2016
)
2117
from scripts.prepare_network import maybe_adjust_costs_and_potentials
2218

19+
logger = logging.getLogger(__name__)
20+
2321

2422
def add_buses(n: pypsa.Network, subnode: pd.Series, name: str) -> None:
2523
"""
@@ -336,11 +334,11 @@ def add_links(
336334
name: str,
337335
cop: xr.DataArray,
338336
direct_heat_source_utilisation_profile: xr.DataArray,
339-
heat_pump_sources: List[str],
340-
direct_utilisation_heat_sources: List[str],
337+
heat_pump_sources: list[str],
338+
direct_utilisation_heat_sources: list[str],
341339
time_dep_hp_cop: bool,
342-
limited_heat_sources: List[str],
343-
heat_source_potentials: Dict[str, str],
340+
limited_heat_sources: list[str],
341+
heat_source_potentials: dict[str, str],
344342
) -> None:
345343
"""
346344
Add links for a district heating subnode.
@@ -479,11 +477,11 @@ def add_subnodes(
479477
head: int = 40,
480478
dynamic_ptes_capacity: bool = False,
481479
limit_ptes_potential_mother_nodes: bool = True,
482-
heat_pump_sources: List[str] = None,
483-
direct_utilisation_heat_sources: List[str] = None,
480+
heat_pump_sources: list[str] = None,
481+
direct_utilisation_heat_sources: list[str] = None,
484482
time_dep_hp_cop: bool = False,
485-
limited_heat_sources: List[str] = None,
486-
heat_source_potentials: Dict[str, str] = None,
483+
limited_heat_sources: list[str] = None,
484+
heat_source_potentials: dict[str, str] = None,
487485
output_path: str = None,
488486
) -> None:
489487
"""

scripts/pypsa-de/prepare_district_heating_subnodes.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
11
import logging
2-
3-
logger = logging.getLogger(__name__)
4-
52
import os
63
import sys
74
import tempfile
@@ -25,6 +22,8 @@
2522
update_config_from_wildcards,
2623
)
2724

25+
logger = logging.getLogger(__name__)
26+
2827

2928
def load_census_data(census_path: str) -> gpd.GeoDataFrame:
3029
"""
@@ -126,7 +125,7 @@ def get_chunked_raster(
126125
def cleanup(temp_path: str) -> None:
127126
try:
128127
os.unlink(temp_path)
129-
except:
128+
except OSError:
130129
pass
131130

132131
weakref.finalize(dataset, cleanup, temp_path)

0 commit comments

Comments
 (0)