Skip to content

Commit 8058be6

Browse files
committed
rerun example
Signed-off-by: Nitish Bharambe <[email protected]>
1 parent 198177b commit 8058be6

File tree

1 file changed

+9
-12
lines changed

1 file changed

+9
-12
lines changed

docs/examples/arrow_example.ipynb

Lines changed: 9 additions & 12 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 by the PGM via `power_grid_meta_data` are not used.\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",
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 schema-------\n",
146+
"-------node scehma-------\n",
147147
"id: int32\n",
148148
"u_rated: double\n",
149-
"-------asym load schema-------\n",
149+
"-------asym load scehma-------\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 schema-------\")\n",
176+
"print(\"-------node scehma-------\")\n",
177177
"print(pgm_schema(DatasetType.input, ComponentType.node))\n",
178-
"print(\"-------asym load schema-------\")\n",
178+
"print(\"-------asym load scehma-------\")\n",
179179
"print(pgm_schema(DatasetType.input, ComponentType.asym_load))"
180180
]
181181
},
@@ -188,12 +188,12 @@
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 and initialization of arrays and combining the data in a RecordBatch is up to the user."
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."
192192
]
193193
},
194194
{
195195
"cell_type": "code",
196-
"execution_count": 4,
196+
"execution_count": null,
197197
"metadata": {},
198198
"outputs": [
199199
{
@@ -213,7 +213,6 @@
213213
}
214214
],
215215
"source": [
216-
"# create the individual columns with the correct data type\n",
217216
"nodes_schema = pgm_schema(DatasetType.input, ComponentType.node)\n",
218217
"nodes = pa.record_batch(\n",
219218
" [\n",
@@ -223,7 +222,6 @@
223222
" names=(\"id\", \"u_rated\"),\n",
224223
")\n",
225224
"\n",
226-
"# or convert directly using the schema\n"
227225
"lines = pa.record_batch(\n",
228226
" {\n",
229227
" \"id\": [4, 5],\n",
@@ -369,7 +367,7 @@
369367
},
370368
{
371369
"cell_type": "code",
372-
"execution_count": 8,
370+
"execution_count": null,
373371
"metadata": {},
374372
"outputs": [
375373
{
@@ -792,7 +790,6 @@
792790
" data: SingleColumnarData, dataset_type: DatasetType, component_type: ComponentType\n",
793791
") -> pa.RecordBatch:\n",
794792
" \"\"\"Convert NumPy data to Arrow data.\"\"\"\n",
795-
" # pa.record_batch.from_arrays(data, schema=pgm_schema(DatasetType.result, ComponentType.node))\n",
796793
" component_pgm_schema = pgm_schema(dataset_type, component_type, data.keys())\n",
797794
" pa_columns = {}\n",
798795
" for attribute, data in data.items():\n",
@@ -820,7 +817,7 @@
820817
{
821818
"data": {
822819
"text/plain": [
823-
"<pyarrow.lib.DoubleArray object at 0x000001A81FF94A00>\n",
820+
"<pyarrow.lib.DoubleArray object at 0x00000184F527A680>\n",
824821
"[\n",
825822
" 1,\n",
826823
" 0.01,\n",

0 commit comments

Comments
 (0)