Skip to content

Commit

Permalink
made sure all notebooks running; updated velocity data for gis notebo…
Browse files Browse the repository at this point in the history
…ok; git lfs should work now
  • Loading branch information
jamesmulhall committed Jan 19, 2024
1 parent 1aef245 commit 76aaf00
Show file tree
Hide file tree
Showing 4 changed files with 44 additions and 67 deletions.
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
data/GIS/**/*.csv filter=lfs diff=lfs merge=lfs -text
data/processed/bicycle_velocity_by_zone.csv filter=lfs diff=lfs merge=lfs -text
data/processed/walk_velocity_by_zone.csv filter=lfs diff=lfs merge=lfs -text
data/GIS/GIS_data_zones.csv filter=lfs diff=lfs merge=lfs -text
4 changes: 2 additions & 2 deletions data/processed/bicycle_velocity_by_zone.csv
Git LFS file not shown
4 changes: 2 additions & 2 deletions data/processed/walk_velocity_by_zone.csv
Git LFS file not shown
102 changes: 39 additions & 63 deletions scripts/gis_global_analysis.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"cells": [
{
"cell_type": "code",
"execution_count": 15,
"execution_count": 1,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -25,7 +25,7 @@
},
{
"cell_type": "code",
"execution_count": 16,
"execution_count": 2,
"metadata": {},
"outputs": [],
"source": [
Expand Down Expand Up @@ -116,7 +116,7 @@
},
{
"cell_type": "code",
"execution_count": 17,
"execution_count": 3,
"metadata": {},
"outputs": [],
"source": [
Expand Down Expand Up @@ -150,7 +150,7 @@
},
{
"cell_type": "code",
"execution_count": 18,
"execution_count": 4,
"metadata": {},
"outputs": [
{
Expand All @@ -161,7 +161,7 @@
"Name: urban_rural, dtype: int64"
]
},
"execution_count": 18,
"execution_count": 4,
"metadata": {},
"output_type": "execute_result"
}
Expand All @@ -184,7 +184,7 @@
},
{
"cell_type": "code",
"execution_count": 19,
"execution_count": 5,
"metadata": {},
"outputs": [
{
Expand Down Expand Up @@ -213,7 +213,7 @@
"Name: slope_1, dtype: float64"
]
},
"execution_count": 19,
"execution_count": 5,
"metadata": {},
"output_type": "execute_result"
},
Expand Down Expand Up @@ -262,7 +262,7 @@
},
{
"cell_type": "code",
"execution_count": 20,
"execution_count": 6,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -289,7 +289,7 @@
},
{
"cell_type": "code",
"execution_count": 21,
"execution_count": 7,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -300,7 +300,7 @@
},
{
"cell_type": "code",
"execution_count": 22,
"execution_count": 8,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -321,7 +321,7 @@
},
{
"cell_type": "code",
"execution_count": 23,
"execution_count": 9,
"metadata": {},
"outputs": [
{
Expand All @@ -330,7 +330,7 @@
"<AxesSubplot:>"
]
},
"execution_count": 23,
"execution_count": 9,
"metadata": {},
"output_type": "execute_result"
},
Expand Down Expand Up @@ -371,7 +371,7 @@
},
{
"cell_type": "code",
"execution_count": 24,
"execution_count": 10,
"metadata": {},
"outputs": [],
"source": [
Expand Down Expand Up @@ -399,21 +399,18 @@
},
{
"cell_type": "code",
"execution_count": 25,
"execution_count": 11,
"metadata": {},
"outputs": [],
"source": [
"load_attempt = 25 # kg\n",
"\n",
"calculate_distance = 0\n",
"calculate_distance = 1\n",
"if calculate_distance:\n",
" # Calculate the bicycle distance\n",
" import sys\n",
" from pathlib import Path\n",
"\n",
"# Map the road types in df_zones to Crr values\n",
"df_zones['Crr'] = df_zones['dominant_road_type'].map(crr_mapping)\n",
"\n",
" # Resolve project root and update sys.path\n",
" project_root = Path().resolve().parent\n",
" sys.path.append(str(project_root))\n",
Expand Down Expand Up @@ -476,7 +473,7 @@
},
{
"cell_type": "code",
"execution_count": 26,
"execution_count": 12,
"metadata": {},
"outputs": [],
"source": [
Expand Down Expand Up @@ -549,30 +546,9 @@
},
{
"cell_type": "code",
"execution_count": 27,
"execution_count": 13,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"0 3.338853\n",
"1 2.810578\n",
"2 2.989990\n",
"3 2.249984\n",
"4 3.017698\n",
"5 2.166688\n",
"6 2.172357\n",
"7 2.077768\n",
"8 2.116220\n",
"9 3.188453\n",
"Name: max distance walking, dtype: float64"
]
},
"execution_count": 30,
"metadata": {},
"output_type": "execute_result"
}
],
"outputs": [],
"source": [
"time_gathering_water = 16\n",
"df_zones[\"max distance cycling\"] = df_zones[\"average_velocity_bicycle\"] * time_gathering_water / 2 # max distance achievable (not round trip, just the distance from home to water source)\n",
Expand All @@ -582,7 +558,7 @@
},
{
"cell_type": "code",
"execution_count": 28,
"execution_count": 14,
"metadata": {},
"outputs": [],
"source": [
Expand Down Expand Up @@ -628,24 +604,24 @@
},
{
"cell_type": "code",
"execution_count": 26,
"execution_count": 15,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"count 9986.000000\n",
"mean 2479.965865\n",
"std 7757.335516\n",
"min 6.042776\n",
"25% 480.276669\n",
"50% 1195.803226\n",
"75% 2362.037534\n",
"max 193064.436593\n",
"count 1.481674e+06\n",
"mean 1.646975e+03\n",
"std 8.653241e+03\n",
"min 0.000000e+00\n",
"25% 6.560864e+00\n",
"50% 4.893252e+01\n",
"75% 5.727339e+02\n",
"max 1.127543e+06\n",
"Name: zone_pop_unpiped, dtype: float64"
]
},
"execution_count": 26,
"execution_count": 15,
"metadata": {},
"output_type": "execute_result"
}
Expand All @@ -665,7 +641,7 @@
},
{
"cell_type": "code",
"execution_count": 29,
"execution_count": 16,
"metadata": {},
"outputs": [],
"source": [
Expand Down Expand Up @@ -712,7 +688,7 @@
},
{
"cell_type": "code",
"execution_count": 30,
"execution_count": 17,
"metadata": {},
"outputs": [
{
Expand Down Expand Up @@ -784,7 +760,7 @@
},
{
"cell_type": "code",
"execution_count": 31,
"execution_count": 18,
"metadata": {},
"outputs": [
{
Expand Down Expand Up @@ -5148,7 +5124,7 @@
},
{
"cell_type": "code",
"execution_count": 32,
"execution_count": 19,
"metadata": {},
"outputs": [
{
Expand Down Expand Up @@ -6918,7 +6894,7 @@
},
{
"cell_type": "code",
"execution_count": 33,
"execution_count": 20,
"metadata": {},
"outputs": [
{
Expand Down Expand Up @@ -8632,7 +8608,7 @@
},
{
"cell_type": "code",
"execution_count": 34,
"execution_count": 21,
"metadata": {},
"outputs": [
{
Expand Down Expand Up @@ -10385,7 +10361,7 @@
},
{
"cell_type": "code",
"execution_count": 35,
"execution_count": 22,
"metadata": {},
"outputs": [
{
Expand Down Expand Up @@ -10479,7 +10455,7 @@
"max 51604.171664 30764.025415 99238.791662"
]
},
"execution_count": 35,
"execution_count": 22,
"metadata": {},
"output_type": "execute_result"
}
Expand Down Expand Up @@ -10524,7 +10500,7 @@
},
{
"cell_type": "code",
"execution_count": 36,
"execution_count": 23,
"metadata": {},
"outputs": [
{
Expand Down Expand Up @@ -13343,7 +13319,7 @@
},
{
"cell_type": "code",
"execution_count": 37,
"execution_count": 24,
"metadata": {},
"outputs": [],
"source": [
Expand Down

0 comments on commit 76aaf00

Please sign in to comment.