diff --git a/debug/histo1d.ipynb b/debug/histo1d.ipynb index cc9437a..a13c521 100644 --- a/debug/histo1d.ipynb +++ b/debug/histo1d.ipynb @@ -2,12 +2,13 @@ "cells": [ { "cell_type": "code", - "execution_count": 1, + "execution_count": 16, "id": "4045b3af-f990-4dbb-990f-937c5ddeee26", "metadata": {}, "outputs": [], "source": [ "import babyyoda as grogu\n", + "from babyyoda import loc\n", "import matplotlib.pyplot as plt" ] }, @@ -18,15 +19,28 @@ "metadata": {}, "outputs": [ { - "ename": "AttributeError", - "evalue": "'yoda.core.HistoBin1D' object has no attribute 'errW'", - "output_type": "error", - "traceback": [ - "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m", - "\u001b[0;31mAttributeError\u001b[0m Traceback (most recent call last)", - "Cell \u001b[0;32mIn[2], line 3\u001b[0m\n\u001b[1;32m 1\u001b[0m hists \u001b[38;5;241m=\u001b[39m grogu\u001b[38;5;241m.\u001b[39mread_yoda(\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124m../tests/test_histo1d_v2.yoda\u001b[39m\u001b[38;5;124m\"\u001b[39m)\n\u001b[1;32m 2\u001b[0m \u001b[38;5;28;01mfor\u001b[39;00m b \u001b[38;5;129;01min\u001b[39;00m hists[\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124m/\u001b[39m\u001b[38;5;124m\"\u001b[39m]:\n\u001b[0;32m----> 3\u001b[0m \u001b[38;5;28mprint\u001b[39m(b\u001b[38;5;241m.\u001b[39msumW(), \u001b[43mb\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43merrW\u001b[49m()\u001b[38;5;241m/\u001b[39m\u001b[38;5;241m2\u001b[39m)\n\u001b[1;32m 4\u001b[0m hists[\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124m/\u001b[39m\u001b[38;5;124m\"\u001b[39m]\u001b[38;5;241m.\u001b[39mvariances()\n", - "\u001b[0;31mAttributeError\u001b[0m: 'yoda.core.HistoBin1D' object has no attribute 'errW'" + "name": "stdout", + "output_type": "stream", + "text": [ + "3.0 1.541103500742244\n", + "3.0 0.9354143466934853\n", + "4.0 1.0606601717798212\n", + "5.0 1.1726039399558574\n", + "6.0 1.2747548783981961\n", + "7.0 1.3693063937629153\n", + "8.0 1.4577379737113252\n", + "8.0 1.9364916731037085\n" ] + }, + { + "data": { + "text/plain": [ + "array([ 9.5, 3.5, 4.5, 5.5, 6.5, 7.5, 8.5, 15. ])" + ] + }, + "execution_count": 2, + "metadata": {}, + "output_type": "execute_result" } ], "source": [ @@ -38,10 +52,35 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 3, "id": "b75dee9c-0432-4ddb-99f6-53f294b5e122", "metadata": {}, - "outputs": [], + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "3.0 1.541103500742244\n", + "3.0 0.9354143466934853\n", + "4.0 1.0606601717798212\n", + "5.0 1.1726039399558574\n", + "6.0 1.2747548783981961\n", + "7.0 1.3693063937629153\n", + "8.0 1.4577379737113252\n", + "8.0 1.9364916731037085\n" + ] + }, + { + "data": { + "text/plain": [ + "array([ 9.5, 3.5, 4.5, 5.5, 6.5, 7.5, 8.5, 15. ])" + ] + }, + "execution_count": 3, + "metadata": {}, + "output_type": "execute_result" + } + ], "source": [ "hists = grogu.read_grogu(\"../tests/test_histo1d_v2.yoda\")\n", "for b in hists[\"/\"]:\n", @@ -51,10 +90,31 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 4, "id": "9e7f5fc2-0126-4a97-b4ab-2b1539245987", "metadata": {}, - "outputs": [], + "outputs": [ + { + "data": { + "text/plain": [ + "" + ] + }, + "execution_count": 4, + "metadata": {}, + "output_type": "execute_result" + }, + { + "data": { + "image/png": "iVBORw0KGgoAAAANSUhEUgAAAiMAAAGiCAYAAAA1LsZRAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjkuMiwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8hTgPZAAAACXBIWXMAAA9hA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AAAU4QRAABgijACAABMEUYAAIApwggAADBFGAEAAKYIIwAAwBRhBAAAmCKMAAAAU4QRAABgijACAABMEUYAAIApwggAADBFGAEAAKYIIwAAwBRhBAAAmCKMAAAAU4QRAABgijACAABMEUYAAIApwggAADBFGAEAAKYIIwAAwBRhBAAAmCKMAAAAU4QRAABgijACAABMEUYAAIApwggAADBFGAEAAKYIIwAAwBRhBAAAmCKMAAAAU4QRAABgijACAABMEUYAAIApwggAADBFGAEAAKYIIwAAwBRhBAAAmAopjGzcuFFjx45VcnKykpOTlZubq/fee6/L5cvLy+XxeDo8jh49etmFAwCA6BATysJDhgzR2rVrdcMNN0iSXn31Vd1zzz2qrq5WVlZWl+sdO3ZMycnJbdPXXnttL8sFAADRJqQwMmvWrHbTq1ev1saNG7V///5uw0hqaqquvvrqXhUIAACiW0hh5GJNTU164403dO7cOeXm5na77Lhx43ThwgWNHj1aK1as0JQpU7pd3ufzyefztU03NDRIkgKBgAKBQG9L7qB1rHCOic650etAINhu/IDHCdvYwUBQ3v7Of74O39hu1tw65sX/hmdMd2t2QyT2GR1FWp8j8VgJBoLy9vvPuS4YDHuvezqex3GckLp15MgR5ebm6sKFC7rqqqu0fft2zZgxo9Nljx07psrKSmVnZ8vn8+m1115TUVGRysvLNXHixC638cwzz2jlypUd5m/fvl2JiYmhlIso5muSlhxoydPP3RqUt79xQT1AzX0jEmtG5GO/66ixsVEPPPCA6uvr292u8X0hhxG/36+TJ0/q22+/VUlJif74xz+qoqJCo0eP7tH6s2bNksfj0a5du7pcprMrI0OHDtWZM2e6/WFCFQgEVFZWpunTpys2NjZs46IjN3rd6A/qplV7JEn/+J87lRjX6wt9HZz3B3XLmr9KkqqWT1VCmMZ2s2Yp8vrslkjsMzqKtD5H4rFy3h/U+LXva1VOsyZMvlNJifFhHb+hoUHXXHPNJcNIyJ2Ki4tru4E1JydHVVVVev755/XSSy/1aP3bbrtN27Zt63YZr9crr9fbYX5sbKwrO6Rb46KjcPY61vF8b9zwHfgBxyN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v3jx9/PHH2rdvX7fL3XjjjbrxxhvbpnNzc3Xq1CmtW7euyzDi9Xrl9Xo7zI+NjXVlh3Rr3HCLdTz//To2VrGxP/wdXZICjke+5pbaY2JiwtbrSOxHX9UcKft0pKPPfSNS+hyJ5yS3zs+tejper97aO3/+fO3atUsffPCBhgwZEvL6t912mz7//PPebBoAAESZkGKb4ziaP3++du7cqfLycmVmZvZqo9XV1crIyOjVugAAILqEFEby8/O1fft2vfXWW0pKSlJtba0kaeDAgUpISJAkLVu2TKdPn9bWrVslSevXr9f111+vrKws+f1+bdu2TSUlJSopKQnzjwIAACJRSGFk48aNkqTJkye3m79582Y98sgjkqSamhqdPHmy7Xt+v1+LFy/W6dOnlZCQoKysLL3zzjuaMWPG5VUOAACiQsgv01zKli1b2k0vWbJES5YsCakoAABw5eCzaQAAgCnCCAAAMEUYAQAApggjAADAFGEEAACYIowAAABThBEAAGCKMAIAAEwRRgAAgCnCCAAAMEUYAQAApggjAADAFGEEAACYIowAAABThBEAAGCKMAIAAEwRRgAAgCnCCAAAMEUYAQAApggjAADAFGEEAACYIowAAABThBEAAGCKMAIAAEwRRgAAgCnCCAAAMEUYAQAApggjAADAFGEEAACYIowAAABThBEAAGCKMAIAAEwRRgAAgCnCCAAAMEUYAQAApggjAADAFGEEAACYIowAAABThBEAAGCKMAIAAEwRRgAAgCnCCAAAMEUYAQAApggjAADAFGEEAACYIowAAABThBEAAGCKMAIAAEwRRgAAgCnCCAAAMEUYAQAApggjAADAFGEEAACYIowAAABThBEAAGCKMAIAAEx5HMdxrIu4lIaGBg0cOFAZGRnq1y+8+enChQuKj48P65hucSR9WX9BkpQ2MF4e23J6zJFU13BBA+Mkr9crjyc8lUdiP/qi5kjapyMZfe4bkdTnSD0nuXF+btXc3KyamhrV19crOTm5y+UiKowAAIDIc6kwEtOHtVw2roxEXuqWuDJyMa6MRA/63Dfos7v66srIpURUGDl69Gi3ySpUgUBA7777rmbMmKHY2NiwjeuWRn9Qo//fXyRJ//z1XUqM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rb56BlZWXp8OHDWrRokQYPHqw5c+ZYlxfVrJ4Xr8gwcs0116h///4droLU1dV1SIW4fPPnz9euXbtUWVmpIUOGWJcTdQ4ePKi6ujplZ2e3zWtqalJlZaU2bNggn8+n/v37G1YYPTIyMjR69Oh280aNGqWSkhKjiqLTr371Kz355JP6+c9/Lkn68Y9/rBMnTqiwsJAw4pL09HRJLVdIMjIy2ub31fPiFXnPSFxcnLKzs1VWVtZufllZmW6//XajqqKP4ziaN2+e3nzzTe3Zs0eZmZnWJUWlqVOn6siRIzp8+HDbIycnR7Nnz9bhw4cJImF0xx13dHh7+meffabrrrvOqKLo1NjYqH792j899e/fn7f2uigzM1Pp6entnhf9fr8qKir65HnxirwyIkkFBQV66KGHlJOTo9zcXBUXF+vkyZN8mnAY5efna/v27XrrrbeUlJTUdiVq4MCBSkhIMK4ueiQlJXW4D2fAgAFKSUnh/pwwe+KJJ3T77bdrzZo1uv/++3XgwAEVFxeruLjYurSoMmvWLK1evVrDhg1TVlaWqqur9bvf/U6PPfaYdWkR7bvvvtO//vWvtunjx4/r8OHDGjRokIYNG6ZFixZpzZo1GjFihEaMGKE1a9YoMTFRDzzwgPvFuf5+nR+wF1980bnuuuucuLg45yc/+QlvOQ0zSZ0+Nm/ebF1a1OOtve55++23nTFjxjher9cZOXKkU1xcbF1S1GloaHAWLlzoDBs2zImPj3eGDx/uPPXUU47P57MuLaJ98MEHnZ6T58yZ4zhOy9t7n376aSc9Pd3xer3OxIkTnSNHjvRJbR7HcRz3Iw8AAEDnrsh7RgAAwA8HYQQAAJgijAAAAFOEEQAAYIowAgAATBFGAACAKcIIAAAwRRgBAACmCCMAAMAUYQQAAJgijAAAAFP/HxByaQSTuhJYAAAAAElFTkSuQmCC", + "text/plain": [ + "
" + ] + }, + "metadata": {}, + "output_type": "display_data" + } + ], "source": [ "hists = grogu.read_grogu(\"../tests/test_histo1d_v2.yoda\")\n", "hists[\"/\"].plot()\n", @@ -65,21 +125,57 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 17, "id": "88fe7219-6233-4574-a5f2-8a7ae69975c9", "metadata": {}, - "outputs": [], + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + " 3 5 None\n" + ] + }, + { + "ename": "AttributeError", + "evalue": "'yoda.core.BinnedHisto1D' object has no attribute 'copy'", + "output_type": "error", + "traceback": [ + "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m", + "\u001b[0;31mAttributeError\u001b[0m Traceback (most recent call last)", + "Cell \u001b[0;32mIn[17], line 2\u001b[0m\n\u001b[1;32m 1\u001b[0m hists \u001b[38;5;241m=\u001b[39m grogu\u001b[38;5;241m.\u001b[39mread_yoda(\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124m../tests/test_histo1d_v2.yoda\u001b[39m\u001b[38;5;124m\"\u001b[39m)\n\u001b[0;32m----> 2\u001b[0m \u001b[43mhists\u001b[49m\u001b[43m[\u001b[49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[38;5;124;43m/\u001b[39;49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[43m]\u001b[49m\u001b[43m[\u001b[49m\u001b[43mloc\u001b[49m\u001b[43m(\u001b[49m\u001b[38;5;241;43m4\u001b[39;49m\u001b[43m)\u001b[49m\u001b[43m:\u001b[49m\u001b[43mloc\u001b[49m\u001b[43m(\u001b[49m\u001b[38;5;241;43m6\u001b[39;49m\u001b[43m)\u001b[49m\u001b[43m]\u001b[49m\n", + "File \u001b[0;32m~/.local/lib/python3.12/site-packages/babyyoda/Histo1D_v2.py:154\u001b[0m, in \u001b[0;36mHISTO1D_V2.__getitem__\u001b[0;34m(self, slices)\u001b[0m\n\u001b[1;32m 152\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m stop \u001b[38;5;129;01mis\u001b[39;00m \u001b[38;5;129;01mnot\u001b[39;00m \u001b[38;5;28;01mNone\u001b[39;00m:\n\u001b[1;32m 153\u001b[0m stop \u001b[38;5;241m+\u001b[39m\u001b[38;5;241m=\u001b[39m \u001b[38;5;241m1\u001b[39m\n\u001b[0;32m--> 154\u001b[0m sc \u001b[38;5;241m=\u001b[39m \u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mcopy\u001b[49m\u001b[43m(\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 155\u001b[0m sc\u001b[38;5;241m.\u001b[39mrebinTo(\u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mxEdges()[start:stop])\n\u001b[1;32m 156\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m sc\n", + "File \u001b[0;32m~/.local/lib/python3.12/site-packages/babyyoda/Histo1D_v2.py:67\u001b[0m, in \u001b[0;36mHISTO1D_V2.copy\u001b[0;34m(self)\u001b[0m\n\u001b[1;32m 66\u001b[0m \u001b[38;5;28;01mdef\u001b[39;00m \u001b[38;5;21mcopy\u001b[39m(\u001b[38;5;28mself\u001b[39m):\n\u001b[0;32m---> 67\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m HISTO1D_V2(\u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mtarget\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mcopy\u001b[49m())\n", + "\u001b[0;31mAttributeError\u001b[0m: 'yoda.core.BinnedHisto1D' object has no attribute 'copy'" + ] + } + ], "source": [ "hists = grogu.read_yoda(\"../tests/test_histo1d_v2.yoda\")\n", - "hists[\"/\"]" + "hists[\"/\"][loc(4) : loc(6)]" ] }, { "cell_type": "code", - "execution_count": null, + "execution_count": 6, "id": "4d72c698-ab00-4ff8-be33-833260b1fc01", "metadata": {}, - "outputs": [], + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "39.0 28.0\n", + "0.2727272727272727 648.0\n", + "0.17391304347826086 1239.6521739130435\n", + "0.1282051282051282 2030.7692307692307\n", + "0.1016949152542373 274.5762711864407\n", + "0.08433734939759036 382.5542168674699\n", + "0.07207207207207207 508.5405405405405\n", + "1.1428571428571428 1157.142857142857\n" + ] + } + ], "source": [ "for b in hists[\"/\"]:\n", " print(b.variance(), b.xVariance())" @@ -87,7 +183,7 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 7, "id": "159c7b2f-e18e-43f6-a630-c6f9ac062a25", "metadata": {}, "outputs": [], @@ -98,60 +194,130 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 8, "id": "2773a80a-4f50-456c-b2a5-b4db8d3d719b", "metadata": {}, - "outputs": [], + "outputs": [ + { + "data": { + "text/plain": [ + "" + ] + }, + "execution_count": 8, + "metadata": {}, + "output_type": "execute_result" + } + ], "source": [ "hists[\"/\"][grogu.loc(3.5) + 1]" ] }, { "cell_type": "code", - "execution_count": null, + "execution_count": 9, "id": "d0cecc9f-4f12-4b70-b4cc-72442582dabc", "metadata": {}, - "outputs": [], + "outputs": [ + { + "data": { + "text/plain": [ + "array([3., 3., 4., 5., 6., 7., 8., 8.])" + ] + }, + "execution_count": 9, + "metadata": {}, + "output_type": "execute_result" + } + ], "source": [ "hists[\"/\"].values()" ] }, { "cell_type": "code", - "execution_count": null, + "execution_count": 10, "id": "bef63e37-e04d-4541-8eb5-bf11b315fcf8", "metadata": {}, - "outputs": [], + "outputs": [ + { + "data": { + "text/plain": [ + "array([ 9.5, 3.5, 4.5, 5.5, 6.5, 7.5, 8.5, 15. ])" + ] + }, + "execution_count": 10, + "metadata": {}, + "output_type": "execute_result" + } + ], "source": [ "hists[\"/\"].variances()" ] }, { "cell_type": "code", - "execution_count": null, + "execution_count": 11, "id": "9391df8c-07f5-4777-87dc-619e3ff9c8e5", "metadata": {}, - "outputs": [], + "outputs": [ + { + "data": { + "text/plain": [ + "5.0" + ] + }, + "execution_count": 11, + "metadata": {}, + "output_type": "execute_result" + } + ], "source": [ "hists[\"/\"].counts()[0]" ] }, { "cell_type": "code", - "execution_count": null, + "execution_count": 12, "id": "26407638-40d0-4f73-81d1-6a795a8a6d5f", "metadata": {}, - "outputs": [], + "outputs": [ + { + "data": { + "text/plain": [ + "array([ 9.5, 3.5, 4.5, 5.5, 6.5, 7.5, 8.5, 15. ])" + ] + }, + "execution_count": 12, + "metadata": {}, + "output_type": "execute_result" + } + ], "source": [ "hists[\"/\"].sumW2s()" ] }, { "cell_type": "code", - "execution_count": null, + "execution_count": 13, "id": "878a5396-f255-4d82-a21e-0c00c356d532", "metadata": {}, - "outputs": [], + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "3.0 1.541103500742244\n", + "3.0 0.9354143466934853\n", + "4.0 1.0606601717798212\n", + "5.0 1.1726039399558574\n", + "6.0 1.2747548783981961\n", + "7.0 1.3693063937629153\n", + "8.0 1.4577379737113252\n", + "8.0 1.9364916731037085\n" + ] + } + ], "source": [ "for b in hists[\"/\"]:\n", " print(b.sumW(), b.errW() / 2)" @@ -159,10 +325,23 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 14, "id": "0cbcb048-ab07-49ad-8759-3f8a371a0a42", "metadata": {}, - "outputs": [], + "outputs": [ + { + "ename": "AttributeError", + "evalue": "'HISTO1D_V2' object and target have no attribute 'yVals'", + "output_type": "error", + "traceback": [ + "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m", + "\u001b[0;31mAttributeError\u001b[0m Traceback (most recent call last)", + "Cell \u001b[0;32mIn[14], line 1\u001b[0m\n\u001b[0;32m----> 1\u001b[0m \u001b[43mhists\u001b[49m\u001b[43m[\u001b[49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[38;5;124;43m/\u001b[39;49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[43m]\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43myVals\u001b[49m()\n", + "File \u001b[0;32m~/.local/lib/python3.12/site-packages/babyyoda/Histo1D_v2.py:40\u001b[0m, in \u001b[0;36mHISTO1D_V2.__getattr__\u001b[0;34m(self, name)\u001b[0m\n\u001b[1;32m 38\u001b[0m \u001b[38;5;28;01melif\u001b[39;00m \u001b[38;5;28mhasattr\u001b[39m(\u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mtarget, name):\n\u001b[1;32m 39\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[38;5;28mgetattr\u001b[39m(\u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mtarget, name)\n\u001b[0;32m---> 40\u001b[0m \u001b[38;5;28;01mraise\u001b[39;00m \u001b[38;5;167;01mAttributeError\u001b[39;00m(\n\u001b[1;32m 41\u001b[0m \u001b[38;5;124mf\u001b[39m\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124m'\u001b[39m\u001b[38;5;132;01m{\u001b[39;00m\u001b[38;5;28mtype\u001b[39m(\u001b[38;5;28mself\u001b[39m)\u001b[38;5;241m.\u001b[39m\u001b[38;5;18m__name__\u001b[39m\u001b[38;5;132;01m}\u001b[39;00m\u001b[38;5;124m'\u001b[39m\u001b[38;5;124m object and target have no attribute \u001b[39m\u001b[38;5;124m'\u001b[39m\u001b[38;5;132;01m{\u001b[39;00mname\u001b[38;5;132;01m}\u001b[39;00m\u001b[38;5;124m'\u001b[39m\u001b[38;5;124m\"\u001b[39m\n\u001b[1;32m 42\u001b[0m )\n", + "\u001b[0;31mAttributeError\u001b[0m: 'HISTO1D_V2' object and target have no attribute 'yVals'" + ] + } + ], "source": [ "hists[\"/\"].yVals()" ] @@ -181,7 +360,7 @@ }, { "cell_type": "code", - "execution_count": 3, + "execution_count": null, "id": "0b9b6237-bf2c-42d8-87d9-f9e45d108a7b", "metadata": {}, "outputs": [], @@ -191,55 +370,25 @@ }, { "cell_type": "code", - "execution_count": 4, + "execution_count": null, "id": "a78c6ed3-af01-4ae5-8ee2-098c0d1ddb5d", "metadata": {}, - "outputs": [ - { - "data": { - "text/plain": [ - "array([[1.5411035 , 1.5411035 ],\n", - " [1.87082869, 1.87082869],\n", - " [2.12132034, 2.12132034],\n", - " [2.34520788, 2.34520788],\n", - " [2.54950976, 2.54950976],\n", - " [2.73861279, 2.73861279],\n", - " [2.91547595, 2.91547595],\n", - " [1.93649167, 1.93649167]])" - ] - }, - "execution_count": 4, - "metadata": {}, - "output_type": "execute_result" - } - ], + "outputs": [], "source": [ "h.mkScatter().yErrs()" ] }, { "cell_type": "code", - "execution_count": 5, + "execution_count": null, "id": "4268e817-fb1c-4b80-933c-384f7e7cb984", "metadata": {}, - "outputs": [ - { - "ename": "AttributeError", - "evalue": "'yoda.core.HistoBin1D' object has no attribute 'val'", - "output_type": "error", - "traceback": [ - "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m", - "\u001b[0;31mAttributeError\u001b[0m Traceback (most recent call last)", - "Cell \u001b[0;32mIn[5], line 1\u001b[0m\n\u001b[0;32m----> 1\u001b[0m \u001b[43mh\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mbinAt\u001b[49m\u001b[43m(\u001b[49m\u001b[38;5;241;43m5\u001b[39;49m\u001b[43m)\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mval\u001b[49m()\n", - "\u001b[0;31mAttributeError\u001b[0m: 'yoda.core.HistoBin1D' object has no attribute 'val'" - ] - } - ], + "outputs": [], "source": [] }, { "cell_type": "code", - "execution_count": 7, + "execution_count": null, "id": "b21bc5fc-7a38-428b-807f-607d262fd35d", "metadata": {}, "outputs": [], @@ -249,7 +398,7 @@ }, { "cell_type": "code", - "execution_count": 12, + "execution_count": null, "id": "c50b2e7e-ab28-47b3-93b1-4d887326c2d1", "metadata": {}, "outputs": [], @@ -259,22 +408,10 @@ }, { "cell_type": "code", - "execution_count": 17, + "execution_count": null, "id": "4a6dd955-aab4-40a4-97fd-0605ea7c38ee", "metadata": {}, - "outputs": [ - { - "ename": "AttributeError", - "evalue": "'yoda.core.HistoBin1D' object has no attribute 'reset'", - "output_type": "error", - "traceback": [ - "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m", - "\u001b[0;31mAttributeError\u001b[0m Traceback (most recent call last)", - "Cell \u001b[0;32mIn[17], line 2\u001b[0m\n\u001b[1;32m 1\u001b[0m \u001b[38;5;28;01mfor\u001b[39;00m b \u001b[38;5;129;01min\u001b[39;00m hh\u001b[38;5;241m.\u001b[39mbins():\n\u001b[0;32m----> 2\u001b[0m \u001b[43mb\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mreset\u001b[49m()\n", - "\u001b[0;31mAttributeError\u001b[0m: 'yoda.core.HistoBin1D' object has no attribute 'reset'" - ] - } - ], + "outputs": [], "source": [ "for b in hh.bins():\n", " b.reset()" diff --git a/src/babyyoda/Histo1D_v2.py b/src/babyyoda/Histo1D_v2.py index a9f4e85..49e6cb3 100644 --- a/src/babyyoda/Histo1D_v2.py +++ b/src/babyyoda/Histo1D_v2.py @@ -62,8 +62,8 @@ def __call__(self, *args, **kwargs): # YODA compatibility code (dropped legacy code?) ######################################################## - def copy(self): - return HISTO1D_V2(self.target.copy()) + def clone(self): + return HISTO1D_V2(self.target.clone()) def overflow(self): # if target has overflow method, call it @@ -143,14 +143,14 @@ def __getitem__(self, slices): if isinstance(step, rebin): if start is None: start = 0 - cs = self.copy() + cs = self.clone() cs.rebinBy(step.factor, start, stop) return cs print(f" {start} {stop} {step}") if stop is not None: stop += 1 - sc = self.copy() + sc = self.clone() sc.rebinTo(self.xEdges()[start:stop]) return sc diff --git a/src/babyyoda/grogu/histo1d_v2.py b/src/babyyoda/grogu/histo1d_v2.py index a9bbd23..e0ab466 100644 --- a/src/babyyoda/grogu/histo1d_v2.py +++ b/src/babyyoda/grogu/histo1d_v2.py @@ -159,7 +159,7 @@ def __post_init__(self): # YODA compatibilty code ############################################ - def copy(self): + def clone(self): return GROGU_HISTO1D_V2( d_key=self.d_key, d_path=self.d_path, diff --git a/tests/grogu/uhi/test_gg_histo1d_slicing.py b/tests/grogu/uhi/test_gg_histo1d_slicing.py index 84e9038..0e4c9fc 100644 --- a/tests/grogu/uhi/test_gg_histo1d_slicing.py +++ b/tests/grogu/uhi/test_gg_histo1d_slicing.py @@ -16,16 +16,16 @@ def get_histo1d(): def test_slicing_everything(): yuhi1d = get_histo1d() - assert yuhi1d.copy() != yuhi1d - assert_histo1d(yuhi1d.copy(), yuhi1d) + assert yuhi1d.clone() != yuhi1d + assert_histo1d(yuhi1d.clone(), yuhi1d) assert yuhi1d[:] != yuhi1d assert_histo1d(yuhi1d[:], yuhi1d) - assert yuhi1d.copy()[:] != yuhi1d + assert yuhi1d.clone()[:] != yuhi1d def test_slicing_subset(): yuhi1d = get_histo1d() - assert yuhi1d.copy()[1:3] != yuhi1d + assert yuhi1d.clone()[1:3] != yuhi1d assert yuhi1d[1:3] != yuhi1d[1:3] assert_histo1d(yuhi1d[1:3], yuhi1d[1:3]) assert yuhi1d[1:3][0].sumW() == yuhi1d[1].sumW()