Add constructor for the DistanceMatrix class

- `DistanceMatrix.from_addresses()` takes a variable number of
  `Address` objects and creates distance matrix entries for them
- as a base measure, the air distance between two `Address`
  objects is calculated
- in addition, an integration with the Google Maps Directions API is
  implemented that provides a more realistic measure of the distance
  and duration a rider on a bicycle would need to travel between two
  `Address` objects
- add a `Location.lat_lng` convenience property that provides the
  `.latitude` and `.longitude` of an `Address` as a 2-`tuple`
This commit is contained in:
Alexander Hess 2021-03-02 18:03:43 +01:00
commit db715edd6d
Signed by: alexander
GPG key ID: 344EA5AB10D868E0
6 changed files with 559 additions and 3 deletions

View file

@ -144,6 +144,9 @@ per-file-ignores =
src/urban_meal_delivery/console/forecasts.py:
# The module is not too complex.
WPS232,
src/urban_meal_delivery/db/addresses_addresses.py:
# The module does not have too many imports.
WPS201,
src/urban_meal_delivery/db/customers.py:
# The module is not too complex.
WPS232,
@ -217,6 +220,7 @@ allowed-domain-names =
obj,
param,
result,
results,
value,
max-name-length = 40
# darglint
@ -267,12 +271,18 @@ cache_dir = .cache/mypy
[mypy-folium.*]
ignore_missing_imports = true
[mypy-geopy.*]
ignore_missing_imports = true
[mypy-googlemaps.*]
ignore_missing_imports = true
[mypy-matplotlib.*]
ignore_missing_imports = true
[mypy-nox.*]
ignore_missing_imports = true
[mypy-numpy.*]
ignore_missing_imports = true
[mypy-ordered_set.*]
ignore_missing_imports = true
[mypy-packaging]
ignore_missing_imports = true
[mypy-pandas]