refactor: add return type annotations to address, routing, and co2only methods
This commit adds return type annotations to the `address`, `routing`, and `co2only` methods in the `CarbonTracer` class. This helps improve code readability and provides better documentation by specifying the expected return types for these methods.
This commit is contained in:
parent
c5d9c6f946
commit
22a13889d2
1 changed files with 3 additions and 3 deletions
|
@ -47,7 +47,7 @@ class CarbonTracer:
|
||||||
|
|
||||||
return request.execute()
|
return request.execute()
|
||||||
|
|
||||||
def address(self, postalCode: str, city: str, street: str):
|
def address(self, postalCode: str, city: str, street: str) -> dict:
|
||||||
"""Request an (Austrian) address from a postal code, city and street.
|
"""Request an (Austrian) address from a postal code, city and street.
|
||||||
|
|
||||||
Args:
|
Args:
|
||||||
|
@ -63,7 +63,7 @@ class CarbonTracer:
|
||||||
|
|
||||||
return request.execute()
|
return request.execute()
|
||||||
|
|
||||||
def routing(self, type: str, start: str, dest: str, waypoints: bool = False, bbox: bool = False, airports: bool = False):
|
def routing(self, type: str, start: str, dest: str, waypoints: bool = False, bbox: bool = False, airports: bool = False) -> dict:
|
||||||
"""Make a routing request.
|
"""Make a routing request.
|
||||||
|
|
||||||
Args:
|
Args:
|
||||||
|
@ -98,7 +98,7 @@ class CarbonTracer:
|
||||||
|
|
||||||
return request.execute()
|
return request.execute()
|
||||||
|
|
||||||
def co2only(self, type: str, distance_km: int):
|
def co2only(self, type: str, distance_km: int) -> dict:
|
||||||
"""Only calculate the CO2 emissions for a given distance for a given transport type.
|
"""Only calculate the CO2 emissions for a given distance for a given transport type.
|
||||||
|
|
||||||
Args:
|
Args:
|
||||||
|
|
Loading…
Reference in a new issue