Skip to content

Commit ff11bad

Browse files
committed
resolve comments
Signed-off-by: Nitish Bharambe <[email protected]>
1 parent 045f0b1 commit ff11bad

File tree

1 file changed

+15
-11
lines changed

1 file changed

+15
-11
lines changed

docs/examples/arrow_example.ipynb

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -90,18 +90,22 @@
9090
"name": "stdout",
9191
"output_type": "stream",
9292
"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"
97101
]
98102
}
99103
],
100104
"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",
105109
"print(\"node:\", node_input_dtype)\n",
106110
"print(\"line:\", line_input_dtype)\n",
107111
"print(\"source:\", source_input_dtype)\n",
@@ -139,7 +143,7 @@
139143
"name": "stdout",
140144
"output_type": "stream",
141145
"text": [
142-
"-------node asym scehma-------\n",
146+
"-------node scehma-------\n",
143147
"id: int32\n",
144148
"u_rated: double\n",
145149
"-------asym load scehma-------\n",
@@ -169,7 +173,7 @@
169173
" return pa.schema(schemas)\n",
170174
"\n",
171175
"\n",
172-
"print(\"-------node asym scehma-------\")\n",
176+
"print(\"-------node scehma-------\")\n",
173177
"print(pgm_schema(DatasetType.input, ComponentType.node))\n",
174178
"print(\"-------asym load scehma-------\")\n",
175179
"print(pgm_schema(DatasetType.input, ComponentType.asym_load))"
@@ -814,7 +818,7 @@
814818
{
815819
"data": {
816820
"text/plain": [
817-
"<pyarrow.lib.DoubleArray object at 0x0000020996813E20>\n",
821+
"<pyarrow.lib.DoubleArray object at 0x000001A81FF94A00>\n",
818822
"[\n",
819823
" 1,\n",
820824
" 0.01,\n",

0 commit comments

Comments
 (0)