From 1b6fe5be804ff95f1340bf5c7621360b87230832 Mon Sep 17 00:00:00 2001 From: Jonas Hoersch Date: Tue, 12 Feb 2019 16:38:35 +0100 Subject: [PATCH] base_network: Fix _add_links_from_tyndp if there are none left (fixes #5) --- scripts/base_network.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/scripts/base_network.py b/scripts/base_network.py index 5ee33711..f8c79edc 100644 --- a/scripts/base_network.py +++ b/scripts/base_network.py @@ -117,7 +117,10 @@ def _add_links_from_tyndp(buses, links): if not is_within_covered_countries_b.all(): logger.info("TYNDP links outside of the covered area (skipping): " + ", ".join(links_tyndp.loc[~ is_within_covered_countries_b, "Name"])) - links_tyndp = links_tyndp.loc[is_within_covered_countries_b] + + links_tyndp = links_tyndp.loc[is_within_covered_countries_b] + if links_tyndp.empty: + return buses, links has_replaces_b = links_tyndp.replaces.notnull() oids = dict(Bus=_get_oid(buses), Link=_get_oid(links))