From 5df631530aa65a72b00cc3e504b74807f7618f48 Mon Sep 17 00:00:00 2001 From: rbolgaryn Date: Fri, 13 Dec 2019 15:14:25 +0100 Subject: [PATCH] small changes to address warnings --- pandapower/auxiliary.py | 2 +- pandapower/create.py | 8 ++++---- pandapower/std_types.py | 2 +- pandapower/test/api/test_convert_format.py | 3 +-- pandapower/test/api/test_file_io.py | 2 +- pandapower/test/api/test_std_types.py | 3 +-- pandapower/toolbox.py | 3 ++- 7 files changed, 11 insertions(+), 12 deletions(-) diff --git a/pandapower/auxiliary.py b/pandapower/auxiliary.py index b1e843eec..77b96dbfe 100644 --- a/pandapower/auxiliary.py +++ b/pandapower/auxiliary.py @@ -26,7 +26,7 @@ # THE SOFTWARE. # (https://github.com/bcj/AttrDict/blob/master/LICENSE.txt) -from collections import MutableMapping +from collections.abc import MutableMapping import copy import numpy as np diff --git a/pandapower/create.py b/pandapower/create.py index 9f25e7006..fd49bfe31 100644 --- a/pandapower/create.py +++ b/pandapower/create.py @@ -1271,7 +1271,7 @@ def create_ext_grid(net, bus, vm_pu=1.0, va_degree=0., name=None, in_service=Tru **min_q_mvar** (float, NaN) - Minimum reactive power injection. Only respected for OPF - \* only considered in loadflow if calculate_voltage_angles = True + ** only considered in loadflow if calculate_voltage_angles = True EXAMPLE: create_ext_grid(net, 1, voltage = 1.03) @@ -1864,7 +1864,7 @@ def create_transformer_from_parameters(net, hv_bus, lv_bus, sn_mva, vn_hv_kv, vn **df** (float) - derating factor: maximal current of transformer in relation to nominal \ current of transformer (from 0 to 1) - \* only considered in loadflow if calculate_voltage_angles = True + ** only considered in loadflow if calculate_voltage_angles = True OUTPUT: **index** (int) - The unique ID of the created transformer @@ -2112,8 +2112,8 @@ def create_transformer3w_from_parameters(net, hv_bus, mv_bus, lv_bus, vn_hv_kv, **in_service** (boolean, True) - True for in_service or False for out of service - \* only considered in loadflow if calculate_voltage_angles = True - \**The model currently only supports one tap-changer per 3W Transformer. + ** only considered in loadflow if calculate_voltage_angles = True + **The model currently only supports one tap-changer per 3W Transformer. **max_loading_percent (float)** - maximum current loading (only needed for OPF) diff --git a/pandapower/std_types.py b/pandapower/std_types.py index 1d7954eff..8ede09b45 100644 --- a/pandapower/std_types.py +++ b/pandapower/std_types.py @@ -25,7 +25,7 @@ def create_std_type(net, data, name, element="line", overwrite=True, check_requi additional parameters can be added and later loaded into pandapower with the function "parameter_from_std_type". - \* only considered in loadflow if calculate_voltage_angles = True + ** only considered in loadflow if calculate_voltage_angles = True The standard type is saved into the pandapower library of the given network by default. diff --git a/pandapower/test/api/test_convert_format.py b/pandapower/test/api/test_convert_format.py index 3647ca95f..2b92d59ef 100644 --- a/pandapower/test/api/test_convert_format.py +++ b/pandapower/test/api/test_convert_format.py @@ -38,5 +38,4 @@ def test_convert_format(version): if __name__ == '__main__': - # load_and_test_network("1.4.3") - pytest.main(__file__) + pytest.main([__file__]) diff --git a/pandapower/test/api/test_file_io.py b/pandapower/test/api/test_file_io.py index 69c811b72..391b8508e 100644 --- a/pandapower/test/api/test_file_io.py +++ b/pandapower/test/api/test_file_io.py @@ -244,4 +244,4 @@ def test_json_io_same_net(net_in, tempdir): if __name__ == "__main__": - pytest.main(["test_file_io.py", "-x"]) + pytest.main([__file__, "-x"]) diff --git a/pandapower/test/api/test_std_types.py b/pandapower/test/api/test_std_types.py index a6d74b1ac..e0fa9c005 100644 --- a/pandapower/test/api/test_std_types.py +++ b/pandapower/test/api/test_std_types.py @@ -322,5 +322,4 @@ def test_add_temperature_coefficient(): if __name__ == "__main__": -# net = pp.create_empty_network() - pytest.main(["test_std_types.py"]) + pytest.main([__file__]) diff --git a/pandapower/toolbox.py b/pandapower/toolbox.py index efb3aefae..6b641971c 100644 --- a/pandapower/toolbox.py +++ b/pandapower/toolbox.py @@ -4,7 +4,8 @@ # and Energy System Technology (IEE), Kassel. All rights reserved. import copy -from collections import Iterable, defaultdict +from collections import defaultdict +from collections.abc import Iterable from itertools import chain import numpy as np