From d32f2105cd367d62b321740daa983da2d545b525 Mon Sep 17 00:00:00 2001 From: Fabian Neumann Date: Fri, 8 Nov 2019 16:46:29 +0100 Subject: [PATCH] fix deprecation: logger.warn -> logger.warning --- scripts/base_network.py | 8 ++++---- scripts/cluster_network.py | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/scripts/base_network.py b/scripts/base_network.py index e65b1f29..ea3610a4 100644 --- a/scripts/base_network.py +++ b/scripts/base_network.py @@ -216,7 +216,7 @@ def _add_links_from_tyndp(buses, links): links_tyndp_located_b = links_tyndp["bus0"].notnull() & links_tyndp["bus1"].notnull() if not links_tyndp_located_b.all(): - logger.warn("Did not find connected buses for TYNDP links (skipping): " + ", ".join(links_tyndp.loc[~links_tyndp_located_b, "Name"])) + logger.warning("Did not find connected buses for TYNDP links (skipping): " + ", ".join(links_tyndp.loc[~links_tyndp_located_b, "Name"])) links_tyndp = links_tyndp.loc[links_tyndp_located_b] logger.info("Adding the following TYNDP links: " + ", ".join(links_tyndp["Name"])) @@ -451,7 +451,7 @@ def _replace_b2b_converter_at_country_border_by_link(n): if busattr is not None: comp, line = next(iter(G[b0][b1])) if comp != "Line": - logger.warn("Unable to replace B2B `{}` expected a Line, but found a {}" + logger.warning("Unable to replace B2B `{}` expected a Line, but found a {}" .format(i, comp)) continue @@ -485,7 +485,7 @@ def _adjust_capacities_of_under_construction_branches(n): elif lines_mode == 'remove': n.mremove("Line", n.lines.index[n.lines.under_construction]) elif lines_mode != 'keep': - logger.warn("Unrecognized configuration for `lines: under_construction` = `{}`. Keeping under construction lines.") + logger.warning("Unrecognized configuration for `lines: under_construction` = `{}`. Keeping under construction lines.") links_mode = snakemake.config['links'].get('under_construction', 'undef') if links_mode == 'zero': @@ -493,7 +493,7 @@ def _adjust_capacities_of_under_construction_branches(n): elif links_mode == 'remove': n.mremove("Link", n.links.index[n.links.under_construction]) elif links_mode != 'keep': - logger.warn("Unrecognized configuration for `links: under_construction` = `{}`. Keeping under construction links.") + logger.warning("Unrecognized configuration for `links: under_construction` = `{}`. Keeping under construction links.") if lines_mode == 'remove' or links_mode == 'remove': # We might need to remove further unconnected components diff --git a/scripts/cluster_network.py b/scripts/cluster_network.py index d01f17ec..e29f6f96 100644 --- a/scripts/cluster_network.py +++ b/scripts/cluster_network.py @@ -188,7 +188,7 @@ def distribute_clusters(n, n_clusters, focus_weights=None, solver_name=None): opt = po.SolverFactory(solver_name) if not opt.has_capability('quadratic_objective'): - logger.warn(f'The configured solver `{solver_name}` does not support quadratic objectives. Falling back to `ipopt`.') + logger.warning(f'The configured solver `{solver_name}` does not support quadratic objectives. Falling back to `ipopt`.') opt = po.SolverFactory('ipopt') results = opt.solve(m)