Skip to content

Commit 5395152

Browse files
committed
merge commit
Signed-off-by: Nitish Bharambe <[email protected]>
2 parents c5ef402 + c49b9e9 commit 5395152

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

docs/examples/arrow_example.ipynb

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
"\n",
1111
"It is by no means intended to provide complete documentation on the topic, but only to show how such conversions could be done.\n",
1212
"\n",
13-
"This example uses `pyarrow.RecordBatch` to demonstrate zero copy operations. The user can choose a `pyarrow.Table` or other structures based on the requirement.\n",
13+
"This example uses `pyarrow.RecordBatch` to demonstrate zero-copy operations. The user can choose a `pyarrow.Table` or other structures based on the requirement.\n",
1414
"\n",
1515
"**NOTE:** To run this example, the optional `examples` dependencies are required:\n",
1616
"\n",
@@ -68,7 +68,7 @@
6868
"\n",
6969
"Construct the input data for the model and construct the actual model.\n",
7070
"\n",
71-
"Arrow uses a columnar data format while the power-grid-model offers both: row based or columnar data format.\n",
71+
"Arrow uses a columnar data format while the power-grid-model offers support for both row based and columnar data format.\n",
7272
"Because of this, the columnar data format of power-grid-model provides a zero-copy interface for Arrow data. This differs from the row-based data format, for which conversions always require a copy."
7373
]
7474
},
@@ -113,11 +113,11 @@
113113
"metadata": {},
114114
"source": [
115115
"The primitive types of each attribute in the arrow tables need to match to make the operation efficient.\n",
116-
"A zero copy is not guaranteed if the data types from power_grid_meta_data / initialize_array are not used.\n",
116+
"Zero-copy conversion is not guaranteed if the data types provided via the PGM via `power_grid_meta_data` are not used.\n",
117117
"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",
118-
"Hence asymmetric attributes need to be handled specially. \n",
118+
"Hence, special care is required when handling asymmetric attributes. \n",
119119
"\n",
120-
"In this tutorial we use the respective primitive types for the symmetrical attributes and a `FixedSizeListArray` of the primitive types with length 3 for asymmetrical attributes. This results in them being stored as contigious memory which would enable zero copy conversion. There might be other ways to approach this problem too."
120+
"In this example, we use the respective primitive types for the symmetrical attributes and a `FixedSizeListArray` of the primitive types with length 3 for asymmetrical attributes. This results in them being stored as contiguous memory which would enable zero-copy conversion. Other possible solutions to this problem are beyond the scope of this example."
121121
]
122122
},
123123
{
@@ -259,7 +259,7 @@
259259
"Converting Arrow data to columnar NumPy arrays is recommended to leverage the columnar nature of Arrow data. \n",
260260
"This conversion can be done with zero-copy operations.\n",
261261
"\n",
262-
"Similar approach be adopted by the user to convert to row based data.\n",
262+
"A similar approach be adopted by the user to convert to row based data.\n",
263263
"\n",
264264
"```{note}\n",
265265
"The option of `zero_copy_only` in the function below and assert for correct dtype is added in this demo to verify no copies are made. \n",

0 commit comments

Comments
 (0)