MCPcopy Create free account
hub / github.com/PowerGridModel/power-grid-model / input_data_r

Function input_data_r

tests/unit/test_optional_ids.py:24–60  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

22
23@pytest.fixture
24def input_data_r():
25 node = initialize_array(DatasetType.input, CT.node, 3)
26 node[AT.id] = np.array([1, 2, 6])
27 node[AT.u_rated] = [10.5e3, 10.5e3, 10.5e3]
28
29 line = initialize_array(DatasetType.input, CT.line, 3)
30 line[AT.id] = [3, 5, 8]
31 line[AT.from_node] = [1, 2, 1]
32 line[AT.to_node] = [2, 6, 6]
33 line[AT.from_status] = [1, 1, 1]
34 line[AT.to_status] = [1, 1, 1]
35 line[AT.r1] = [0.25, 0.25, 0.25]
36 line[AT.x1] = [0.2, 0.2, 0.2]
37 line[AT.c1] = [10e-6, 10e-6, 10e-6]
38 line[AT.tan1] = [0.0, 0.0, 0.0]
39 line[AT.i_n] = [1000, 1000, 1000]
40
41 sym_load = initialize_array(DatasetType.input, CT.sym_load, 2)
42 sym_load[AT.id] = [4, 7]
43 sym_load[AT.node] = [2, 6]
44 sym_load[AT.status] = [1, 1]
45 sym_load[AT.type] = [LoadGenType.const_power, LoadGenType.const_power]
46 sym_load[AT.p_specified] = [20e6, 10e6]
47 sym_load[AT.q_specified] = [5e6, 2e6]
48
49 source = initialize_array(DatasetType.input, CT.source, 1)
50 source[AT.id] = [10]
51 source[AT.node] = [1]
52 source[AT.status] = [1]
53 source[AT.u_ref] = [1.0]
54
55 return {
56 CT.node: node,
57 CT.line: line,
58 CT.sym_load: sym_load,
59 CT.source: source,
60 }
61
62
63@pytest.fixture

Callers

nothing calls this directly

Calls 1

initialize_arrayFunction · 0.90

Tested by

no test coverage detected