Procházet zdrojové kódy

Added another NIX saving step to tutorial

Michael Denker před 2 roky
rodič
revize
b4b5b36450
1 změnil soubory, kde provedl 25 přidání a 2 odebrání
  1. 25 2
      day_3/tutorial_3.ipynb

+ 25 - 2
day_3/tutorial_3.ipynb

@@ -1157,7 +1157,7 @@
    "source": [
     "This way, we can save analysis results to disk with important information indicating how these were generated.\n",
     "We can save these results using the Neo NIX IO. To this end, we compile results into a Neo `Block`, and all\n",
-    "rate results in particular into a `Segement`."
+    "rate results in particular into a `Segment`."
    ]
   },
   {
@@ -1182,6 +1182,29 @@
     "    io.write(results_block)"
    ]
   },
+  {
+   "cell_type": "markdown",
+   "id": "9784961b",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "subslide"
+    }
+   },
+   "source": [
+    "If we think about a collaborator who may want to build upon your results, maybe it would be good to also supply him/her with the data used to calculate these results. Luckily, these are available as a Neo `Block` in the variable `trials` which we created in the beginning of this tutorial. Saving this data to the same NIX file, we can combine analysis input and output in a single, compact file."
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 28,
+   "id": "6eb11db9",
+   "metadata": {},
+   "outputs": [],
+   "source": [
+    "with neo.io.NixIO('results.nix', 'rw') as io:\n",
+    "    io.write(trials)"
+   ]
+  },
   {
    "cell_type": "markdown",
    "id": "fcc6568a",
@@ -1202,7 +1225,7 @@
   },
   {
    "cell_type": "code",
-   "execution_count": 28,
+   "execution_count": 29,
    "id": "36d59a83",
    "metadata": {
     "pycharm": {