Skip to content

Commit

Permalink
rename cluster_interest_area
Browse files Browse the repository at this point in the history
  • Loading branch information
CarlosEpia committed Apr 22, 2024
1 parent 2ff73a1 commit 0cb1fa6
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 14 deletions.
15 changes: 4 additions & 11 deletions etrago/appl.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,9 +117,9 @@
"network_clustering": {
"active": True, # choose if clustering is activated
"method": "kmedoids-dijkstra", # choose clustering method: kmeans or kmedoids-dijkstra
"n_clusters_AC": 30, # total number of resulting AC nodes (DE+foreign)
"n_clusters_AC": 30, # total number of resulting AC nodes (DE+foreign-interest_area)
"cluster_foreign_AC": False, # take foreign AC buses into account, True or False
"cluster_interest_area": False, # False or number of buses.
"n_cluster_interest_area": False, # False or number of buses.
"method_gas": "kmedoids-dijkstra", # choose clustering method: kmeans or kmedoids-dijkstra
"n_clusters_gas": 14, # total number of resulting CH4 nodes (DE+foreign)
"cluster_foreign_gas": False, # take foreign CH4 buses into account, True or False
Expand Down Expand Up @@ -454,15 +454,8 @@ def run_etrago(args, json_path):
as well and included in number of clusters specified through
``'n_clusters_AC'``.
Default: False.
* "interest_area": False, list, string
Area of especial interest that will be not clustered. It is by
default set to false. When an interest_area is provided, the given
value for n_clusters_AC will mean the total of AC buses outside the
area.The area can be provided in two ways: list of
nuts names e.G. ["Cuxhaven", "Bremerhaven", "Bremen"] or a string
with a path to a shape file (.shp).
Default: False.
* "cluster_interest_area": False, int
* "n_cluster_interest_area": False, int
Number of buses to cluster all the electrical buses in the area
of interest. Method provided in the arg "method" is used. If
it is set to False, the area of interest is not clustered.
Expand Down
6 changes: 3 additions & 3 deletions etrago/cluster/electrical.py
Original file line number Diff line number Diff line change
Expand Up @@ -936,7 +936,7 @@ def include_busmap_area(etrago, busmap, medoid_idx, network_area, weight_area):

if not etrago.args["interest_area"]:
return busmap, medoid_idx
if not args["cluster_interest_area"]:
if not args["n_cluster_interest_area"]:
for bus in network_area.buses.index:
busmap[bus] = bus
return busmap, medoid_idx
Expand All @@ -946,7 +946,7 @@ def include_busmap_area(etrago, busmap, medoid_idx, network_area, weight_area):
etrago,
network_area,
weight_area,
args["cluster_interest_area"],
args["n_cluster_interest_area"],
)
busmap_area = (
busmap_area.astype(int) + busmap.apply(int).max() + 1
Expand All @@ -958,7 +958,7 @@ def include_busmap_area(etrago, busmap, medoid_idx, network_area, weight_area):
network_area.buses,
network_area.lines,
weight_area,
args["cluster_interest_area"],
args["n_cluster_interest_area"],
)

medoid_idx_area.index = (
Expand Down

0 comments on commit 0cb1fa6

Please sign in to comment.