Skip to content

Commit

Permalink
Merge pull request #77 from hsf-training/fix_dataload_uproot5
Browse files Browse the repository at this point in the history
Fix dataloading with uproot5
  • Loading branch information
jonas-eschle authored Jan 10, 2024
2 parents 7820455 + c4c23f0 commit 2a5ac34
Show file tree
Hide file tree
Showing 15 changed files with 304 additions and 1,808 deletions.
7 changes: 4 additions & 3 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@ repos:
# - id: black
# args: [ --line-length=120 ]
#
- repo: https://github.com/roy-ht/pre-commit-jupyter
rev: v1.2.1
- repo: https://github.com/kynan/nbstripout
rev: 0.6.1
hooks:
- id: jupyter-notebook-cleanup
- id: nbstripout

166 changes: 25 additions & 141 deletions advanced-python/10Basics.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -52,12 +52,7 @@
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"ExecuteTime": {
"end_time": "2023-11-09T18:21:55.162938280Z",
"start_time": "2023-11-09T18:21:54.591214759Z"
}
},
"metadata": {},
"outputs": [],
"source": [
"a = ['a', 'b', 'c']\n",
Expand All @@ -71,12 +66,7 @@
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"ExecuteTime": {
"end_time": "2023-11-09T18:21:55.164206324Z",
"start_time": "2023-11-09T18:21:54.591634409Z"
}
},
"metadata": {},
"outputs": [],
"source": [
"a = {'a': '0', 'b': '1', 'c': '2'}\n",
Expand All @@ -90,12 +80,7 @@
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"ExecuteTime": {
"end_time": "2023-11-09T18:21:55.165379338Z",
"start_time": "2023-11-09T18:21:54.592201956Z"
}
},
"metadata": {},
"outputs": [],
"source": [
"a = 'foo'\n",
Expand All @@ -117,12 +102,7 @@
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"ExecuteTime": {
"end_time": "2023-11-09T18:21:55.174086165Z",
"start_time": "2023-11-09T18:21:54.592801793Z"
}
},
"metadata": {},
"outputs": [],
"source": [
"N = 10\n",
Expand All @@ -143,12 +123,7 @@
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"ExecuteTime": {
"end_time": "2023-11-09T18:21:55.174961405Z",
"start_time": "2023-11-09T18:21:54.639862013Z"
}
},
"metadata": {},
"outputs": [],
"source": [
"squares = {i: i**2 for i in range(10)}\n",
Expand All @@ -158,12 +133,7 @@
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"ExecuteTime": {
"end_time": "2023-11-09T18:21:55.177083872Z",
"start_time": "2023-11-09T18:21:54.640208754Z"
}
},
"metadata": {},
"outputs": [],
"source": [
"N = 5\n",
Expand Down Expand Up @@ -232,12 +202,7 @@
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"ExecuteTime": {
"end_time": "2023-11-09T18:21:55.178900927Z",
"start_time": "2023-11-09T18:21:54.640684978Z"
}
},
"metadata": {},
"outputs": [],
"source": [
"pt_cut = 1789.234567890987654\n",
Expand Down Expand Up @@ -267,12 +232,7 @@
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"ExecuteTime": {
"end_time": "2023-11-09T18:21:55.179761160Z",
"start_time": "2023-11-09T18:21:54.683193413Z"
}
},
"metadata": {},
"outputs": [],
"source": [
"\"Hello starterkitters\""
Expand All @@ -281,12 +241,7 @@
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"ExecuteTime": {
"end_time": "2023-11-09T18:21:55.180074403Z",
"start_time": "2023-11-09T18:21:54.683507163Z"
}
},
"metadata": {},
"outputs": [],
"source": [
"None"
Expand All @@ -302,12 +257,7 @@
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"ExecuteTime": {
"end_time": "2023-11-09T18:21:55.708097724Z",
"start_time": "2023-11-09T18:21:54.683700759Z"
}
},
"metadata": {},
"outputs": [],
"source": [
"!ls"
Expand All @@ -316,12 +266,7 @@
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"ExecuteTime": {
"end_time": "2023-11-09T18:21:57.188240198Z",
"start_time": "2023-11-09T18:21:55.712286379Z"
}
},
"metadata": {},
"outputs": [],
"source": [
"!wget https://example.com/index.html"
Expand All @@ -337,12 +282,7 @@
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"ExecuteTime": {
"end_time": "2023-11-09T18:21:57.209109687Z",
"start_time": "2023-11-09T18:21:57.194328587Z"
}
},
"metadata": {},
"outputs": [],
"source": [
"%time sum([i**2 for i in range(10000)])"
Expand All @@ -358,12 +298,7 @@
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"ExecuteTime": {
"end_time": "2023-11-09T18:21:57.268821159Z",
"start_time": "2023-11-09T18:21:57.208320012Z"
}
},
"metadata": {},
"outputs": [],
"source": [
"%%time\n",
Expand Down Expand Up @@ -402,12 +337,7 @@
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"ExecuteTime": {
"end_time": "2023-11-09T18:21:57.269768775Z",
"start_time": "2023-11-09T18:21:57.263045210Z"
}
},
"metadata": {},
"outputs": [],
"source": [
"def my_print(my_string):\n",
Expand All @@ -417,12 +347,7 @@
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"ExecuteTime": {
"end_time": "2023-11-09T18:21:58.320620623Z",
"start_time": "2023-11-09T18:21:57.263292639Z"
}
},
"metadata": {},
"outputs": [],
"source": [
"my_print?"
Expand All @@ -438,12 +363,7 @@
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"ExecuteTime": {
"end_time": "2023-11-09T18:21:58.324026004Z",
"start_time": "2023-11-09T18:21:57.541042260Z"
}
},
"metadata": {},
"outputs": [],
"source": [
"my_print??"
Expand All @@ -452,12 +372,7 @@
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"ExecuteTime": {
"end_time": "2023-11-09T18:21:58.357805971Z",
"start_time": "2023-11-09T18:21:57.552034854Z"
}
},
"metadata": {},
"outputs": [],
"source": [
"range?"
Expand All @@ -473,26 +388,16 @@
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"ExecuteTime": {
"end_time": "2023-11-09T18:21:58.396066090Z",
"start_time": "2023-11-09T18:21:57.647040419Z"
}
},
"metadata": {},
"outputs": [],
"source": [
"{'a': 'b'}.get?"
"{'a': 'b'}.get?"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"ExecuteTime": {
"end_time": "2023-11-09T18:21:58.398964659Z",
"start_time": "2023-11-09T18:21:57.695017046Z"
}
},
"metadata": {},
"outputs": [],
"source": [
"{'a': 'b'}.get"
Expand All @@ -501,12 +406,7 @@
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"ExecuteTime": {
"end_time": "2023-11-09T18:21:58.401053224Z",
"start_time": "2023-11-09T18:21:57.695273312Z"
}
},
"metadata": {},
"outputs": [],
"source": [
"junk = {'a': 'b'}.get\n",
Expand All @@ -532,12 +432,7 @@
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"ExecuteTime": {
"end_time": "2023-11-09T18:21:58.404008533Z",
"start_time": "2023-11-09T18:21:57.695446136Z"
}
},
"metadata": {},
"outputs": [],
"source": [
"max(10, 15)"
Expand All @@ -549,11 +444,7 @@
"metadata": {
"tags": [
"raises-exception"
],
"ExecuteTime": {
"end_time": "2023-11-09T18:21:59.040701073Z",
"start_time": "2023-11-09T18:21:57.695622001Z"
}
]
},
"outputs": [],
"source": [
Expand All @@ -572,11 +463,7 @@
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"ExecuteTime": {
"start_time": "2023-11-09T18:21:58.564441476Z"
}
},
"metadata": {},
"outputs": [],
"source": [
"import numpy as np\n",
Expand Down Expand Up @@ -610,10 +497,7 @@
"metadata": {
"tags": [
"raises-exception"
],
"ExecuteTime": {
"start_time": "2023-11-09T18:21:58.606952947Z"
}
]
},
"outputs": [],
"source": [
Expand Down
Loading

0 comments on commit 2a5ac34

Please sign in to comment.