[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
This commit is contained in:
parent
756a814c63
commit
74e9d56adb
@ -120,12 +120,14 @@ def calculate_annuity(n, r):
|
|||||||
else:
|
else:
|
||||||
return 1 / n
|
return 1 / n
|
||||||
|
|
||||||
|
|
||||||
def add_missing_carrier(n):
|
def add_missing_carrier(n):
|
||||||
components = [n.buses, n.generators, n.lines, n.links, n.storage_units, n.stores]
|
components = [n.buses, n.generators, n.lines, n.links, n.storage_units, n.stores]
|
||||||
for c in components:
|
for c in components:
|
||||||
missing_carrier = np.setdiff1d(c.carrier.unique(), n.carriers.index)
|
missing_carrier = np.setdiff1d(c.carrier.unique(), n.carriers.index)
|
||||||
n.madd("Carrier", missing_carrier)
|
n.madd("Carrier", missing_carrier)
|
||||||
|
|
||||||
|
|
||||||
def _add_missing_carriers_from_costs(n, costs, carriers):
|
def _add_missing_carriers_from_costs(n, costs, carriers):
|
||||||
missing_carriers = pd.Index(carriers).difference(n.carriers.index)
|
missing_carriers = pd.Index(carriers).difference(n.carriers.index)
|
||||||
if missing_carriers.empty:
|
if missing_carriers.empty:
|
||||||
|
@ -22,8 +22,8 @@ import numpy as np
|
|||||||
import pypsa
|
import pypsa
|
||||||
import xarray as xr
|
import xarray as xr
|
||||||
from _helpers import override_component_attrs, update_config_with_sector_opts
|
from _helpers import override_component_attrs, update_config_with_sector_opts
|
||||||
from prepare_sector_network import cluster_heat_buses, define_spatial, prepare_costs
|
|
||||||
from add_electricity import add_missing_carrier
|
from add_electricity import add_missing_carrier
|
||||||
|
from prepare_sector_network import cluster_heat_buses, define_spatial, prepare_costs
|
||||||
|
|
||||||
cc = coco.CountryConverter()
|
cc = coco.CountryConverter()
|
||||||
|
|
||||||
|
@ -57,8 +57,8 @@ import pandas as pd
|
|||||||
import pypsa
|
import pypsa
|
||||||
from _helpers import configure_logging
|
from _helpers import configure_logging
|
||||||
from add_electricity import (
|
from add_electricity import (
|
||||||
add_missing_carrier,
|
|
||||||
_add_missing_carriers_from_costs,
|
_add_missing_carriers_from_costs,
|
||||||
|
add_missing_carrier,
|
||||||
add_nice_carrier_names,
|
add_nice_carrier_names,
|
||||||
load_costs,
|
load_costs,
|
||||||
)
|
)
|
||||||
|
@ -22,6 +22,7 @@ from _helpers import (
|
|||||||
override_component_attrs,
|
override_component_attrs,
|
||||||
update_config_with_sector_opts,
|
update_config_with_sector_opts,
|
||||||
)
|
)
|
||||||
|
from add_electricity import add_missing_carrier
|
||||||
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
|
||||||
@ -29,7 +30,6 @@ 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 vresutils.costdata import annuity
|
from vresutils.costdata import annuity
|
||||||
from add_electricity import add_missing_carrier
|
|
||||||
|
|
||||||
logger = logging.getLogger(__name__)
|
logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user