diff --git a/content/slides.ipynb b/content/slides.ipynb index 41622d8..cd426a8 100644 --- a/content/slides.ipynb +++ b/content/slides.ipynb @@ -11,7 +11,7 @@ "tags": [] }, "source": [ - "
↑↑↑↑↑↑\n", + "↑↑↑↑↑↑
↑↑↑↑↑↑
\n", "\n", "**To view this notebook as a slideshow click on the deck icon ![deck](https://raw.githubusercontent.com/deathbeds/jupyterlab-deck/main/docs/_static/deck.svg) above.**\n", "\n", @@ -53,7 +53,7 @@ "- Introduction and motivation for RNTuple.\n", "- Status of RNTuple support in Uproot.\n", "- Hands-on demo.\n", - "- Future work and outlook" + "- Future work and outlook." ] }, { @@ -735,7 +735,7 @@ "source": [ "### We can already ready complex files\n", "\n", - "Here is an example of a file produced by an ATLAS workflow." + "Here is an example of a file produced with an ATLAS workflow." ] }, { @@ -758,8 +758,8 @@ "\n", "# For WASM we need some workarounds\n", "import requests\n", - "r = requests.get(f\"https://corsproxy.io/?{url}\") # Please be careful when using a CORS proxy\n", - "open(\"DAOD_TRUTH3_RC2.root\", \"wb\").write(r.content)\n", + "#r = requests.get(f\"https://corsproxy.io/?{url}\") # Please be careful when using a CORS proxy\n", + "#open(\"DAOD_TRUTH3_RC2.root\", \"wb\").write(r.content)\n", "f = uproot.open(\"DAOD_TRUTH3_RC2.root\")" ] }, @@ -856,50 +856,16 @@ }, "outputs": [], "source": [ + "# 4M events\n", "url = \"http://root.cern/files/tutorials/ntpl004_dimuon_v1rc2.root\"\n", "\n", "# When not using WASM we can read the file directly\n", "# f = uproot.open(f\"simplecache::{url}\")\n", + "# ntpl = f[\"Events\"]\n", + "# arrays = ntpl.arrays() # Takes ~1 second\n", "\n", - "# For WASM we need some workarounds\n", - "import requests\n", - "r = requests.get(f\"https://corsproxy.io/?{url}\") # Please be careful when using a CORS proxy\n", - "open(\"ntpl004_dimuon_v1rc2.root\", \"wb\").write(r.content)\n", - "f = uproot.open(\"ntpl004_dimuon_v1rc2.root\")" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "b63b5c19-d84f-491a-9622-2d3d5f6fc1f3", - "metadata": { - "editable": true, - "slideshow": { - "slide_type": "fragment" - }, - "tags": [] - }, - "outputs": [], - "source": [ - "f.classnames()" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "65757acb-1c47-42f4-9198-1a89267b3aa3", - "metadata": { - "editable": true, - "slideshow": { - "slide_type": "fragment" - }, - "tags": [] - }, - "outputs": [], - "source": [ - "ntpl = f[\"Events\"]\n", - "arrays = ntpl.arrays()\n", - "arrays" + "# Performance is still not very good on WASM so we'll skip it here,\n", + "# but you can try it with your native install." ] }, { @@ -932,8 +898,8 @@ "import awkward as ak\n", "from hist import Hist\n", "\n", - "h = Hist.new.Regular(50, 0, 70, name=\"pt\", label=\"Muon $p_T$\").Double()\n", - "h.fill(pt=ak.flatten(arrays.Muon_pt))\n", + "h = Hist.new.Regular(50, 0, 70000, name=\"pt\", label=\"Muon $p_T$\").Double()\n", + "h.fill(pt=ak.flatten(arrays[\"AntiKt4TruthDressedWZJetsAux:\"].pt))\n", "h.plot();" ] }, @@ -976,7 +942,7 @@ "tags": [] }, "source": [ - "- Lazy-reading will be implemented with `dask`, just how it has been done for `TTree`." + "- Lazy-reading will be implemented with `dask`, just how it was done for `TTree`." ] }, { @@ -1018,7 +984,7 @@ "tags": [] }, "source": [ - "- `uproot` will become even more useful since it should support almost 100% of the `RNTuple` spec, and so should be almost equivalent to `ROOT` for reading and writing.\n", + "- `uproot` will become even more useful since it should support almost 100% of the `RNTuple` spec, and so should be almost equivalent (albeit slower) to `ROOT` for reading and writing.\n", "\n", "