use pypsa.clustering.spatial namespace
This commit is contained in:
parent
329349d794
commit
2f3005e555
@ -283,7 +283,7 @@ def get_aggregation_strategies(aggregation_strategies):
|
|||||||
# when custom values are specified in the config.
|
# when custom values are specified in the config.
|
||||||
|
|
||||||
import numpy as np
|
import numpy as np
|
||||||
from pypsa.networkclustering import _make_consense
|
from pypsa.clustering.spatial import _make_consense
|
||||||
|
|
||||||
bus_strategies = dict(country=_make_consense("Bus", "country"))
|
bus_strategies = dict(country=_make_consense("Bus", "country"))
|
||||||
bus_strategies.update(aggregation_strategies.get("buses", {}))
|
bus_strategies.update(aggregation_strategies.get("buses", {}))
|
||||||
|
@ -89,7 +89,7 @@ Description
|
|||||||
**Is it possible to run the model without the** ``simplify_network`` **rule?**
|
**Is it possible to run the model without the** ``simplify_network`` **rule?**
|
||||||
|
|
||||||
No, the network clustering methods in the PyPSA module
|
No, the network clustering methods in the PyPSA module
|
||||||
`pypsa.networkclustering <https://github.com/PyPSA/PyPSA/blob/master/pypsa/networkclustering.py>`_
|
`pypsa.clustering.spatial <https://github.com/PyPSA/PyPSA/blob/master/pypsa/clustering/spatial.py>`_
|
||||||
do not work reliably with multiple voltage levels and transformers.
|
do not work reliably with multiple voltage levels and transformers.
|
||||||
|
|
||||||
.. tip::
|
.. tip::
|
||||||
@ -134,7 +134,7 @@ import pyomo.environ as po
|
|||||||
import pypsa
|
import pypsa
|
||||||
import seaborn as sns
|
import seaborn as sns
|
||||||
from _helpers import configure_logging, get_aggregation_strategies, update_p_nom_max
|
from _helpers import configure_logging, get_aggregation_strategies, update_p_nom_max
|
||||||
from pypsa.networkclustering import (
|
from pypsa.clustering.spatial import (
|
||||||
busmap_by_greedy_modularity,
|
busmap_by_greedy_modularity,
|
||||||
busmap_by_hac,
|
busmap_by_hac,
|
||||||
busmap_by_kmeans,
|
busmap_by_kmeans,
|
||||||
@ -484,7 +484,7 @@ if __name__ == "__main__":
|
|||||||
# Fast-path if no clustering is necessary
|
# Fast-path if no clustering is necessary
|
||||||
busmap = n.buses.index.to_series()
|
busmap = n.buses.index.to_series()
|
||||||
linemap = n.lines.index.to_series()
|
linemap = n.lines.index.to_series()
|
||||||
clustering = pypsa.networkclustering.Clustering(
|
clustering = pypsa.clustering.spatial.Clustering(
|
||||||
n, busmap, linemap, linemap, pd.Series(dtype="O")
|
n, busmap, linemap, linemap, pd.Series(dtype="O")
|
||||||
)
|
)
|
||||||
else:
|
else:
|
||||||
|
@ -95,13 +95,13 @@ import scipy as sp
|
|||||||
from _helpers import configure_logging, get_aggregation_strategies, update_p_nom_max
|
from _helpers import configure_logging, get_aggregation_strategies, update_p_nom_max
|
||||||
from add_electricity import load_costs
|
from add_electricity import load_costs
|
||||||
from cluster_network import cluster_regions, clustering_for_n_clusters
|
from cluster_network import cluster_regions, clustering_for_n_clusters
|
||||||
from pypsa.io import import_components_from_dataframe, import_series_from_dataframe
|
from pypsa.clustering.spatial import (
|
||||||
from pypsa.networkclustering import (
|
|
||||||
aggregategenerators,
|
aggregategenerators,
|
||||||
aggregateoneport,
|
aggregateoneport,
|
||||||
busmap_by_stubs,
|
busmap_by_stubs,
|
||||||
get_clustering_from_busmap,
|
get_clustering_from_busmap,
|
||||||
)
|
)
|
||||||
|
from pypsa.io import import_components_from_dataframe, import_series_from_dataframe
|
||||||
from scipy.sparse.csgraph import connected_components, dijkstra
|
from scipy.sparse.csgraph import connected_components, dijkstra
|
||||||
|
|
||||||
logger = logging.getLogger(__name__)
|
logger = logging.getLogger(__name__)
|
||||||
|
Loading…
Reference in New Issue
Block a user