From 3150af09297c2ae055963679eb38732aa0cd95f1 Mon Sep 17 00:00:00 2001 From: Sam Greenbury Date: Thu, 5 Oct 2023 10:39:18 +0100 Subject: [PATCH] Update example notebooks --- python/examples/spc_reader_comparison.ipynb | 54 +++++++++++--------- python/examples/spc_reader_exploratory.ipynb | 6 +-- 2 files changed, 34 insertions(+), 26 deletions(-) diff --git a/python/examples/spc_reader_comparison.ipynb b/python/examples/spc_reader_comparison.ipynb index e8ba8b4..7046853 100644 --- a/python/examples/spc_reader_comparison.ipynb +++ b/python/examples/spc_reader_comparison.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "code", - "execution_count": 1, + "execution_count": 2, "metadata": {}, "outputs": [], "source": [ @@ -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": [ { @@ -103,7 +104,7 @@ "└───────┴───────────┴───────────┴────────────┴───┴────────────┴────────────┴───────────┴───────────┘" ] }, - "execution_count": 3, + "execution_count": 4, "metadata": {}, "output_type": "execute_result" } @@ -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": [ { @@ -164,7 +165,7 @@ "└─────┴───────────┴───────────┴─────────────┴───────────────────────────────────┘" ] }, - "execution_count": 5, + "execution_count": 6, "metadata": {}, "output_type": "execute_result" } @@ -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": [ { @@ -263,7 +264,7 @@ "└─────────┴───────────┴───────────┴────────────┴───┴───────────┴───────────┴───────────┴───────────┘" ] }, - "execution_count": 7, + "execution_count": 8, "metadata": {}, "output_type": "execute_result" } @@ -275,7 +276,7 @@ }, { "cell_type": "code", - "execution_count": 8, + "execution_count": 9, "metadata": {}, "outputs": [ { @@ -300,7 +301,7 @@ }, { "cell_type": "code", - "execution_count": 9, + "execution_count": 10, "metadata": {}, "outputs": [ { @@ -328,6 +329,13 @@ "plt.colorbar()\n", "plt.show()" ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [] } ], "metadata": { diff --git a/python/examples/spc_reader_exploratory.ipynb b/python/examples/spc_reader_exploratory.ipynb index dcf5b65..4b308ad 100644 --- a/python/examples/spc_reader_exploratory.ipynb +++ b/python/examples/spc_reader_exploratory.ipynb @@ -29,7 +29,8 @@ "metadata": {}, "outputs": [], "source": [ - "path = \"../../data/output/England/2020/greater-manchester.pb\"" + "path = \"../../data/output/England/2020\"\n", + "region = \"greater-manchester\"" ] }, { @@ -39,7 +40,7 @@ "outputs": [], "source": [ "# Read from parquet and JSON\n", - "spc = SPCReader(path)" + "spc = SPCReader(path, region)" ] }, { @@ -1069,7 +1070,6 @@ "tracegroupgap": 0 }, "mapbox": { - "accesstoken": "pk.eyJ1Ijoic2dyZWVuYnVyeSIsImEiOiJjbGwyNWplc20wMTdyM3BwcnExbGowczRnIn0.DL1BtNLh4hSQ_xK8kybrtQ", "center": { "lat": 53.5051383972168, "lon": -2.3101441860198975