Skip to content

Commit

Permalink
Update example notebooks
Browse files Browse the repository at this point in the history
  • Loading branch information
sgreenbury committed Oct 5, 2023
1 parent ac31801 commit 3150af0
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 26 deletions.
54 changes: 31 additions & 23 deletions python/examples/spc_reader_comparison.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"cells": [
{
"cell_type": "code",
"execution_count": 1,
"execution_count": 2,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -23,29 +23,30 @@
},
{
"cell_type": "code",
"execution_count": 2,
"execution_count": 3,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"CPU times: user 4.73 s, sys: 124 ms, total: 4.85 s\n",
"Wall time: 4.86 s\n"
"CPU times: user 4.62 s, sys: 177 ms, total: 4.8 s\n",
"Wall time: 4.82 s\n"
]
}
],
"source": [
"%%time\n",
"path = \"../../data/output/England/2020/rutland.pb\"\n",
"path = \"../../data/output/England/2020/\"\n",
"region = \"rutland\"\n",
"\n",
"# Read from protobuf\n",
"spc = SPCReaderProto(path)"
"spc = SPCReaderProto(path, region)"
]
},
{
"cell_type": "code",
"execution_count": 3,
"execution_count": 4,
"metadata": {},
"outputs": [
{
Expand Down Expand Up @@ -103,7 +104,7 @@
"└───────┴───────────┴───────────┴────────────┴───┴────────────┴────────────┴───────────┴───────────┘"
]
},
"execution_count": 3,
"execution_count": 4,
"metadata": {},
"output_type": "execute_result"
}
Expand All @@ -115,27 +116,27 @@
},
{
"cell_type": "code",
"execution_count": 4,
"execution_count": 5,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"CPU times: user 129 ms, sys: 25.7 ms, total: 154 ms\n",
"Wall time: 110 ms\n"
"CPU times: user 131 ms, sys: 33.2 ms, total: 165 ms\n",
"Wall time: 146 ms\n"
]
}
],
"source": [
"%%time\n",
"# Read from parquet and JSON\n",
"spc = SPCReaderParquet(path)"
"spc = SPCReaderParquet(path, region)"
]
},
{
"cell_type": "code",
"execution_count": 5,
"execution_count": 6,
"metadata": {},
"outputs": [
{
Expand Down Expand Up @@ -164,7 +165,7 @@
"└─────┴───────────┴───────────┴─────────────┴───────────────────────────────────┘"
]
},
"execution_count": 5,
"execution_count": 6,
"metadata": {},
"output_type": "execute_result"
}
Expand All @@ -185,27 +186,27 @@
},
{
"cell_type": "code",
"execution_count": 6,
"execution_count": 7,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"CPU times: user 29.2 s, sys: 7.25 s, total: 36.4 s\n",
"Wall time: 22.6 s\n"
"CPU times: user 29.1 s, sys: 6.09 s, total: 35.1 s\n",
"Wall time: 21.1 s\n"
]
}
],
"source": [
"%%time\n",
"path = \"../../data/output/England/2020/greater-london.pb\"\n",
"spc = SPCReaderParquet(path)"
"region = \"greater-london\"\n",
"spc = SPCReaderParquet(path, region)"
]
},
{
"cell_type": "code",
"execution_count": 7,
"execution_count": 8,
"metadata": {},
"outputs": [
{
Expand Down Expand Up @@ -263,7 +264,7 @@
"└─────────┴───────────┴───────────┴────────────┴───┴───────────┴───────────┴───────────┴───────────┘"
]
},
"execution_count": 7,
"execution_count": 8,
"metadata": {},
"output_type": "execute_result"
}
Expand All @@ -275,7 +276,7 @@
},
{
"cell_type": "code",
"execution_count": 8,
"execution_count": 9,
"metadata": {},
"outputs": [
{
Expand All @@ -300,7 +301,7 @@
},
{
"cell_type": "code",
"execution_count": 9,
"execution_count": 10,
"metadata": {},
"outputs": [
{
Expand Down Expand Up @@ -328,6 +329,13 @@
"plt.colorbar()\n",
"plt.show()"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
Expand Down
6 changes: 3 additions & 3 deletions python/examples/spc_reader_exploratory.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@
"metadata": {},
"outputs": [],
"source": [
"path = \"../../data/output/England/2020/greater-manchester.pb\""
"path = \"../../data/output/England/2020\"\n",
"region = \"greater-manchester\""
]
},
{
Expand All @@ -39,7 +40,7 @@
"outputs": [],
"source": [
"# Read from parquet and JSON\n",
"spc = SPCReader(path)"
"spc = SPCReader(path, region)"
]
},
{
Expand Down Expand Up @@ -1069,7 +1070,6 @@
"tracegroupgap": 0
},
"mapbox": {
"accesstoken": "pk.eyJ1Ijoic2dyZWVuYnVyeSIsImEiOiJjbGwyNWplc20wMTdyM3BwcnExbGowczRnIn0.DL1BtNLh4hSQ_xK8kybrtQ",
"center": {
"lat": 53.5051383972168,
"lon": -2.3101441860198975
Expand Down

0 comments on commit 3150af0

Please sign in to comment.