-
Notifications
You must be signed in to change notification settings - Fork 0
/
bikeability.py
46 lines (34 loc) · 1.06 KB
/
bikeability.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
# ---
# jupyter:
# jupytext:
# text_representation:
# extension: .py
# format_name: percent
# format_version: '1.3'
# jupytext_version: 1.16.1
# kernelspec:
# display_name: Python 3 (ipykernel)
# language: python
# name: python3
# ---
# %%
from common import configvar
from services import walkscore
# %%
@configvar(type=float)
def value_of_bikeability():
"""
Annual dollar value of city's bike-friendliness.
value_of_bikeability should be the extra value from living in a location that is extremely
bike friendly vs living in a location that is not at all bikeable.
Internally, we use the formula
value_of_bikeability * walkscore_bikeability_score / 100
to get the value of bikeability for a location.
See https://www.walkscore.com/methodology.shtml for the meaning of Bike Score values from 0 - 100.
"""
# %%
FACTOR_NAME = 'Bikeability'
def annual_value(loc):
return value_of_bikeability() * walkscore.bike_score(loc) / 100
# %% tags=["active-ipynb"]
# annual_value(locs.seattle)