cluster_gas_network: generalise so it can be used elsewhere
This commit is contained in:
parent
3750cc5350
commit
a2315c289e
@ -75,10 +75,10 @@ def build_clustered_gas_network(df, bus_regions, length_factor=1.25):
|
||||
return df
|
||||
|
||||
|
||||
def reindex_pipes(df):
|
||||
def reindex_pipes(df, prefix="gas pipeline"):
|
||||
def make_index(x):
|
||||
connector = " <-> " if x.bidirectional else " -> "
|
||||
return "gas pipeline " + x.bus0 + connector + x.bus1
|
||||
return prefix + " " + x.bus0 + connector + x.bus1
|
||||
|
||||
df.index = df.apply(make_index, axis=1)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user