From 6bec701645ab956a540098528aa3961f21f00c59 Mon Sep 17 00:00:00 2001 From: danielfeismann Date: Wed, 11 Sep 2024 09:53:35 +0200 Subject: [PATCH 01/32] tests --- tests/test_grid.py | 111 +++++++++++++++++++++++++++++++++++++++++++ tests/test_pytest.py | 2 - tests/utils.py | 19 ++++++++ 3 files changed, 130 insertions(+), 2 deletions(-) create mode 100644 tests/test_grid.py delete mode 100644 tests/test_pytest.py create mode 100644 tests/utils.py diff --git a/tests/test_grid.py b/tests/test_grid.py new file mode 100644 index 0000000..1a3b9d0 --- /dev/null +++ b/tests/test_grid.py @@ -0,0 +1,111 @@ +import math + +import pandapower as pp +import pytest + +from pp2psdm.grid import convert_grid, convert_line, convert_node, convert_transformer +from tests.utils import read_psdm_lv, read_sb_lv + + +@pytest.fixture +def input_data(): + expected = read_sb_lv() + input = read_psdm_lv() + return expected, input + + +def test_convert_grid(input_data): + _, input = input_data + s_mva = 5 + name = "test_grid" + net, uuid_idx = convert_grid(input, name=name, s_rated_mva=s_mva) + assert net.sn_mva == s_mva + assert net.name == name + assert len(net.bus) == len(input.nodes.data) + for uuid, idx in uuid_idx.node.items(): + assert net.bus.name.iloc[idx] == input.nodes.data.loc[uuid]["id"] + assert len(net.line) == len(input.lines.data) + for uuid, idx in uuid_idx.line.items(): + assert net.line.name.iloc[idx] == input.lines.data.loc[uuid]["id"] + assert len(net.trafo) == len(input.transformers_2_w.data) + for uuid, idx in uuid_idx.trafo.items(): + assert net.trafo.name.iloc[idx] == input.transformers_2_w.data.loc[uuid]["id"] + + +def test_node_conversion(input_data): + _, input = input_data + net = pp.create_empty_network() + input_node = input.nodes.data.iloc[0] + idx = convert_node(net, input_node) + assert idx == 0 + assert net["bus"]["name"].iloc[idx] == input_node["id"] + assert net["bus"]["vn_kv"].iloc[idx] == input_node["v_rated"] + assert net["bus"]["subnet"].iloc[idx] == input_node["subnet"] + assert net["bus"]["in_service"].iloc[idx] + assert net["bus_geodata"]["x"].iloc[idx] == input_node["longitude"] + assert net["bus_geodata"]["y"].iloc[idx] == input_node["latitude"] + + +def test_line_conversion(input_data): + expected, input = input_data + net = pp.create_empty_network() + input_line = input.lines.data.iloc[0] + node_a = input.nodes.data.loc[input_line["node_a"]] + node_b = input.nodes.data.loc[input_line["node_b"]] + noda_a_idx = convert_node(net, node_a) + noda_b_idx = convert_node(net, node_b) + uuid_idx = {node_a.name: noda_a_idx, node_b.name: noda_b_idx} + idx = convert_line(net, input_line, uuid_idx) + + assert idx == 0 + assert net["line"]["name"].iloc[idx] == input_line["id"] + assert net["line"]["from_bus"].iloc[idx] == noda_a_idx + assert net["line"]["to_bus"].iloc[idx] == noda_b_idx + + sb_lines = expected.line[expected.line["name"] == input_line["id"]] + assert len(sb_lines) == 1 + sb_line = sb_lines.iloc[0] + assert net["line"]["length_km"].iloc[idx] == sb_line["length_km"] + assert math.isclose(net["line"]["r_ohm_per_km"].iloc[idx], sb_line["r_ohm_per_km"]) + assert math.isclose(net["line"]["x_ohm_per_km"].iloc[idx], sb_line["x_ohm_per_km"]) + assert math.isclose(net["line"]["c_nf_per_km"].iloc[idx], sb_line["c_nf_per_km"]) + assert math.isclose(net["line"]["g_us_per_km"].iloc[idx], sb_line["g_us_per_km"]) + assert math.isclose(net["line"]["max_i_ka"].iloc[idx], sb_line["max_i_ka"]) + + +def test_trafo_conversion(input_data): + expected, input = input_data + net = pp.create_empty_network() + input_trafo = input.transformers_2_w.data.iloc[0] + node_a = input.nodes.data.loc[input_trafo["node_a"]] + node_b = input.nodes.data.loc[input_trafo["node_b"]] + noda_a_idx = convert_node(net, node_a) + noda_b_idx = convert_node(net, node_b) + uuid_idx = {node_a.name: noda_a_idx, node_b.name: noda_b_idx} + idx = convert_transformer(net, input_trafo, uuid_idx) + + assert idx == 0 + assert net["trafo"]["name"].iloc[idx] == input_trafo["id"] + assert net["trafo"]["hv_bus"].iloc[idx] == noda_a_idx + assert net["trafo"]["lv_bus"].iloc[idx] == noda_b_idx + + sb_trafos = expected.trafo[expected.trafo["name"] == input_trafo["id"]] + assert len(sb_trafos) == 1 + sb_trafo = sb_trafos.iloc[0] + assert net["trafo"]["sn_mva"].iloc[idx] == sb_trafo["sn_mva"] + assert math.isclose(net["trafo"]["vn_hv_kv"].iloc[idx], sb_trafo["vn_hv_kv"]) + assert math.isclose(net["trafo"]["vn_lv_kv"].iloc[idx], sb_trafo["vn_lv_kv"]) + assert math.isclose(net["trafo"]["vk_percent"].iloc[idx], sb_trafo["vk_percent"]) + assert math.isclose(net["trafo"]["vkr_percent"].iloc[idx], sb_trafo["vkr_percent"]) + assert math.isclose(net["trafo"]["pfe_kw"].iloc[idx], sb_trafo["pfe_kw"]) + assert math.isclose(net["trafo"]["i0_percent"].iloc[idx], sb_trafo["i0_percent"]) + assert net["trafo"]["tap_side"].iloc[idx] == sb_trafo["tap_side"] + assert net["trafo"]["tap_neutral"].iloc[idx] == sb_trafo["tap_neutral"] + assert net["trafo"]["tap_min"].iloc[idx] == sb_trafo["tap_min"] + assert net["trafo"]["tap_max"].iloc[idx] == sb_trafo["tap_max"] + assert math.isclose( + net["trafo"]["tap_step_degree"].iloc[idx], sb_trafo["tap_step_degree"] + ) + assert math.isclose( + net["trafo"]["tap_step_percent"].iloc[idx], sb_trafo["tap_step_percent"] + ) diff --git a/tests/test_pytest.py b/tests/test_pytest.py deleted file mode 100644 index 11543bc..0000000 --- a/tests/test_pytest.py +++ /dev/null @@ -1,2 +0,0 @@ -def test_pytest(): - assert 2 == 1 + 1 diff --git a/tests/utils.py b/tests/utils.py new file mode 100644 index 0000000..0050b49 --- /dev/null +++ b/tests/utils.py @@ -0,0 +1,19 @@ +from pathlib import Path + +import pandapower as pp +from pypsdm import GridContainer + +ROOT_DIR = Path(__file__).resolve().parent.parent +TESTS_DIR = ROOT_DIR / "tests" +TEST_RESOURCES_DIR = TESTS_DIR / "resources" +SB_DIR = TEST_RESOURCES_DIR / "simbench" +PSDM_DIR = TEST_RESOURCES_DIR / "psdm" +LV_NAME = "1-LV-rural1--2-no_sw_1" + + +def read_sb_lv(): + return pp.from_json(SB_DIR / (LV_NAME + ".json")) + + +def read_psdm_lv(): + return GridContainer.from_csv(str(PSDM_DIR / LV_NAME / "input"), delimiter=";") From d3e92dc593fb621f96e36c135dc2a6d060c68f92 Mon Sep 17 00:00:00 2001 From: danielfeismann Date: Wed, 11 Sep 2024 17:00:56 +0200 Subject: [PATCH 02/32] converting nodes --- pp2psdm/grid.py | 21 +++++++++++++++++---- tests/test_grid.py | 30 +++++++++++++++--------------- 2 files changed, 32 insertions(+), 19 deletions(-) diff --git a/pp2psdm/grid.py b/pp2psdm/grid.py index f6d7ee9..af44056 100644 --- a/pp2psdm/grid.py +++ b/pp2psdm/grid.py @@ -45,15 +45,28 @@ def convert_grid( return net, uuid_idx +def get_default(value, default): + return value if not pd.isna(value) else default + def convert_nodes(grid): df = grid.bus + geodata = grid.bus_geodata + - def get_default(value, default): - return value if not pd.isna(value) else default + def format_geo_position(row): + if not pd.isna(row["x"]) and not pd.isna(row["y"]): + return f'{{"type":"Point","coordinates":[{row["x"]},{row["y"]}],"crs":{{"type":"name","properties":{{"name":"EPSG:0"}}}}}}' + return None + + node_index_uuid_map = {idx: str(uuid4()) for idx in df.index} data_dict = { "id": df["name"].tolist(), - "geo_position": [None] * len(df), + "uuid": [node_index_uuid_map[idx] for idx in df.index], + "geo_position": [ + format_geo_position(geodata.iloc[idx]) + for idx in range(len(df)) + ], "subnet": [ get_default(row.get("zone"), 101) for _, row in df.iterrows() @@ -75,7 +88,7 @@ def get_default(value, default): ] } - return create_nodes(data_dict) + return create_nodes(data_dict), node_index_uuid_map def get_operation_times(row): diff --git a/tests/test_grid.py b/tests/test_grid.py index 1a3b9d0..4b7ff83 100644 --- a/tests/test_grid.py +++ b/tests/test_grid.py @@ -2,15 +2,15 @@ import pandapower as pp import pytest - -from pp2psdm.grid import convert_grid, convert_line, convert_node, convert_transformer +import numpy as np +from pp2psdm.grid import convert_grid, convert_line_types, convert_lines, convert_nodes#, convert_transformers from tests.utils import read_psdm_lv, read_sb_lv @pytest.fixture def input_data(): - expected = read_sb_lv() - input = read_psdm_lv() + expected = read_psdm_lv() + input = read_sb_lv() return expected, input @@ -32,18 +32,18 @@ def test_convert_grid(input_data): assert net.trafo.name.iloc[idx] == input.transformers_2_w.data.loc[uuid]["id"] -def test_node_conversion(input_data): +def test_nodes_conversion(input_data): _, input = input_data - net = pp.create_empty_network() - input_node = input.nodes.data.iloc[0] - idx = convert_node(net, input_node) - assert idx == 0 - assert net["bus"]["name"].iloc[idx] == input_node["id"] - assert net["bus"]["vn_kv"].iloc[idx] == input_node["v_rated"] - assert net["bus"]["subnet"].iloc[idx] == input_node["subnet"] - assert net["bus"]["in_service"].iloc[idx] - assert net["bus_geodata"]["x"].iloc[idx] == input_node["longitude"] - assert net["bus_geodata"]["y"].iloc[idx] == input_node["latitude"] + len = input.bus.shape[0] + net, _ = convert_nodes(input) + for i in range(len): + assert net.data.iloc[i]['id'] == input.bus.iloc[i]["name"] + assert net.data.iloc[i]["v_rated"] == input.bus.iloc[i]["vn_kv"] + assert net.data.iloc[i]["subnet"] == 101 + assert net.data.iloc[i]["operates_from"] == None + assert net.data.iloc[i]["operates_until"] == None + assert net.data.iloc[i]["operator"] == None + assert net.data.iloc[i]["geo_position"] == f'{{"type":"Point","coordinates":[{input.bus_geodata.iloc[i]["x"]},{input.bus_geodata.iloc[i]["y"]}],"crs":{{"type":"name","properties":{{"name":"EPSG:0"}}}}}}' def test_line_conversion(input_data): From b331e8e0f8a2cbaadeef697c68a6cd1c0960186d Mon Sep 17 00:00:00 2001 From: danielfeismann Date: Wed, 11 Sep 2024 17:01:53 +0200 Subject: [PATCH 03/32] converting line types --- pp2psdm/grid.py | 44 ++++++++++++++++++++++++++++---------------- tests/test_grid.py | 24 +++++++++++++++--------- 2 files changed, 43 insertions(+), 25 deletions(-) diff --git a/pp2psdm/grid.py b/pp2psdm/grid.py index af44056..66adae4 100644 --- a/pp2psdm/grid.py +++ b/pp2psdm/grid.py @@ -103,11 +103,12 @@ def get_operation_times(row): def get_node_uuid(nodes, node_id): - for uuid, node_data in nodes.items(): + for _, node_data in nodes.data.iterrows(): if node_data['id'] == node_id: - return uuid + return node_data.name raise ValueError(f"No matching node found for id {node_id}") + def get_v_target_for_node(nodes, node_uuid): return nodes[node_uuid]['v_target'] @@ -119,43 +120,54 @@ def line_param_conversion(c_nf_per_km: float, g_us_per_km: float): return g_us, b_us -def convert_line_types(df, nodes): - line_type_columns = ['r_ohm_per_km', 'x_ohm_per_km', 'c_nf_per_km', 'g_us_per_km', 'max_i_ka'] - unique_line_types = df[line_type_columns].drop_duplicates().reset_index(drop=True) - +def convert_line_types(grid, nodes, node_index_uuid_map): + + # Geo Position of Line not implemented + + df = grid.line line_types = {} - for idx, row in unique_line_types.iterrows(): - uuid = str(uuid4()) - + for idx, row in df.iterrows(): + line_index_line_type_uuid_map = {idx: str(uuid4()) for idx in df.index} + + # Convert line parameters g_us, b_us = line_param_conversion(row['c_nf_per_km'], row['g_us_per_km']) - # Retrieve node_a and node_b UUIDs based on from_bus and to_bus - node_a_uuid = get_node_uuid(nodes, row['from_bus']) - node_b_uuid = get_node_uuid(nodes, row['to_bus']) + # Use index_uuid_map to retrieve UUIDs for from_bus and to_bus + node_a_uuid = node_index_uuid_map.get(row['from_bus']) + node_b_uuid = node_index_uuid_map.get(row['to_bus']) - # Retrieve v_target for node_a and node_b + # Check if the UUIDs were found + if node_a_uuid is None or node_b_uuid is None: + raise KeyError(f"UUID not found for from_bus {row['from_bus']} or to_bus {row['to_bus']}") + + # Retrieve v_target for node_a and node_b (assuming these functions exist) v_target_a = get_v_target_for_node(nodes, node_a_uuid) v_target_b = get_v_target_for_node(nodes, node_b_uuid) # Ensure v_target_a and v_target_b are the same if v_target_a != v_target_b: - raise ValueError(f"v_target mismatch between node_a ({v_target_a}) and node_b ({v_target_b}) for line {row['from_bus']} to {row['to_bus']}") - + raise ValueError( + f"v_target mismatch between node_a ({v_target_a}) and node_b ({v_target_b}) for line {row['from_bus']} to {row['to_bus']}") + uuid = line_index_line_type_uuid_map[idx] + line_types[uuid] = { 'uuid': uuid, 'r': row['r_ohm_per_km'], 'x': row['x_ohm_per_km'], 'b': b_us, 'g': g_us, - 'i_max': row['max_i_ka'] * 1000, + 'i_max': row['max_i_ka'] * 1000, # Convert to amperes 'id': f"line_type_{idx + 1}", 'v_rated': v_target_a, } return line_types def convert_lines(df, line_types, nodes): + line_types = pd.DataFrame.from_dict(line_types, orient='index').reset_index() + line_types = line_types.set_index('uuid').drop(columns='index') + return line_types, line_index_line_type_uuid_map lines_data = [] for idx, row in df.iterrows(): diff --git a/tests/test_grid.py b/tests/test_grid.py index 4b7ff83..f3ceb41 100644 --- a/tests/test_grid.py +++ b/tests/test_grid.py @@ -46,16 +46,22 @@ def test_nodes_conversion(input_data): assert net.data.iloc[i]["geo_position"] == f'{{"type":"Point","coordinates":[{input.bus_geodata.iloc[i]["x"]},{input.bus_geodata.iloc[i]["y"]}],"crs":{{"type":"name","properties":{{"name":"EPSG:0"}}}}}}' -def test_line_conversion(input_data): +def test_line_types_conversion(input_data): expected, input = input_data - net = pp.create_empty_network() - input_line = input.lines.data.iloc[0] - node_a = input.nodes.data.loc[input_line["node_a"]] - node_b = input.nodes.data.loc[input_line["node_b"]] - noda_a_idx = convert_node(net, node_a) - noda_b_idx = convert_node(net, node_b) - uuid_idx = {node_a.name: noda_a_idx, node_b.name: noda_b_idx} - idx = convert_line(net, input_line, uuid_idx) + len = input.line.shape[0] + nodes, node_index_uuid_map = convert_nodes(input) + net, _ = convert_line_types(input, nodes, index_uuid_map) + + for i in range(len): + assert net.iloc[i]["v_rated"] == nodes.get(node_index_uuid_map.get(input.line.iloc[i]["from_bus"]))['v_target'] + assert net.iloc[i]["v_rated"] == nodes.get(node_index_uuid_map.get(input.line.iloc[i]["to_bus"]))['v_target'] + assert math.isclose(net.iloc[i]["r"], input.line.iloc[i]["r_ohm_per_km"]) + assert math.isclose(net.iloc[i]["x"], input.line.iloc[i]["x_ohm_per_km"]) + assert math.isclose(net.iloc[i]["b"], input.line.iloc[i]["c_nf_per_km"] * 2 * np.pi * 50 * 1e-3) + assert math.isclose(net.iloc[i]["g"], input.line.iloc[i]["g_us_per_km"]) + assert math.isclose(net.iloc[i]["i_max"], input.line.iloc[i]["max_i_ka"] * 1000) + + assert idx == 0 assert net["line"]["name"].iloc[idx] == input_line["id"] From b233ec80203ab288b399d5c76c9f486495f16743 Mon Sep 17 00:00:00 2001 From: danielfeismann Date: Wed, 11 Sep 2024 17:03:12 +0200 Subject: [PATCH 04/32] converting lines --- pp2psdm/grid.py | 55 +++++++++++++++++----------------------------- tests/test_grid.py | 33 ++++++++++++++++------------ 2 files changed, 39 insertions(+), 49 deletions(-) diff --git a/pp2psdm/grid.py b/pp2psdm/grid.py index 66adae4..84608ce 100644 --- a/pp2psdm/grid.py +++ b/pp2psdm/grid.py @@ -163,63 +163,48 @@ def convert_line_types(grid, nodes, node_index_uuid_map): 'v_rated': v_target_a, } - return line_types -def convert_lines(df, line_types, nodes): line_types = pd.DataFrame.from_dict(line_types, orient='index').reset_index() line_types = line_types.set_index('uuid').drop(columns='index') return line_types, line_index_line_type_uuid_map + + +def convert_lines(grid, line_index_line_type_uuid_map, node_index_uuid_map): + df = grid.line lines_data = [] + # Create a mapping of line index to UUID + line_index_uuid_map = {idx: str(uuid4()) for idx in df.index} + for idx, row in df.iterrows(): - # Find the corresponding line type based on r, x, c, g, max_i_ka - line_type_uuid = None - - for uuid, line_type_data in line_types.items(): - if ( - line_type_data['r'] == row['r_ohm_per_km'] and - line_type_data['x'] == row['x_ohm_per_km'] and - line_type_data['b'] == row['c_nf_per_km'] and - line_type_data['g'] == row['g_us_per_km'] and - line_type_data['i_max'] == row['max_i_ka'] - ): - line_type_uuid = uuid - break - - # If no matching line type is found, there might be an issue + # Retrieve line type UUID + line_type_uuid = line_index_line_type_uuid_map.get(idx) if not line_type_uuid: raise ValueError(f"No matching line type found for line {row['name']}") # Retrieve node_a and node_b UUIDs based on from_bus and to_bus - node_a_uuid = get_node_uuid(nodes, row['from_bus']) - node_b_uuid = get_node_uuid(nodes, row['to_bus']) - - # Set operates_from and operates_until based on in_service status - if row['in_service']: - operates_from = None - operates_until = None - else: - operates_from = datetime(1980, 1, 1) - operates_until = datetime(1980, 12, 31) - - # Create line data + node_a_uuid = node_index_uuid_map.get(row['from_bus']) + node_b_uuid = node_index_uuid_map.get(row['to_bus']) + + # Collect data for each line line_data = { - 'uuid': row["uuid"], - 'geo_position': None, 'id': row['name'], + 'uuid': line_index_uuid_map[idx], + 'geo_position': None, 'length': row['length_km'], 'node_a': node_a_uuid, 'node_b': node_b_uuid, 'olm_characteristic': "olm:{(0.0,1.0)}", - 'operates_from': operates_from, - 'operates_until': operates_until, + "operates_from": get_operation_times(row)[0], + "operates_until": get_operation_times(row)[1], 'operator': None, 'parallel_devices': row['parallel'], 'type': line_type_uuid, } - lines_data.append(line_data) + + data_dict = {key: [d[key] for d in lines_data] for key in lines_data[0]} - return lines_data + return create_lines(data_dict) def convert_transformer(net: pp.pandapowerNet, trafo_data: pd.Series, uuid_idx: dict): diff --git a/tests/test_grid.py b/tests/test_grid.py index f3ceb41..daba134 100644 --- a/tests/test_grid.py +++ b/tests/test_grid.py @@ -63,20 +63,25 @@ def test_line_types_conversion(input_data): - assert idx == 0 - assert net["line"]["name"].iloc[idx] == input_line["id"] - assert net["line"]["from_bus"].iloc[idx] == noda_a_idx - assert net["line"]["to_bus"].iloc[idx] == noda_b_idx - - sb_lines = expected.line[expected.line["name"] == input_line["id"]] - assert len(sb_lines) == 1 - sb_line = sb_lines.iloc[0] - assert net["line"]["length_km"].iloc[idx] == sb_line["length_km"] - assert math.isclose(net["line"]["r_ohm_per_km"].iloc[idx], sb_line["r_ohm_per_km"]) - assert math.isclose(net["line"]["x_ohm_per_km"].iloc[idx], sb_line["x_ohm_per_km"]) - assert math.isclose(net["line"]["c_nf_per_km"].iloc[idx], sb_line["c_nf_per_km"]) - assert math.isclose(net["line"]["g_us_per_km"].iloc[idx], sb_line["g_us_per_km"]) - assert math.isclose(net["line"]["max_i_ka"].iloc[idx], sb_line["max_i_ka"]) +def test_lines_conversion(input_data): + expected, input = input_data + len = input.line.shape[0] + nodes, node_index_uuid_map = convert_nodes(input) + line_types, line_index_line_type_uuid_map = convert_line_types(input, nodes, node_index_uuid_map) + + net = convert_lines(input, line_index_line_type_uuid_map, node_index_uuid_map) + + for i in range(len): + assert net.data.iloc[i]['id'] == input.line.iloc[i]["name"] + assert net.data.iloc[i]["node_a"] == node_index_uuid_map.get(input.line.iloc[i]["from_bus"]) + assert net.data.iloc[i]["node_b"] == node_index_uuid_map.get(input.line.iloc[i]["to_bus"]) + assert net.data.iloc[i]["length"] == input.line.iloc[i]["length_km"] + assert net.data.iloc[i]["olm_characteristic"] == "olm:{(0.0,1.0)}" + assert net.data.iloc[i]["operates_from"] == None + assert net.data.iloc[i]["operates_until"] == None + assert net.data.iloc[i]["operator"] == None + assert net.data.iloc[i]["parallel_devices"] == input.line.iloc[i]["parallel"] + assert net.data.iloc[i]["type"] == line_index_line_type_uuid_map.get(i) def test_trafo_conversion(input_data): From 920fc4553966d3c7ccf85966dd096f8a26e11a19 Mon Sep 17 00:00:00 2001 From: danielfeismann Date: Wed, 11 Sep 2024 17:29:48 +0200 Subject: [PATCH 05/32] fmt --- pp2psdm/conversion/pandapower.py | 1 - pp2psdm/grid.py | 112 +++++++++++++++---------------- pp2psdm/io/utils.py | 6 +- tests/test_grid.py | 54 +++++++++++---- 4 files changed, 98 insertions(+), 75 deletions(-) diff --git a/pp2psdm/conversion/pandapower.py b/pp2psdm/conversion/pandapower.py index df638e9..176ac50 100644 --- a/pp2psdm/conversion/pandapower.py +++ b/pp2psdm/conversion/pandapower.py @@ -1,7 +1,6 @@ from datetime import datetime, timedelta import pandas as pd - from pypsdm.models.enums import ( EntitiesEnum, RawGridElementsEnum, diff --git a/pp2psdm/grid.py b/pp2psdm/grid.py index 84608ce..ca45364 100644 --- a/pp2psdm/grid.py +++ b/pp2psdm/grid.py @@ -8,8 +8,10 @@ import pandapower as pp import pandas as pd from pypsdm.models.input.container.raw_grid import RawGridContainer -from pypsdm.models.input.create.participants import create_data -from pypsdm.models.input.create.grid_elements import create_nodes, create_nodes_data, create_lines, create_lines_data +from pypsdm.models.input.create.grid_elements import ( + create_lines, + create_nodes, +) @dataclass @@ -25,14 +27,12 @@ def convert_grid( uuid_idx = UuidIdxMaps() - net = RawGridContainer.empty( - ) + net = RawGridContainer.empty() nodes = convert_nodes(grid.bus) convert_lines(grid) - for uuid, line in grid.line.data.iterrows(): idx = convert_line(net, line, uuid_idx.node) uuid_idx.line[uuid] = idx # type: ignore @@ -45,14 +45,15 @@ def convert_grid( return net, uuid_idx + def get_default(value, default): return value if not pd.isna(value) else default + def convert_nodes(grid): df = grid.bus geodata = grid.bus_geodata - def format_geo_position(row): if not pd.isna(row["x"]) and not pd.isna(row["y"]): return f'{{"type":"Point","coordinates":[{row["x"]},{row["y"]}],"crs":{{"type":"name","properties":{{"name":"EPSG:0"}}}}}}' @@ -64,28 +65,17 @@ def format_geo_position(row): "id": df["name"].tolist(), "uuid": [node_index_uuid_map[idx] for idx in df.index], "geo_position": [ - format_geo_position(geodata.iloc[idx]) - for idx in range(len(df)) - ], - "subnet": [ - get_default(row.get("zone"), 101) - for _, row in df.iterrows() + format_geo_position(geodata.iloc[idx]) for idx in range(len(df)) ], + "subnet": [get_default(row.get("zone"), 101) for _, row in df.iterrows()], "v_rated": df["vn_kv"].tolist(), "v_target": df["vn_kv"].tolist(), "volt_lvl": [ - get_default(row.get("vlt_lvl"), row["vn_kv"]) - for _, row in df.iterrows() - ], - "slack": ['false'] * len(df), - "operates_from": [ - get_operation_times(row)[0] - for _, row in df.iterrows() + get_default(row.get("vlt_lvl"), row["vn_kv"]) for _, row in df.iterrows() ], - "operates_until": [ - get_operation_times(row)[1] - for _, row in df.iterrows() - ] + "slack": ["false"] * len(df), + "operates_from": [get_operation_times(row)[0] for _, row in df.iterrows()], + "operates_until": [get_operation_times(row)[1] for _, row in df.iterrows()], } return create_nodes(data_dict), node_index_uuid_map @@ -103,14 +93,14 @@ def get_operation_times(row): def get_node_uuid(nodes, node_id): - for _, node_data in nodes.data.iterrows(): - if node_data['id'] == node_id: - return node_data.name + for _, node_data in nodes.data.iterrows(): + if node_data["id"] == node_id: + return node_data.name raise ValueError(f"No matching node found for id {node_id}") def get_v_target_for_node(nodes, node_uuid): - return nodes[node_uuid]['v_target'] + return nodes[node_uuid]["v_target"] def line_param_conversion(c_nf_per_km: float, g_us_per_km: float): @@ -120,26 +110,29 @@ def line_param_conversion(c_nf_per_km: float, g_us_per_km: float): return g_us, b_us + def convert_line_types(grid, nodes, node_index_uuid_map): - + # Geo Position of Line not implemented - + df = grid.line line_types = {} for idx, row in df.iterrows(): line_index_line_type_uuid_map = {idx: str(uuid4()) for idx in df.index} - + # Convert line parameters - g_us, b_us = line_param_conversion(row['c_nf_per_km'], row['g_us_per_km']) + g_us, b_us = line_param_conversion(row["c_nf_per_km"], row["g_us_per_km"]) # Use index_uuid_map to retrieve UUIDs for from_bus and to_bus - node_a_uuid = node_index_uuid_map.get(row['from_bus']) - node_b_uuid = node_index_uuid_map.get(row['to_bus']) + node_a_uuid = node_index_uuid_map.get(row["from_bus"]) + node_b_uuid = node_index_uuid_map.get(row["to_bus"]) # Check if the UUIDs were found if node_a_uuid is None or node_b_uuid is None: - raise KeyError(f"UUID not found for from_bus {row['from_bus']} or to_bus {row['to_bus']}") + raise KeyError( + f"UUID not found for from_bus {row['from_bus']} or to_bus {row['to_bus']}" + ) # Retrieve v_target for node_a and node_b (assuming these functions exist) v_target_a = get_v_target_for_node(nodes, node_a_uuid) @@ -148,23 +141,24 @@ def convert_line_types(grid, nodes, node_index_uuid_map): # Ensure v_target_a and v_target_b are the same if v_target_a != v_target_b: raise ValueError( - f"v_target mismatch between node_a ({v_target_a}) and node_b ({v_target_b}) for line {row['from_bus']} to {row['to_bus']}") + f"v_target mismatch between node_a ({v_target_a}) and node_b ({v_target_b}) for line {row['from_bus']} to {row['to_bus']}" + ) uuid = line_index_line_type_uuid_map[idx] - + line_types[uuid] = { - 'uuid': uuid, - 'r': row['r_ohm_per_km'], - 'x': row['x_ohm_per_km'], - 'b': b_us, - 'g': g_us, - 'i_max': row['max_i_ka'] * 1000, # Convert to amperes - 'id': f"line_type_{idx + 1}", - 'v_rated': v_target_a, + "uuid": uuid, + "r": row["r_ohm_per_km"], + "x": row["x_ohm_per_km"], + "b": b_us, + "g": g_us, + "i_max": row["max_i_ka"] * 1000, # Convert to amperes + "id": f"line_type_{idx + 1}", + "v_rated": v_target_a, } - line_types = pd.DataFrame.from_dict(line_types, orient='index').reset_index() - line_types = line_types.set_index('uuid').drop(columns='index') + line_types = pd.DataFrame.from_dict(line_types, orient="index").reset_index() + line_types = line_types.set_index("uuid").drop(columns="index") return line_types, line_index_line_type_uuid_map @@ -182,26 +176,26 @@ def convert_lines(grid, line_index_line_type_uuid_map, node_index_uuid_map): raise ValueError(f"No matching line type found for line {row['name']}") # Retrieve node_a and node_b UUIDs based on from_bus and to_bus - node_a_uuid = node_index_uuid_map.get(row['from_bus']) - node_b_uuid = node_index_uuid_map.get(row['to_bus']) + node_a_uuid = node_index_uuid_map.get(row["from_bus"]) + node_b_uuid = node_index_uuid_map.get(row["to_bus"]) # Collect data for each line line_data = { - 'id': row['name'], - 'uuid': line_index_uuid_map[idx], - 'geo_position': None, - 'length': row['length_km'], - 'node_a': node_a_uuid, - 'node_b': node_b_uuid, - 'olm_characteristic': "olm:{(0.0,1.0)}", + "id": row["name"], + "uuid": line_index_uuid_map[idx], + "geo_position": None, + "length": row["length_km"], + "node_a": node_a_uuid, + "node_b": node_b_uuid, + "olm_characteristic": "olm:{(0.0,1.0)}", "operates_from": get_operation_times(row)[0], "operates_until": get_operation_times(row)[1], - 'operator': None, - 'parallel_devices': row['parallel'], - 'type': line_type_uuid, + "operator": None, + "parallel_devices": row["parallel"], + "type": line_type_uuid, } lines_data.append(line_data) - + data_dict = {key: [d[key] for d in lines_data] for key in lines_data[0]} return create_lines(data_dict) diff --git a/pp2psdm/io/utils.py b/pp2psdm/io/utils.py index e967be4..56cfd1a 100644 --- a/pp2psdm/io/utils.py +++ b/pp2psdm/io/utils.py @@ -58,7 +58,11 @@ def read_csv( raise IOError("File with path: " + str(full_path) + " does not exist") if index_col: return pd.read_csv( - full_path, delimiter=delimiter, quotechar='"', index_col=index_col, compression="zip" + full_path, + delimiter=delimiter, + quotechar='"', + index_col=index_col, + compression="zip", ) else: return pd.read_csv(full_path, delimiter=delimiter, quotechar='"') diff --git a/tests/test_grid.py b/tests/test_grid.py index daba134..91f6a76 100644 --- a/tests/test_grid.py +++ b/tests/test_grid.py @@ -1,15 +1,21 @@ import math +import numpy as np import pandapower as pp import pytest -import numpy as np -from pp2psdm.grid import convert_grid, convert_line_types, convert_lines, convert_nodes#, convert_transformers + +from pp2psdm.grid import ( # , convert_transformers + convert_grid, + convert_line_types, + convert_lines, + convert_nodes, +) from tests.utils import read_psdm_lv, read_sb_lv @pytest.fixture def input_data(): - expected = read_psdm_lv() + expected = read_psdm_lv() input = read_sb_lv() return expected, input @@ -36,14 +42,17 @@ def test_nodes_conversion(input_data): _, input = input_data len = input.bus.shape[0] net, _ = convert_nodes(input) - for i in range(len): - assert net.data.iloc[i]['id'] == input.bus.iloc[i]["name"] + for i in range(len): + assert net.data.iloc[i]["id"] == input.bus.iloc[i]["name"] assert net.data.iloc[i]["v_rated"] == input.bus.iloc[i]["vn_kv"] assert net.data.iloc[i]["subnet"] == 101 assert net.data.iloc[i]["operates_from"] == None assert net.data.iloc[i]["operates_until"] == None assert net.data.iloc[i]["operator"] == None - assert net.data.iloc[i]["geo_position"] == f'{{"type":"Point","coordinates":[{input.bus_geodata.iloc[i]["x"]},{input.bus_geodata.iloc[i]["y"]}],"crs":{{"type":"name","properties":{{"name":"EPSG:0"}}}}}}' + assert ( + net.data.iloc[i]["geo_position"] + == f'{{"type":"Point","coordinates":[{input.bus_geodata.iloc[i]["x"]},{input.bus_geodata.iloc[i]["y"]}],"crs":{{"type":"name","properties":{{"name":"EPSG:0"}}}}}}' + ) def test_line_types_conversion(input_data): @@ -53,28 +62,45 @@ def test_line_types_conversion(input_data): net, _ = convert_line_types(input, nodes, index_uuid_map) for i in range(len): - assert net.iloc[i]["v_rated"] == nodes.get(node_index_uuid_map.get(input.line.iloc[i]["from_bus"]))['v_target'] - assert net.iloc[i]["v_rated"] == nodes.get(node_index_uuid_map.get(input.line.iloc[i]["to_bus"]))['v_target'] + assert ( + net.iloc[i]["v_rated"] + == nodes.get(node_index_uuid_map.get(input.line.iloc[i]["from_bus"]))[ + "v_target" + ] + ) + assert ( + net.iloc[i]["v_rated"] + == nodes.get(node_index_uuid_map.get(input.line.iloc[i]["to_bus"]))[ + "v_target" + ] + ) assert math.isclose(net.iloc[i]["r"], input.line.iloc[i]["r_ohm_per_km"]) assert math.isclose(net.iloc[i]["x"], input.line.iloc[i]["x_ohm_per_km"]) - assert math.isclose(net.iloc[i]["b"], input.line.iloc[i]["c_nf_per_km"] * 2 * np.pi * 50 * 1e-3) + assert math.isclose( + net.iloc[i]["b"], input.line.iloc[i]["c_nf_per_km"] * 2 * np.pi * 50 * 1e-3 + ) assert math.isclose(net.iloc[i]["g"], input.line.iloc[i]["g_us_per_km"]) assert math.isclose(net.iloc[i]["i_max"], input.line.iloc[i]["max_i_ka"] * 1000) - def test_lines_conversion(input_data): expected, input = input_data len = input.line.shape[0] nodes, node_index_uuid_map = convert_nodes(input) - line_types, line_index_line_type_uuid_map = convert_line_types(input, nodes, node_index_uuid_map) + line_types, line_index_line_type_uuid_map = convert_line_types( + input, nodes, node_index_uuid_map + ) net = convert_lines(input, line_index_line_type_uuid_map, node_index_uuid_map) for i in range(len): - assert net.data.iloc[i]['id'] == input.line.iloc[i]["name"] - assert net.data.iloc[i]["node_a"] == node_index_uuid_map.get(input.line.iloc[i]["from_bus"]) - assert net.data.iloc[i]["node_b"] == node_index_uuid_map.get(input.line.iloc[i]["to_bus"]) + assert net.data.iloc[i]["id"] == input.line.iloc[i]["name"] + assert net.data.iloc[i]["node_a"] == node_index_uuid_map.get( + input.line.iloc[i]["from_bus"] + ) + assert net.data.iloc[i]["node_b"] == node_index_uuid_map.get( + input.line.iloc[i]["to_bus"] + ) assert net.data.iloc[i]["length"] == input.line.iloc[i]["length_km"] assert net.data.iloc[i]["olm_characteristic"] == "olm:{(0.0,1.0)}" assert net.data.iloc[i]["operates_from"] == None From dac7b91e36140920ea3c5f97e65baa670388fa75 Mon Sep 17 00:00:00 2001 From: danielfeismann Date: Thu, 12 Sep 2024 10:20:44 +0200 Subject: [PATCH 06/32] add transformer conversion --- pp2psdm/grid.py | 188 +++++++++++++++++++++++++++++---------------- tests/test_grid.py | 137 ++++++++++++++++++++++++--------- 2 files changed, 222 insertions(+), 103 deletions(-) diff --git a/pp2psdm/grid.py b/pp2psdm/grid.py index ca45364..059a1aa 100644 --- a/pp2psdm/grid.py +++ b/pp2psdm/grid.py @@ -134,7 +134,7 @@ def convert_line_types(grid, nodes, node_index_uuid_map): f"UUID not found for from_bus {row['from_bus']} or to_bus {row['to_bus']}" ) - # Retrieve v_target for node_a and node_b (assuming these functions exist) + # Retrieve v_target for node_a and node_b v_target_a = get_v_target_for_node(nodes, node_a_uuid) v_target_b = get_v_target_for_node(nodes, node_b_uuid) @@ -201,85 +201,137 @@ def convert_lines(grid, line_index_line_type_uuid_map, node_index_uuid_map): return create_lines(data_dict) -def convert_transformer(net: pp.pandapowerNet, trafo_data: pd.Series, uuid_idx: dict): - trafo_id = trafo_data["id"] - hv_bus = uuid_idx[trafo_data["node_a"]] - lv_bus = uuid_idx[trafo_data["node_b"]] - sn_mva = trafo_data["s_rated"] / 1000 - vn_hv_kv = trafo_data["v_rated_a"] - vn_lv_kv = trafo_data["v_rated_b"] - vk_percent, vkr_percent, pfe_kw, i0_percent = trafo_param_conversion( - float(trafo_data["r_sc"]), - float(trafo_data["x_sc"]), - float(trafo_data["s_rated"]), - float(trafo_data["v_rated_a"]), - float(trafo_data["g_m"]), - float(trafo_data["b_m"]), - ) - if trafo_data["tap_side"]: - tap_side = "lv" - else: - tap_side = "hv" - - tap_neutral = int(trafo_data["tap_neutr"]) - tap_min = int(trafo_data["tap_min"]) - tap_max = int(trafo_data["tap_max"]) - tap_step_degree = float(trafo_data["d_phi"]) - tap_step_percent = float(trafo_data["d_v"]) - - return pp.create_transformer_from_parameters( - net, - hv_bus=hv_bus, - lv_bus=lv_bus, - name=trafo_id, - sn_mva=sn_mva, - vn_hv_kv=vn_hv_kv, - vn_lv_kv=vn_lv_kv, - vk_percent=vk_percent, - vkr_percent=vkr_percent, - pfe_kw=pfe_kw, - i0_percent=i0_percent, - tap_side=tap_side, - tap_neutral=tap_neutral, - tap_min=tap_min, - tap_max=tap_max, - tap_step_degree=tap_step_degree, - tap_step_percent=tap_step_percent, - ) +def convert_transformer_types(grid): + df = grid.trafo + trafo_types = {} + + for idx, row in df.iterrows(): + trafo_index_trafo_type_uuid_map = {idx: str(uuid4()) for idx in df.index} + + # Convert trafo parameters + rSc, xSc, gM, bM = trafo_param_conversion( + row["vk_percent"], + row["vkr_percent"], + row["pfe_kw"], + row["i0_percent"], + row["vn_hv_kv"], + row["sn_mva"], + ) + + tap_side = True if row["tap_side"] == "hv" else False + + uuid = trafo_index_trafo_type_uuid_map[idx] + + trafo_types[uuid] = { + "uuid": uuid, + "b_m": bM, + "d_phi": row["tap_step_degree"], + "d_v": row["tap_step_percent"], + "g_m": gM, + "id": f"trafo2w_type_{idx + 1}", + "r_sc": rSc, + "s_rated": row["sn_mva"] * 1000, # Convert to kVA + "tap_max": row["tap_max"], + "tap_min": row["tap_min"], + "tap_neutr": row["tap_neutral"], + "tap_side": tap_side, + "v_rated_a": row["vn_hv_kv"], + "v_rated_b": row["vn_lv_kv"], + "x_sc": xSc, + } + + trafo_types = pd.DataFrame.from_dict(trafo_types, orient="index").reset_index() + trafo_types = trafo_types.set_index("uuid").drop(columns="index") + return trafo_types, trafo_index_trafo_type_uuid_map + + +def convert_transformers(grid, trafo_index_trafo_type_uuid_map, node_index_uuid_map): + df = grid.trafo + transformers_data = [] + + # Create a mapping of line index to UUID + trafo_index_uuid_map = {idx: str(uuid4()) for idx in df.index} + + for idx, row in df.iterrows(): + # Retrieve trafo type UUID + trafo_type_uuid = trafo_index_trafo_type_uuid_map.get(idx) + + if not trafo_type_uuid: + raise ValueError( + f"No matching transformer type found for transformer {row['name']}" + ) + + # Retrieve node_a and node_b UUIDs based on hv_bus and lv_bus + node_a_uuid = node_index_uuid_map.get(row["hv_bus"]) + node_b_uuid = node_index_uuid_map.get(row["lv_bus"]) + + # Collect data for each transformer + + autoTap = True if row["autoTap"] == 1 else False + + trafo_data = { + "id": row["name"], + "uuid": trafo_index_uuid_map[idx], + "auto_tap": autoTap, + "node_a": node_a_uuid, + "node_b": node_b_uuid, + "operates_from": get_operation_times(row)[0], + "operates_until": get_operation_times(row)[1], + "operator": None, + "parallel_devices": row["parallel"], + "tap_pos": row["tap_pos"], + "type": trafo_type_uuid, + } + transformers_data.append(trafo_data) + + data_dict = { + key: [d[key] for d in transformers_data] for key in transformers_data[0] + } + + return create_2w_transformers(data_dict) def trafo_param_conversion( - r_sc: float, x_sc: float, s_rated: float, v_rated_a: float, g_m: float, b_m: float + vk_percent, vkr_percent, pfe_kw, i0_percent, vn_hv_kv, sn_mva ): + # Rated current on high voltage side in Ampere + i_rated = sn_mva * 1e6 / (math.sqrt(3) * vn_hv_kv * 1e3) + + # Voltage at the main field admittance in V + vM = vn_hv_kv * 1e3 / math.sqrt(3) - # Circuit impedance - z_sc = math.sqrt(r_sc**2 + x_sc**2) + # No load current in Ampere + iNoLoad = (i0_percent / 100) * i_rated - # Rated current on high voltage side in Ampere - i_rated = s_rated / (math.sqrt(3) * v_rated_a) + # No load admittance in Ohm + yNoLoad = iNoLoad / vM - # Short-circuit voltage - v_imp = z_sc * i_rated * math.sqrt(3) / 1000 + # Reference current in Ampere + i_ref = sn_mva * 1e6 / (math.sqrt(3) * vn_hv_kv * 1e3) - # Short-circuit voltage in percent - vk_percent = (v_imp / v_rated_a) * 100 + # No load conductance in Siemens + gM = pfe_kw * 1e3 / ((vn_hv_kv * 1e3) ** 2) + # Convert into nano Siemens for psdm + gM_nS = gM * 1e9 - # Real part of relative short-circuit voltage - vkr_percent = (r_sc / z_sc) * vk_percent + # No load susceptance in Siemens + bM = math.sqrt(yNoLoad**2 - gM**2) + # Convert into nano Siemens for psdm and correct sign + bm_uS_directed = bM * 1e9 * (-1) - # Voltage at the main field admittance in V - v_m = v_rated_a / math.sqrt(3) * 1e3 + # Copper losses at short circuit in Watt + pCU = ((vkr_percent * 1e-3 / 100) * sn_mva * 1e6) * 1e3 - # Recalculating Iron losses in kW - pfe_kw = (g_m * 3 * v_m**2) / 1e12 # converting to kW + # Resistance at short circuit in Ohm + rSc = pCU / (3 * i_ref**2) - # No load admittance - y_no_load = math.sqrt(g_m**2 + b_m**2) / 1e9 # in Siemens + # Reference Impedance in Ohm + z_ref = (vn_hv_kv * 1e3) ** 2 / (sn_mva * 1e6) - # No load current in Ampere - i_no_load = y_no_load * v_m + # Short circuit impedance in Ohm + zSc = (vk_percent / 100) * z_ref - # No load current in percent - i0_percent = (i_no_load / i_rated) * 100 + # Short circuit reactance in Ohm + xSc = math.sqrt(zSc * zSc - rSc * rSc) - return vk_percent, vkr_percent, pfe_kw, i0_percent + return (rSc, xSc, gM_nS, bm_uS_directed) diff --git a/tests/test_grid.py b/tests/test_grid.py index 91f6a76..467b787 100644 --- a/tests/test_grid.py +++ b/tests/test_grid.py @@ -1,7 +1,6 @@ import math import numpy as np -import pandapower as pp import pytest from pp2psdm.grid import ( # , convert_transformers @@ -9,6 +8,8 @@ convert_line_types, convert_lines, convert_nodes, + convert_transformer_types, + convert_transformers, ) from tests.utils import read_psdm_lv, read_sb_lv @@ -59,7 +60,7 @@ def test_line_types_conversion(input_data): expected, input = input_data len = input.line.shape[0] nodes, node_index_uuid_map = convert_nodes(input) - net, _ = convert_line_types(input, nodes, index_uuid_map) + net, _ = convert_line_types(input, nodes, node_index_uuid_map) for i in range(len): assert ( @@ -110,39 +111,105 @@ def test_lines_conversion(input_data): assert net.data.iloc[i]["type"] == line_index_line_type_uuid_map.get(i) +def trafo_parameter_test_conversion( + vk_percent, vkr_percent, pfe_kw, i0_percent, vn_hv_kv, sn_mva +): + # Rated current on high voltage side in Ampere + i_rated = sn_mva * 1e6 / (math.sqrt(3) * vn_hv_kv * 1e3) + + # Voltage at the main field admittance in V + vM = vn_hv_kv * 1e3 / math.sqrt(3) + + # No load current in Ampere + iNoLoad = (i0_percent / 100) * i_rated + + # No load admittance in Ohm + yNoLoad = iNoLoad / vM + + # Reference current in Ampere + i_ref = sn_mva * 1e6 / (math.sqrt(3) * vn_hv_kv * 1e3) + + # No load conductance in Siemens + gM = pfe_kw * 1e3 / ((vn_hv_kv * 1e3) ** 2) + # Convert into nano Siemens for psdm + gM_nS = gM * 1e9 + + # No load susceptance in Siemens + bM = math.sqrt(yNoLoad**2 - gM**2) + # Convert into nano Siemens for psdm and correct sign + bm_uS_directed = bM * 1e9 * (-1) + + # Copper losses at short circuit in Watt + pCU = ((vkr_percent * 1e-3 / 100) * sn_mva * 1e6) * 1e3 + + # Resistance at short circuit in Ohm + rSc = pCU / (3 * i_ref**2) + + # Reference Impedance in Ohm + z_ref = (vn_hv_kv * 1e3) ** 2 / (sn_mva * 1e6) + + # Short circuit impedance in Ohm + zSc = (vk_percent / 100) * z_ref + + # Short circuit reactance in Ohm + xSc = math.sqrt(zSc * zSc - rSc * rSc) + return (rSc, xSc, gM_nS, bm_uS_directed) + + +def test_tranfo_type_conversion(input_data): + expected, input = input_data + len = input.trafo.shape[0] + net, _ = convert_transformer_types(input) + + for i in range(len): + rSc, xSc, gM, bM = trafo_parameter_test_conversion( + input.trafo.iloc[i]["vk_percent"], + input.trafo.iloc[i]["vkr_percent"], + input.trafo.iloc[i]["pfe_kw"], + input.trafo.iloc[i]["i0_percent"], + input.trafo.iloc[i]["vn_hv_kv"], + input.trafo.iloc[i]["sn_mva"], + ) + + tap_side = True if input.trafo.iloc[i]["tap_side"] == "hv" else False + + assert net.iloc[i]["tap_max"] == input.trafo.iloc[i]["tap_max"] + assert net.iloc[i]["tap_min"] == input.trafo.iloc[i]["tap_min"] + assert net.iloc[i]["tap_neutr"] == input.trafo.iloc[i]["tap_neutral"] + assert net.iloc[i]["tap_side"] == tap_side + assert net.iloc[i]["v_rated_a"] == input.trafo.iloc[i]["vn_hv_kv"] + assert net.iloc[i]["v_rated_b"] == input.trafo.iloc[i]["vn_lv_kv"] + assert net.iloc[i]["d_phi"] == input.trafo.iloc[i]["tap_step_degree"] + assert net.iloc[i]["d_v"] == input.trafo.iloc[i]["tap_step_percent"] + assert math.isclose(net.iloc[i]["r_sc"], rSc) + assert math.isclose(net.iloc[i]["x_sc"], xSc) + assert math.isclose(net.iloc[i]["g_m"], gM) + assert math.isclose(net.iloc[i]["b_m"], bM) + assert net.iloc[i]["s_rated"] == input.trafo.iloc[i]["sn_mva"] * 1000 + + def test_trafo_conversion(input_data): expected, input = input_data - net = pp.create_empty_network() - input_trafo = input.transformers_2_w.data.iloc[0] - node_a = input.nodes.data.loc[input_trafo["node_a"]] - node_b = input.nodes.data.loc[input_trafo["node_b"]] - noda_a_idx = convert_node(net, node_a) - noda_b_idx = convert_node(net, node_b) - uuid_idx = {node_a.name: noda_a_idx, node_b.name: noda_b_idx} - idx = convert_transformer(net, input_trafo, uuid_idx) - - assert idx == 0 - assert net["trafo"]["name"].iloc[idx] == input_trafo["id"] - assert net["trafo"]["hv_bus"].iloc[idx] == noda_a_idx - assert net["trafo"]["lv_bus"].iloc[idx] == noda_b_idx - - sb_trafos = expected.trafo[expected.trafo["name"] == input_trafo["id"]] - assert len(sb_trafos) == 1 - sb_trafo = sb_trafos.iloc[0] - assert net["trafo"]["sn_mva"].iloc[idx] == sb_trafo["sn_mva"] - assert math.isclose(net["trafo"]["vn_hv_kv"].iloc[idx], sb_trafo["vn_hv_kv"]) - assert math.isclose(net["trafo"]["vn_lv_kv"].iloc[idx], sb_trafo["vn_lv_kv"]) - assert math.isclose(net["trafo"]["vk_percent"].iloc[idx], sb_trafo["vk_percent"]) - assert math.isclose(net["trafo"]["vkr_percent"].iloc[idx], sb_trafo["vkr_percent"]) - assert math.isclose(net["trafo"]["pfe_kw"].iloc[idx], sb_trafo["pfe_kw"]) - assert math.isclose(net["trafo"]["i0_percent"].iloc[idx], sb_trafo["i0_percent"]) - assert net["trafo"]["tap_side"].iloc[idx] == sb_trafo["tap_side"] - assert net["trafo"]["tap_neutral"].iloc[idx] == sb_trafo["tap_neutral"] - assert net["trafo"]["tap_min"].iloc[idx] == sb_trafo["tap_min"] - assert net["trafo"]["tap_max"].iloc[idx] == sb_trafo["tap_max"] - assert math.isclose( - net["trafo"]["tap_step_degree"].iloc[idx], sb_trafo["tap_step_degree"] - ) - assert math.isclose( - net["trafo"]["tap_step_percent"].iloc[idx], sb_trafo["tap_step_percent"] + len = input.trafo.shape[0] + _, node_index_uuid_map = convert_nodes(input) + trafo_types, trafo_index_trafo_type_uuid_map = convert_transformer_types(input) + + net = convert_transformers( + input, trafo_index_trafo_type_uuid_map, node_index_uuid_map ) + + for i in range(len): + assert net.data.iloc[i]["id"] == input.trafo.iloc[i]["name"] + assert net.data.iloc[i]["auto_tap"] == input.trafo.iloc[i]["autoTap"] + assert net.data.iloc[i]["node_a"] == node_index_uuid_map.get( + input.trafo.iloc[i]["hv_bus"] + ) + assert net.data.iloc[i]["node_b"] == node_index_uuid_map.get( + input.trafo.iloc[i]["lv_bus"] + ) + assert net.data.iloc[i]["operates_from"] == None + assert net.data.iloc[i]["operates_until"] == None + assert net.data.iloc[i]["operator"] == None + assert net.data.iloc[i]["parallel_devices"] == input.trafo.iloc[i]["parallel"] + assert net.data.iloc[i]["tap_pos"] == input.trafo.iloc[i]["tap_pos"] + assert net.data.iloc[i]["type"] == trafo_index_trafo_type_uuid_map.get(i) From d278f2bfb6f0afb342745b35f84f0737d114dbd4 Mon Sep 17 00:00:00 2001 From: danielfeismann Date: Thu, 12 Sep 2024 10:21:01 +0200 Subject: [PATCH 07/32] adapt convert grid --- pp2psdm/grid.py | 28 +++++++++++++++------------- 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/pp2psdm/grid.py b/pp2psdm/grid.py index 059a1aa..a42fe97 100644 --- a/pp2psdm/grid.py +++ b/pp2psdm/grid.py @@ -7,8 +7,10 @@ import numpy as np import pandapower as pp import pandas as pd +from pypsdm.models.input.connector import Switches from pypsdm.models.input.container.raw_grid import RawGridContainer from pypsdm.models.input.create.grid_elements import ( + create_2w_transformers, create_lines, create_nodes, ) @@ -23,27 +25,27 @@ class UuidIdxMaps: def convert_grid( grid: pp.pandapowerNet, name: str = "", s_rated_mva: float = 1 -) -> Tuple[RawGridContainer, UuidIdxMaps]: +) -> Tuple[RawGridContainer]: - uuid_idx = UuidIdxMaps() + nodes, node_index_uuid_map = convert_nodes(grid) - net = RawGridContainer.empty() + line_types, line_index_line_type_uuid_map = convert_line_types( + grid, nodes, node_index_uuid_map + ) - nodes = convert_nodes(grid.bus) + lines = convert_lines(grid, line_index_line_type_uuid_map, node_index_uuid_map) - convert_lines(grid) + transformer_types, trafo_index_trafo_type_uuid_map = convert_transformer_types(grid) - for uuid, line in grid.line.data.iterrows(): - idx = convert_line(net, line, uuid_idx.node) - uuid_idx.line[uuid] = idx # type: ignore - - for uuid, trafo in grid.trafo.data.iterrows(): - idx = convert_transformer(net, trafo, uuid_idx.node) - uuid_idx.trafo[uuid] = idx # type: ignore + transformers = convert_transformers( + grid, trafo_index_trafo_type_uuid_map, node_index_uuid_map + ) # TODO convert switches - return net, uuid_idx + net = RawGridContainer(nodes, lines, transformers, Switches.create_empty) + + return net def get_default(value, default): From 5f063ed2a00041d0f7e84f57f389a3831081de0c Mon Sep 17 00:00:00 2001 From: danielfeismann Date: Thu, 12 Sep 2024 10:25:53 +0200 Subject: [PATCH 08/32] fix method inputs --- pp2psdm/grid.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pp2psdm/grid.py b/pp2psdm/grid.py index a42fe97..ee81666 100644 --- a/pp2psdm/grid.py +++ b/pp2psdm/grid.py @@ -24,7 +24,7 @@ class UuidIdxMaps: def convert_grid( - grid: pp.pandapowerNet, name: str = "", s_rated_mva: float = 1 + grid: pp.pandapowerNet ) -> Tuple[RawGridContainer]: nodes, node_index_uuid_map = convert_nodes(grid) From 30f5818e5597d852f042a950d0b63d464e879f19 Mon Sep 17 00:00:00 2001 From: danielfeismann Date: Thu, 12 Sep 2024 10:28:44 +0200 Subject: [PATCH 09/32] flake --- pp2psdm/grid.py | 4 +--- tests/test_grid.py | 18 +++++++++--------- 2 files changed, 10 insertions(+), 12 deletions(-) diff --git a/pp2psdm/grid.py b/pp2psdm/grid.py index ee81666..940a69a 100644 --- a/pp2psdm/grid.py +++ b/pp2psdm/grid.py @@ -23,9 +23,7 @@ class UuidIdxMaps: trafo: dict[str, int] = field(default_factory=dict) -def convert_grid( - grid: pp.pandapowerNet -) -> Tuple[RawGridContainer]: +def convert_grid(grid: pp.pandapowerNet) -> Tuple[RawGridContainer]: nodes, node_index_uuid_map = convert_nodes(grid) diff --git a/tests/test_grid.py b/tests/test_grid.py index 467b787..30c74a0 100644 --- a/tests/test_grid.py +++ b/tests/test_grid.py @@ -47,9 +47,9 @@ def test_nodes_conversion(input_data): assert net.data.iloc[i]["id"] == input.bus.iloc[i]["name"] assert net.data.iloc[i]["v_rated"] == input.bus.iloc[i]["vn_kv"] assert net.data.iloc[i]["subnet"] == 101 - assert net.data.iloc[i]["operates_from"] == None - assert net.data.iloc[i]["operates_until"] == None - assert net.data.iloc[i]["operator"] == None + assert net.data.iloc[i]["operates_from"] is None + assert net.data.iloc[i]["operates_until"] is None + assert net.data.iloc[i]["operator"] is None assert ( net.data.iloc[i]["geo_position"] == f'{{"type":"Point","coordinates":[{input.bus_geodata.iloc[i]["x"]},{input.bus_geodata.iloc[i]["y"]}],"crs":{{"type":"name","properties":{{"name":"EPSG:0"}}}}}}' @@ -104,9 +104,9 @@ def test_lines_conversion(input_data): ) assert net.data.iloc[i]["length"] == input.line.iloc[i]["length_km"] assert net.data.iloc[i]["olm_characteristic"] == "olm:{(0.0,1.0)}" - assert net.data.iloc[i]["operates_from"] == None - assert net.data.iloc[i]["operates_until"] == None - assert net.data.iloc[i]["operator"] == None + assert net.data.iloc[i]["operates_from"] is None + assert net.data.iloc[i]["operates_until"] is None + assert net.data.iloc[i]["operator"] is None assert net.data.iloc[i]["parallel_devices"] == input.line.iloc[i]["parallel"] assert net.data.iloc[i]["type"] == line_index_line_type_uuid_map.get(i) @@ -207,9 +207,9 @@ def test_trafo_conversion(input_data): assert net.data.iloc[i]["node_b"] == node_index_uuid_map.get( input.trafo.iloc[i]["lv_bus"] ) - assert net.data.iloc[i]["operates_from"] == None - assert net.data.iloc[i]["operates_until"] == None - assert net.data.iloc[i]["operator"] == None + assert net.data.iloc[i]["operates_from"] is None + assert net.data.iloc[i]["operates_until"] is None + assert net.data.iloc[i]["operator"] is None assert net.data.iloc[i]["parallel_devices"] == input.trafo.iloc[i]["parallel"] assert net.data.iloc[i]["tap_pos"] == input.trafo.iloc[i]["tap_pos"] assert net.data.iloc[i]["type"] == trafo_index_trafo_type_uuid_map.get(i) From 6f5d8da3b5e2e68b8f5cb70a8801ff3d40fdaf7b Mon Sep 17 00:00:00 2001 From: danielfeismann Date: Thu, 12 Sep 2024 10:35:28 +0200 Subject: [PATCH 10/32] fmt --- tests/test_grid.py | 24 ++++++++---------------- 1 file changed, 8 insertions(+), 16 deletions(-) diff --git a/tests/test_grid.py b/tests/test_grid.py index 30c74a0..9f85524 100644 --- a/tests/test_grid.py +++ b/tests/test_grid.py @@ -43,17 +43,16 @@ def test_nodes_conversion(input_data): _, input = input_data len = input.bus.shape[0] net, _ = convert_nodes(input) + for i in range(len): + coord_string = f'{{"type":"Point","coordinates":[{input.bus_geodata.iloc[i]["x"]},{input.bus_geodata.iloc[i]["y"]}],"crs":{{"type":"name","properties":{{"name":"EPSG:0"}}}}}}' assert net.data.iloc[i]["id"] == input.bus.iloc[i]["name"] assert net.data.iloc[i]["v_rated"] == input.bus.iloc[i]["vn_kv"] assert net.data.iloc[i]["subnet"] == 101 assert net.data.iloc[i]["operates_from"] is None assert net.data.iloc[i]["operates_until"] is None assert net.data.iloc[i]["operator"] is None - assert ( - net.data.iloc[i]["geo_position"] - == f'{{"type":"Point","coordinates":[{input.bus_geodata.iloc[i]["x"]},{input.bus_geodata.iloc[i]["y"]}],"crs":{{"type":"name","properties":{{"name":"EPSG:0"}}}}}}' - ) + assert net.data.iloc[i]["geo_position"] == coord_string def test_line_types_conversion(input_data): @@ -63,18 +62,11 @@ def test_line_types_conversion(input_data): net, _ = convert_line_types(input, nodes, node_index_uuid_map) for i in range(len): - assert ( - net.iloc[i]["v_rated"] - == nodes.get(node_index_uuid_map.get(input.line.iloc[i]["from_bus"]))[ - "v_target" - ] - ) - assert ( - net.iloc[i]["v_rated"] - == nodes.get(node_index_uuid_map.get(input.line.iloc[i]["to_bus"]))[ - "v_target" - ] - ) + + node_from_bus = node_index_uuid_map.get(input.line.iloc[i]["from_bus"]) + assert net.iloc[i]["v_rated"] == nodes.get(node_from_bus)["v_target"] + node_to_bus = node_index_uuid_map.get(input.line.iloc[i]["to_bus"]) + assert net.iloc[i]["v_rated"] == nodes.get(node_to_bus)["v_target"] assert math.isclose(net.iloc[i]["r"], input.line.iloc[i]["r_ohm_per_km"]) assert math.isclose(net.iloc[i]["x"], input.line.iloc[i]["x_ohm_per_km"]) assert math.isclose( From 1c401ef8216a8f730ea523ddaea32fb230c82d52 Mon Sep 17 00:00:00 2001 From: danielfeismann Date: Thu, 12 Sep 2024 10:41:21 +0200 Subject: [PATCH 11/32] update ci --- .github/workflows/simple-ci.yml | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/.github/workflows/simple-ci.yml b/.github/workflows/simple-ci.yml index 209f81b..558af02 100644 --- a/.github/workflows/simple-ci.yml +++ b/.github/workflows/simple-ci.yml @@ -1,10 +1,10 @@ name: CI on: - push: - branches: [ "main" ] - pull_request: - branches: [ "main" ] + push: + branches: ['main'] + pull_request: + branches: ['main'] jobs: linting: @@ -16,7 +16,7 @@ jobs: - uses: actions/checkout@v3 - uses: actions/setup-python@v4 with: - python-version: '3.10' + python-version: '3.10' #---------------------------------------------- # load pip cache if cache exists #---------------------------------------------- @@ -30,17 +30,17 @@ jobs: #---------------------------------------------- - run: python -m pip install black flake8 isort - run: | - flake8 . --count --show-source --statistics - black . --check - isort . + flake8 . --count --show-source --statistics + black . --check + isort . test: needs: linting strategy: fail-fast: true matrix: - os: [ "ubuntu-latest", "macos-latest" ] - python-version: [ "3.10"] + os: ['ubuntu-latest', 'macos-latest'] + python-version: ['3.11'] runs-on: ${{ matrix.os }} steps: #---------------------------------------------- @@ -87,4 +87,4 @@ jobs: - name: Run tests run: | source .venv/bin/activate - pytest tests/ \ No newline at end of file + pytest tests/ From 382c2227b6ce91d3e588e05ec27987eccb55c5f4 Mon Sep 17 00:00:00 2001 From: danielfeismann Date: Thu, 12 Sep 2024 10:49:59 +0200 Subject: [PATCH 12/32] poetry --- poetry.lock | 157 ++++++++++++++++++++++--------------------------- pyproject.toml | 1 - 2 files changed, 71 insertions(+), 87 deletions(-) diff --git a/poetry.lock b/poetry.lock index a949674..33b266d 100644 --- a/poetry.lock +++ b/poetry.lock @@ -873,69 +873,77 @@ files = [ [[package]] name = "greenlet" -version = "3.0.3" +version = "3.1.0" description = "Lightweight in-process concurrent programming" optional = false python-versions = ">=3.7" files = [ - {file = "greenlet-3.0.3-cp310-cp310-macosx_11_0_universal2.whl", hash = "sha256:9da2bd29ed9e4f15955dd1595ad7bc9320308a3b766ef7f837e23ad4b4aac31a"}, - {file = "greenlet-3.0.3-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:d353cadd6083fdb056bb46ed07e4340b0869c305c8ca54ef9da3421acbdf6881"}, - {file = "greenlet-3.0.3-cp310-cp310-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:dca1e2f3ca00b84a396bc1bce13dd21f680f035314d2379c4160c98153b2059b"}, - {file = "greenlet-3.0.3-cp310-cp310-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:3ed7fb269f15dc662787f4119ec300ad0702fa1b19d2135a37c2c4de6fadfd4a"}, - {file = "greenlet-3.0.3-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:dd4f49ae60e10adbc94b45c0b5e6a179acc1736cf7a90160b404076ee283cf83"}, - {file = "greenlet-3.0.3-cp310-cp310-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:73a411ef564e0e097dbe7e866bb2dda0f027e072b04da387282b02c308807405"}, - {file = "greenlet-3.0.3-cp310-cp310-musllinux_1_1_aarch64.whl", hash = "sha256:7f362975f2d179f9e26928c5b517524e89dd48530a0202570d55ad6ca5d8a56f"}, - {file = "greenlet-3.0.3-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:649dde7de1a5eceb258f9cb00bdf50e978c9db1b996964cd80703614c86495eb"}, - {file = "greenlet-3.0.3-cp310-cp310-win_amd64.whl", hash = "sha256:68834da854554926fbedd38c76e60c4a2e3198c6fbed520b106a8986445caaf9"}, - {file = "greenlet-3.0.3-cp311-cp311-macosx_11_0_universal2.whl", hash = "sha256:b1b5667cced97081bf57b8fa1d6bfca67814b0afd38208d52538316e9422fc61"}, - {file = "greenlet-3.0.3-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:52f59dd9c96ad2fc0d5724107444f76eb20aaccb675bf825df6435acb7703559"}, - {file = "greenlet-3.0.3-cp311-cp311-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:afaff6cf5200befd5cec055b07d1c0a5a06c040fe5ad148abcd11ba6ab9b114e"}, - {file = "greenlet-3.0.3-cp311-cp311-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:fe754d231288e1e64323cfad462fcee8f0288654c10bdf4f603a39ed923bef33"}, - {file = "greenlet-3.0.3-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:2797aa5aedac23af156bbb5a6aa2cd3427ada2972c828244eb7d1b9255846379"}, - {file = "greenlet-3.0.3-cp311-cp311-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:b7f009caad047246ed379e1c4dbcb8b020f0a390667ea74d2387be2998f58a22"}, - {file = "greenlet-3.0.3-cp311-cp311-musllinux_1_1_aarch64.whl", hash = "sha256:c5e1536de2aad7bf62e27baf79225d0d64360d4168cf2e6becb91baf1ed074f3"}, - {file = "greenlet-3.0.3-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:894393ce10ceac937e56ec00bb71c4c2f8209ad516e96033e4b3b1de270e200d"}, - {file = "greenlet-3.0.3-cp311-cp311-win_amd64.whl", hash = "sha256:1ea188d4f49089fc6fb283845ab18a2518d279c7cd9da1065d7a84e991748728"}, - {file = "greenlet-3.0.3-cp312-cp312-macosx_11_0_universal2.whl", hash = "sha256:70fb482fdf2c707765ab5f0b6655e9cfcf3780d8d87355a063547b41177599be"}, - {file = "greenlet-3.0.3-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:d4d1ac74f5c0c0524e4a24335350edad7e5f03b9532da7ea4d3c54d527784f2e"}, - {file = "greenlet-3.0.3-cp312-cp312-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:149e94a2dd82d19838fe4b2259f1b6b9957d5ba1b25640d2380bea9c5df37676"}, - {file = "greenlet-3.0.3-cp312-cp312-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:15d79dd26056573940fcb8c7413d84118086f2ec1a8acdfa854631084393efcc"}, - {file = "greenlet-3.0.3-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:881b7db1ebff4ba09aaaeae6aa491daeb226c8150fc20e836ad00041bcb11230"}, - {file = "greenlet-3.0.3-cp312-cp312-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:fcd2469d6a2cf298f198f0487e0a5b1a47a42ca0fa4dfd1b6862c999f018ebbf"}, - {file = "greenlet-3.0.3-cp312-cp312-musllinux_1_1_aarch64.whl", hash = "sha256:1f672519db1796ca0d8753f9e78ec02355e862d0998193038c7073045899f305"}, - {file = "greenlet-3.0.3-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:2516a9957eed41dd8f1ec0c604f1cdc86758b587d964668b5b196a9db5bfcde6"}, - {file = "greenlet-3.0.3-cp312-cp312-win_amd64.whl", hash = "sha256:bba5387a6975598857d86de9eac14210a49d554a77eb8261cc68b7d082f78ce2"}, - {file = "greenlet-3.0.3-cp37-cp37m-macosx_11_0_universal2.whl", hash = "sha256:5b51e85cb5ceda94e79d019ed36b35386e8c37d22f07d6a751cb659b180d5274"}, - {file = "greenlet-3.0.3-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:daf3cb43b7cf2ba96d614252ce1684c1bccee6b2183a01328c98d36fcd7d5cb0"}, - {file = "greenlet-3.0.3-cp37-cp37m-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:99bf650dc5d69546e076f413a87481ee1d2d09aaaaaca058c9251b6d8c14783f"}, - {file = "greenlet-3.0.3-cp37-cp37m-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:2dd6e660effd852586b6a8478a1d244b8dc90ab5b1321751d2ea15deb49ed414"}, - {file = "greenlet-3.0.3-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:e3391d1e16e2a5a1507d83e4a8b100f4ee626e8eca43cf2cadb543de69827c4c"}, - {file = "greenlet-3.0.3-cp37-cp37m-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:e1f145462f1fa6e4a4ae3c0f782e580ce44d57c8f2c7aae1b6fa88c0b2efdb41"}, - {file = "greenlet-3.0.3-cp37-cp37m-musllinux_1_1_aarch64.whl", hash = "sha256:1a7191e42732df52cb5f39d3527217e7ab73cae2cb3694d241e18f53d84ea9a7"}, - {file = "greenlet-3.0.3-cp37-cp37m-musllinux_1_1_x86_64.whl", hash = "sha256:0448abc479fab28b00cb472d278828b3ccca164531daab4e970a0458786055d6"}, - {file = "greenlet-3.0.3-cp37-cp37m-win32.whl", hash = "sha256:b542be2440edc2d48547b5923c408cbe0fc94afb9f18741faa6ae970dbcb9b6d"}, - {file = "greenlet-3.0.3-cp37-cp37m-win_amd64.whl", hash = "sha256:01bc7ea167cf943b4c802068e178bbf70ae2e8c080467070d01bfa02f337ee67"}, - {file = "greenlet-3.0.3-cp38-cp38-macosx_11_0_universal2.whl", hash = "sha256:1996cb9306c8595335bb157d133daf5cf9f693ef413e7673cb07e3e5871379ca"}, - {file = "greenlet-3.0.3-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:3ddc0f794e6ad661e321caa8d2f0a55ce01213c74722587256fb6566049a8b04"}, - {file = "greenlet-3.0.3-cp38-cp38-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:c9db1c18f0eaad2f804728c67d6c610778456e3e1cc4ab4bbd5eeb8e6053c6fc"}, - {file = "greenlet-3.0.3-cp38-cp38-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:7170375bcc99f1a2fbd9c306f5be8764eaf3ac6b5cb968862cad4c7057756506"}, - {file = "greenlet-3.0.3-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:6b66c9c1e7ccabad3a7d037b2bcb740122a7b17a53734b7d72a344ce39882a1b"}, - {file = "greenlet-3.0.3-cp38-cp38-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:098d86f528c855ead3479afe84b49242e174ed262456c342d70fc7f972bc13c4"}, - {file = "greenlet-3.0.3-cp38-cp38-musllinux_1_1_aarch64.whl", hash = "sha256:81bb9c6d52e8321f09c3d165b2a78c680506d9af285bfccbad9fb7ad5a5da3e5"}, - {file = "greenlet-3.0.3-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:fd096eb7ffef17c456cfa587523c5f92321ae02427ff955bebe9e3c63bc9f0da"}, - {file = "greenlet-3.0.3-cp38-cp38-win32.whl", hash = "sha256:d46677c85c5ba00a9cb6f7a00b2bfa6f812192d2c9f7d9c4f6a55b60216712f3"}, - {file = "greenlet-3.0.3-cp38-cp38-win_amd64.whl", hash = "sha256:419b386f84949bf0e7c73e6032e3457b82a787c1ab4a0e43732898a761cc9dbf"}, - {file = "greenlet-3.0.3-cp39-cp39-macosx_11_0_universal2.whl", hash = "sha256:da70d4d51c8b306bb7a031d5cff6cc25ad253affe89b70352af5f1cb68e74b53"}, - {file = "greenlet-3.0.3-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:086152f8fbc5955df88382e8a75984e2bb1c892ad2e3c80a2508954e52295257"}, - {file = "greenlet-3.0.3-cp39-cp39-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:d73a9fe764d77f87f8ec26a0c85144d6a951a6c438dfe50487df5595c6373eac"}, - {file = "greenlet-3.0.3-cp39-cp39-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:b7dcbe92cc99f08c8dd11f930de4d99ef756c3591a5377d1d9cd7dd5e896da71"}, - {file = "greenlet-3.0.3-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:1551a8195c0d4a68fac7a4325efac0d541b48def35feb49d803674ac32582f61"}, - {file = "greenlet-3.0.3-cp39-cp39-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:64d7675ad83578e3fc149b617a444fab8efdafc9385471f868eb5ff83e446b8b"}, - {file = "greenlet-3.0.3-cp39-cp39-musllinux_1_1_aarch64.whl", hash = "sha256:b37eef18ea55f2ffd8f00ff8fe7c8d3818abd3e25fb73fae2ca3b672e333a7a6"}, - {file = "greenlet-3.0.3-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:77457465d89b8263bca14759d7c1684df840b6811b2499838cc5b040a8b5b113"}, - {file = "greenlet-3.0.3-cp39-cp39-win32.whl", hash = "sha256:57e8974f23e47dac22b83436bdcf23080ade568ce77df33159e019d161ce1d1e"}, - {file = "greenlet-3.0.3-cp39-cp39-win_amd64.whl", hash = "sha256:c5ee858cfe08f34712f548c3c363e807e7186f03ad7a5039ebadb29e8c6be067"}, - {file = "greenlet-3.0.3.tar.gz", hash = "sha256:43374442353259554ce33599da8b692d5aa96f8976d567d4badf263371fbe491"}, + {file = "greenlet-3.1.0-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:a814dc3100e8a046ff48faeaa909e80cdb358411a3d6dd5293158425c684eda8"}, + {file = "greenlet-3.1.0-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:a771dc64fa44ebe58d65768d869fcfb9060169d203446c1d446e844b62bdfdca"}, + {file = "greenlet-3.1.0-cp310-cp310-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:0e49a65d25d7350cca2da15aac31b6f67a43d867448babf997fe83c7505f57bc"}, + {file = "greenlet-3.1.0-cp310-cp310-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:2cd8518eade968bc52262d8c46727cfc0826ff4d552cf0430b8d65aaf50bb91d"}, + {file = "greenlet-3.1.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:76dc19e660baea5c38e949455c1181bc018893f25372d10ffe24b3ed7341fb25"}, + {file = "greenlet-3.1.0-cp310-cp310-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:c0a5b1c22c82831f56f2f7ad9bbe4948879762fe0d59833a4a71f16e5fa0f682"}, + {file = "greenlet-3.1.0-cp310-cp310-musllinux_1_1_aarch64.whl", hash = "sha256:2651dfb006f391bcb240635079a68a261b227a10a08af6349cba834a2141efa1"}, + {file = "greenlet-3.1.0-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:3e7e6ef1737a819819b1163116ad4b48d06cfdd40352d813bb14436024fcda99"}, + {file = "greenlet-3.1.0-cp310-cp310-win_amd64.whl", hash = "sha256:ffb08f2a1e59d38c7b8b9ac8083c9c8b9875f0955b1e9b9b9a965607a51f8e54"}, + {file = "greenlet-3.1.0-cp311-cp311-macosx_10_9_universal2.whl", hash = "sha256:9730929375021ec90f6447bff4f7f5508faef1c02f399a1953870cdb78e0c345"}, + {file = "greenlet-3.1.0-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:713d450cf8e61854de9420fb7eea8ad228df4e27e7d4ed465de98c955d2b3fa6"}, + {file = "greenlet-3.1.0-cp311-cp311-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:4c3446937be153718250fe421da548f973124189f18fe4575a0510b5c928f0cc"}, + {file = "greenlet-3.1.0-cp311-cp311-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:1ddc7bcedeb47187be74208bc652d63d6b20cb24f4e596bd356092d8000da6d6"}, + {file = "greenlet-3.1.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:44151d7b81b9391ed759a2f2865bbe623ef00d648fed59363be2bbbd5154656f"}, + {file = "greenlet-3.1.0-cp311-cp311-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:6cea1cca3be76c9483282dc7760ea1cc08a6ecec1f0b6ca0a94ea0d17432da19"}, + {file = "greenlet-3.1.0-cp311-cp311-musllinux_1_1_aarch64.whl", hash = "sha256:619935a44f414274a2c08c9e74611965650b730eb4efe4b2270f91df5e4adf9a"}, + {file = "greenlet-3.1.0-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:221169d31cada333a0c7fd087b957c8f431c1dba202c3a58cf5a3583ed973e9b"}, + {file = "greenlet-3.1.0-cp311-cp311-win_amd64.whl", hash = "sha256:01059afb9b178606b4b6e92c3e710ea1635597c3537e44da69f4531e111dd5e9"}, + {file = "greenlet-3.1.0-cp312-cp312-macosx_11_0_universal2.whl", hash = "sha256:24fc216ec7c8be9becba8b64a98a78f9cd057fd2dc75ae952ca94ed8a893bf27"}, + {file = "greenlet-3.1.0-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:3d07c28b85b350564bdff9f51c1c5007dfb2f389385d1bc23288de51134ca303"}, + {file = "greenlet-3.1.0-cp312-cp312-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:243a223c96a4246f8a30ea470c440fe9db1f5e444941ee3c3cd79df119b8eebf"}, + {file = "greenlet-3.1.0-cp312-cp312-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:26811df4dc81271033a7836bc20d12cd30938e6bd2e9437f56fa03da81b0f8fc"}, + {file = "greenlet-3.1.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:c9d86401550b09a55410f32ceb5fe7efcd998bd2dad9e82521713cb148a4a15f"}, + {file = "greenlet-3.1.0-cp312-cp312-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:26d9c1c4f1748ccac0bae1dbb465fb1a795a75aba8af8ca871503019f4285e2a"}, + {file = "greenlet-3.1.0-cp312-cp312-musllinux_1_1_aarch64.whl", hash = "sha256:cd468ec62257bb4544989402b19d795d2305eccb06cde5da0eb739b63dc04665"}, + {file = "greenlet-3.1.0-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:a53dfe8f82b715319e9953330fa5c8708b610d48b5c59f1316337302af5c0811"}, + {file = "greenlet-3.1.0-cp312-cp312-win_amd64.whl", hash = "sha256:28fe80a3eb673b2d5cc3b12eea468a5e5f4603c26aa34d88bf61bba82ceb2f9b"}, + {file = "greenlet-3.1.0-cp313-cp313-macosx_11_0_universal2.whl", hash = "sha256:76b3e3976d2a452cba7aa9e453498ac72240d43030fdc6d538a72b87eaff52fd"}, + {file = "greenlet-3.1.0-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:655b21ffd37a96b1e78cc48bf254f5ea4b5b85efaf9e9e2a526b3c9309d660ca"}, + {file = "greenlet-3.1.0-cp313-cp313-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:c6f4c2027689093775fd58ca2388d58789009116844432d920e9147f91acbe64"}, + {file = "greenlet-3.1.0-cp313-cp313-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:76e5064fd8e94c3f74d9fd69b02d99e3cdb8fc286ed49a1f10b256e59d0d3a0b"}, + {file = "greenlet-3.1.0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:6a4bf607f690f7987ab3291406e012cd8591a4f77aa54f29b890f9c331e84989"}, + {file = "greenlet-3.1.0-cp313-cp313-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:037d9ac99540ace9424cb9ea89f0accfaff4316f149520b4ae293eebc5bded17"}, + {file = "greenlet-3.1.0-cp313-cp313-musllinux_1_1_aarch64.whl", hash = "sha256:90b5bbf05fe3d3ef697103850c2ce3374558f6fe40fd57c9fac1bf14903f50a5"}, + {file = "greenlet-3.1.0-cp313-cp313-musllinux_1_1_x86_64.whl", hash = "sha256:726377bd60081172685c0ff46afbc600d064f01053190e4450857483c4d44484"}, + {file = "greenlet-3.1.0-cp313-cp313-win_amd64.whl", hash = "sha256:d46d5069e2eeda111d6f71970e341f4bd9aeeee92074e649ae263b834286ecc0"}, + {file = "greenlet-3.1.0-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:81eeec4403a7d7684b5812a8aaa626fa23b7d0848edb3a28d2eb3220daddcbd0"}, + {file = "greenlet-3.1.0-cp37-cp37m-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:4a3dae7492d16e85ea6045fd11cb8e782b63eac8c8d520c3a92c02ac4573b0a6"}, + {file = "greenlet-3.1.0-cp37-cp37m-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:4b5ea3664eed571779403858d7cd0a9b0ebf50d57d2cdeafc7748e09ef8cd81a"}, + {file = "greenlet-3.1.0-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:a22f4e26400f7f48faef2d69c20dc055a1f3043d330923f9abe08ea0aecc44df"}, + {file = "greenlet-3.1.0-cp37-cp37m-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:13ff8c8e54a10472ce3b2a2da007f915175192f18e6495bad50486e87c7f6637"}, + {file = "greenlet-3.1.0-cp37-cp37m-musllinux_1_1_aarch64.whl", hash = "sha256:f9671e7282d8c6fcabc32c0fb8d7c0ea8894ae85cee89c9aadc2d7129e1a9954"}, + {file = "greenlet-3.1.0-cp37-cp37m-musllinux_1_1_x86_64.whl", hash = "sha256:184258372ae9e1e9bddce6f187967f2e08ecd16906557c4320e3ba88a93438c3"}, + {file = "greenlet-3.1.0-cp37-cp37m-win32.whl", hash = "sha256:a0409bc18a9f85321399c29baf93545152d74a49d92f2f55302f122007cfda00"}, + {file = "greenlet-3.1.0-cp37-cp37m-win_amd64.whl", hash = "sha256:9eb4a1d7399b9f3c7ac68ae6baa6be5f9195d1d08c9ddc45ad559aa6b556bce6"}, + {file = "greenlet-3.1.0-cp38-cp38-macosx_11_0_universal2.whl", hash = "sha256:a8870983af660798dc1b529e1fd6f1cefd94e45135a32e58bd70edd694540f33"}, + {file = "greenlet-3.1.0-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:cfcfb73aed40f550a57ea904629bdaf2e562c68fa1164fa4588e752af6efdc3f"}, + {file = "greenlet-3.1.0-cp38-cp38-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:f9482c2ed414781c0af0b35d9d575226da6b728bd1a720668fa05837184965b7"}, + {file = "greenlet-3.1.0-cp38-cp38-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:d58ec349e0c2c0bc6669bf2cd4982d2f93bf067860d23a0ea1fe677b0f0b1e09"}, + {file = "greenlet-3.1.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:dd65695a8df1233309b701dec2539cc4b11e97d4fcc0f4185b4a12ce54db0491"}, + {file = "greenlet-3.1.0-cp38-cp38-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:665b21e95bc0fce5cab03b2e1d90ba9c66c510f1bb5fdc864f3a377d0f553f6b"}, + {file = "greenlet-3.1.0-cp38-cp38-musllinux_1_1_aarch64.whl", hash = "sha256:d3c59a06c2c28a81a026ff11fbf012081ea34fb9b7052f2ed0366e14896f0a1d"}, + {file = "greenlet-3.1.0-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:5415b9494ff6240b09af06b91a375731febe0090218e2898d2b85f9b92abcda0"}, + {file = "greenlet-3.1.0-cp38-cp38-win32.whl", hash = "sha256:1544b8dd090b494c55e60c4ff46e238be44fdc472d2589e943c241e0169bcea2"}, + {file = "greenlet-3.1.0-cp38-cp38-win_amd64.whl", hash = "sha256:7f346d24d74c00b6730440f5eb8ec3fe5774ca8d1c9574e8e57c8671bb51b910"}, + {file = "greenlet-3.1.0-cp39-cp39-macosx_10_9_universal2.whl", hash = "sha256:db1b3ccb93488328c74e97ff888604a8b95ae4f35f4f56677ca57a4fc3a4220b"}, + {file = "greenlet-3.1.0-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:44cd313629ded43bb3b98737bba2f3e2c2c8679b55ea29ed73daea6b755fe8e7"}, + {file = "greenlet-3.1.0-cp39-cp39-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:fad7a051e07f64e297e6e8399b4d6a3bdcad3d7297409e9a06ef8cbccff4f501"}, + {file = "greenlet-3.1.0-cp39-cp39-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:c3967dcc1cd2ea61b08b0b276659242cbce5caca39e7cbc02408222fb9e6ff39"}, + {file = "greenlet-3.1.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:d45b75b0f3fd8d99f62eb7908cfa6d727b7ed190737dec7fe46d993da550b81a"}, + {file = "greenlet-3.1.0-cp39-cp39-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:2d004db911ed7b6218ec5c5bfe4cf70ae8aa2223dffbb5b3c69e342bb253cb28"}, + {file = "greenlet-3.1.0-cp39-cp39-musllinux_1_1_aarch64.whl", hash = "sha256:b9505a0c8579899057cbefd4ec34d865ab99852baf1ff33a9481eb3924e2da0b"}, + {file = "greenlet-3.1.0-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:5fd6e94593f6f9714dbad1aaba734b5ec04593374fa6638df61592055868f8b8"}, + {file = "greenlet-3.1.0-cp39-cp39-win32.whl", hash = "sha256:d0dd943282231480aad5f50f89bdf26690c995e8ff555f26d8a5b9887b559bcc"}, + {file = "greenlet-3.1.0-cp39-cp39-win_amd64.whl", hash = "sha256:ac0adfdb3a21dc2a24ed728b61e72440d297d0fd3a577389df566651fcd08f97"}, + {file = "greenlet-3.1.0.tar.gz", hash = "sha256:b395121e9bbe8d02a750886f108d540abe66075e61e22f7353d9acb0b81be0f0"}, ] [package.extras] @@ -2888,13 +2896,13 @@ files = [ [[package]] name = "pytz" -version = "2024.1" +version = "2024.2" description = "World timezone definitions, modern and historical" optional = false python-versions = "*" files = [ - {file = "pytz-2024.1-py2.py3-none-any.whl", hash = "sha256:328171f4e3623139da4983451950b28e95ac706e13f3f2630a879749e7a8b319"}, - {file = "pytz-2024.1.tar.gz", hash = "sha256:2a29735ea9c18baf14b448846bde5a48030ed267578472d8955cd0e7443a9812"}, + {file = "pytz-2024.2-py2.py3-none-any.whl", hash = "sha256:31c7c1817eb7fae7ca4b8c7ee50c72f93aa2dd863de768e1ef4245d426aa0725"}, + {file = "pytz-2024.2.tar.gz", hash = "sha256:2aa355083c50a0f93fa581709deac0c9ad65cca8a9e9beac660adcbd493c798a"}, ] [[package]] @@ -3448,29 +3456,6 @@ numpy = ">=1.14,<3" docs = ["matplotlib", "numpydoc (==1.1.*)", "sphinx", "sphinx-book-theme", "sphinx-remove-toctrees"] test = ["pytest", "pytest-cov"] -[[package]] -name = "simbench" -version = "1.5.3" -description = "Electrical Power System Benchmark Models." -optional = false -python-versions = ">=3.8" -files = [ - {file = "simbench-1.5.3-py3-none-any.whl", hash = "sha256:4728e7d5894e34715436f4e73b6bb479045f37df97188f835330af6c5982b260"}, - {file = "simbench-1.5.3.tar.gz", hash = "sha256:518db08a9a72180de4ce0668715f7cf796dc50a1b5a973b0b6ff0bbaf938e8a8"}, -] - -[package.dependencies] -pandapower = ">=2.12.1" - -[package.extras] -all = ["geojson", "geopandas", "igraph", "lightsim2grid (>=0.8.1)", "matplotlib", "nbmake", "numba (>=0.25)", "ortools", "plotly (>=3.1.1)", "pytest (>=8.1,<9.0)", "pytest-xdist"] -docs = ["numpydoc", "sphinx", "sphinx-pyproject", "sphinx-rtd-theme"] -fileio = ["geopandas"] -performance = ["lightsim2grid (>=0.8.1)", "numba (>=0.25)", "ortools"] -plotting = ["geojson", "geopandas", "igraph", "matplotlib", "plotly (>=3.1.1)"] -test = ["nbmake", "pytest (>=8.1,<9.0)", "pytest-xdist"] -tutorials = ["matplotlib"] - [[package]] name = "six" version = "1.16.0" @@ -3910,4 +3895,4 @@ dev = ["black (>=19.3b0)", "pytest (>=4.6.2)"] [metadata] lock-version = "2.0" python-versions = "<3.12,>3.11" -content-hash = "f6ae7631878d4b6ea023239d33dd0c72d4acff14461b308c18d06de42c05b9b7" +content-hash = "593810d37c67171128702e0313580dde9c7ddbcf9e331e92fa30db76253f96c6" diff --git a/pyproject.toml b/pyproject.toml index 5a8b3ce..046424d 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -9,7 +9,6 @@ readme = "README.md" python = "<3.12,>3.11" pypsdm = {git = "https://github.com/ie3-institute/pypsdm.git"} pandapower = "^2.14.11" -simbench = "^1.5.3" [tool.poetry.group.dev.dependencies] pytest = "^7.2.1" From 854482936e8a1b35db1e748884efa8eb659d5014 Mon Sep 17 00:00:00 2001 From: danielfeismann Date: Thu, 12 Sep 2024 11:10:54 +0200 Subject: [PATCH 13/32] poetry --- pyproject.toml | 1 + 1 file changed, 1 insertion(+) diff --git a/pyproject.toml b/pyproject.toml index 046424d..901b304 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -9,6 +9,7 @@ readme = "README.md" python = "<3.12,>3.11" pypsdm = {git = "https://github.com/ie3-institute/pypsdm.git"} pandapower = "^2.14.11" +psycopg2-binary = ">=2.9.9" [tool.poetry.group.dev.dependencies] pytest = "^7.2.1" From 4345c06861f01b4072e9f8d975a9598d12526302 Mon Sep 17 00:00:00 2001 From: danielfeismann Date: Thu, 12 Sep 2024 11:30:52 +0200 Subject: [PATCH 14/32] poetry --- pyproject.toml | 1 - 1 file changed, 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 901b304..046424d 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -9,7 +9,6 @@ readme = "README.md" python = "<3.12,>3.11" pypsdm = {git = "https://github.com/ie3-institute/pypsdm.git"} pandapower = "^2.14.11" -psycopg2-binary = ">=2.9.9" [tool.poetry.group.dev.dependencies] pytest = "^7.2.1" From 505ebd218e9a2b2d33fadcf22018320293df82c1 Mon Sep 17 00:00:00 2001 From: danielfeismann Date: Thu, 12 Sep 2024 11:33:42 +0200 Subject: [PATCH 15/32] asyncpg --- pyproject.toml | 1 + 1 file changed, 1 insertion(+) diff --git a/pyproject.toml b/pyproject.toml index 046424d..e382b69 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -9,6 +9,7 @@ readme = "README.md" python = "<3.12,>3.11" pypsdm = {git = "https://github.com/ie3-institute/pypsdm.git"} pandapower = "^2.14.11" +asyncpg = ">=0.25.0" [tool.poetry.group.dev.dependencies] pytest = "^7.2.1" From d1f735d5ca336f91baf0eaa81fb615b4497fbf09 Mon Sep 17 00:00:00 2001 From: danielfeismann Date: Thu, 12 Sep 2024 11:34:03 +0200 Subject: [PATCH 16/32] asyncpg poetry --- poetry.lock | 70 ++++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 69 insertions(+), 1 deletion(-) diff --git a/poetry.lock b/poetry.lock index 33b266d..5adce98 100644 --- a/poetry.lock +++ b/poetry.lock @@ -147,6 +147,74 @@ files = [ {file = "async_lru-2.0.4-py3-none-any.whl", hash = "sha256:ff02944ce3c288c5be660c42dbcca0742b32c3b279d6dceda655190240b99224"}, ] +[[package]] +name = "async-timeout" +version = "4.0.3" +description = "Timeout context manager for asyncio programs" +optional = false +python-versions = ">=3.7" +files = [ + {file = "async-timeout-4.0.3.tar.gz", hash = "sha256:4640d96be84d82d02ed59ea2b7105a0f7b33abe8703703cd0ab0bf87c427522f"}, + {file = "async_timeout-4.0.3-py3-none-any.whl", hash = "sha256:7405140ff1230c310e51dc27b3145b9092d659ce68ff733fb0cefe3ee42be028"}, +] + +[[package]] +name = "asyncpg" +version = "0.29.0" +description = "An asyncio PostgreSQL driver" +optional = false +python-versions = ">=3.8.0" +files = [ + {file = "asyncpg-0.29.0-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:72fd0ef9f00aeed37179c62282a3d14262dbbafb74ec0ba16e1b1864d8a12169"}, + {file = "asyncpg-0.29.0-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:52e8f8f9ff6e21f9b39ca9f8e3e33a5fcdceaf5667a8c5c32bee158e313be385"}, + {file = "asyncpg-0.29.0-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:a9e6823a7012be8b68301342ba33b4740e5a166f6bbda0aee32bc01638491a22"}, + {file = "asyncpg-0.29.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:746e80d83ad5d5464cfbf94315eb6744222ab00aa4e522b704322fb182b83610"}, + {file = "asyncpg-0.29.0-cp310-cp310-musllinux_1_1_aarch64.whl", hash = "sha256:ff8e8109cd6a46ff852a5e6bab8b0a047d7ea42fcb7ca5ae6eaae97d8eacf397"}, + {file = "asyncpg-0.29.0-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:97eb024685b1d7e72b1972863de527c11ff87960837919dac6e34754768098eb"}, + {file = "asyncpg-0.29.0-cp310-cp310-win32.whl", hash = "sha256:5bbb7f2cafd8d1fa3e65431833de2642f4b2124be61a449fa064e1a08d27e449"}, + {file = "asyncpg-0.29.0-cp310-cp310-win_amd64.whl", hash = "sha256:76c3ac6530904838a4b650b2880f8e7af938ee049e769ec2fba7cd66469d7772"}, + {file = "asyncpg-0.29.0-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:d4900ee08e85af01adb207519bb4e14b1cae8fd21e0ccf80fac6aa60b6da37b4"}, + {file = "asyncpg-0.29.0-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:a65c1dcd820d5aea7c7d82a3fdcb70e096f8f70d1a8bf93eb458e49bfad036ac"}, + {file = "asyncpg-0.29.0-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:5b52e46f165585fd6af4863f268566668407c76b2c72d366bb8b522fa66f1870"}, + {file = "asyncpg-0.29.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:dc600ee8ef3dd38b8d67421359779f8ccec30b463e7aec7ed481c8346decf99f"}, + {file = "asyncpg-0.29.0-cp311-cp311-musllinux_1_1_aarch64.whl", hash = "sha256:039a261af4f38f949095e1e780bae84a25ffe3e370175193174eb08d3cecab23"}, + {file = "asyncpg-0.29.0-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:6feaf2d8f9138d190e5ec4390c1715c3e87b37715cd69b2c3dfca616134efd2b"}, + {file = "asyncpg-0.29.0-cp311-cp311-win32.whl", hash = "sha256:1e186427c88225ef730555f5fdda6c1812daa884064bfe6bc462fd3a71c4b675"}, + {file = "asyncpg-0.29.0-cp311-cp311-win_amd64.whl", hash = "sha256:cfe73ffae35f518cfd6e4e5f5abb2618ceb5ef02a2365ce64f132601000587d3"}, + {file = "asyncpg-0.29.0-cp312-cp312-macosx_10_9_x86_64.whl", hash = "sha256:6011b0dc29886ab424dc042bf9eeb507670a3b40aece3439944006aafe023178"}, + {file = "asyncpg-0.29.0-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:b544ffc66b039d5ec5a7454667f855f7fec08e0dfaf5a5490dfafbb7abbd2cfb"}, + {file = "asyncpg-0.29.0-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:d84156d5fb530b06c493f9e7635aa18f518fa1d1395ef240d211cb563c4e2364"}, + {file = "asyncpg-0.29.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:54858bc25b49d1114178d65a88e48ad50cb2b6f3e475caa0f0c092d5f527c106"}, + {file = "asyncpg-0.29.0-cp312-cp312-musllinux_1_1_aarch64.whl", hash = "sha256:bde17a1861cf10d5afce80a36fca736a86769ab3579532c03e45f83ba8a09c59"}, + {file = "asyncpg-0.29.0-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:37a2ec1b9ff88d8773d3eb6d3784dc7e3fee7756a5317b67f923172a4748a175"}, + {file = "asyncpg-0.29.0-cp312-cp312-win32.whl", hash = "sha256:bb1292d9fad43112a85e98ecdc2e051602bce97c199920586be83254d9dafc02"}, + {file = "asyncpg-0.29.0-cp312-cp312-win_amd64.whl", hash = "sha256:2245be8ec5047a605e0b454c894e54bf2ec787ac04b1cb7e0d3c67aa1e32f0fe"}, + {file = "asyncpg-0.29.0-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:0009a300cae37b8c525e5b449233d59cd9868fd35431abc470a3e364d2b85cb9"}, + {file = "asyncpg-0.29.0-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:5cad1324dbb33f3ca0cd2074d5114354ed3be2b94d48ddfd88af75ebda7c43cc"}, + {file = "asyncpg-0.29.0-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:012d01df61e009015944ac7543d6ee30c2dc1eb2f6b10b62a3f598beb6531548"}, + {file = "asyncpg-0.29.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:000c996c53c04770798053e1730d34e30cb645ad95a63265aec82da9093d88e7"}, + {file = "asyncpg-0.29.0-cp38-cp38-musllinux_1_1_aarch64.whl", hash = "sha256:e0bfe9c4d3429706cf70d3249089de14d6a01192d617e9093a8e941fea8ee775"}, + {file = "asyncpg-0.29.0-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:642a36eb41b6313ffa328e8a5c5c2b5bea6ee138546c9c3cf1bffaad8ee36dd9"}, + {file = "asyncpg-0.29.0-cp38-cp38-win32.whl", hash = "sha256:a921372bbd0aa3a5822dd0409da61b4cd50df89ae85150149f8c119f23e8c408"}, + {file = "asyncpg-0.29.0-cp38-cp38-win_amd64.whl", hash = "sha256:103aad2b92d1506700cbf51cd8bb5441e7e72e87a7b3a2ca4e32c840f051a6a3"}, + {file = "asyncpg-0.29.0-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:5340dd515d7e52f4c11ada32171d87c05570479dc01dc66d03ee3e150fb695da"}, + {file = "asyncpg-0.29.0-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:e17b52c6cf83e170d3d865571ba574577ab8e533e7361a2b8ce6157d02c665d3"}, + {file = "asyncpg-0.29.0-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:f100d23f273555f4b19b74a96840aa27b85e99ba4b1f18d4ebff0734e78dc090"}, + {file = "asyncpg-0.29.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:48e7c58b516057126b363cec8ca02b804644fd012ef8e6c7e23386b7d5e6ce83"}, + {file = "asyncpg-0.29.0-cp39-cp39-musllinux_1_1_aarch64.whl", hash = "sha256:f9ea3f24eb4c49a615573724d88a48bd1b7821c890c2effe04f05382ed9e8810"}, + {file = "asyncpg-0.29.0-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:8d36c7f14a22ec9e928f15f92a48207546ffe68bc412f3be718eedccdf10dc5c"}, + {file = "asyncpg-0.29.0-cp39-cp39-win32.whl", hash = "sha256:797ab8123ebaed304a1fad4d7576d5376c3a006a4100380fb9d517f0b59c1ab2"}, + {file = "asyncpg-0.29.0-cp39-cp39-win_amd64.whl", hash = "sha256:cce08a178858b426ae1aa8409b5cc171def45d4293626e7aa6510696d46decd8"}, + {file = "asyncpg-0.29.0.tar.gz", hash = "sha256:d1c49e1f44fffafd9a55e1a9b101590859d881d639ea2922516f5d9c512d354e"}, +] + +[package.dependencies] +async-timeout = {version = ">=4.0.3", markers = "python_version < \"3.12.0\""} + +[package.extras] +docs = ["Sphinx (>=5.3.0,<5.4.0)", "sphinx-rtd-theme (>=1.2.2)", "sphinxcontrib-asyncio (>=0.3.0,<0.4.0)"] +test = ["flake8 (>=6.1,<7.0)", "uvloop (>=0.15.3)"] + [[package]] name = "attrs" version = "24.2.0" @@ -3895,4 +3963,4 @@ dev = ["black (>=19.3b0)", "pytest (>=4.6.2)"] [metadata] lock-version = "2.0" python-versions = "<3.12,>3.11" -content-hash = "593810d37c67171128702e0313580dde9c7ddbcf9e331e92fa30db76253f96c6" +content-hash = "1c77de773ff96625f5eb94d7ddd8ab1e33823a4cebb71700cdb904992f22f0d4" From cfdb2047bdc33b7263660296f71273923a98d5db Mon Sep 17 00:00:00 2001 From: danielfeismann Date: Thu, 12 Sep 2024 11:45:52 +0200 Subject: [PATCH 17/32] pg8000 = ">=1.29.0" --- poetry.lock | 110 ++++++++++++++++++------------------------------- pyproject.toml | 2 +- 2 files changed, 42 insertions(+), 70 deletions(-) diff --git a/poetry.lock b/poetry.lock index 5adce98..af947eb 100644 --- a/poetry.lock +++ b/poetry.lock @@ -118,6 +118,17 @@ types-python-dateutil = ">=2.8.10" doc = ["doc8", "sphinx (>=7.0.0)", "sphinx-autobuild", "sphinx-autodoc-typehints", "sphinx_rtd_theme (>=1.3.0)"] test = ["dateparser (==1.*)", "pre-commit", "pytest", "pytest-cov", "pytest-mock", "pytz (==2021.1)", "simplejson (==3.*)"] +[[package]] +name = "asn1crypto" +version = "1.5.1" +description = "Fast ASN.1 parser and serializer with definitions for private keys, public keys, certificates, CRL, OCSP, CMS, PKCS#3, PKCS#7, PKCS#8, PKCS#12, PKCS#5, X.509 and TSP" +optional = false +python-versions = "*" +files = [ + {file = "asn1crypto-1.5.1-py2.py3-none-any.whl", hash = "sha256:db4e40728b728508912cbb3d44f19ce188f218e9eba635821bb4b68564f8fd67"}, + {file = "asn1crypto-1.5.1.tar.gz", hash = "sha256:13ae38502be632115abf8a24cbe5f4da52e3b5231990aff31123c805306ccb9c"}, +] + [[package]] name = "asttokens" version = "2.4.1" @@ -147,74 +158,6 @@ files = [ {file = "async_lru-2.0.4-py3-none-any.whl", hash = "sha256:ff02944ce3c288c5be660c42dbcca0742b32c3b279d6dceda655190240b99224"}, ] -[[package]] -name = "async-timeout" -version = "4.0.3" -description = "Timeout context manager for asyncio programs" -optional = false -python-versions = ">=3.7" -files = [ - {file = "async-timeout-4.0.3.tar.gz", hash = "sha256:4640d96be84d82d02ed59ea2b7105a0f7b33abe8703703cd0ab0bf87c427522f"}, - {file = "async_timeout-4.0.3-py3-none-any.whl", hash = "sha256:7405140ff1230c310e51dc27b3145b9092d659ce68ff733fb0cefe3ee42be028"}, -] - -[[package]] -name = "asyncpg" -version = "0.29.0" -description = "An asyncio PostgreSQL driver" -optional = false -python-versions = ">=3.8.0" -files = [ - {file = "asyncpg-0.29.0-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:72fd0ef9f00aeed37179c62282a3d14262dbbafb74ec0ba16e1b1864d8a12169"}, - {file = "asyncpg-0.29.0-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:52e8f8f9ff6e21f9b39ca9f8e3e33a5fcdceaf5667a8c5c32bee158e313be385"}, - {file = "asyncpg-0.29.0-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:a9e6823a7012be8b68301342ba33b4740e5a166f6bbda0aee32bc01638491a22"}, - {file = "asyncpg-0.29.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:746e80d83ad5d5464cfbf94315eb6744222ab00aa4e522b704322fb182b83610"}, - {file = "asyncpg-0.29.0-cp310-cp310-musllinux_1_1_aarch64.whl", hash = "sha256:ff8e8109cd6a46ff852a5e6bab8b0a047d7ea42fcb7ca5ae6eaae97d8eacf397"}, - {file = "asyncpg-0.29.0-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:97eb024685b1d7e72b1972863de527c11ff87960837919dac6e34754768098eb"}, - {file = "asyncpg-0.29.0-cp310-cp310-win32.whl", hash = "sha256:5bbb7f2cafd8d1fa3e65431833de2642f4b2124be61a449fa064e1a08d27e449"}, - {file = "asyncpg-0.29.0-cp310-cp310-win_amd64.whl", hash = "sha256:76c3ac6530904838a4b650b2880f8e7af938ee049e769ec2fba7cd66469d7772"}, - {file = "asyncpg-0.29.0-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:d4900ee08e85af01adb207519bb4e14b1cae8fd21e0ccf80fac6aa60b6da37b4"}, - {file = "asyncpg-0.29.0-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:a65c1dcd820d5aea7c7d82a3fdcb70e096f8f70d1a8bf93eb458e49bfad036ac"}, - {file = "asyncpg-0.29.0-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:5b52e46f165585fd6af4863f268566668407c76b2c72d366bb8b522fa66f1870"}, - {file = "asyncpg-0.29.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:dc600ee8ef3dd38b8d67421359779f8ccec30b463e7aec7ed481c8346decf99f"}, - {file = "asyncpg-0.29.0-cp311-cp311-musllinux_1_1_aarch64.whl", hash = "sha256:039a261af4f38f949095e1e780bae84a25ffe3e370175193174eb08d3cecab23"}, - {file = "asyncpg-0.29.0-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:6feaf2d8f9138d190e5ec4390c1715c3e87b37715cd69b2c3dfca616134efd2b"}, - {file = "asyncpg-0.29.0-cp311-cp311-win32.whl", hash = "sha256:1e186427c88225ef730555f5fdda6c1812daa884064bfe6bc462fd3a71c4b675"}, - {file = "asyncpg-0.29.0-cp311-cp311-win_amd64.whl", hash = "sha256:cfe73ffae35f518cfd6e4e5f5abb2618ceb5ef02a2365ce64f132601000587d3"}, - {file = "asyncpg-0.29.0-cp312-cp312-macosx_10_9_x86_64.whl", hash = "sha256:6011b0dc29886ab424dc042bf9eeb507670a3b40aece3439944006aafe023178"}, - {file = "asyncpg-0.29.0-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:b544ffc66b039d5ec5a7454667f855f7fec08e0dfaf5a5490dfafbb7abbd2cfb"}, - {file = "asyncpg-0.29.0-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:d84156d5fb530b06c493f9e7635aa18f518fa1d1395ef240d211cb563c4e2364"}, - {file = "asyncpg-0.29.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:54858bc25b49d1114178d65a88e48ad50cb2b6f3e475caa0f0c092d5f527c106"}, - {file = "asyncpg-0.29.0-cp312-cp312-musllinux_1_1_aarch64.whl", hash = "sha256:bde17a1861cf10d5afce80a36fca736a86769ab3579532c03e45f83ba8a09c59"}, - {file = "asyncpg-0.29.0-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:37a2ec1b9ff88d8773d3eb6d3784dc7e3fee7756a5317b67f923172a4748a175"}, - {file = "asyncpg-0.29.0-cp312-cp312-win32.whl", hash = "sha256:bb1292d9fad43112a85e98ecdc2e051602bce97c199920586be83254d9dafc02"}, - {file = "asyncpg-0.29.0-cp312-cp312-win_amd64.whl", hash = "sha256:2245be8ec5047a605e0b454c894e54bf2ec787ac04b1cb7e0d3c67aa1e32f0fe"}, - {file = "asyncpg-0.29.0-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:0009a300cae37b8c525e5b449233d59cd9868fd35431abc470a3e364d2b85cb9"}, - {file = "asyncpg-0.29.0-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:5cad1324dbb33f3ca0cd2074d5114354ed3be2b94d48ddfd88af75ebda7c43cc"}, - {file = "asyncpg-0.29.0-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:012d01df61e009015944ac7543d6ee30c2dc1eb2f6b10b62a3f598beb6531548"}, - {file = "asyncpg-0.29.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:000c996c53c04770798053e1730d34e30cb645ad95a63265aec82da9093d88e7"}, - {file = "asyncpg-0.29.0-cp38-cp38-musllinux_1_1_aarch64.whl", hash = "sha256:e0bfe9c4d3429706cf70d3249089de14d6a01192d617e9093a8e941fea8ee775"}, - {file = "asyncpg-0.29.0-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:642a36eb41b6313ffa328e8a5c5c2b5bea6ee138546c9c3cf1bffaad8ee36dd9"}, - {file = "asyncpg-0.29.0-cp38-cp38-win32.whl", hash = "sha256:a921372bbd0aa3a5822dd0409da61b4cd50df89ae85150149f8c119f23e8c408"}, - {file = "asyncpg-0.29.0-cp38-cp38-win_amd64.whl", hash = "sha256:103aad2b92d1506700cbf51cd8bb5441e7e72e87a7b3a2ca4e32c840f051a6a3"}, - {file = "asyncpg-0.29.0-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:5340dd515d7e52f4c11ada32171d87c05570479dc01dc66d03ee3e150fb695da"}, - {file = "asyncpg-0.29.0-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:e17b52c6cf83e170d3d865571ba574577ab8e533e7361a2b8ce6157d02c665d3"}, - {file = "asyncpg-0.29.0-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:f100d23f273555f4b19b74a96840aa27b85e99ba4b1f18d4ebff0734e78dc090"}, - {file = "asyncpg-0.29.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:48e7c58b516057126b363cec8ca02b804644fd012ef8e6c7e23386b7d5e6ce83"}, - {file = "asyncpg-0.29.0-cp39-cp39-musllinux_1_1_aarch64.whl", hash = "sha256:f9ea3f24eb4c49a615573724d88a48bd1b7821c890c2effe04f05382ed9e8810"}, - {file = "asyncpg-0.29.0-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:8d36c7f14a22ec9e928f15f92a48207546ffe68bc412f3be718eedccdf10dc5c"}, - {file = "asyncpg-0.29.0-cp39-cp39-win32.whl", hash = "sha256:797ab8123ebaed304a1fad4d7576d5376c3a006a4100380fb9d517f0b59c1ab2"}, - {file = "asyncpg-0.29.0-cp39-cp39-win_amd64.whl", hash = "sha256:cce08a178858b426ae1aa8409b5cc171def45d4293626e7aa6510696d46decd8"}, - {file = "asyncpg-0.29.0.tar.gz", hash = "sha256:d1c49e1f44fffafd9a55e1a9b101590859d881d639ea2922516f5d9c512d354e"}, -] - -[package.dependencies] -async-timeout = {version = ">=4.0.3", markers = "python_version < \"3.12.0\""} - -[package.extras] -docs = ["Sphinx (>=5.3.0,<5.4.0)", "sphinx-rtd-theme (>=1.2.2)", "sphinxcontrib-asyncio (>=0.3.0,<0.4.0)"] -test = ["flake8 (>=6.1,<7.0)", "uvloop (>=0.15.3)"] - [[package]] name = "attrs" version = "24.2.0" @@ -2369,6 +2312,21 @@ files = [ [package.dependencies] ptyprocess = ">=0.5" +[[package]] +name = "pg8000" +version = "1.31.2" +description = "PostgreSQL interface library" +optional = false +python-versions = ">=3.8" +files = [ + {file = "pg8000-1.31.2-py3-none-any.whl", hash = "sha256:436c771ede71af4d4c22ba867a30add0bc5c942d7ab27fadbb6934a487ecc8f6"}, + {file = "pg8000-1.31.2.tar.gz", hash = "sha256:1ea46cf09d8eca07fe7eaadefd7951e37bee7fabe675df164f1a572ffb300876"}, +] + +[package.dependencies] +python-dateutil = ">=2.8.2" +scramp = ">=1.4.5" + [[package]] name = "pillow" version = "10.4.0" @@ -3409,6 +3367,20 @@ dev = ["cython-lint (>=0.12.2)", "doit (>=0.36.0)", "mypy", "pycodestyle", "pyde doc = ["jupyterlite-pyodide-kernel", "jupyterlite-sphinx (>=0.12.0)", "jupytext", "matplotlib (>=3.5)", "myst-nb", "numpydoc", "pooch", "pydata-sphinx-theme (>=0.15.2)", "sphinx (>=5.0.0)", "sphinx-design (>=0.4.0)"] test = ["array-api-strict", "asv", "gmpy2", "hypothesis (>=6.30)", "mpmath", "pooch", "pytest", "pytest-cov", "pytest-timeout", "pytest-xdist", "scikit-umfpack", "threadpoolctl"] +[[package]] +name = "scramp" +version = "1.4.5" +description = "An implementation of the SCRAM protocol." +optional = false +python-versions = ">=3.8" +files = [ + {file = "scramp-1.4.5-py3-none-any.whl", hash = "sha256:50e37c464fc67f37994e35bee4151e3d8f9320e9c204fca83a5d313c121bbbe7"}, + {file = "scramp-1.4.5.tar.gz", hash = "sha256:be3fbe774ca577a7a658117dca014e5d254d158cecae3dd60332dfe33ce6d78e"}, +] + +[package.dependencies] +asn1crypto = ">=1.5.1" + [[package]] name = "seaborn" version = "0.13.0" @@ -3963,4 +3935,4 @@ dev = ["black (>=19.3b0)", "pytest (>=4.6.2)"] [metadata] lock-version = "2.0" python-versions = "<3.12,>3.11" -content-hash = "1c77de773ff96625f5eb94d7ddd8ab1e33823a4cebb71700cdb904992f22f0d4" +content-hash = "3b42cbd26c806651a5aadce4dba301a1750ef86f01fe6103eb2ea6c3ae6bfe10" diff --git a/pyproject.toml b/pyproject.toml index e382b69..41470f3 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -9,7 +9,7 @@ readme = "README.md" python = "<3.12,>3.11" pypsdm = {git = "https://github.com/ie3-institute/pypsdm.git"} pandapower = "^2.14.11" -asyncpg = ">=0.25.0" +pg8000 = ">=1.29.0" [tool.poetry.group.dev.dependencies] pytest = "^7.2.1" From 6aa9769c9ac7e8ba4c2805ab5041204d7b716a61 Mon Sep 17 00:00:00 2001 From: danielfeismann Date: Thu, 12 Sep 2024 11:50:07 +0200 Subject: [PATCH 18/32] poetry --- poetry.lock | 42 +----------------------------------------- pyproject.toml | 1 - 2 files changed, 1 insertion(+), 42 deletions(-) diff --git a/poetry.lock b/poetry.lock index af947eb..33b266d 100644 --- a/poetry.lock +++ b/poetry.lock @@ -118,17 +118,6 @@ types-python-dateutil = ">=2.8.10" doc = ["doc8", "sphinx (>=7.0.0)", "sphinx-autobuild", "sphinx-autodoc-typehints", "sphinx_rtd_theme (>=1.3.0)"] test = ["dateparser (==1.*)", "pre-commit", "pytest", "pytest-cov", "pytest-mock", "pytz (==2021.1)", "simplejson (==3.*)"] -[[package]] -name = "asn1crypto" -version = "1.5.1" -description = "Fast ASN.1 parser and serializer with definitions for private keys, public keys, certificates, CRL, OCSP, CMS, PKCS#3, PKCS#7, PKCS#8, PKCS#12, PKCS#5, X.509 and TSP" -optional = false -python-versions = "*" -files = [ - {file = "asn1crypto-1.5.1-py2.py3-none-any.whl", hash = "sha256:db4e40728b728508912cbb3d44f19ce188f218e9eba635821bb4b68564f8fd67"}, - {file = "asn1crypto-1.5.1.tar.gz", hash = "sha256:13ae38502be632115abf8a24cbe5f4da52e3b5231990aff31123c805306ccb9c"}, -] - [[package]] name = "asttokens" version = "2.4.1" @@ -2312,21 +2301,6 @@ files = [ [package.dependencies] ptyprocess = ">=0.5" -[[package]] -name = "pg8000" -version = "1.31.2" -description = "PostgreSQL interface library" -optional = false -python-versions = ">=3.8" -files = [ - {file = "pg8000-1.31.2-py3-none-any.whl", hash = "sha256:436c771ede71af4d4c22ba867a30add0bc5c942d7ab27fadbb6934a487ecc8f6"}, - {file = "pg8000-1.31.2.tar.gz", hash = "sha256:1ea46cf09d8eca07fe7eaadefd7951e37bee7fabe675df164f1a572ffb300876"}, -] - -[package.dependencies] -python-dateutil = ">=2.8.2" -scramp = ">=1.4.5" - [[package]] name = "pillow" version = "10.4.0" @@ -3367,20 +3341,6 @@ dev = ["cython-lint (>=0.12.2)", "doit (>=0.36.0)", "mypy", "pycodestyle", "pyde doc = ["jupyterlite-pyodide-kernel", "jupyterlite-sphinx (>=0.12.0)", "jupytext", "matplotlib (>=3.5)", "myst-nb", "numpydoc", "pooch", "pydata-sphinx-theme (>=0.15.2)", "sphinx (>=5.0.0)", "sphinx-design (>=0.4.0)"] test = ["array-api-strict", "asv", "gmpy2", "hypothesis (>=6.30)", "mpmath", "pooch", "pytest", "pytest-cov", "pytest-timeout", "pytest-xdist", "scikit-umfpack", "threadpoolctl"] -[[package]] -name = "scramp" -version = "1.4.5" -description = "An implementation of the SCRAM protocol." -optional = false -python-versions = ">=3.8" -files = [ - {file = "scramp-1.4.5-py3-none-any.whl", hash = "sha256:50e37c464fc67f37994e35bee4151e3d8f9320e9c204fca83a5d313c121bbbe7"}, - {file = "scramp-1.4.5.tar.gz", hash = "sha256:be3fbe774ca577a7a658117dca014e5d254d158cecae3dd60332dfe33ce6d78e"}, -] - -[package.dependencies] -asn1crypto = ">=1.5.1" - [[package]] name = "seaborn" version = "0.13.0" @@ -3935,4 +3895,4 @@ dev = ["black (>=19.3b0)", "pytest (>=4.6.2)"] [metadata] lock-version = "2.0" python-versions = "<3.12,>3.11" -content-hash = "3b42cbd26c806651a5aadce4dba301a1750ef86f01fe6103eb2ea6c3ae6bfe10" +content-hash = "593810d37c67171128702e0313580dde9c7ddbcf9e331e92fa30db76253f96c6" diff --git a/pyproject.toml b/pyproject.toml index 41470f3..046424d 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -9,7 +9,6 @@ readme = "README.md" python = "<3.12,>3.11" pypsdm = {git = "https://github.com/ie3-institute/pypsdm.git"} pandapower = "^2.14.11" -pg8000 = ">=1.29.0" [tool.poetry.group.dev.dependencies] pytest = "^7.2.1" From b1c76836ff41417443dd52d4db839657f47db397 Mon Sep 17 00:00:00 2001 From: danielfeismann Date: Thu, 12 Sep 2024 11:56:04 +0200 Subject: [PATCH 19/32] poetry --- .github/workflows/simple-ci.yml | 28 +++++++++++++++------------- pyproject.toml | 1 + 2 files changed, 16 insertions(+), 13 deletions(-) diff --git a/.github/workflows/simple-ci.yml b/.github/workflows/simple-ci.yml index 558af02..5d9a356 100644 --- a/.github/workflows/simple-ci.yml +++ b/.github/workflows/simple-ci.yml @@ -48,12 +48,17 @@ jobs: #---------------------------------------------- - name: Check out repository uses: actions/checkout@v3 - - name: Set up python ${{ matrix.python-version }} - id: setup-python + + - name: Set up Python uses: actions/setup-python@v4 with: python-version: ${{ matrix.python-version }} #---------------------------------------------- + # ----- install PostgreSQL ----- + #---------------------------------------------- + - name: Install PostgreSQL + run: sudo apt-get update && sudo apt-get install -y libpq-dev + #---------------------------------------------- # ----- install & configure poetry ----- #---------------------------------------------- - name: Install Poetry @@ -64,24 +69,21 @@ jobs: #---------------------------------------------- # load cached venv if cache exists #---------------------------------------------- - - name: Load cached venv - id: cached-poetry-dependencies + - name: Cache Poetry dependencies uses: actions/cache@v3 with: - path: .venv - key: venv-${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('**/poetry.lock') }} + path: | + ~/.cache/pypoetry + .venv + key: poetry-${{ runner.os }}-${{ hashFiles('**/poetry.lock') }} + restore-keys: | + poetry-${{ runner.os }}- #---------------------------------------------- - # install dependencies if cache does not exist + # install your root project, if required #---------------------------------------------- - name: Install dependencies - if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true' run: poetry install --no-interaction --no-root #---------------------------------------------- - # install your root project, if required - #---------------------------------------------- - - name: Install library - run: poetry install --no-interaction - #---------------------------------------------- # run test suite #---------------------------------------------- - name: Run tests diff --git a/pyproject.toml b/pyproject.toml index 046424d..901b304 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -9,6 +9,7 @@ readme = "README.md" python = "<3.12,>3.11" pypsdm = {git = "https://github.com/ie3-institute/pypsdm.git"} pandapower = "^2.14.11" +psycopg2-binary = ">=2.9.9" [tool.poetry.group.dev.dependencies] pytest = "^7.2.1" From e8f62d29031ed1b6216992074740d93e3d109808 Mon Sep 17 00:00:00 2001 From: danielfeismann Date: Thu, 12 Sep 2024 11:56:14 +0200 Subject: [PATCH 20/32] poetry --- poetry.lock | 83 ++++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 82 insertions(+), 1 deletion(-) diff --git a/poetry.lock b/poetry.lock index 33b266d..ba13985 100644 --- a/poetry.lock +++ b/poetry.lock @@ -2539,6 +2539,87 @@ files = [ {file = "psycopg2-2.9.9.tar.gz", hash = "sha256:d1454bde93fb1e224166811694d600e746430c006fbb031ea06ecc2ea41bf156"}, ] +[[package]] +name = "psycopg2-binary" +version = "2.9.9" +description = "psycopg2 - Python-PostgreSQL Database Adapter" +optional = false +python-versions = ">=3.7" +files = [ + {file = "psycopg2-binary-2.9.9.tar.gz", hash = "sha256:7f01846810177d829c7692f1f5ada8096762d9172af1b1a28d4ab5b77c923c1c"}, + {file = "psycopg2_binary-2.9.9-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:c2470da5418b76232f02a2fcd2229537bb2d5a7096674ce61859c3229f2eb202"}, + {file = "psycopg2_binary-2.9.9-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:c6af2a6d4b7ee9615cbb162b0738f6e1fd1f5c3eda7e5da17861eacf4c717ea7"}, + {file = "psycopg2_binary-2.9.9-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:75723c3c0fbbf34350b46a3199eb50638ab22a0228f93fb472ef4d9becc2382b"}, + {file = "psycopg2_binary-2.9.9-cp310-cp310-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:83791a65b51ad6ee6cf0845634859d69a038ea9b03d7b26e703f94c7e93dbcf9"}, + {file = "psycopg2_binary-2.9.9-cp310-cp310-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:0ef4854e82c09e84cc63084a9e4ccd6d9b154f1dbdd283efb92ecd0b5e2b8c84"}, + {file = "psycopg2_binary-2.9.9-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:ed1184ab8f113e8d660ce49a56390ca181f2981066acc27cf637d5c1e10ce46e"}, + {file = "psycopg2_binary-2.9.9-cp310-cp310-musllinux_1_1_aarch64.whl", hash = "sha256:d2997c458c690ec2bc6b0b7ecbafd02b029b7b4283078d3b32a852a7ce3ddd98"}, + {file = "psycopg2_binary-2.9.9-cp310-cp310-musllinux_1_1_i686.whl", hash = "sha256:b58b4710c7f4161b5e9dcbe73bb7c62d65670a87df7bcce9e1faaad43e715245"}, + {file = "psycopg2_binary-2.9.9-cp310-cp310-musllinux_1_1_ppc64le.whl", hash = "sha256:0c009475ee389757e6e34611d75f6e4f05f0cf5ebb76c6037508318e1a1e0d7e"}, + {file = "psycopg2_binary-2.9.9-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:8dbf6d1bc73f1d04ec1734bae3b4fb0ee3cb2a493d35ede9badbeb901fb40f6f"}, + {file = "psycopg2_binary-2.9.9-cp310-cp310-win32.whl", hash = "sha256:3f78fd71c4f43a13d342be74ebbc0666fe1f555b8837eb113cb7416856c79682"}, + {file = "psycopg2_binary-2.9.9-cp310-cp310-win_amd64.whl", hash = "sha256:876801744b0dee379e4e3c38b76fc89f88834bb15bf92ee07d94acd06ec890a0"}, + {file = "psycopg2_binary-2.9.9-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:ee825e70b1a209475622f7f7b776785bd68f34af6e7a46e2e42f27b659b5bc26"}, + {file = "psycopg2_binary-2.9.9-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:1ea665f8ce695bcc37a90ee52de7a7980be5161375d42a0b6c6abedbf0d81f0f"}, + {file = "psycopg2_binary-2.9.9-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:143072318f793f53819048fdfe30c321890af0c3ec7cb1dfc9cc87aa88241de2"}, + {file = "psycopg2_binary-2.9.9-cp311-cp311-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:c332c8d69fb64979ebf76613c66b985414927a40f8defa16cf1bc028b7b0a7b0"}, + {file = "psycopg2_binary-2.9.9-cp311-cp311-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:f7fc5a5acafb7d6ccca13bfa8c90f8c51f13d8fb87d95656d3950f0158d3ce53"}, + {file = "psycopg2_binary-2.9.9-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:977646e05232579d2e7b9c59e21dbe5261f403a88417f6a6512e70d3f8a046be"}, + {file = "psycopg2_binary-2.9.9-cp311-cp311-musllinux_1_1_aarch64.whl", hash = "sha256:b6356793b84728d9d50ead16ab43c187673831e9d4019013f1402c41b1db9b27"}, + {file = "psycopg2_binary-2.9.9-cp311-cp311-musllinux_1_1_i686.whl", hash = "sha256:bc7bb56d04601d443f24094e9e31ae6deec9ccb23581f75343feebaf30423359"}, + {file = "psycopg2_binary-2.9.9-cp311-cp311-musllinux_1_1_ppc64le.whl", hash = "sha256:77853062a2c45be16fd6b8d6de2a99278ee1d985a7bd8b103e97e41c034006d2"}, + {file = "psycopg2_binary-2.9.9-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:78151aa3ec21dccd5cdef6c74c3e73386dcdfaf19bced944169697d7ac7482fc"}, + {file = "psycopg2_binary-2.9.9-cp311-cp311-win32.whl", hash = "sha256:dc4926288b2a3e9fd7b50dc6a1909a13bbdadfc67d93f3374d984e56f885579d"}, + {file = "psycopg2_binary-2.9.9-cp311-cp311-win_amd64.whl", hash = "sha256:b76bedd166805480ab069612119ea636f5ab8f8771e640ae103e05a4aae3e417"}, + {file = "psycopg2_binary-2.9.9-cp312-cp312-macosx_10_9_x86_64.whl", hash = "sha256:8532fd6e6e2dc57bcb3bc90b079c60de896d2128c5d9d6f24a63875a95a088cf"}, + {file = "psycopg2_binary-2.9.9-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:b0605eaed3eb239e87df0d5e3c6489daae3f7388d455d0c0b4df899519c6a38d"}, + {file = "psycopg2_binary-2.9.9-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:8f8544b092a29a6ddd72f3556a9fcf249ec412e10ad28be6a0c0d948924f2212"}, + {file = "psycopg2_binary-2.9.9-cp312-cp312-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:2d423c8d8a3c82d08fe8af900ad5b613ce3632a1249fd6a223941d0735fce493"}, + {file = "psycopg2_binary-2.9.9-cp312-cp312-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:2e5afae772c00980525f6d6ecf7cbca55676296b580c0e6abb407f15f3706996"}, + {file = "psycopg2_binary-2.9.9-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:6e6f98446430fdf41bd36d4faa6cb409f5140c1c2cf58ce0bbdaf16af7d3f119"}, + {file = "psycopg2_binary-2.9.9-cp312-cp312-musllinux_1_1_aarch64.whl", hash = "sha256:c77e3d1862452565875eb31bdb45ac62502feabbd53429fdc39a1cc341d681ba"}, + {file = "psycopg2_binary-2.9.9-cp312-cp312-musllinux_1_1_i686.whl", hash = "sha256:cb16c65dcb648d0a43a2521f2f0a2300f40639f6f8c1ecbc662141e4e3e1ee07"}, + {file = "psycopg2_binary-2.9.9-cp312-cp312-musllinux_1_1_ppc64le.whl", hash = "sha256:911dda9c487075abd54e644ccdf5e5c16773470a6a5d3826fda76699410066fb"}, + {file = "psycopg2_binary-2.9.9-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:57fede879f08d23c85140a360c6a77709113efd1c993923c59fde17aa27599fe"}, + {file = "psycopg2_binary-2.9.9-cp312-cp312-win32.whl", hash = "sha256:64cf30263844fa208851ebb13b0732ce674d8ec6a0c86a4e160495d299ba3c93"}, + {file = "psycopg2_binary-2.9.9-cp312-cp312-win_amd64.whl", hash = "sha256:81ff62668af011f9a48787564ab7eded4e9fb17a4a6a74af5ffa6a457400d2ab"}, + {file = "psycopg2_binary-2.9.9-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:2293b001e319ab0d869d660a704942c9e2cce19745262a8aba2115ef41a0a42a"}, + {file = "psycopg2_binary-2.9.9-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:03ef7df18daf2c4c07e2695e8cfd5ee7f748a1d54d802330985a78d2a5a6dca9"}, + {file = "psycopg2_binary-2.9.9-cp37-cp37m-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:0a602ea5aff39bb9fac6308e9c9d82b9a35c2bf288e184a816002c9fae930b77"}, + {file = "psycopg2_binary-2.9.9-cp37-cp37m-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:8359bf4791968c5a78c56103702000105501adb557f3cf772b2c207284273984"}, + {file = "psycopg2_binary-2.9.9-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:275ff571376626195ab95a746e6a04c7df8ea34638b99fc11160de91f2fef503"}, + {file = "psycopg2_binary-2.9.9-cp37-cp37m-musllinux_1_1_aarch64.whl", hash = "sha256:f9b5571d33660d5009a8b3c25dc1db560206e2d2f89d3df1cb32d72c0d117d52"}, + {file = "psycopg2_binary-2.9.9-cp37-cp37m-musllinux_1_1_i686.whl", hash = "sha256:420f9bbf47a02616e8554e825208cb947969451978dceb77f95ad09c37791dae"}, + {file = "psycopg2_binary-2.9.9-cp37-cp37m-musllinux_1_1_ppc64le.whl", hash = "sha256:4154ad09dac630a0f13f37b583eae260c6aa885d67dfbccb5b02c33f31a6d420"}, + {file = "psycopg2_binary-2.9.9-cp37-cp37m-musllinux_1_1_x86_64.whl", hash = "sha256:a148c5d507bb9b4f2030a2025c545fccb0e1ef317393eaba42e7eabd28eb6041"}, + {file = "psycopg2_binary-2.9.9-cp37-cp37m-win32.whl", hash = "sha256:68fc1f1ba168724771e38bee37d940d2865cb0f562380a1fb1ffb428b75cb692"}, + {file = "psycopg2_binary-2.9.9-cp37-cp37m-win_amd64.whl", hash = "sha256:281309265596e388ef483250db3640e5f414168c5a67e9c665cafce9492eda2f"}, + {file = "psycopg2_binary-2.9.9-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:60989127da422b74a04345096c10d416c2b41bd7bf2a380eb541059e4e999980"}, + {file = "psycopg2_binary-2.9.9-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:246b123cc54bb5361588acc54218c8c9fb73068bf227a4a531d8ed56fa3ca7d6"}, + {file = "psycopg2_binary-2.9.9-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:34eccd14566f8fe14b2b95bb13b11572f7c7d5c36da61caf414d23b91fcc5d94"}, + {file = "psycopg2_binary-2.9.9-cp38-cp38-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:18d0ef97766055fec15b5de2c06dd8e7654705ce3e5e5eed3b6651a1d2a9a152"}, + {file = "psycopg2_binary-2.9.9-cp38-cp38-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:d3f82c171b4ccd83bbaf35aa05e44e690113bd4f3b7b6cc54d2219b132f3ae55"}, + {file = "psycopg2_binary-2.9.9-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:ead20f7913a9c1e894aebe47cccf9dc834e1618b7aa96155d2091a626e59c972"}, + {file = "psycopg2_binary-2.9.9-cp38-cp38-musllinux_1_1_aarch64.whl", hash = "sha256:ca49a8119c6cbd77375ae303b0cfd8c11f011abbbd64601167ecca18a87e7cdd"}, + {file = "psycopg2_binary-2.9.9-cp38-cp38-musllinux_1_1_i686.whl", hash = "sha256:323ba25b92454adb36fa425dc5cf6f8f19f78948cbad2e7bc6cdf7b0d7982e59"}, + {file = "psycopg2_binary-2.9.9-cp38-cp38-musllinux_1_1_ppc64le.whl", hash = "sha256:1236ed0952fbd919c100bc839eaa4a39ebc397ed1c08a97fc45fee2a595aa1b3"}, + {file = "psycopg2_binary-2.9.9-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:729177eaf0aefca0994ce4cffe96ad3c75e377c7b6f4efa59ebf003b6d398716"}, + {file = "psycopg2_binary-2.9.9-cp38-cp38-win32.whl", hash = "sha256:804d99b24ad523a1fe18cc707bf741670332f7c7412e9d49cb5eab67e886b9b5"}, + {file = "psycopg2_binary-2.9.9-cp38-cp38-win_amd64.whl", hash = "sha256:a6cdcc3ede532f4a4b96000b6362099591ab4a3e913d70bcbac2b56c872446f7"}, + {file = "psycopg2_binary-2.9.9-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:72dffbd8b4194858d0941062a9766f8297e8868e1dd07a7b36212aaa90f49472"}, + {file = "psycopg2_binary-2.9.9-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:30dcc86377618a4c8f3b72418df92e77be4254d8f89f14b8e8f57d6d43603c0f"}, + {file = "psycopg2_binary-2.9.9-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:31a34c508c003a4347d389a9e6fcc2307cc2150eb516462a7a17512130de109e"}, + {file = "psycopg2_binary-2.9.9-cp39-cp39-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:15208be1c50b99203fe88d15695f22a5bed95ab3f84354c494bcb1d08557df67"}, + {file = "psycopg2_binary-2.9.9-cp39-cp39-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:1873aade94b74715be2246321c8650cabf5a0d098a95bab81145ffffa4c13876"}, + {file = "psycopg2_binary-2.9.9-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:3a58c98a7e9c021f357348867f537017057c2ed7f77337fd914d0bedb35dace7"}, + {file = "psycopg2_binary-2.9.9-cp39-cp39-musllinux_1_1_aarch64.whl", hash = "sha256:4686818798f9194d03c9129a4d9a702d9e113a89cb03bffe08c6cf799e053291"}, + {file = "psycopg2_binary-2.9.9-cp39-cp39-musllinux_1_1_i686.whl", hash = "sha256:ebdc36bea43063116f0486869652cb2ed7032dbc59fbcb4445c4862b5c1ecf7f"}, + {file = "psycopg2_binary-2.9.9-cp39-cp39-musllinux_1_1_ppc64le.whl", hash = "sha256:ca08decd2697fdea0aea364b370b1249d47336aec935f87b8bbfd7da5b2ee9c1"}, + {file = "psycopg2_binary-2.9.9-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:ac05fb791acf5e1a3e39402641827780fe44d27e72567a000412c648a85ba860"}, + {file = "psycopg2_binary-2.9.9-cp39-cp39-win32.whl", hash = "sha256:9dba73be7305b399924709b91682299794887cbbd88e38226ed9f6712eabee90"}, + {file = "psycopg2_binary-2.9.9-cp39-cp39-win_amd64.whl", hash = "sha256:f7ae5d65ccfbebdfa761585228eb4d0df3a8b15cfb53bd953e713e09fbb12957"}, +] + [[package]] name = "ptyprocess" version = "0.7.0" @@ -3895,4 +3976,4 @@ dev = ["black (>=19.3b0)", "pytest (>=4.6.2)"] [metadata] lock-version = "2.0" python-versions = "<3.12,>3.11" -content-hash = "593810d37c67171128702e0313580dde9c7ddbcf9e331e92fa30db76253f96c6" +content-hash = "0e721fbb63c2a6e922e143ed5136430fcba3ed2db7093fa5aba382b6e63677ed" From aff09335ab89c495e34c9dbbd0e8b3977eeb112a Mon Sep 17 00:00:00 2001 From: danielfeismann Date: Thu, 12 Sep 2024 12:10:23 +0200 Subject: [PATCH 21/32] update ci --- .github/workflows/simple-ci.yml | 28 ++++++----- poetry.lock | 83 +-------------------------------- pyproject.toml | 2 +- 3 files changed, 15 insertions(+), 98 deletions(-) diff --git a/.github/workflows/simple-ci.yml b/.github/workflows/simple-ci.yml index 5d9a356..558af02 100644 --- a/.github/workflows/simple-ci.yml +++ b/.github/workflows/simple-ci.yml @@ -48,17 +48,12 @@ jobs: #---------------------------------------------- - name: Check out repository uses: actions/checkout@v3 - - - name: Set up Python + - name: Set up python ${{ matrix.python-version }} + id: setup-python uses: actions/setup-python@v4 with: python-version: ${{ matrix.python-version }} #---------------------------------------------- - # ----- install PostgreSQL ----- - #---------------------------------------------- - - name: Install PostgreSQL - run: sudo apt-get update && sudo apt-get install -y libpq-dev - #---------------------------------------------- # ----- install & configure poetry ----- #---------------------------------------------- - name: Install Poetry @@ -69,21 +64,24 @@ jobs: #---------------------------------------------- # load cached venv if cache exists #---------------------------------------------- - - name: Cache Poetry dependencies + - name: Load cached venv + id: cached-poetry-dependencies uses: actions/cache@v3 with: - path: | - ~/.cache/pypoetry - .venv - key: poetry-${{ runner.os }}-${{ hashFiles('**/poetry.lock') }} - restore-keys: | - poetry-${{ runner.os }}- + path: .venv + key: venv-${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('**/poetry.lock') }} #---------------------------------------------- - # install your root project, if required + # install dependencies if cache does not exist #---------------------------------------------- - name: Install dependencies + if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true' run: poetry install --no-interaction --no-root #---------------------------------------------- + # install your root project, if required + #---------------------------------------------- + - name: Install library + run: poetry install --no-interaction + #---------------------------------------------- # run test suite #---------------------------------------------- - name: Run tests diff --git a/poetry.lock b/poetry.lock index ba13985..33b266d 100644 --- a/poetry.lock +++ b/poetry.lock @@ -2539,87 +2539,6 @@ files = [ {file = "psycopg2-2.9.9.tar.gz", hash = "sha256:d1454bde93fb1e224166811694d600e746430c006fbb031ea06ecc2ea41bf156"}, ] -[[package]] -name = "psycopg2-binary" -version = "2.9.9" -description = "psycopg2 - Python-PostgreSQL Database Adapter" -optional = false -python-versions = ">=3.7" -files = [ - {file = "psycopg2-binary-2.9.9.tar.gz", hash = "sha256:7f01846810177d829c7692f1f5ada8096762d9172af1b1a28d4ab5b77c923c1c"}, - {file = "psycopg2_binary-2.9.9-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:c2470da5418b76232f02a2fcd2229537bb2d5a7096674ce61859c3229f2eb202"}, - {file = "psycopg2_binary-2.9.9-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:c6af2a6d4b7ee9615cbb162b0738f6e1fd1f5c3eda7e5da17861eacf4c717ea7"}, - {file = "psycopg2_binary-2.9.9-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:75723c3c0fbbf34350b46a3199eb50638ab22a0228f93fb472ef4d9becc2382b"}, - {file = "psycopg2_binary-2.9.9-cp310-cp310-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:83791a65b51ad6ee6cf0845634859d69a038ea9b03d7b26e703f94c7e93dbcf9"}, - {file = "psycopg2_binary-2.9.9-cp310-cp310-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:0ef4854e82c09e84cc63084a9e4ccd6d9b154f1dbdd283efb92ecd0b5e2b8c84"}, - {file = "psycopg2_binary-2.9.9-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:ed1184ab8f113e8d660ce49a56390ca181f2981066acc27cf637d5c1e10ce46e"}, - {file = "psycopg2_binary-2.9.9-cp310-cp310-musllinux_1_1_aarch64.whl", hash = "sha256:d2997c458c690ec2bc6b0b7ecbafd02b029b7b4283078d3b32a852a7ce3ddd98"}, - {file = "psycopg2_binary-2.9.9-cp310-cp310-musllinux_1_1_i686.whl", hash = "sha256:b58b4710c7f4161b5e9dcbe73bb7c62d65670a87df7bcce9e1faaad43e715245"}, - {file = "psycopg2_binary-2.9.9-cp310-cp310-musllinux_1_1_ppc64le.whl", hash = "sha256:0c009475ee389757e6e34611d75f6e4f05f0cf5ebb76c6037508318e1a1e0d7e"}, - {file = "psycopg2_binary-2.9.9-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:8dbf6d1bc73f1d04ec1734bae3b4fb0ee3cb2a493d35ede9badbeb901fb40f6f"}, - {file = "psycopg2_binary-2.9.9-cp310-cp310-win32.whl", hash = "sha256:3f78fd71c4f43a13d342be74ebbc0666fe1f555b8837eb113cb7416856c79682"}, - {file = "psycopg2_binary-2.9.9-cp310-cp310-win_amd64.whl", hash = "sha256:876801744b0dee379e4e3c38b76fc89f88834bb15bf92ee07d94acd06ec890a0"}, - {file = "psycopg2_binary-2.9.9-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:ee825e70b1a209475622f7f7b776785bd68f34af6e7a46e2e42f27b659b5bc26"}, - {file = "psycopg2_binary-2.9.9-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:1ea665f8ce695bcc37a90ee52de7a7980be5161375d42a0b6c6abedbf0d81f0f"}, - {file = "psycopg2_binary-2.9.9-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:143072318f793f53819048fdfe30c321890af0c3ec7cb1dfc9cc87aa88241de2"}, - {file = "psycopg2_binary-2.9.9-cp311-cp311-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:c332c8d69fb64979ebf76613c66b985414927a40f8defa16cf1bc028b7b0a7b0"}, - {file = "psycopg2_binary-2.9.9-cp311-cp311-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:f7fc5a5acafb7d6ccca13bfa8c90f8c51f13d8fb87d95656d3950f0158d3ce53"}, - {file = "psycopg2_binary-2.9.9-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:977646e05232579d2e7b9c59e21dbe5261f403a88417f6a6512e70d3f8a046be"}, - {file = "psycopg2_binary-2.9.9-cp311-cp311-musllinux_1_1_aarch64.whl", hash = "sha256:b6356793b84728d9d50ead16ab43c187673831e9d4019013f1402c41b1db9b27"}, - {file = "psycopg2_binary-2.9.9-cp311-cp311-musllinux_1_1_i686.whl", hash = "sha256:bc7bb56d04601d443f24094e9e31ae6deec9ccb23581f75343feebaf30423359"}, - {file = "psycopg2_binary-2.9.9-cp311-cp311-musllinux_1_1_ppc64le.whl", hash = "sha256:77853062a2c45be16fd6b8d6de2a99278ee1d985a7bd8b103e97e41c034006d2"}, - {file = "psycopg2_binary-2.9.9-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:78151aa3ec21dccd5cdef6c74c3e73386dcdfaf19bced944169697d7ac7482fc"}, - {file = "psycopg2_binary-2.9.9-cp311-cp311-win32.whl", hash = "sha256:dc4926288b2a3e9fd7b50dc6a1909a13bbdadfc67d93f3374d984e56f885579d"}, - {file = "psycopg2_binary-2.9.9-cp311-cp311-win_amd64.whl", hash = "sha256:b76bedd166805480ab069612119ea636f5ab8f8771e640ae103e05a4aae3e417"}, - {file = "psycopg2_binary-2.9.9-cp312-cp312-macosx_10_9_x86_64.whl", hash = "sha256:8532fd6e6e2dc57bcb3bc90b079c60de896d2128c5d9d6f24a63875a95a088cf"}, - {file = "psycopg2_binary-2.9.9-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:b0605eaed3eb239e87df0d5e3c6489daae3f7388d455d0c0b4df899519c6a38d"}, - {file = "psycopg2_binary-2.9.9-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:8f8544b092a29a6ddd72f3556a9fcf249ec412e10ad28be6a0c0d948924f2212"}, - {file = "psycopg2_binary-2.9.9-cp312-cp312-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:2d423c8d8a3c82d08fe8af900ad5b613ce3632a1249fd6a223941d0735fce493"}, - {file = "psycopg2_binary-2.9.9-cp312-cp312-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:2e5afae772c00980525f6d6ecf7cbca55676296b580c0e6abb407f15f3706996"}, - {file = "psycopg2_binary-2.9.9-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:6e6f98446430fdf41bd36d4faa6cb409f5140c1c2cf58ce0bbdaf16af7d3f119"}, - {file = "psycopg2_binary-2.9.9-cp312-cp312-musllinux_1_1_aarch64.whl", hash = "sha256:c77e3d1862452565875eb31bdb45ac62502feabbd53429fdc39a1cc341d681ba"}, - {file = "psycopg2_binary-2.9.9-cp312-cp312-musllinux_1_1_i686.whl", hash = "sha256:cb16c65dcb648d0a43a2521f2f0a2300f40639f6f8c1ecbc662141e4e3e1ee07"}, - {file = "psycopg2_binary-2.9.9-cp312-cp312-musllinux_1_1_ppc64le.whl", hash = "sha256:911dda9c487075abd54e644ccdf5e5c16773470a6a5d3826fda76699410066fb"}, - {file = "psycopg2_binary-2.9.9-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:57fede879f08d23c85140a360c6a77709113efd1c993923c59fde17aa27599fe"}, - {file = "psycopg2_binary-2.9.9-cp312-cp312-win32.whl", hash = "sha256:64cf30263844fa208851ebb13b0732ce674d8ec6a0c86a4e160495d299ba3c93"}, - {file = "psycopg2_binary-2.9.9-cp312-cp312-win_amd64.whl", hash = "sha256:81ff62668af011f9a48787564ab7eded4e9fb17a4a6a74af5ffa6a457400d2ab"}, - {file = "psycopg2_binary-2.9.9-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:2293b001e319ab0d869d660a704942c9e2cce19745262a8aba2115ef41a0a42a"}, - {file = "psycopg2_binary-2.9.9-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:03ef7df18daf2c4c07e2695e8cfd5ee7f748a1d54d802330985a78d2a5a6dca9"}, - {file = "psycopg2_binary-2.9.9-cp37-cp37m-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:0a602ea5aff39bb9fac6308e9c9d82b9a35c2bf288e184a816002c9fae930b77"}, - {file = "psycopg2_binary-2.9.9-cp37-cp37m-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:8359bf4791968c5a78c56103702000105501adb557f3cf772b2c207284273984"}, - {file = "psycopg2_binary-2.9.9-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:275ff571376626195ab95a746e6a04c7df8ea34638b99fc11160de91f2fef503"}, - {file = "psycopg2_binary-2.9.9-cp37-cp37m-musllinux_1_1_aarch64.whl", hash = "sha256:f9b5571d33660d5009a8b3c25dc1db560206e2d2f89d3df1cb32d72c0d117d52"}, - {file = "psycopg2_binary-2.9.9-cp37-cp37m-musllinux_1_1_i686.whl", hash = "sha256:420f9bbf47a02616e8554e825208cb947969451978dceb77f95ad09c37791dae"}, - {file = "psycopg2_binary-2.9.9-cp37-cp37m-musllinux_1_1_ppc64le.whl", hash = "sha256:4154ad09dac630a0f13f37b583eae260c6aa885d67dfbccb5b02c33f31a6d420"}, - {file = "psycopg2_binary-2.9.9-cp37-cp37m-musllinux_1_1_x86_64.whl", hash = "sha256:a148c5d507bb9b4f2030a2025c545fccb0e1ef317393eaba42e7eabd28eb6041"}, - {file = "psycopg2_binary-2.9.9-cp37-cp37m-win32.whl", hash = "sha256:68fc1f1ba168724771e38bee37d940d2865cb0f562380a1fb1ffb428b75cb692"}, - {file = "psycopg2_binary-2.9.9-cp37-cp37m-win_amd64.whl", hash = "sha256:281309265596e388ef483250db3640e5f414168c5a67e9c665cafce9492eda2f"}, - {file = "psycopg2_binary-2.9.9-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:60989127da422b74a04345096c10d416c2b41bd7bf2a380eb541059e4e999980"}, - {file = "psycopg2_binary-2.9.9-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:246b123cc54bb5361588acc54218c8c9fb73068bf227a4a531d8ed56fa3ca7d6"}, - {file = "psycopg2_binary-2.9.9-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:34eccd14566f8fe14b2b95bb13b11572f7c7d5c36da61caf414d23b91fcc5d94"}, - {file = "psycopg2_binary-2.9.9-cp38-cp38-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:18d0ef97766055fec15b5de2c06dd8e7654705ce3e5e5eed3b6651a1d2a9a152"}, - {file = "psycopg2_binary-2.9.9-cp38-cp38-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:d3f82c171b4ccd83bbaf35aa05e44e690113bd4f3b7b6cc54d2219b132f3ae55"}, - {file = "psycopg2_binary-2.9.9-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:ead20f7913a9c1e894aebe47cccf9dc834e1618b7aa96155d2091a626e59c972"}, - {file = "psycopg2_binary-2.9.9-cp38-cp38-musllinux_1_1_aarch64.whl", hash = "sha256:ca49a8119c6cbd77375ae303b0cfd8c11f011abbbd64601167ecca18a87e7cdd"}, - {file = "psycopg2_binary-2.9.9-cp38-cp38-musllinux_1_1_i686.whl", hash = "sha256:323ba25b92454adb36fa425dc5cf6f8f19f78948cbad2e7bc6cdf7b0d7982e59"}, - {file = "psycopg2_binary-2.9.9-cp38-cp38-musllinux_1_1_ppc64le.whl", hash = "sha256:1236ed0952fbd919c100bc839eaa4a39ebc397ed1c08a97fc45fee2a595aa1b3"}, - {file = "psycopg2_binary-2.9.9-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:729177eaf0aefca0994ce4cffe96ad3c75e377c7b6f4efa59ebf003b6d398716"}, - {file = "psycopg2_binary-2.9.9-cp38-cp38-win32.whl", hash = "sha256:804d99b24ad523a1fe18cc707bf741670332f7c7412e9d49cb5eab67e886b9b5"}, - {file = "psycopg2_binary-2.9.9-cp38-cp38-win_amd64.whl", hash = "sha256:a6cdcc3ede532f4a4b96000b6362099591ab4a3e913d70bcbac2b56c872446f7"}, - {file = "psycopg2_binary-2.9.9-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:72dffbd8b4194858d0941062a9766f8297e8868e1dd07a7b36212aaa90f49472"}, - {file = "psycopg2_binary-2.9.9-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:30dcc86377618a4c8f3b72418df92e77be4254d8f89f14b8e8f57d6d43603c0f"}, - {file = "psycopg2_binary-2.9.9-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:31a34c508c003a4347d389a9e6fcc2307cc2150eb516462a7a17512130de109e"}, - {file = "psycopg2_binary-2.9.9-cp39-cp39-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:15208be1c50b99203fe88d15695f22a5bed95ab3f84354c494bcb1d08557df67"}, - {file = "psycopg2_binary-2.9.9-cp39-cp39-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:1873aade94b74715be2246321c8650cabf5a0d098a95bab81145ffffa4c13876"}, - {file = "psycopg2_binary-2.9.9-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:3a58c98a7e9c021f357348867f537017057c2ed7f77337fd914d0bedb35dace7"}, - {file = "psycopg2_binary-2.9.9-cp39-cp39-musllinux_1_1_aarch64.whl", hash = "sha256:4686818798f9194d03c9129a4d9a702d9e113a89cb03bffe08c6cf799e053291"}, - {file = "psycopg2_binary-2.9.9-cp39-cp39-musllinux_1_1_i686.whl", hash = "sha256:ebdc36bea43063116f0486869652cb2ed7032dbc59fbcb4445c4862b5c1ecf7f"}, - {file = "psycopg2_binary-2.9.9-cp39-cp39-musllinux_1_1_ppc64le.whl", hash = "sha256:ca08decd2697fdea0aea364b370b1249d47336aec935f87b8bbfd7da5b2ee9c1"}, - {file = "psycopg2_binary-2.9.9-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:ac05fb791acf5e1a3e39402641827780fe44d27e72567a000412c648a85ba860"}, - {file = "psycopg2_binary-2.9.9-cp39-cp39-win32.whl", hash = "sha256:9dba73be7305b399924709b91682299794887cbbd88e38226ed9f6712eabee90"}, - {file = "psycopg2_binary-2.9.9-cp39-cp39-win_amd64.whl", hash = "sha256:f7ae5d65ccfbebdfa761585228eb4d0df3a8b15cfb53bd953e713e09fbb12957"}, -] - [[package]] name = "ptyprocess" version = "0.7.0" @@ -3976,4 +3895,4 @@ dev = ["black (>=19.3b0)", "pytest (>=4.6.2)"] [metadata] lock-version = "2.0" python-versions = "<3.12,>3.11" -content-hash = "0e721fbb63c2a6e922e143ed5136430fcba3ed2db7093fa5aba382b6e63677ed" +content-hash = "593810d37c67171128702e0313580dde9c7ddbcf9e331e92fa30db76253f96c6" diff --git a/pyproject.toml b/pyproject.toml index 901b304..ae9fd54 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -9,7 +9,6 @@ readme = "README.md" python = "<3.12,>3.11" pypsdm = {git = "https://github.com/ie3-institute/pypsdm.git"} pandapower = "^2.14.11" -psycopg2-binary = ">=2.9.9" [tool.poetry.group.dev.dependencies] pytest = "^7.2.1" @@ -26,3 +25,4 @@ profile = "black" [build-system] requires = ["poetry-core"] build-backend = "poetry.core.masonry.api" + From b349654a440f1bb78ffb8a22e816c76795a56574 Mon Sep 17 00:00:00 2001 From: danielfeismann Date: Thu, 12 Sep 2024 12:16:03 +0200 Subject: [PATCH 22/32] update ci --- .github/workflows/simple-ci.yml | 48 +++++++++---------- poetry.lock | 83 ++++++++++++++++++++++++++++++++- pyproject.toml | 2 + 3 files changed, 105 insertions(+), 28 deletions(-) diff --git a/.github/workflows/simple-ci.yml b/.github/workflows/simple-ci.yml index 558af02..4469917 100644 --- a/.github/workflows/simple-ci.yml +++ b/.github/workflows/simple-ci.yml @@ -43,47 +43,41 @@ jobs: python-version: ['3.11'] runs-on: ${{ matrix.os }} steps: - #---------------------------------------------- - # check-out repo and set-up python - #---------------------------------------------- - name: Check out repository uses: actions/checkout@v3 - - name: Set up python ${{ matrix.python-version }} - id: setup-python + + - name: Set up Python uses: actions/setup-python@v4 with: python-version: ${{ matrix.python-version }} - #---------------------------------------------- - # ----- install & configure poetry ----- - #---------------------------------------------- + + - name: Install PostgreSQL Development Tools + if: matrix.os == 'ubuntu-latest' + run: sudo apt-get update && sudo apt-get install -y libpq-dev + + - name: Install PostgreSQL + if: matrix.os == 'macos-latest' + run: brew install postgresql + - name: Install Poetry uses: snok/install-poetry@v1 with: virtualenvs-create: true virtualenvs-in-project: true - #---------------------------------------------- - # load cached venv if cache exists - #---------------------------------------------- - - name: Load cached venv - id: cached-poetry-dependencies + + - name: Cache Poetry dependencies uses: actions/cache@v3 with: - path: .venv - key: venv-${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('**/poetry.lock') }} - #---------------------------------------------- - # install dependencies if cache does not exist - #---------------------------------------------- + path: | + ~/.cache/pypoetry + .venv + key: poetry-${{ runner.os }}-${{ hashFiles('**/poetry.lock') }} + restore-keys: | + poetry-${{ runner.os }}- + - name: Install dependencies - if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true' run: poetry install --no-interaction --no-root - #---------------------------------------------- - # install your root project, if required - #---------------------------------------------- - - name: Install library - run: poetry install --no-interaction - #---------------------------------------------- - # run test suite - #---------------------------------------------- + - name: Run tests run: | source .venv/bin/activate diff --git a/poetry.lock b/poetry.lock index 33b266d..ba13985 100644 --- a/poetry.lock +++ b/poetry.lock @@ -2539,6 +2539,87 @@ files = [ {file = "psycopg2-2.9.9.tar.gz", hash = "sha256:d1454bde93fb1e224166811694d600e746430c006fbb031ea06ecc2ea41bf156"}, ] +[[package]] +name = "psycopg2-binary" +version = "2.9.9" +description = "psycopg2 - Python-PostgreSQL Database Adapter" +optional = false +python-versions = ">=3.7" +files = [ + {file = "psycopg2-binary-2.9.9.tar.gz", hash = "sha256:7f01846810177d829c7692f1f5ada8096762d9172af1b1a28d4ab5b77c923c1c"}, + {file = "psycopg2_binary-2.9.9-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:c2470da5418b76232f02a2fcd2229537bb2d5a7096674ce61859c3229f2eb202"}, + {file = "psycopg2_binary-2.9.9-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:c6af2a6d4b7ee9615cbb162b0738f6e1fd1f5c3eda7e5da17861eacf4c717ea7"}, + {file = "psycopg2_binary-2.9.9-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:75723c3c0fbbf34350b46a3199eb50638ab22a0228f93fb472ef4d9becc2382b"}, + {file = "psycopg2_binary-2.9.9-cp310-cp310-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:83791a65b51ad6ee6cf0845634859d69a038ea9b03d7b26e703f94c7e93dbcf9"}, + {file = "psycopg2_binary-2.9.9-cp310-cp310-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:0ef4854e82c09e84cc63084a9e4ccd6d9b154f1dbdd283efb92ecd0b5e2b8c84"}, + {file = "psycopg2_binary-2.9.9-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:ed1184ab8f113e8d660ce49a56390ca181f2981066acc27cf637d5c1e10ce46e"}, + {file = "psycopg2_binary-2.9.9-cp310-cp310-musllinux_1_1_aarch64.whl", hash = "sha256:d2997c458c690ec2bc6b0b7ecbafd02b029b7b4283078d3b32a852a7ce3ddd98"}, + {file = "psycopg2_binary-2.9.9-cp310-cp310-musllinux_1_1_i686.whl", hash = "sha256:b58b4710c7f4161b5e9dcbe73bb7c62d65670a87df7bcce9e1faaad43e715245"}, + {file = "psycopg2_binary-2.9.9-cp310-cp310-musllinux_1_1_ppc64le.whl", hash = "sha256:0c009475ee389757e6e34611d75f6e4f05f0cf5ebb76c6037508318e1a1e0d7e"}, + {file = "psycopg2_binary-2.9.9-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:8dbf6d1bc73f1d04ec1734bae3b4fb0ee3cb2a493d35ede9badbeb901fb40f6f"}, + {file = "psycopg2_binary-2.9.9-cp310-cp310-win32.whl", hash = "sha256:3f78fd71c4f43a13d342be74ebbc0666fe1f555b8837eb113cb7416856c79682"}, + {file = "psycopg2_binary-2.9.9-cp310-cp310-win_amd64.whl", hash = "sha256:876801744b0dee379e4e3c38b76fc89f88834bb15bf92ee07d94acd06ec890a0"}, + {file = "psycopg2_binary-2.9.9-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:ee825e70b1a209475622f7f7b776785bd68f34af6e7a46e2e42f27b659b5bc26"}, + {file = "psycopg2_binary-2.9.9-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:1ea665f8ce695bcc37a90ee52de7a7980be5161375d42a0b6c6abedbf0d81f0f"}, + {file = "psycopg2_binary-2.9.9-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:143072318f793f53819048fdfe30c321890af0c3ec7cb1dfc9cc87aa88241de2"}, + {file = "psycopg2_binary-2.9.9-cp311-cp311-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:c332c8d69fb64979ebf76613c66b985414927a40f8defa16cf1bc028b7b0a7b0"}, + {file = "psycopg2_binary-2.9.9-cp311-cp311-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:f7fc5a5acafb7d6ccca13bfa8c90f8c51f13d8fb87d95656d3950f0158d3ce53"}, + {file = "psycopg2_binary-2.9.9-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:977646e05232579d2e7b9c59e21dbe5261f403a88417f6a6512e70d3f8a046be"}, + {file = "psycopg2_binary-2.9.9-cp311-cp311-musllinux_1_1_aarch64.whl", hash = "sha256:b6356793b84728d9d50ead16ab43c187673831e9d4019013f1402c41b1db9b27"}, + {file = "psycopg2_binary-2.9.9-cp311-cp311-musllinux_1_1_i686.whl", hash = "sha256:bc7bb56d04601d443f24094e9e31ae6deec9ccb23581f75343feebaf30423359"}, + {file = "psycopg2_binary-2.9.9-cp311-cp311-musllinux_1_1_ppc64le.whl", hash = "sha256:77853062a2c45be16fd6b8d6de2a99278ee1d985a7bd8b103e97e41c034006d2"}, + {file = "psycopg2_binary-2.9.9-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:78151aa3ec21dccd5cdef6c74c3e73386dcdfaf19bced944169697d7ac7482fc"}, + {file = "psycopg2_binary-2.9.9-cp311-cp311-win32.whl", hash = "sha256:dc4926288b2a3e9fd7b50dc6a1909a13bbdadfc67d93f3374d984e56f885579d"}, + {file = "psycopg2_binary-2.9.9-cp311-cp311-win_amd64.whl", hash = "sha256:b76bedd166805480ab069612119ea636f5ab8f8771e640ae103e05a4aae3e417"}, + {file = "psycopg2_binary-2.9.9-cp312-cp312-macosx_10_9_x86_64.whl", hash = "sha256:8532fd6e6e2dc57bcb3bc90b079c60de896d2128c5d9d6f24a63875a95a088cf"}, + {file = "psycopg2_binary-2.9.9-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:b0605eaed3eb239e87df0d5e3c6489daae3f7388d455d0c0b4df899519c6a38d"}, + {file = "psycopg2_binary-2.9.9-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:8f8544b092a29a6ddd72f3556a9fcf249ec412e10ad28be6a0c0d948924f2212"}, + {file = "psycopg2_binary-2.9.9-cp312-cp312-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:2d423c8d8a3c82d08fe8af900ad5b613ce3632a1249fd6a223941d0735fce493"}, + {file = "psycopg2_binary-2.9.9-cp312-cp312-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:2e5afae772c00980525f6d6ecf7cbca55676296b580c0e6abb407f15f3706996"}, + {file = "psycopg2_binary-2.9.9-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:6e6f98446430fdf41bd36d4faa6cb409f5140c1c2cf58ce0bbdaf16af7d3f119"}, + {file = "psycopg2_binary-2.9.9-cp312-cp312-musllinux_1_1_aarch64.whl", hash = "sha256:c77e3d1862452565875eb31bdb45ac62502feabbd53429fdc39a1cc341d681ba"}, + {file = "psycopg2_binary-2.9.9-cp312-cp312-musllinux_1_1_i686.whl", hash = "sha256:cb16c65dcb648d0a43a2521f2f0a2300f40639f6f8c1ecbc662141e4e3e1ee07"}, + {file = "psycopg2_binary-2.9.9-cp312-cp312-musllinux_1_1_ppc64le.whl", hash = "sha256:911dda9c487075abd54e644ccdf5e5c16773470a6a5d3826fda76699410066fb"}, + {file = "psycopg2_binary-2.9.9-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:57fede879f08d23c85140a360c6a77709113efd1c993923c59fde17aa27599fe"}, + {file = "psycopg2_binary-2.9.9-cp312-cp312-win32.whl", hash = "sha256:64cf30263844fa208851ebb13b0732ce674d8ec6a0c86a4e160495d299ba3c93"}, + {file = "psycopg2_binary-2.9.9-cp312-cp312-win_amd64.whl", hash = "sha256:81ff62668af011f9a48787564ab7eded4e9fb17a4a6a74af5ffa6a457400d2ab"}, + {file = "psycopg2_binary-2.9.9-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:2293b001e319ab0d869d660a704942c9e2cce19745262a8aba2115ef41a0a42a"}, + {file = "psycopg2_binary-2.9.9-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:03ef7df18daf2c4c07e2695e8cfd5ee7f748a1d54d802330985a78d2a5a6dca9"}, + {file = "psycopg2_binary-2.9.9-cp37-cp37m-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:0a602ea5aff39bb9fac6308e9c9d82b9a35c2bf288e184a816002c9fae930b77"}, + {file = "psycopg2_binary-2.9.9-cp37-cp37m-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:8359bf4791968c5a78c56103702000105501adb557f3cf772b2c207284273984"}, + {file = "psycopg2_binary-2.9.9-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:275ff571376626195ab95a746e6a04c7df8ea34638b99fc11160de91f2fef503"}, + {file = "psycopg2_binary-2.9.9-cp37-cp37m-musllinux_1_1_aarch64.whl", hash = "sha256:f9b5571d33660d5009a8b3c25dc1db560206e2d2f89d3df1cb32d72c0d117d52"}, + {file = "psycopg2_binary-2.9.9-cp37-cp37m-musllinux_1_1_i686.whl", hash = "sha256:420f9bbf47a02616e8554e825208cb947969451978dceb77f95ad09c37791dae"}, + {file = "psycopg2_binary-2.9.9-cp37-cp37m-musllinux_1_1_ppc64le.whl", hash = "sha256:4154ad09dac630a0f13f37b583eae260c6aa885d67dfbccb5b02c33f31a6d420"}, + {file = "psycopg2_binary-2.9.9-cp37-cp37m-musllinux_1_1_x86_64.whl", hash = "sha256:a148c5d507bb9b4f2030a2025c545fccb0e1ef317393eaba42e7eabd28eb6041"}, + {file = "psycopg2_binary-2.9.9-cp37-cp37m-win32.whl", hash = "sha256:68fc1f1ba168724771e38bee37d940d2865cb0f562380a1fb1ffb428b75cb692"}, + {file = "psycopg2_binary-2.9.9-cp37-cp37m-win_amd64.whl", hash = "sha256:281309265596e388ef483250db3640e5f414168c5a67e9c665cafce9492eda2f"}, + {file = "psycopg2_binary-2.9.9-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:60989127da422b74a04345096c10d416c2b41bd7bf2a380eb541059e4e999980"}, + {file = "psycopg2_binary-2.9.9-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:246b123cc54bb5361588acc54218c8c9fb73068bf227a4a531d8ed56fa3ca7d6"}, + {file = "psycopg2_binary-2.9.9-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:34eccd14566f8fe14b2b95bb13b11572f7c7d5c36da61caf414d23b91fcc5d94"}, + {file = "psycopg2_binary-2.9.9-cp38-cp38-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:18d0ef97766055fec15b5de2c06dd8e7654705ce3e5e5eed3b6651a1d2a9a152"}, + {file = "psycopg2_binary-2.9.9-cp38-cp38-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:d3f82c171b4ccd83bbaf35aa05e44e690113bd4f3b7b6cc54d2219b132f3ae55"}, + {file = "psycopg2_binary-2.9.9-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:ead20f7913a9c1e894aebe47cccf9dc834e1618b7aa96155d2091a626e59c972"}, + {file = "psycopg2_binary-2.9.9-cp38-cp38-musllinux_1_1_aarch64.whl", hash = "sha256:ca49a8119c6cbd77375ae303b0cfd8c11f011abbbd64601167ecca18a87e7cdd"}, + {file = "psycopg2_binary-2.9.9-cp38-cp38-musllinux_1_1_i686.whl", hash = "sha256:323ba25b92454adb36fa425dc5cf6f8f19f78948cbad2e7bc6cdf7b0d7982e59"}, + {file = "psycopg2_binary-2.9.9-cp38-cp38-musllinux_1_1_ppc64le.whl", hash = "sha256:1236ed0952fbd919c100bc839eaa4a39ebc397ed1c08a97fc45fee2a595aa1b3"}, + {file = "psycopg2_binary-2.9.9-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:729177eaf0aefca0994ce4cffe96ad3c75e377c7b6f4efa59ebf003b6d398716"}, + {file = "psycopg2_binary-2.9.9-cp38-cp38-win32.whl", hash = "sha256:804d99b24ad523a1fe18cc707bf741670332f7c7412e9d49cb5eab67e886b9b5"}, + {file = "psycopg2_binary-2.9.9-cp38-cp38-win_amd64.whl", hash = "sha256:a6cdcc3ede532f4a4b96000b6362099591ab4a3e913d70bcbac2b56c872446f7"}, + {file = "psycopg2_binary-2.9.9-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:72dffbd8b4194858d0941062a9766f8297e8868e1dd07a7b36212aaa90f49472"}, + {file = "psycopg2_binary-2.9.9-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:30dcc86377618a4c8f3b72418df92e77be4254d8f89f14b8e8f57d6d43603c0f"}, + {file = "psycopg2_binary-2.9.9-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:31a34c508c003a4347d389a9e6fcc2307cc2150eb516462a7a17512130de109e"}, + {file = "psycopg2_binary-2.9.9-cp39-cp39-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:15208be1c50b99203fe88d15695f22a5bed95ab3f84354c494bcb1d08557df67"}, + {file = "psycopg2_binary-2.9.9-cp39-cp39-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:1873aade94b74715be2246321c8650cabf5a0d098a95bab81145ffffa4c13876"}, + {file = "psycopg2_binary-2.9.9-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:3a58c98a7e9c021f357348867f537017057c2ed7f77337fd914d0bedb35dace7"}, + {file = "psycopg2_binary-2.9.9-cp39-cp39-musllinux_1_1_aarch64.whl", hash = "sha256:4686818798f9194d03c9129a4d9a702d9e113a89cb03bffe08c6cf799e053291"}, + {file = "psycopg2_binary-2.9.9-cp39-cp39-musllinux_1_1_i686.whl", hash = "sha256:ebdc36bea43063116f0486869652cb2ed7032dbc59fbcb4445c4862b5c1ecf7f"}, + {file = "psycopg2_binary-2.9.9-cp39-cp39-musllinux_1_1_ppc64le.whl", hash = "sha256:ca08decd2697fdea0aea364b370b1249d47336aec935f87b8bbfd7da5b2ee9c1"}, + {file = "psycopg2_binary-2.9.9-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:ac05fb791acf5e1a3e39402641827780fe44d27e72567a000412c648a85ba860"}, + {file = "psycopg2_binary-2.9.9-cp39-cp39-win32.whl", hash = "sha256:9dba73be7305b399924709b91682299794887cbbd88e38226ed9f6712eabee90"}, + {file = "psycopg2_binary-2.9.9-cp39-cp39-win_amd64.whl", hash = "sha256:f7ae5d65ccfbebdfa761585228eb4d0df3a8b15cfb53bd953e713e09fbb12957"}, +] + [[package]] name = "ptyprocess" version = "0.7.0" @@ -3895,4 +3976,4 @@ dev = ["black (>=19.3b0)", "pytest (>=4.6.2)"] [metadata] lock-version = "2.0" python-versions = "<3.12,>3.11" -content-hash = "593810d37c67171128702e0313580dde9c7ddbcf9e331e92fa30db76253f96c6" +content-hash = "0e721fbb63c2a6e922e143ed5136430fcba3ed2db7093fa5aba382b6e63677ed" diff --git a/pyproject.toml b/pyproject.toml index ae9fd54..355b4e7 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -9,6 +9,8 @@ readme = "README.md" python = "<3.12,>3.11" pypsdm = {git = "https://github.com/ie3-institute/pypsdm.git"} pandapower = "^2.14.11" +psycopg2-binary = ">=2.9.9" + [tool.poetry.group.dev.dependencies] pytest = "^7.2.1" From c564d2bb24bef577fc033c0653efbf449c5289aa Mon Sep 17 00:00:00 2001 From: danielfeismann Date: Thu, 12 Sep 2024 13:10:32 +0200 Subject: [PATCH 23/32] include type parameter into lines and transformer --- pp2psdm/grid.py | 126 ++++++++++----------------------------------- tests/test_grid.py | 85 +++++++++++------------------- 2 files changed, 56 insertions(+), 155 deletions(-) diff --git a/pp2psdm/grid.py b/pp2psdm/grid.py index 940a69a..cb74787 100644 --- a/pp2psdm/grid.py +++ b/pp2psdm/grid.py @@ -27,16 +27,10 @@ def convert_grid(grid: pp.pandapowerNet) -> Tuple[RawGridContainer]: nodes, node_index_uuid_map = convert_nodes(grid) - line_types, line_index_line_type_uuid_map = convert_line_types( - grid, nodes, node_index_uuid_map - ) - - lines = convert_lines(grid, line_index_line_type_uuid_map, node_index_uuid_map) - - transformer_types, trafo_index_trafo_type_uuid_map = convert_transformer_types(grid) + lines = convert_lines(grid, nodes, node_index_uuid_map) transformers = convert_transformers( - grid, trafo_index_trafo_type_uuid_map, node_index_uuid_map + grid, node_index_uuid_map ) # TODO convert switches @@ -111,23 +105,17 @@ def line_param_conversion(c_nf_per_km: float, g_us_per_km: float): return g_us, b_us -def convert_line_types(grid, nodes, node_index_uuid_map): - - # Geo Position of Line not implemented +def convert_lines(grid, nodes, node_index_uuid_map): df = grid.line - line_types = {} + lines_data = [] for idx, row in df.iterrows(): - line_index_line_type_uuid_map = {idx: str(uuid4()) for idx in df.index} - # Convert line parameters - g_us, b_us = line_param_conversion(row["c_nf_per_km"], row["g_us_per_km"]) - - # Use index_uuid_map to retrieve UUIDs for from_bus and to_bus + # Retrieve node_a and node_b UUIDs based on from_bus and to_bus node_a_uuid = node_index_uuid_map.get(row["from_bus"]) node_b_uuid = node_index_uuid_map.get(row["to_bus"]) - + # Check if the UUIDs were found if node_a_uuid is None or node_b_uuid is None: raise KeyError( @@ -144,55 +132,27 @@ def convert_line_types(grid, nodes, node_index_uuid_map): f"v_target mismatch between node_a ({v_target_a}) and node_b ({v_target_b}) for line {row['from_bus']} to {row['to_bus']}" ) - uuid = line_index_line_type_uuid_map[idx] - - line_types[uuid] = { - "uuid": uuid, - "r": row["r_ohm_per_km"], - "x": row["x_ohm_per_km"], - "b": b_us, - "g": g_us, - "i_max": row["max_i_ka"] * 1000, # Convert to amperes - "id": f"line_type_{idx + 1}", - "v_rated": v_target_a, - } - - line_types = pd.DataFrame.from_dict(line_types, orient="index").reset_index() - line_types = line_types.set_index("uuid").drop(columns="index") - return line_types, line_index_line_type_uuid_map - - -def convert_lines(grid, line_index_line_type_uuid_map, node_index_uuid_map): - df = grid.line - lines_data = [] - - # Create a mapping of line index to UUID - line_index_uuid_map = {idx: str(uuid4()) for idx in df.index} - - for idx, row in df.iterrows(): - # Retrieve line type UUID - line_type_uuid = line_index_line_type_uuid_map.get(idx) - if not line_type_uuid: - raise ValueError(f"No matching line type found for line {row['name']}") - - # Retrieve node_a and node_b UUIDs based on from_bus and to_bus - node_a_uuid = node_index_uuid_map.get(row["from_bus"]) - node_b_uuid = node_index_uuid_map.get(row["to_bus"]) + # Convert line parameters + g_us, b_us = line_param_conversion(row["c_nf_per_km"], row["g_us_per_km"]) # Collect data for each line line_data = { "id": row["name"], - "uuid": line_index_uuid_map[idx], "geo_position": None, "length": row["length_km"], "node_a": node_a_uuid, "node_b": node_b_uuid, + "r": row["r_ohm_per_km"], + "x": row["x_ohm_per_km"], + "b": b_us, + "g": g_us, + "i_max": row["max_i_ka"] * 1000, # Convert to amperes + "v_rated": v_target_a, "olm_characteristic": "olm:{(0.0,1.0)}", "operates_from": get_operation_times(row)[0], "operates_until": get_operation_times(row)[1], "operator": None, "parallel_devices": row["parallel"], - "type": line_type_uuid, } lines_data.append(line_data) @@ -201,13 +161,11 @@ def convert_lines(grid, line_index_line_type_uuid_map, node_index_uuid_map): return create_lines(data_dict) -def convert_transformer_types(grid): +def convert_transformers(grid, node_index_uuid_map): df = grid.trafo - trafo_types = {} + transformers_data = [] for idx, row in df.iterrows(): - trafo_index_trafo_type_uuid_map = {idx: str(uuid4()) for idx in df.index} - # Convert trafo parameters rSc, xSc, gM, bM = trafo_param_conversion( row["vk_percent"], @@ -220,15 +178,21 @@ def convert_transformer_types(grid): tap_side = True if row["tap_side"] == "hv" else False - uuid = trafo_index_trafo_type_uuid_map[idx] + # Retrieve node_a and node_b UUIDs based on hv_bus and lv_bus + node_a_uuid = node_index_uuid_map.get(row["hv_bus"]) + node_b_uuid = node_index_uuid_map.get(row["lv_bus"]) + + autoTap = True if row["autoTap"] == 1 else False - trafo_types[uuid] = { - "uuid": uuid, + trafo_data = { + "id": row["name"], + "auto_tap": autoTap, + "node_a": node_a_uuid, + "node_b": node_b_uuid, "b_m": bM, "d_phi": row["tap_step_degree"], "d_v": row["tap_step_percent"], "g_m": gM, - "id": f"trafo2w_type_{idx + 1}", "r_sc": rSc, "s_rated": row["sn_mva"] * 1000, # Convert to kVA "tap_max": row["tap_max"], @@ -238,49 +202,11 @@ def convert_transformer_types(grid): "v_rated_a": row["vn_hv_kv"], "v_rated_b": row["vn_lv_kv"], "x_sc": xSc, - } - - trafo_types = pd.DataFrame.from_dict(trafo_types, orient="index").reset_index() - trafo_types = trafo_types.set_index("uuid").drop(columns="index") - return trafo_types, trafo_index_trafo_type_uuid_map - - -def convert_transformers(grid, trafo_index_trafo_type_uuid_map, node_index_uuid_map): - df = grid.trafo - transformers_data = [] - - # Create a mapping of line index to UUID - trafo_index_uuid_map = {idx: str(uuid4()) for idx in df.index} - - for idx, row in df.iterrows(): - # Retrieve trafo type UUID - trafo_type_uuid = trafo_index_trafo_type_uuid_map.get(idx) - - if not trafo_type_uuid: - raise ValueError( - f"No matching transformer type found for transformer {row['name']}" - ) - - # Retrieve node_a and node_b UUIDs based on hv_bus and lv_bus - node_a_uuid = node_index_uuid_map.get(row["hv_bus"]) - node_b_uuid = node_index_uuid_map.get(row["lv_bus"]) - - # Collect data for each transformer - - autoTap = True if row["autoTap"] == 1 else False - - trafo_data = { - "id": row["name"], - "uuid": trafo_index_uuid_map[idx], - "auto_tap": autoTap, - "node_a": node_a_uuid, - "node_b": node_b_uuid, "operates_from": get_operation_times(row)[0], "operates_until": get_operation_times(row)[1], "operator": None, "parallel_devices": row["parallel"], "tap_pos": row["tap_pos"], - "type": trafo_type_uuid, } transformers_data.append(trafo_data) diff --git a/tests/test_grid.py b/tests/test_grid.py index 9f85524..3c41a59 100644 --- a/tests/test_grid.py +++ b/tests/test_grid.py @@ -5,10 +5,8 @@ from pp2psdm.grid import ( # , convert_transformers convert_grid, - convert_line_types, convert_lines, convert_nodes, - convert_transformer_types, convert_transformers, ) from tests.utils import read_psdm_lv, read_sb_lv @@ -54,39 +52,27 @@ def test_nodes_conversion(input_data): assert net.data.iloc[i]["operator"] is None assert net.data.iloc[i]["geo_position"] == coord_string - -def test_line_types_conversion(input_data): +def test_lines_conversion(input_data): expected, input = input_data len = input.line.shape[0] nodes, node_index_uuid_map = convert_nodes(input) - net, _ = convert_line_types(input, nodes, node_index_uuid_map) + + net = convert_lines(input, nodes, node_index_uuid_map) for i in range(len): + node_from_bus = node_index_uuid_map.get(input.line.iloc[i]["from_bus"]) - assert net.iloc[i]["v_rated"] == nodes.get(node_from_bus)["v_target"] + assert net.data.iloc[i]["v_rated"] == nodes.get(node_from_bus)["v_target"] node_to_bus = node_index_uuid_map.get(input.line.iloc[i]["to_bus"]) - assert net.iloc[i]["v_rated"] == nodes.get(node_to_bus)["v_target"] - assert math.isclose(net.iloc[i]["r"], input.line.iloc[i]["r_ohm_per_km"]) - assert math.isclose(net.iloc[i]["x"], input.line.iloc[i]["x_ohm_per_km"]) + assert net.data.iloc[i]["v_rated"] == nodes.get(node_to_bus)["v_target"] + assert math.isclose(net.data.iloc[i]["r"], input.line.iloc[i]["r_ohm_per_km"]) + assert math.isclose(net.data.iloc[i]["x"], input.line.iloc[i]["x_ohm_per_km"]) assert math.isclose( - net.iloc[i]["b"], input.line.iloc[i]["c_nf_per_km"] * 2 * np.pi * 50 * 1e-3 + net.data.iloc[i]["b"], input.line.iloc[i]["c_nf_per_km"] * 2 * np.pi * 50 * 1e-3 ) - assert math.isclose(net.iloc[i]["g"], input.line.iloc[i]["g_us_per_km"]) - assert math.isclose(net.iloc[i]["i_max"], input.line.iloc[i]["max_i_ka"] * 1000) - - -def test_lines_conversion(input_data): - expected, input = input_data - len = input.line.shape[0] - nodes, node_index_uuid_map = convert_nodes(input) - line_types, line_index_line_type_uuid_map = convert_line_types( - input, nodes, node_index_uuid_map - ) - - net = convert_lines(input, line_index_line_type_uuid_map, node_index_uuid_map) - - for i in range(len): + assert math.isclose(net.data.iloc[i]["g"], input.line.iloc[i]["g_us_per_km"]) + assert math.isclose(net.data.iloc[i]["i_max"], input.line.iloc[i]["max_i_ka"] * 1000) assert net.data.iloc[i]["id"] == input.line.iloc[i]["name"] assert net.data.iloc[i]["node_a"] == node_index_uuid_map.get( input.line.iloc[i]["from_bus"] @@ -100,7 +86,6 @@ def test_lines_conversion(input_data): assert net.data.iloc[i]["operates_until"] is None assert net.data.iloc[i]["operator"] is None assert net.data.iloc[i]["parallel_devices"] == input.line.iloc[i]["parallel"] - assert net.data.iloc[i]["type"] == line_index_line_type_uuid_map.get(i) def trafo_parameter_test_conversion( @@ -148,10 +133,14 @@ def trafo_parameter_test_conversion( return (rSc, xSc, gM_nS, bm_uS_directed) -def test_tranfo_type_conversion(input_data): +def test_trafo_conversion(input_data): expected, input = input_data len = input.trafo.shape[0] - net, _ = convert_transformer_types(input) + _, node_index_uuid_map = convert_nodes(input) + + net = convert_transformers( + input, node_index_uuid_map + ) for i in range(len): rSc, xSc, gM, bM = trafo_parameter_test_conversion( @@ -165,32 +154,19 @@ def test_tranfo_type_conversion(input_data): tap_side = True if input.trafo.iloc[i]["tap_side"] == "hv" else False - assert net.iloc[i]["tap_max"] == input.trafo.iloc[i]["tap_max"] - assert net.iloc[i]["tap_min"] == input.trafo.iloc[i]["tap_min"] - assert net.iloc[i]["tap_neutr"] == input.trafo.iloc[i]["tap_neutral"] - assert net.iloc[i]["tap_side"] == tap_side - assert net.iloc[i]["v_rated_a"] == input.trafo.iloc[i]["vn_hv_kv"] - assert net.iloc[i]["v_rated_b"] == input.trafo.iloc[i]["vn_lv_kv"] - assert net.iloc[i]["d_phi"] == input.trafo.iloc[i]["tap_step_degree"] - assert net.iloc[i]["d_v"] == input.trafo.iloc[i]["tap_step_percent"] - assert math.isclose(net.iloc[i]["r_sc"], rSc) - assert math.isclose(net.iloc[i]["x_sc"], xSc) - assert math.isclose(net.iloc[i]["g_m"], gM) - assert math.isclose(net.iloc[i]["b_m"], bM) - assert net.iloc[i]["s_rated"] == input.trafo.iloc[i]["sn_mva"] * 1000 - - -def test_trafo_conversion(input_data): - expected, input = input_data - len = input.trafo.shape[0] - _, node_index_uuid_map = convert_nodes(input) - trafo_types, trafo_index_trafo_type_uuid_map = convert_transformer_types(input) - - net = convert_transformers( - input, trafo_index_trafo_type_uuid_map, node_index_uuid_map - ) - - for i in range(len): + assert net.data.iloc[i]["tap_max"] == input.trafo.iloc[i]["tap_max"] + assert net.data.iloc[i]["tap_min"] == input.trafo.iloc[i]["tap_min"] + assert net.data.iloc[i]["tap_neutr"] == input.trafo.iloc[i]["tap_neutral"] + assert net.data.iloc[i]["tap_side"] == tap_side + assert net.data.iloc[i]["v_rated_a"] == input.trafo.iloc[i]["vn_hv_kv"] + assert net.data.iloc[i]["v_rated_b"] == input.trafo.iloc[i]["vn_lv_kv"] + assert net.data.iloc[i]["d_phi"] == input.trafo.iloc[i]["tap_step_degree"] + assert net.data.iloc[i]["d_v"] == input.trafo.iloc[i]["tap_step_percent"] + assert math.isclose(net.data.iloc[i]["r_sc"], rSc) + assert math.isclose(net.data.iloc[i]["x_sc"], xSc) + assert math.isclose(net.data.iloc[i]["g_m"], gM) + assert math.isclose(net.data.iloc[i]["b_m"], bM) + assert net.data.iloc[i]["s_rated"] == input.trafo.iloc[i]["sn_mva"] * 1000 assert net.data.iloc[i]["id"] == input.trafo.iloc[i]["name"] assert net.data.iloc[i]["auto_tap"] == input.trafo.iloc[i]["autoTap"] assert net.data.iloc[i]["node_a"] == node_index_uuid_map.get( @@ -204,4 +180,3 @@ def test_trafo_conversion(input_data): assert net.data.iloc[i]["operator"] is None assert net.data.iloc[i]["parallel_devices"] == input.trafo.iloc[i]["parallel"] assert net.data.iloc[i]["tap_pos"] == input.trafo.iloc[i]["tap_pos"] - assert net.data.iloc[i]["type"] == trafo_index_trafo_type_uuid_map.get(i) From 1345c3adbc58a6a04e9a2281afd1278eebe1bff8 Mon Sep 17 00:00:00 2001 From: danielfeismann Date: Thu, 12 Sep 2024 15:16:52 +0200 Subject: [PATCH 24/32] fmt --- poetry.lock | 8 ++++---- pp2psdm/grid.py | 7 ++----- tests/test_grid.py | 15 ++++++++------- 3 files changed, 14 insertions(+), 16 deletions(-) diff --git a/poetry.lock b/poetry.lock index ba13985..dce9050 100644 --- a/poetry.lock +++ b/poetry.lock @@ -2914,7 +2914,7 @@ sqlmodel = "^0.0.14" type = "git" url = "https://github.com/ie3-institute/pypsdm.git" reference = "HEAD" -resolved_reference = "b926e9fe34c787c9164b8c260e2dfb930b0d8b36" +resolved_reference = "16fab7b849b6e48abb9a1ba7e7b36937da975cea" [[package]] name = "pytest" @@ -3860,13 +3860,13 @@ dev = ["flake8", "flake8-annotations", "flake8-bandit", "flake8-bugbear", "flake [[package]] name = "urllib3" -version = "2.2.2" +version = "2.2.3" description = "HTTP library with thread-safe connection pooling, file post, and more." optional = false python-versions = ">=3.8" files = [ - {file = "urllib3-2.2.2-py3-none-any.whl", hash = "sha256:a448b2f64d686155468037e1ace9f2d2199776e17f0a46610480d311f73e3472"}, - {file = "urllib3-2.2.2.tar.gz", hash = "sha256:dd505485549a7a552833da5e6063639d0d177c04f23bc3864e41e5dc5f612168"}, + {file = "urllib3-2.2.3-py3-none-any.whl", hash = "sha256:ca899ca043dcb1bafa3e262d73aa25c465bfb49e0bd9dd5d59f1d0acba2f8fac"}, + {file = "urllib3-2.2.3.tar.gz", hash = "sha256:e7d814a81dad81e6caf2ec9fdedb284ecc9c73076b62654547cc64ccdcae26e9"}, ] [package.extras] diff --git a/pp2psdm/grid.py b/pp2psdm/grid.py index cb74787..aa06ef0 100644 --- a/pp2psdm/grid.py +++ b/pp2psdm/grid.py @@ -29,9 +29,7 @@ def convert_grid(grid: pp.pandapowerNet) -> Tuple[RawGridContainer]: lines = convert_lines(grid, nodes, node_index_uuid_map) - transformers = convert_transformers( - grid, node_index_uuid_map - ) + transformers = convert_transformers(grid, node_index_uuid_map) # TODO convert switches @@ -105,7 +103,6 @@ def line_param_conversion(c_nf_per_km: float, g_us_per_km: float): return g_us, b_us - def convert_lines(grid, nodes, node_index_uuid_map): df = grid.line lines_data = [] @@ -115,7 +112,7 @@ def convert_lines(grid, nodes, node_index_uuid_map): # Retrieve node_a and node_b UUIDs based on from_bus and to_bus node_a_uuid = node_index_uuid_map.get(row["from_bus"]) node_b_uuid = node_index_uuid_map.get(row["to_bus"]) - + # Check if the UUIDs were found if node_a_uuid is None or node_b_uuid is None: raise KeyError( diff --git a/tests/test_grid.py b/tests/test_grid.py index 3c41a59..db933fc 100644 --- a/tests/test_grid.py +++ b/tests/test_grid.py @@ -52,15 +52,15 @@ def test_nodes_conversion(input_data): assert net.data.iloc[i]["operator"] is None assert net.data.iloc[i]["geo_position"] == coord_string + def test_lines_conversion(input_data): expected, input = input_data len = input.line.shape[0] nodes, node_index_uuid_map = convert_nodes(input) - + net = convert_lines(input, nodes, node_index_uuid_map) for i in range(len): - node_from_bus = node_index_uuid_map.get(input.line.iloc[i]["from_bus"]) assert net.data.iloc[i]["v_rated"] == nodes.get(node_from_bus)["v_target"] @@ -69,10 +69,13 @@ def test_lines_conversion(input_data): assert math.isclose(net.data.iloc[i]["r"], input.line.iloc[i]["r_ohm_per_km"]) assert math.isclose(net.data.iloc[i]["x"], input.line.iloc[i]["x_ohm_per_km"]) assert math.isclose( - net.data.iloc[i]["b"], input.line.iloc[i]["c_nf_per_km"] * 2 * np.pi * 50 * 1e-3 + net.data.iloc[i]["b"], + input.line.iloc[i]["c_nf_per_km"] * 2 * np.pi * 50 * 1e-3, ) assert math.isclose(net.data.iloc[i]["g"], input.line.iloc[i]["g_us_per_km"]) - assert math.isclose(net.data.iloc[i]["i_max"], input.line.iloc[i]["max_i_ka"] * 1000) + assert math.isclose( + net.data.iloc[i]["i_max"], input.line.iloc[i]["max_i_ka"] * 1000 + ) assert net.data.iloc[i]["id"] == input.line.iloc[i]["name"] assert net.data.iloc[i]["node_a"] == node_index_uuid_map.get( input.line.iloc[i]["from_bus"] @@ -138,9 +141,7 @@ def test_trafo_conversion(input_data): len = input.trafo.shape[0] _, node_index_uuid_map = convert_nodes(input) - net = convert_transformers( - input, node_index_uuid_map - ) + net = convert_transformers(input, node_index_uuid_map) for i in range(len): rSc, xSc, gM, bM = trafo_parameter_test_conversion( From a0f1a3af1023dce1b35b9b62b0f766c5f7ef6919 Mon Sep 17 00:00:00 2001 From: danielfeismann Date: Thu, 12 Sep 2024 15:23:19 +0200 Subject: [PATCH 25/32] fix test_convert_grid --- tests/test_grid.py | 19 ++++--------------- 1 file changed, 4 insertions(+), 15 deletions(-) diff --git a/tests/test_grid.py b/tests/test_grid.py index db933fc..4248d87 100644 --- a/tests/test_grid.py +++ b/tests/test_grid.py @@ -20,21 +20,10 @@ def input_data(): def test_convert_grid(input_data): - _, input = input_data - s_mva = 5 - name = "test_grid" - net, uuid_idx = convert_grid(input, name=name, s_rated_mva=s_mva) - assert net.sn_mva == s_mva - assert net.name == name - assert len(net.bus) == len(input.nodes.data) - for uuid, idx in uuid_idx.node.items(): - assert net.bus.name.iloc[idx] == input.nodes.data.loc[uuid]["id"] - assert len(net.line) == len(input.lines.data) - for uuid, idx in uuid_idx.line.items(): - assert net.line.name.iloc[idx] == input.lines.data.loc[uuid]["id"] - assert len(net.trafo) == len(input.transformers_2_w.data) - for uuid, idx in uuid_idx.trafo.items(): - assert net.trafo.name.iloc[idx] == input.transformers_2_w.data.loc[uuid]["id"] + net = convert_grid(input) + assert len(net.nodes) == len(input.bus) + assert len(net.lines) == len(input.line) + assert len(net.transformers_2_w) == len(input.trafo) def test_nodes_conversion(input_data): From 7a81cc4b170f4b6e50de23f34ca405cfc1921a99 Mon Sep 17 00:00:00 2001 From: danielfeismann Date: Thu, 12 Sep 2024 15:28:43 +0200 Subject: [PATCH 26/32] fix test_convert_grid --- tests/test_grid.py | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/test_grid.py b/tests/test_grid.py index 4248d87..bc1c902 100644 --- a/tests/test_grid.py +++ b/tests/test_grid.py @@ -20,6 +20,7 @@ def input_data(): def test_convert_grid(input_data): + _, input = input_data net = convert_grid(input) assert len(net.nodes) == len(input.bus) assert len(net.lines) == len(input.line) From 2a55fed6e285c9ef9f4e762ee3225445b3d44c1b Mon Sep 17 00:00:00 2001 From: danielfeismann Date: Thu, 12 Sep 2024 15:50:36 +0200 Subject: [PATCH 27/32] readme and clean up --- README.md | 57 +++-------- pp2psdm/conversion/__init__.py | 0 pp2psdm/conversion/pandapower.py | 109 -------------------- pp2psdm/io/__init__.py | 0 pp2psdm/io/utils.py | 170 ------------------------------- 5 files changed, 13 insertions(+), 323 deletions(-) delete mode 100644 pp2psdm/conversion/__init__.py delete mode 100644 pp2psdm/conversion/pandapower.py delete mode 100644 pp2psdm/io/__init__.py delete mode 100644 pp2psdm/io/utils.py diff --git a/README.md b/README.md index 2f0ecca..2b15e74 100644 --- a/README.md +++ b/README.md @@ -1,53 +1,22 @@ -# python-template +# pp2psdm -Python template that includes all the basics for your new shiny project. -## Setup +This is a work-in-progress tool for converting [pandapower](https://github.com/e2nIEE/pandapower) to [PSDM](https://github.com/ie3-institute/PowerSystemDataModel) grid models. -1. Open a new repository while using this template. -This repository is marked as a template repository. -Github offers you the convenient possibility to open a new repository from a such a template repository. -See [here](https://docs.github.com/en/repositories/creating-and-managing-repositories/creating-a-repository-from-a-template) for details. -2. Clone your new repository -3. Rename the `python-project` package to your project name (this is where your source code should go). -4. Install the dependencies (preferably within a fresh virtual environment) -5. Run `pre-commit install` -6. Enjoy! -## What's in here? +## Limitations -### Formatting +- Currently only basic grid model conversion supported +- No switch conversion implemented yet -To spare you the pain of manually taking care of formatting your code and establish some consistency (remember "äußere Ordnung führt zu innerer Ordnung") it includes [Black](https://black.readthedocs.io/en/stable/) for automated formatting. -Execute `black .` in the terminal at the project's root directory to format your code. -### Testing +## Usage -To make sure your code actually does what you think it does! -The template includes [pytest](https://docs.pytest.org/en/7.1.x/) for that purpose. -Include the tests in the `tests` directory. Running `pytest` in the terminal at the project's root directory executes all tests and hopefully replaces hoping that your code works by knowing (at least so far as your actual test all relevant cases and boundary conditions). +```py +from pypsdm import RawGridContainer +from pp2psdm.grid import convert_grid -### CI - -To give you a slap on the wrist if you did not apply the formatter or your tests don't pass there is a [Github Actions](https://github.com/features/actions) workflow at `.github/workflows/simple-ci.yml`. -After pushing to the remote repository it checks out your code, installs all the dependencies then runs `flake8` for any code style issues and `black --check` to check the formatting. -Depending on how that went you will see yourself either confronted with a friendly green tick or rather unfriendly red cross at the code window in github (or the `Actions` section of the github repository.) - -### Pre-Commit - -To reduce slaps on the wrist there is [pre-commit](https://pre-commit.com/) having your back. -It installs pre-commit hooks that `black` and `flake8` before the CI gets a chance to complain. -The types of git hooks are configured in `.pre-commit-config.yaml`. -To install the hooks run `pre-commit install` once in the terminal at the project's root directory. - -### Dependabot - -To keep the dust off your dependencies [Dependabot](https://github.blog/2020-06-01-keep-all-your-packages-up-to-date-with-dependabot/) checks for new versions once a day (according to current cofigurations) and opens Pull-Requests in case it finds any newer versions. -The configuration can be changed at `.github/dependabot.yml` -Keep in mind that dependency updates can break your code. -You safeguard yourself against this by making sure you have all your code tested and the dependency pull request does not break any of them. - -## Something Missing? - -We are happy to learn about additional tools for easing the developer workflow. -Feel free to open an issue or pull-request to make suggestions. \ No newline at end of file +pp_path = "/my/psdm_grid/path" +psdm_grid = RawGridContainer.from_csv(psdm_path) +pp_grid, uuid_idx_maps = convert_grid(psdm_grid) +``` diff --git a/pp2psdm/conversion/__init__.py b/pp2psdm/conversion/__init__.py deleted file mode 100644 index e69de29..0000000 diff --git a/pp2psdm/conversion/pandapower.py b/pp2psdm/conversion/pandapower.py deleted file mode 100644 index 176ac50..0000000 --- a/pp2psdm/conversion/pandapower.py +++ /dev/null @@ -1,109 +0,0 @@ -from datetime import datetime, timedelta - -import pandas as pd -from pypsdm.models.enums import ( - EntitiesEnum, - RawGridElementsEnum, - SystemParticipantsEnum, -) -from pypsdm.models.result.grid.node import NodeResult, NodesResult -from pypsdm.models.result.power import PQResult -from pypsdm.models.ts.types import ComplexPowerDict - -# These are just some early quite specific conversions. Additional ones will be added as needed. - - -def pp_load_to_participants_result( - pp_net_file: str, # pp net xlsx export - participant_p_file: str, # pp time series p_mw export - participant_q_file: str, # pp time series q_mvar export - psdm_load_file: str, # psdm load csv input - start: datetime, # start of the time series simulation - resolution: timedelta, # resolution of the time series simulation -) -> ComplexPowerDict: - return _pp_to_psdm_result( - entity_type=SystemParticipantsEnum.LOAD, - pp_net_file=pp_net_file, - pp_sheet_name="load", - pp_attribute_a_file=participant_p_file, - psdm_attribute_a_name="p", - pp_attribute_b_file=participant_q_file, - psdm_attribute_b_name="q", - psdm_entity_input_file=psdm_load_file, - start=start, - resolution=resolution, - res_entity_class=PQResult, - res_dict_class=ComplexPowerDict, - ) - - -def pp_node_to_nodes_result( - pp_net_file: str, # pp net xlsx export - node_vm_file: str, # pp time series vm_pu export - node_va_file: str, # pp time series va_degree export - psdm_node_file: str, # psdm node csv input - start: datetime, # start of the time series simulation - resolution: timedelta, # resolution of the time series simulation -) -> ComplexPowerDict: - return _pp_to_psdm_result( - entity_type=RawGridElementsEnum.NODE, - pp_net_file=pp_net_file, - pp_sheet_name="bus", - pp_attribute_a_file=node_vm_file, - psdm_attribute_a_name="v_mag", - pp_attribute_b_file=node_va_file, - psdm_attribute_b_name="v_ang", - psdm_entity_input_file=psdm_node_file, - start=start, - resolution=resolution, - res_entity_class=NodeResult, - res_dict_class=NodesResult, - ) - - -def _pp_to_psdm_result( - entity_type: EntitiesEnum, - pp_net_file: str, - pp_sheet_name: str, - pp_attribute_a_file: str, - psdm_attribute_a_name: str, - pp_attribute_b_file: str, - psdm_attribute_b_name: str, - psdm_entity_input_file: str, - start: datetime, - resolution: timedelta, - res_entity_class, - res_dict_class, -): - pp_entity = pd.read_excel(pp_net_file, sheet_name=pp_sheet_name, index_col=0) - idx_to_id = pp_entity["name"].to_dict() - psdm_entity = pd.read_csv(psdm_entity_input_file, sep=";", index_col=0) - id_to_uuid = {id: uuid for uuid, id in psdm_entity["id"].to_dict().items()} - idx_to_uuid = {idx: id_to_uuid[id] for idx, id in idx_to_id.items()} - pp_attribute_a = pd.read_json(pp_attribute_a_file) - pp_attribute_b = pd.read_json(pp_attribute_b_file) - pp_attribute_a["time"] = pd.date_range( - start=start, periods=len(pp_attribute_a), freq=resolution - ) - pp_attribute_a.set_index("time", inplace=True) - pp_attribute_b["time"] = pd.date_range( - start=start, periods=len(pp_attribute_a), freq=resolution - ) - pp_attribute_b.set_index("time", inplace=True) - participants = {} - - for ts in pp_attribute_a.columns: - data = pd.concat( - [ - pp_attribute_a[ts].rename(psdm_attribute_a_name), - pp_attribute_b[ts].rename(psdm_attribute_b_name), - ], - axis=1, - ) - uuid = idx_to_uuid[ts] - node_res = res_entity_class( - type=entity_type, name=idx_to_id[ts], input_model=uuid, data=data - ) - participants[uuid] = node_res - - return res_dict_class(entity_type=entity_type, entities=participants) diff --git a/pp2psdm/io/__init__.py b/pp2psdm/io/__init__.py deleted file mode 100644 index e69de29..0000000 diff --git a/pp2psdm/io/utils.py b/pp2psdm/io/utils.py deleted file mode 100644 index 56cfd1a..0000000 --- a/pp2psdm/io/utils.py +++ /dev/null @@ -1,170 +0,0 @@ -import os -from datetime import datetime -from enum import Enum -from pathlib import Path -from typing import Optional, Union - -import pandas as pd -from pandas import DataFrame -from pandas.core.groupby.generic import DataFrameGroupBy - -ROOT_DIR = os.path.abspath(__file__ + "/../../../") - - -class DateTimePattern(Enum): - UTC_TIME_PATTERN_EXTENDED = "%Y-%m-%dT%H:%M:%SZ" - UTC_TIME_PATTERN = "%Y-%m-%dT%H:%MZ" - PLAIN = "%Y-%m-%d %H:%M:%S" - - -def get_absolute_path_from_project_root(path: str): - if not isinstance(path, str): - path = str(path) - if path.startswith(ROOT_DIR): - return path - else: - return Path(ROOT_DIR).joinpath(path) - - -def get_absolute_path_from_working_dir(path: str | Path) -> Path: - """ - Given a path (as string or pathlib.Path), returns its absolute path based on - the current working directory. If the path is already absolute, it's returned unchanged. - - Args: - - path (Union[str, Path]): The input path. - - Returns: - - Path: The absolute path as a pathlib.Path object. - """ - path_obj = Path(path) - if path_obj.is_absolute(): - return path_obj - return path_obj.resolve() - - -def get_file_path(path: str | Path, file_name: str): - return Path(path).resolve().joinpath(file_name) - - -def read_csv( - path: str | Path, - file_name: str, - delimiter: str | None = None, - index_col: Optional[str] = None, -) -> DataFrame: - full_path = get_file_path(path, file_name) - if not full_path.exists(): - raise IOError("File with path: " + str(full_path) + " does not exist") - if index_col: - return pd.read_csv( - full_path, - delimiter=delimiter, - quotechar='"', - index_col=index_col, - compression="zip", - ) - else: - return pd.read_csv(full_path, delimiter=delimiter, quotechar='"') - - -def to_date_time(zoned_date_time: str) -> datetime: - """ - Converts zoned date time string with format: "yyyy-MM-dd'T'HH:mm:ss[.S[S][S]]'Z'" - e.g. '2022-02-01T00:15Z[UTC]' to python datetime - - Args: - zoned_date_time: The zoned date time string to convert. - - Returns: - The converted datetime object. - """ - if not zoned_date_time or not isinstance(zoned_date_time, str): - raise ValueError(f"Unexpected date time string: {zoned_date_time}") - try: - year = int(zoned_date_time[0:4]) - month = int(zoned_date_time[5:7]) - day = int(zoned_date_time[8:10]) - hour = int(zoned_date_time[11:13]) - minute = int(zoned_date_time[14:16]) - except Exception: - return pd.to_datetime(zoned_date_time) - return datetime(year=year, month=month, day=day, hour=hour, minute=minute) - - -def csv_to_grpd_df( - file_name: str, simulation_data_path: str, delimiter: str | None = None -) -> DataFrameGroupBy: - """ - Reads in a PSDM csv results file cleans it up and groups it by input_archive model. - - Args: - file_name: name of the file to read - simulation_data_path: base directory of the result data - delimiter: the csv delimiter - - Returns: - DataFrameGroupBy object of the file - """ - data = read_csv(simulation_data_path, file_name, delimiter) - - if "uuid" in data.columns: - data = data.drop(columns=["uuid"]) - return data.groupby(by="input_model") - - -def check_filter(filter_start: Optional[datetime], filter_end: Optional[datetime]): - if (filter_start or filter_end) and not (filter_start and filter_end): - raise ValueError( - "Both start and end of the filter must be provided if one is provided." - ) - if (filter_start and filter_end) and (filter_start > filter_end): - raise ValueError("Filter start must be before end.") - - -def df_to_csv( - df: DataFrame, - path: Union[str, Path], - file_name: str, - mkdirs=False, - delimiter: str = ",", - index_label="uuid", - datetime_pattern=DateTimePattern.UTC_TIME_PATTERN, -): - df = df.copy(deep=True) - if isinstance(path, Path): - path = str(path) - file_path = get_file_path(path, file_name) - if mkdirs: - os.makedirs(os.path.dirname(file_path), exist_ok=True) - - bool_cols = [] - for col in df.columns: - is_bool_col = df[col].dropna().apply(lambda x: isinstance(x, bool)).all() - if is_bool_col: - bool_cols.append(col) - - # replace True with 'true' only in boolean columns - df[bool_cols] = df[bool_cols].replace({True: "true", False: "false"}) - - if isinstance(df.index, pd.DatetimeIndex): - df.index = df.index.strftime(datetime_pattern.value) - - datetime_cols = df.select_dtypes( - include=["datetime64[ns, UTC]", "datetime64"] - ).columns - for col in datetime_cols: - df[col] = df[col].apply( - lambda x: x.strftime(datetime_pattern.value) if not pd.isnull(x) else x - ) - - df.to_csv(file_path, index=True, index_label=index_label, sep=delimiter) - - -def bool_converter(maybe_bool): - if isinstance(maybe_bool, bool): - return maybe_bool - elif isinstance(maybe_bool, str) and maybe_bool.lower() in ["true", "false"]: - return maybe_bool.lower() == "true" - else: - raise ValueError("Cannot convert to bool: " + str(maybe_bool)) From a163d3666c65882c4819d68be5a03129a9bed1f3 Mon Sep 17 00:00:00 2001 From: danielfeismann Date: Thu, 12 Sep 2024 16:57:39 +0200 Subject: [PATCH 28/32] poetry --- poetry.lock | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/poetry.lock b/poetry.lock index f7c0a5d..fd814ab 100644 --- a/poetry.lock +++ b/poetry.lock @@ -2530,8 +2530,6 @@ files = [ {file = "psycopg2-2.9.9-cp310-cp310-win_amd64.whl", hash = "sha256:426f9f29bde126913a20a96ff8ce7d73fd8a216cfb323b1f04da402d452853c3"}, {file = "psycopg2-2.9.9-cp311-cp311-win32.whl", hash = "sha256:ade01303ccf7ae12c356a5e10911c9e1c51136003a9a1d92f7aa9d010fb98372"}, {file = "psycopg2-2.9.9-cp311-cp311-win_amd64.whl", hash = "sha256:121081ea2e76729acfb0673ff33755e8703d45e926e416cb59bae3a86c6a4981"}, - {file = "psycopg2-2.9.9-cp312-cp312-win32.whl", hash = "sha256:d735786acc7dd25815e89cc4ad529a43af779db2e25aa7c626de864127e5a024"}, - {file = "psycopg2-2.9.9-cp312-cp312-win_amd64.whl", hash = "sha256:a7653d00b732afb6fc597e29c50ad28087dcb4fbfb28e86092277a559ae4e693"}, {file = "psycopg2-2.9.9-cp37-cp37m-win32.whl", hash = "sha256:5e0d98cade4f0e0304d7d6f25bbfbc5bd186e07b38eac65379309c4ca3193efa"}, {file = "psycopg2-2.9.9-cp37-cp37m-win_amd64.whl", hash = "sha256:7e2dacf8b009a1c1e843b5213a87f7c544b2b042476ed7755be813eaf4e8347a"}, {file = "psycopg2-2.9.9-cp38-cp38-win32.whl", hash = "sha256:ff432630e510709564c01dafdbe996cb552e0b9f3f065eb89bdce5bd31fabf4c"}, @@ -3978,4 +3976,4 @@ dev = ["black (>=19.3b0)", "pytest (>=4.6.2)"] [metadata] lock-version = "2.0" python-versions = "<3.12,>3.11" -content-hash = "0e721fbb63c2a6e922e143ed5136430fcba3ed2db7093fa5aba382b6e63677ed" +content-hash = "ab2a9996e23ef71b25921acb30dcbbb02416c310929b68fa58d8235e16c8f353" From 61d3dd00760afd2c8dc923a3fcf0477299286ad8 Mon Sep 17 00:00:00 2001 From: danielfeismann Date: Thu, 12 Sep 2024 17:24:05 +0200 Subject: [PATCH 29/32] delete empty files --- pp2psdm/__init__.py | 0 pp2psdm/conversion/pandapower.py | 0 pp2psdm/io/utils.py | 0 tests/__init__.py | 0 4 files changed, 0 insertions(+), 0 deletions(-) delete mode 100644 pp2psdm/__init__.py delete mode 100644 pp2psdm/conversion/pandapower.py delete mode 100644 pp2psdm/io/utils.py delete mode 100644 tests/__init__.py diff --git a/pp2psdm/__init__.py b/pp2psdm/__init__.py deleted file mode 100644 index e69de29..0000000 diff --git a/pp2psdm/conversion/pandapower.py b/pp2psdm/conversion/pandapower.py deleted file mode 100644 index e69de29..0000000 diff --git a/pp2psdm/io/utils.py b/pp2psdm/io/utils.py deleted file mode 100644 index e69de29..0000000 diff --git a/tests/__init__.py b/tests/__init__.py deleted file mode 100644 index e69de29..0000000 From c2ddee3998ab0d366d32ebb3352bf653befca1ed Mon Sep 17 00:00:00 2001 From: danielfeismann Date: Thu, 12 Sep 2024 17:30:02 +0200 Subject: [PATCH 30/32] __init__.py --- pp2psdm/__init__.py | 0 tests/__init__.py | 0 2 files changed, 0 insertions(+), 0 deletions(-) create mode 100644 pp2psdm/__init__.py create mode 100644 tests/__init__.py diff --git a/pp2psdm/__init__.py b/pp2psdm/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/tests/__init__.py b/tests/__init__.py new file mode 100644 index 0000000..e69de29 From d6bd6fc43b79fc69e4161ba4e22a18553b307b6b Mon Sep 17 00:00:00 2001 From: danielfeismann Date: Tue, 3 Dec 2024 10:49:16 +0100 Subject: [PATCH 31/32] adapt return type --- pp2psdm/grid.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pp2psdm/grid.py b/pp2psdm/grid.py index aa06ef0..f28fd9b 100644 --- a/pp2psdm/grid.py +++ b/pp2psdm/grid.py @@ -23,7 +23,7 @@ class UuidIdxMaps: trafo: dict[str, int] = field(default_factory=dict) -def convert_grid(grid: pp.pandapowerNet) -> Tuple[RawGridContainer]: +def convert_grid(grid: pp.pandapowerNet) -> RawGridContainer: nodes, node_index_uuid_map = convert_nodes(grid) From abff61be3b5154df739cece6fb0fc00327e00490 Mon Sep 17 00:00:00 2001 From: danielfeismann Date: Tue, 3 Dec 2024 10:49:33 +0100 Subject: [PATCH 32/32] remove redundant value --- pp2psdm/grid.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/pp2psdm/grid.py b/pp2psdm/grid.py index f28fd9b..7b1e7d0 100644 --- a/pp2psdm/grid.py +++ b/pp2psdm/grid.py @@ -229,9 +229,6 @@ def trafo_param_conversion( # No load admittance in Ohm yNoLoad = iNoLoad / vM - # Reference current in Ampere - i_ref = sn_mva * 1e6 / (math.sqrt(3) * vn_hv_kv * 1e3) - # No load conductance in Siemens gM = pfe_kw * 1e3 / ((vn_hv_kv * 1e3) ** 2) # Convert into nano Siemens for psdm @@ -246,7 +243,7 @@ def trafo_param_conversion( pCU = ((vkr_percent * 1e-3 / 100) * sn_mva * 1e6) * 1e3 # Resistance at short circuit in Ohm - rSc = pCU / (3 * i_ref**2) + rSc = pCU / (3 * i_rated**2) # Reference Impedance in Ohm z_ref = (vn_hv_kv * 1e3) ** 2 / (sn_mva * 1e6)