base_network: Fix _add_links_from_tyndp if there are none left (fixes #5)

This commit is contained in:
Jonas Hoersch 2019-02-12 16:38:35 +01:00
parent 15e986a0ec
commit 1b6fe5be80

View File

@ -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))