diff --git a/site/files/solutions-NO-PEEKING.ipynb b/site/files/solutions-NO-PEEKING.ipynb index 6df949f..2accde8 100644 --- a/site/files/solutions-NO-PEEKING.ipynb +++ b/site/files/solutions-NO-PEEKING.ipynb @@ -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\")" @@ -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()" ] }, @@ -1656,13 +1656,13 @@ "100\n", "\n", "\n", - "mass GeV\n", + "mass (GeV)\n", "\n", "\n", "\n", "\n", "
\n", - "Regular(100, 0, 100, label='mass GeV')
\n", + "Regular(100, 0, 100, label='mass (GeV)')
\n", "
\n", "Double() Σ=271500.0 (272832.0 with flow)\n", "\n", @@ -1671,7 +1671,7 @@ "" ], "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, @@ -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)\")" ] }, { diff --git a/site/files/tutorial.ipynb b/site/files/tutorial.ipynb index 562a76a..a675508 100644 --- a/site/files/tutorial.ipynb +++ b/site/files/tutorial.ipynb @@ -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\")" @@ -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" ] @@ -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", "" ] @@ -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)" ] }, @@ -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)\")" ] }, { diff --git a/site/requirements.txt b/site/requirements.txt index 690b957..b5c5fb6 100644 --- a/site/requirements.txt +++ b/site/requirements.txt @@ -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