Skip to content

Commit 127320d

Browse files
committed
add docs
1 parent 36b631a commit 127320d

36 files changed

+5463
-1129
lines changed

.dvc/config

Whitespace-only changes.

.dvcignore

-3
This file was deleted.

Dockerfile

-16
This file was deleted.

Makefile

+2-1
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,5 @@ routing:
1313
- python -m ahah.routing
1414

1515
docs:
16-
pdoc --html --force --output-dir docs ahah
16+
pdoc --html --force --output-dir docs ahah \
17+
&& mv -f docs/ahah/* docs

README.md

+7-6
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ Liverpool, United Kingdom_
3333

3434
This project identifies the time-weighted distance required to travel by road between every postcode in Great Britain and a selection of health related points of interest. A ranked combination of these drive-times is used to create the AHAH index.
3535

36-
Access is defined through the average time-weighted road network distance for each postcode within each LSOA to the nearest point of interest of a particular type. For this, the road highways network and road speed estimates provided through [Ordnance Survey](https://www.ordnancesurvey.co.uk/business-government/products/open-map-roads) was used, alongside the [ONS Postcode Directory for May 2020](https://data.gov.uk/dataset/06803af0-6054-410a-822a-f7ab30bcd8b1/ons-postcode-directory-may-2020), which gives centroids for every postcode in the country.
36+
Access is defined through the average time-weighted road network distance for each postcode within each LSOA to the nearest point of interest of a particular type. For this, the road highways network and road speed estimates provided through [Ordnance Survey](https://www.ordnancesurvey.co.uk/business-government/products/open-map-roads) was used, alongside the [OWNS Postcode Directory for May 2020](https://data.gov.uk/dataset/06803af0-6054-410a-822a-f7ab30bcd8b1/ons-postcode-directory-may-2020), which gives centroids for every postcode in the country.
3737

3838
This is a computationally intense calculation, with the total road network used having 3,816,897 edges, and 3,215,522 nodes. Access to each nearest health related POI was calculated using the _Single Source Shortest Path_ algorithm, for all 1,659,451 postcodes in Great Britain.
3939

@@ -112,12 +112,13 @@ ahah
112112
113113
- [OS
114114
Open Roads](https://www.ordnancesurvey.co.uk/business-government/products/open-map-roads)
115+
- [Ferry Routes](https://www.ordnancesurvey.co.uk/business-government/products/strategi)
115116
- [Air quality](https://uk-air.defra.gov.uk/data/pcm-data)
116-
- [Greenspace](https://osdatahub.os.uk/downloads/open/OpenGreenspace)
117-
- [LSOA
118-
Polygons](https://borders.ukdataservice.ac.uk/easy_download_data.html?data=England_lsoa_2011)
117+
- Greenspace (NDVI Classification)
119118
- [NHS
120119
England](https://digital.nhs.uk/services/organisation-data-service/data-downloads)
121120
- [NHS Scotland](https://www.opendata.nhs.scot/dataset/)
122-
- [Postcodes](<https://geoportal.statistics.gov.uk/search?collection=Dataset&sort=name&tags=all(PRD_ONSPD%2CFEB_2021)>)
123-
- NDVI (Private)
121+
122+
- [Postcodes](https://geoportal.statistics.gov.uk/datasets/ons-postcode-directory-february-2022/about)
123+
- [LSOA
124+
Polygons](https://borders.ukdataservice.ac.uk/easy_download_data.html?data=England_lsoa_2011)

docs/ahah/aggregate_lsoa.html docs/aggregate_lsoa.html

+16-24
Original file line numberDiff line numberDiff line change
@@ -38,19 +38,15 @@ <h1 class="title">Module <code>ahah.aggregate_lsoa</code></h1>
3838

3939
def read_dists(dist_files: Generator, pcs: cudf.DataFrame, ndvi) -&gt; pd.DataFrame:
4040
dfs = (
41-
cudf.concat(
42-
[
43-
cudf.read_csv(file)
44-
.drop_duplicates(&#34;postcode&#34;)
45-
.set_index(&#34;postcode&#34;)
46-
.rename(columns={&#34;distance&#34;: re.split(r&#34;_|\.&#34;, file.name)[1]})
47-
for file in dist_files
48-
],
49-
axis=1,
50-
)
51-
.reset_index()
52-
.pipe(fix_postcodes)
41+
[
42+
cudf.read_csv(file)
43+
.drop_duplicates(&#34;postcode&#34;)
44+
.set_index(&#34;postcode&#34;)
45+
.rename(columns={&#34;distance&#34;: re.split(r&#34;_|\.&#34;, file.name)[1]})
46+
for file in dist_files
47+
],
5348
)
49+
dfs = cudf.concat(dfs, axis=1).reset_index().pipe(fix_postcodes)
5450

5551
return (
5652
dfs.set_index(&#34;postcode&#34;)
@@ -99,19 +95,15 @@ <h2 class="section-title" id="header-functions">Functions</h2>
9995
</summary>
10096
<pre><code class="python">def read_dists(dist_files: Generator, pcs: cudf.DataFrame, ndvi) -&gt; pd.DataFrame:
10197
dfs = (
102-
cudf.concat(
103-
[
104-
cudf.read_csv(file)
105-
.drop_duplicates(&#34;postcode&#34;)
106-
.set_index(&#34;postcode&#34;)
107-
.rename(columns={&#34;distance&#34;: re.split(r&#34;_|\.&#34;, file.name)[1]})
108-
for file in dist_files
109-
],
110-
axis=1,
111-
)
112-
.reset_index()
113-
.pipe(fix_postcodes)
98+
[
99+
cudf.read_csv(file)
100+
.drop_duplicates(&#34;postcode&#34;)
101+
.set_index(&#34;postcode&#34;)
102+
.rename(columns={&#34;distance&#34;: re.split(r&#34;_|\.&#34;, file.name)[1]})
103+
for file in dist_files
104+
],
114105
)
106+
dfs = cudf.concat(dfs, axis=1).reset_index().pipe(fix_postcodes)
115107

116108
return (
117109
dfs.set_index(&#34;postcode&#34;)

0 commit comments

Comments
 (0)