Skip to content

Commit 198177b

Browse files
nitbharambemgovers
andauthored
Apply suggestions from code review
Co-authored-by: Martijn Govers <[email protected]> Signed-off-by: Nitish Bharambe <[email protected]>
1 parent ff11bad commit 198177b

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

docs/examples/arrow_example.ipynb

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@
117117
"metadata": {},
118118
"source": [
119119
"The primitive types of each attribute in the arrow tables need to match to make the operation efficient.\n",
120-
"Zero-copy conversion is not guaranteed if the data types provided via the PGM via `power_grid_meta_data` are not used.\n",
120+
"Zero-copy conversion is not guaranteed if the data types provided by the PGM via `power_grid_meta_data` are not used.\n",
121121
"Note that the asymmetric type of attribute in power-grid-model has a shape of `(3,)` along with a specific type. These represent the 3 phases of electrical system.\n",
122122
"Hence, special care is required when handling asymmetric attributes. \n",
123123
"\n",
@@ -143,10 +143,10 @@
143143
"name": "stdout",
144144
"output_type": "stream",
145145
"text": [
146-
"-------node scehma-------\n",
146+
"-------node schema-------\n",
147147
"id: int32\n",
148148
"u_rated: double\n",
149-
"-------asym load scehma-------\n",
149+
"-------asym load schema-------\n",
150150
"id: int32\n",
151151
"node: int32\n",
152152
"status: int8\n",
@@ -173,9 +173,9 @@
173173
" return pa.schema(schemas)\n",
174174
"\n",
175175
"\n",
176-
"print(\"-------node scehma-------\")\n",
176+
"print(\"-------node schema-------\")\n",
177177
"print(pgm_schema(DatasetType.input, ComponentType.node))\n",
178-
"print(\"-------asym load scehma-------\")\n",
178+
"print(\"-------asym load schema-------\")\n",
179179
"print(pgm_schema(DatasetType.input, ComponentType.asym_load))"
180180
]
181181
},
@@ -188,7 +188,7 @@
188188
"The [power-grid-model documentation on Components](https://power-grid-model.readthedocs.io/en/stable/user_manual/components.html) provides documentation on which components are required and which ones are optional.\n",
189189
"\n",
190190
"Construct the Arrow data as a table with the correct headers and data types. \n",
191-
"The creation of arrays and combining it in a RecordBatch as well as the method of initializing that RecordBatch is up to the user."
191+
"The creation and initialization of arrays and combining the data in a RecordBatch is up to the user."
192192
]
193193
},
194194
{
@@ -213,6 +213,7 @@
213213
}
214214
],
215215
"source": [
216+
"# create the individual columns with the correct data type\n",
216217
"nodes_schema = pgm_schema(DatasetType.input, ComponentType.node)\n",
217218
"nodes = pa.record_batch(\n",
218219
" [\n",
@@ -222,6 +223,7 @@
222223
" names=(\"id\", \"u_rated\"),\n",
223224
")\n",
224225
"\n",
226+
"# or convert directly using the schema\n"
225227
"lines = pa.record_batch(\n",
226228
" {\n",
227229
" \"id\": [4, 5],\n",

0 commit comments

Comments
 (0)