Skip to content

Commit

Permalink
fix: small fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
ariostas committed Jul 2, 2024
1 parent 149c8ab commit ab2dc90
Showing 1 changed file with 14 additions and 48 deletions.
62 changes: 14 additions & 48 deletions content/slides.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"tags": []
},
"source": [
"<pre> &#8593;&#8593;&#8593;&#8593;&#8593;&#8593;</pre>\n",
"&#8593;&#8593;&#8593;&#8593;&#8593;&#8593; <p style=\"text-align: right;\">&#8593;&#8593;&#8593;&#8593;&#8593;&#8593;</p>\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",
Expand Down Expand Up @@ -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."
]
},
{
Expand Down Expand Up @@ -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."
]
},
{
Expand All @@ -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\")"
]
},
Expand Down Expand Up @@ -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."
]
},
{
Expand Down Expand Up @@ -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();"
]
},
Expand Down Expand Up @@ -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`."
]
},
{
Expand Down Expand Up @@ -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",
"<center><img src=\"https://raw.githubusercontent.com/ariostas-talks/2024-07-02-pyhep-uproot-rntuple/main/images/rntuple_goal.svg\" style=\"height:400px;\"/></center>"
]
Expand Down

0 comments on commit ab2dc90

Please sign in to comment.