|
90 | 90 | "name": "stdout", |
91 | 91 | "output_type": "stream", |
92 | 92 | "text": [ |
93 | | - "node: {'names': ['id', 'u_rated'], 'formats': ['<i4', '<f8'], 'offsets': [0, 8], 'itemsize': 16, 'aligned': True}\n", |
94 | | - "line: {'names': ['id', 'from_node', 'to_node', 'from_status', 'to_status', 'r1', 'x1', 'c1', 'tan1', 'r0', 'x0', 'c0', 'tan0', 'i_n'], 'formats': ['<i4', '<i4', '<i4', 'i1', 'i1', '<f8', '<f8', '<f8', '<f8', '<f8', '<f8', '<f8', '<f8', '<f8'], 'offsets': [0, 4, 8, 12, 13, 16, 24, 32, 40, 48, 56, 64, 72, 80], 'itemsize': 88, 'aligned': True}\n", |
95 | | - "source: {'names': ['id', 'node', 'status', 'u_ref', 'u_ref_angle', 'sk', 'rx_ratio', 'z01_ratio'], 'formats': ['<i4', '<i4', 'i1', '<f8', '<f8', '<f8', '<f8', '<f8'], 'offsets': [0, 4, 8, 16, 24, 32, 40, 48], 'itemsize': 56, 'aligned': True}\n", |
96 | | - "asym_load: {'names': ['id', 'node', 'status', 'type', 'p_specified', 'q_specified'], 'formats': ['<i4', '<i4', 'i1', 'i1', ('<f8', (3,)), ('<f8', (3,))], 'offsets': [0, 4, 8, 9, 16, 40], 'itemsize': 64, 'aligned': True}\n" |
| 93 | + "node: ComponentMetaData(dtype=dtype([('id', '<i4'), ('u_rated', '<f8')], align=True), dtype_dict={'names': ['id', 'u_rated'], 'formats': ['<i4', '<f8'], 'offsets': [0, 8], 'itemsize': 16, 'aligned': True, 'nans': [-2147483648, nan]}, nans={'id': -2147483648, 'u_rated': nan}, nan_scalar=array([(-2147483648, nan)],\n", |
| 94 | + " dtype={'names': ['id', 'u_rated'], 'formats': ['<i4', '<f8'], 'offsets': [0, 8], 'itemsize': 16, 'aligned': True}))\n", |
| 95 | + "line: ComponentMetaData(dtype=dtype([('id', '<i4'), ('from_node', '<i4'), ('to_node', '<i4'), ('from_status', 'i1'), ('to_status', 'i1'), ('r1', '<f8'), ('x1', '<f8'), ('c1', '<f8'), ('tan1', '<f8'), ('r0', '<f8'), ('x0', '<f8'), ('c0', '<f8'), ('tan0', '<f8'), ('i_n', '<f8')], align=True), dtype_dict={'names': ['id', 'from_node', 'to_node', 'from_status', 'to_status', 'r1', 'x1', 'c1', 'tan1', 'r0', 'x0', 'c0', 'tan0', 'i_n'], 'formats': ['<i4', '<i4', '<i4', '<i1', '<i1', '<f8', '<f8', '<f8', '<f8', '<f8', '<f8', '<f8', '<f8', '<f8'], 'offsets': [0, 4, 8, 12, 13, 16, 24, 32, 40, 48, 56, 64, 72, 80], 'itemsize': 88, 'aligned': True, 'nans': [-2147483648, -2147483648, -2147483648, -128, -128, nan, nan, nan, nan, nan, nan, nan, nan, nan]}, nans={'id': -2147483648, 'from_node': -2147483648, 'to_node': -2147483648, 'from_status': -128, 'to_status': -128, 'r1': nan, 'x1': nan, 'c1': nan, 'tan1': nan, 'r0': nan, 'x0': nan, 'c0': nan, 'tan0': nan, 'i_n': nan}, nan_scalar=array([(-2147483648, -2147483648, -2147483648, -128, -128, nan, nan, nan, nan, nan, nan, nan, nan, nan)],\n", |
| 96 | + " dtype={'names': ['id', 'from_node', 'to_node', 'from_status', 'to_status', 'r1', 'x1', 'c1', 'tan1', 'r0', 'x0', 'c0', 'tan0', 'i_n'], 'formats': ['<i4', '<i4', '<i4', 'i1', 'i1', '<f8', '<f8', '<f8', '<f8', '<f8', '<f8', '<f8', '<f8', '<f8'], 'offsets': [0, 4, 8, 12, 13, 16, 24, 32, 40, 48, 56, 64, 72, 80], 'itemsize': 88, 'aligned': True}))\n", |
| 97 | + "source: ComponentMetaData(dtype=dtype([('id', '<i4'), ('node', '<i4'), ('status', 'i1'), ('u_ref', '<f8'), ('u_ref_angle', '<f8'), ('sk', '<f8'), ('rx_ratio', '<f8'), ('z01_ratio', '<f8')], align=True), dtype_dict={'names': ['id', 'node', 'status', 'u_ref', 'u_ref_angle', 'sk', 'rx_ratio', 'z01_ratio'], 'formats': ['<i4', '<i4', '<i1', '<f8', '<f8', '<f8', '<f8', '<f8'], 'offsets': [0, 4, 8, 16, 24, 32, 40, 48], 'itemsize': 56, 'aligned': True, 'nans': [-2147483648, -2147483648, -128, nan, nan, nan, nan, nan]}, nans={'id': -2147483648, 'node': -2147483648, 'status': -128, 'u_ref': nan, 'u_ref_angle': nan, 'sk': nan, 'rx_ratio': nan, 'z01_ratio': nan}, nan_scalar=array([(-2147483648, -2147483648, -128, nan, nan, nan, nan, nan)],\n", |
| 98 | + " dtype={'names': ['id', 'node', 'status', 'u_ref', 'u_ref_angle', 'sk', 'rx_ratio', 'z01_ratio'], 'formats': ['<i4', '<i4', 'i1', '<f8', '<f8', '<f8', '<f8', '<f8'], 'offsets': [0, 4, 8, 16, 24, 32, 40, 48], 'itemsize': 56, 'aligned': True}))\n", |
| 99 | + "asym_load: ComponentMetaData(dtype=dtype([('id', '<i4'), ('node', '<i4'), ('status', 'i1'), ('type', 'i1'), ('p_specified', '<f8', (3,)), ('q_specified', '<f8', (3,))], align=True), dtype_dict={'names': ['id', 'node', 'status', 'type', 'p_specified', 'q_specified'], 'formats': ['<i4', '<i4', '<i1', '<i1', '<(3,)f8', '<(3,)f8'], 'offsets': [0, 4, 8, 9, 16, 40], 'itemsize': 64, 'aligned': True, 'nans': [-2147483648, -2147483648, -128, -128, nan, nan]}, nans={'id': -2147483648, 'node': -2147483648, 'status': -128, 'type': -128, 'p_specified': nan, 'q_specified': nan}, nan_scalar=array([(-2147483648, -2147483648, -128, -128, [nan, nan, nan], [nan, nan, nan])],\n", |
| 100 | + " dtype={'names': ['id', 'node', 'status', 'type', 'p_specified', 'q_specified'], 'formats': ['<i4', '<i4', 'i1', 'i1', ('<f8', (3,)), ('<f8', (3,))], 'offsets': [0, 4, 8, 9, 16, 40], 'itemsize': 64, 'aligned': True}))\n" |
97 | 101 | ] |
98 | 102 | } |
99 | 103 | ], |
100 | 104 | "source": [ |
101 | | - "node_input_dtype = initialize_array(\"input\", \"node\", 0).dtype\n", |
102 | | - "line_input_dtype = initialize_array(\"input\", \"line\", 0).dtype\n", |
103 | | - "source_input_dtype = initialize_array(\"input\", \"source\", 0).dtype\n", |
104 | | - "asym_load_input_dtype = initialize_array(\"input\", \"asym_load\", 0).dtype\n", |
| 105 | + "node_input_dtype = power_grid_meta_data[DatasetType.input][ComponentType.node]\n", |
| 106 | + "line_input_dtype = power_grid_meta_data[DatasetType.input][ComponentType.line]\n", |
| 107 | + "source_input_dtype = power_grid_meta_data[DatasetType.input][ComponentType.source]\n", |
| 108 | + "asym_load_input_dtype = power_grid_meta_data[DatasetType.input][ComponentType.asym_load]\n", |
105 | 109 | "print(\"node:\", node_input_dtype)\n", |
106 | 110 | "print(\"line:\", line_input_dtype)\n", |
107 | 111 | "print(\"source:\", source_input_dtype)\n", |
|
139 | 143 | "name": "stdout", |
140 | 144 | "output_type": "stream", |
141 | 145 | "text": [ |
142 | | - "-------node asym scehma-------\n", |
| 146 | + "-------node scehma-------\n", |
143 | 147 | "id: int32\n", |
144 | 148 | "u_rated: double\n", |
145 | 149 | "-------asym load scehma-------\n", |
|
169 | 173 | " return pa.schema(schemas)\n", |
170 | 174 | "\n", |
171 | 175 | "\n", |
172 | | - "print(\"-------node asym scehma-------\")\n", |
| 176 | + "print(\"-------node scehma-------\")\n", |
173 | 177 | "print(pgm_schema(DatasetType.input, ComponentType.node))\n", |
174 | 178 | "print(\"-------asym load scehma-------\")\n", |
175 | 179 | "print(pgm_schema(DatasetType.input, ComponentType.asym_load))" |
|
814 | 818 | { |
815 | 819 | "data": { |
816 | 820 | "text/plain": [ |
817 | | - "<pyarrow.lib.DoubleArray object at 0x0000020996813E20>\n", |
| 821 | + "<pyarrow.lib.DoubleArray object at 0x000001A81FF94A00>\n", |
818 | 822 | "[\n", |
819 | 823 | " 1,\n", |
820 | 824 | " 0.01,\n", |
|
0 commit comments