Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions site/files/solutions-NO-PEEKING.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
"outputs": [],
"source": [
"import piplite\n",
"await piplite.install(\"awkward==2.7.2\")\n",
"await piplite.install(\"awkward==2.8.5\")\n",
"await piplite.install(\"hist\")\n",
"await piplite.install(\"uproot\")\n",
"await piplite.install(\"vector\")"
Expand Down Expand Up @@ -566,7 +566,7 @@
"metadata": {},
"outputs": [],
"source": [
"with uproot.open(\"data/SMHiggsToZZTo4L.root\", handler=uproot.MemmapSource) as file:\n",
"with uproot.open(\"data/SMHiggsToZZTo4L.root\") as file:\n",
" dataset = file[\"Events\"].arrays()"
]
},
Expand Down Expand Up @@ -1656,13 +1656,13 @@
"100\n",
"</text>\n",
"<text text-anchor=\"middle\" x=\"125.0\" y=\"15\" style=\"fill:currentColor;\">\n",
"mass GeV\n",
"mass (GeV)\n",
"</text>\n",
"<polyline points=\" 0,0 0,-12 2.5,-12 2.5,-14.9 5,-14.9 5,-18.7 7.5,-18.7 7.5,-22.8 10,-22.8 10,-27.7 12.5,-27.7 12.5,-37.3 15,-37.3 15,-40.1 17.5,-40.1 17.5,-38.6 20,-38.6 20,-38.4 22.5,-38.4 22.5,-39.8 25,-39.8 25,-40.9 27.5,-40.9 27.5,-42.1 30,-42.1 30,-42.2 32.5,-42.2 32.5,-43.8 35,-43.8 35,-45 37.5,-45 37.5,-44.9 40,-44.9 40,-47.7 42.5,-47.7 42.5,-48.9 45,-48.9 45,-51.4 47.5,-51.4 47.5,-53.1 50,-53.1 50,-55 52.5,-55 52.5,-56.6 55,-56.6 55,-59.8 57.5,-59.8 57.5,-58.6 60,-58.6 60,-61 62.5,-61 62.5,-63.2 65,-63.2 65,-62 67.5,-62 67.5,-63.4 70,-63.4 70,-61.9 72.5,-61.9 72.5,-62.2 75,-62.2 75,-60.7 77.5,-60.7 77.5,-56.1 80,-56.1 80,-50.5 82.5,-50.5 82.5,-45 85,-45 85,-38.4 87.5,-38.4 87.5,-34.8 90,-34.8 90,-32 92.5,-32 92.5,-31.2 95,-31.2 95,-29.3 97.5,-29.3 97.5,-28.3 100,-28.3 100,-28.6 102.5,-28.6 102.5,-27.1 105,-27.1 105,-25.3 107.5,-25.3 107.5,-25.4 110,-25.4 110,-25.9 112.5,-25.9 112.5,-24.6 115,-24.6 115,-23.2 117.5,-23.2 117.5,-23.9 120,-23.9 120,-21.9 122.5,-21.9 122.5,-21.5 125,-21.5 125,-20.7 127.5,-20.7 127.5,-20.8 130,-20.8 130,-19.6 132.5,-19.6 132.5,-18.7 135,-18.7 135,-19 137.5,-19 137.5,-18.6 140,-18.6 140,-18.1 142.5,-18.1 142.5,-16.3 145,-16.3 145,-15.7 147.5,-15.7 147.5,-15 150,-15 150,-15.6 152.5,-15.6 152.5,-14.5 155,-14.5 155,-14.3 157.5,-14.3 157.5,-13.5 160,-13.5 160,-13.4 162.5,-13.4 162.5,-12.1 165,-12.1 165,-12.4 167.5,-12.4 167.5,-11.7 170,-11.7 170,-11.8 172.5,-11.8 172.5,-11 175,-11 175,-11 177.5,-11 177.5,-11.1 180,-11.1 180,-10.5 182.5,-10.5 182.5,-10.9 185,-10.9 185,-9.91 187.5,-9.91 187.5,-10.3 190,-10.3 190,-11.2 192.5,-11.2 192.5,-11.3 195,-11.3 195,-11.9 197.5,-11.9 197.5,-12 200,-12 200,-12.3 202.5,-12.3 202.5,-13.3 205,-13.3 205,-15 207.5,-15 207.5,-16.5 210,-16.5 210,-20.2 212.5,-20.2 212.5,-23.3 215,-23.3 215,-30.9 217.5,-30.9 217.5,-39.8 220,-39.8 220,-58 222.5,-58 222.5,-81 225,-81 225,-100 227.5,-100 227.5,-94.8 230,-94.8 230,-66 232.5,-66 232.5,-36.3 235,-36.3 235,-19.6 237.5,-19.6 237.5,-10.9 240,-10.9 240,-6.22 242.5,-6.22 242.5,-3.83 245,-3.83 245,-2.41 247.5,-2.41 247.5,-1.71 250,-1.71 250,0\" style=\"fill:none; stroke:currentColor;\"/>\n",
"</svg>\n",
"</div>\n",
"<div style=\"flex=grow:1;\">\n",
"Regular(100, 0, 100, label='mass GeV')<br/>\n",
"Regular(100, 0, 100, label='mass (GeV)')<br/>\n",
"<hr style=\"margin-top:.2em; margin-bottom:.2em;\"/>\n",
"Double() Σ=271500.0 <em>(272832.0 with flow)</em>\n",
"\n",
Expand All @@ -1671,7 +1671,7 @@
"</html>"
],
"text/plain": [
"Hist(Regular(100, 0, 100, label='mass GeV'), storage=Double()) # Sum: 271500.0 (272832.0 with flow)"
"Hist(Regular(100, 0, 100, label='mass (GeV)'), storage=Double()) # Sum: 271500.0 (272832.0 with flow)"
]
},
"execution_count": 40,
Expand All @@ -1682,7 +1682,7 @@
"source": [
"mu1, mu2 = ak.unzip(ak.cartesian([muon_plus, muon_minus]))\n",
"\n",
"quickplot(100, 0, 100, ak.flatten((mu1 + mu2).mass), label=\"mass GeV\")"
"quickplot(100, 0, 100, ak.flatten((mu1 + mu2).mass), label=\"mass (GeV)\")"
]
},
{
Expand Down
59 changes: 29 additions & 30 deletions site/files/tutorial.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@
"outputs": [],
"source": [
"import piplite\n",
"await piplite.install(\"awkward==2.7.4\")\n",
"await piplite.install(\"awkward==2.8.5\")\n",
"await piplite.install(\"hist\")\n",
"await piplite.install(\"uproot\")\n",
"await piplite.install(\"vector\")"
Expand Down Expand Up @@ -365,32 +365,31 @@
"\n",
" for i in range(len(x)):\n",
" for j in range(i + 1, len(x)):\n",
" if i != j:\n",
" mi, mj = m[i], m[j]\n",
" xi, xj = x[i], x[j]\n",
" pi, pj = p[i], p[j]\n",
" displacement = [\n",
" xj[0] - xi[0],\n",
" xj[1] - xi[1],\n",
" xj[2] - xi[2],\n",
" ]\n",
" distance = np.sqrt(displacement[0]**2 + displacement[1]**2 + displacement[2]**2)\n",
" direction = [\n",
" displacement[0] / distance,\n",
" displacement[1] / distance,\n",
" displacement[2] / distance,\n",
" ]\n",
" force = [\n",
" G * mi * mj * direction[0] / distance**2,\n",
" G * mi * mj * direction[1] / distance**2,\n",
" G * mi * mj * direction[2] / distance**2,\n",
" ]\n",
" total_force[i, 0] += force[0]\n",
" total_force[i, 1] += force[1]\n",
" total_force[i, 2] += force[2]\n",
" total_force[j, 0] += -force[0]\n",
" total_force[j, 1] += -force[1]\n",
" total_force[j, 2] += -force[2]\n",
" mi, mj = m[i], m[j]\n",
" xi, xj = x[i], x[j]\n",
" pi, pj = p[i], p[j]\n",
" displacement = [\n",
" xj[0] - xi[0],\n",
" xj[1] - xi[1],\n",
" xj[2] - xi[2],\n",
" ]\n",
" distance = np.sqrt(displacement[0]**2 + displacement[1]**2 + displacement[2]**2)\n",
" direction = [\n",
" displacement[0] / distance,\n",
" displacement[1] / distance,\n",
" displacement[2] / distance,\n",
" ]\n",
" force = [\n",
" G * mi * mj * direction[0] / distance**2,\n",
" G * mi * mj * direction[1] / distance**2,\n",
" G * mi * mj * direction[2] / distance**2,\n",
" ]\n",
" total_force[i, 0] += force[0]\n",
" total_force[i, 1] += force[1]\n",
" total_force[i, 2] += force[2]\n",
" total_force[j, 0] += -force[0]\n",
" total_force[j, 1] += -force[1]\n",
" total_force[j, 2] += -force[2]\n",
"\n",
" return total_force"
]
Expand Down Expand Up @@ -881,7 +880,7 @@
"id": "fe1c0e4e-e1e4-4f4e-bbb2-fc8c96648cf8",
"metadata": {},
"source": [
"Write a slice the selects these elements:\n",
"Write a slice that selects these elements:\n",
"\n",
"<img src=\"img/array3d-highlight2.svg\" width=\"25%\">"
]
Expand Down Expand Up @@ -1216,7 +1215,7 @@
"with open(\"data/SMHiggsToZZTo4L.root\", \"rb\") as file:\n",
" file.seek(42104123)\n",
" compressed_data = file.read(14718)\n",
" uncompressed_data = uncompressed_data = zlib.decompress(compressed_data)\n",
" uncompressed_data = zlib.decompress(compressed_data)\n",
" array_of_uint8 = np.frombuffer(uncompressed_data, np.uint8, 12524)"
]
},
Expand Down Expand Up @@ -2358,7 +2357,7 @@
"source": [
"cut = mu1.charge != mu2.charge\n",
"\n",
"quickplot(100, 0, 100, ak.flatten((mu1[cut] + mu2[cut]).mass), label=\"mass GeV\")"
"quickplot(100, 0, 100, ak.flatten((mu1[cut] + mu2[cut]).mass), label=\"mass (GeV)\")"
]
},
{
Expand Down
4 changes: 2 additions & 2 deletions site/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
jupyterlite-core==0.8.0
jupyterlite-core==0.7.5
jupyterlab==4.6.1
notebook==7.6.0
jupyterlite-pyodide-kernel==0.8.1
jupyterlite-pyodide-kernel==0.7.2