Skip to content

Commit 48f1c81

Browse files
committed
Improved readability
1 parent 80e7004 commit 48f1c81

File tree

1 file changed

+17
-12
lines changed

1 file changed

+17
-12
lines changed

docs/tutorials/basics.ipynb

Lines changed: 17 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -637,18 +637,12 @@
637637
"source": [
638638
"# Let's document all storing processes in a list\n",
639639
"stored = []\n",
640-
"# Let's store the entity\n",
640+
"\n",
641+
"# Storing an entity requires only one line:\n",
641642
"res = osw_obj.store_entity(john)\n",
642-
"stored.append(res)\n",
643-
"# In this specific case equivalent to:\n",
644-
"params = prm.StoreEntityParam(\n",
645-
" entities=[john],\n",
646-
" namespace=john.get_namespace(),\n",
647-
" parallel=False,\n",
648-
" overwrite=\"keep existing\",\n",
649-
" overwrite_per_class=None,\n",
650-
") # All default values included\n",
651-
"# osw_obj.store_entity(params)"
643+
"\n",
644+
"# But to be able to access all storage event later on, we will append the result to the list\n",
645+
"stored.append(res)"
652646
],
653647
"id": "99cf8828bee651ee"
654648
},
@@ -657,7 +651,18 @@
657651
"id": "639db64348bbd905",
658652
"metadata": {},
659653
"source": [
660-
"Like most methods and functions in the osw-python library, the `store_entity` takes only a single argument. Usually \n",
654+
"```python\n",
655+
"# In this specific case equivalent to:\n",
656+
"params = prm.StoreEntityParam(\n",
657+
" entities=[john],\n",
658+
" namespace=john.get_namespace(),\n",
659+
" parallel=False,\n",
660+
" overwrite=\"keep existing\",\n",
661+
" overwrite_per_class=None,\n",
662+
") # All default values included\n",
663+
"stored.append(osw_obj.store_entity(params))\n",
664+
"```\n",
665+
"Like most methods and functions in the osw-python library, the `store_entity` takes only a single argument. Usually\n",
661666
"either a specific object type or a dedicated params object is accepted. If an object of type other than the params \n",
662667
"object is passed, it is usually tested for compatibility and put inside a params object, filling the other parameters \n",
663668
"with default values. \n",

0 commit comments

Comments
 (0)