Closed euronion closed 5 months ago
Very interesting. But in fact, this is not a bug, because the un-aggregated lines of elec.nc
that build line 3
in elec_s_128.nc
already have the attributes num_paralell = 0
. This is because they are all under_construction=True
.
If you don't believe me, you can check:
linemap = pd.read_csv("resources/linemap_elec_s_128.csv", dtype={"Line": str, "name": str}, index_col=0)
aggregated_lines = linemap.query("name == '3'").index
n_full = pypsa.Network("networks/elec.nc")
n_full.lines.loc[aggregated_lines][["under_construction", "num_parallel"]]
For my test-run, the array aggregated_lines
has only one index (14988
), and the respective line in elec.nc
has the following attributes:
under_construction True
num_parallel 0.0
Name: 14988, dtype: object
Thus, line 3
also has num_parallel=0
.
In fact, my aggregated test-network with 128
nodes had another line in Germany (Line 59
) with num_parallel=0
. The same statement is true in this case. Here, the array aggregated_lines
again consists of a single index (3575
), and the respective line 3575
in elec.nc
has the attributes
under_construction True
num_parallel 0.0
Name: 3575, dtype: object
We might rather think about the model assumptions if it makes sense to assign some artificial num_parallel
value to lines that are under construction, for example based on their intended voltage level.
Interesting! This information is not really preserved in the aggregated links, right? So difficult to understand? Can we do something about it?
Looking at it from a different angle:
If I set
config["lines"]["under_construction"] = "remove"
instead of zero
the line should be gone, right?
You are right, the under_construction
tag is being removed after simplify_network
, see: https://github.com/PyPSA/pypsa-eur/blob/master/scripts/simplify_network.py#L587-L594.
I never tried removing lines using the config, so I don't know. I usually try one of
n.lines = n.lines.query("under_construction == False")
n.lines = n.lines[~n.lines.under_construction]
...
Checklist
master
branch or the latest release. Please indicate.pypsa-eur
environment. Update viaconda env update -f envs/environment.yaml
.Describe the Bug
Line number "3" after clustering (
clusters=128
) hasnum_parallel = 0
which does not make any sense. Where does the line with this unrealistic value come from?Here's the line in question: