Import geopy.distance as geo_distance everywhere
This commit is contained in:
parent
d660f0cc4e
commit
07660ecff9
3 changed files with 5 additions and 4 deletions
|
|
@ -545,6 +545,7 @@ banned-from = [
|
|||
[tool.ruff.lint.flake8-import-conventions.extend-aliases]
|
||||
|
||||
"collections.abc" = "cabc"
|
||||
"geopy.distance" = "geo_distance"
|
||||
"googlemaps" = "gm"
|
||||
"sqlalchemy" = "sa"
|
||||
"sqlalchemy.dialects.postgresql" = "psql"
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ import random
|
|||
|
||||
import factory
|
||||
from factory import alchemy
|
||||
from geopy import distance
|
||||
from geopy import distance as geo_distance
|
||||
|
||||
from tests import config as test_config
|
||||
from tests.db.fake_data.factories import utils
|
||||
|
|
@ -204,7 +204,7 @@ class AdHocOrderFactory(alchemy.SQLAlchemyModelFactory):
|
|||
# Statistical attributes -> calculate realistic stats
|
||||
logged_delivery_distance = factory.LazyAttribute(
|
||||
lambda obj: (
|
||||
distance.great_circle(
|
||||
geo_distance.great_circle(
|
||||
(obj.pickup_address.latitude, obj.pickup_address.longitude),
|
||||
(obj.delivery_address.latitude, obj.delivery_address.longitude),
|
||||
).meters
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ import json
|
|||
import googlemaps as gm
|
||||
import pytest
|
||||
import sqlalchemy as sa
|
||||
from geopy import distance
|
||||
from geopy import distance as geo_distance
|
||||
from sqlalchemy import exc as sa_exc
|
||||
|
||||
from velofy import db
|
||||
|
|
@ -21,7 +21,7 @@ def another_address(make_address):
|
|||
@pytest.fixture
|
||||
def path(address, another_address, make_address):
|
||||
"""A `Path` from `address` to `another_address`."""
|
||||
air_distance = distance.great_circle(
|
||||
air_distance = geo_distance.great_circle(
|
||||
address.location.lat_lng,
|
||||
another_address.location.lat_lng,
|
||||
).meters
|
||||
|
|
|
|||
Loading…
Reference in a new issue