[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
This commit is contained in:
parent
e91068196b
commit
b21965a986
@ -85,17 +85,17 @@ It further adds extendable ``generators`` with **zero** capacity for
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
import logging
|
import logging
|
||||||
|
from itertools import product
|
||||||
|
|
||||||
import geopandas as gpd
|
import geopandas as gpd
|
||||||
import numpy as np
|
import numpy as np
|
||||||
import pandas as pd
|
import pandas as pd
|
||||||
import powerplantmatching as pm
|
import powerplantmatching as pm
|
||||||
import pypsa
|
import pypsa
|
||||||
|
import scipy.sparse as sparse
|
||||||
import xarray as xr
|
import xarray as xr
|
||||||
from _helpers import configure_logging, update_p_nom_max
|
from _helpers import configure_logging, update_p_nom_max
|
||||||
from powerplantmatching.export import map_country_bus
|
from powerplantmatching.export import map_country_bus
|
||||||
from itertools import product
|
|
||||||
import scipy.sparse as sparse
|
|
||||||
from shapely.prepared import prep
|
from shapely.prepared import prep
|
||||||
|
|
||||||
idx = pd.IndexSlice
|
idx = pd.IndexSlice
|
||||||
@ -217,6 +217,7 @@ def load_powerplants(ppl_fn):
|
|||||||
.replace({"carrier": carrier_dict})
|
.replace({"carrier": carrier_dict})
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
def Shapes2Shapes(orig, dest):
|
def Shapes2Shapes(orig, dest):
|
||||||
"""
|
"""
|
||||||
Adopted from vresutils.transfer.Shapes2Shapes()
|
Adopted from vresutils.transfer.Shapes2Shapes()
|
||||||
@ -224,10 +225,10 @@ def Shapes2Shapes(orig, dest):
|
|||||||
orig_prepped = list(map(prep, orig))
|
orig_prepped = list(map(prep, orig))
|
||||||
transfer = sparse.lil_matrix((len(dest), len(orig)), dtype=float)
|
transfer = sparse.lil_matrix((len(dest), len(orig)), dtype=float)
|
||||||
|
|
||||||
for i,j in product(range(len(dest)), range(len(orig))):
|
for i, j in product(range(len(dest)), range(len(orig))):
|
||||||
if orig_prepped[j].intersects(dest[i]):
|
if orig_prepped[j].intersects(dest[i]):
|
||||||
area = orig[j].intersection(dest[i]).area
|
area = orig[j].intersection(dest[i]).area
|
||||||
transfer[i,j] = area/dest[i].area
|
transfer[i, j] = area / dest[i].area
|
||||||
|
|
||||||
return transfer
|
return transfer
|
||||||
|
|
||||||
|
@ -22,13 +22,13 @@ from _helpers import (
|
|||||||
override_component_attrs,
|
override_component_attrs,
|
||||||
update_config_with_sector_opts,
|
update_config_with_sector_opts,
|
||||||
)
|
)
|
||||||
|
from add_electricity import calculate_annuity
|
||||||
from build_energy_totals import build_co2_totals, build_eea_co2, build_eurostat_co2
|
from build_energy_totals import build_co2_totals, build_eea_co2, build_eurostat_co2
|
||||||
from networkx.algorithms import complement
|
from networkx.algorithms import complement
|
||||||
from networkx.algorithms.connectivity.edge_augmentation import k_edge_augmentation
|
from networkx.algorithms.connectivity.edge_augmentation import k_edge_augmentation
|
||||||
from pypsa.geo import haversine_pts
|
from pypsa.geo import haversine_pts
|
||||||
from pypsa.io import import_components_from_dataframe
|
from pypsa.io import import_components_from_dataframe
|
||||||
from scipy.stats import beta
|
from scipy.stats import beta
|
||||||
from add_electricity import calculate_annuity
|
|
||||||
|
|
||||||
logger = logging.getLogger(__name__)
|
logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user