From 22a13889d28da1b843adb0ae1b3022bbdf633df7 Mon Sep 17 00:00:00 2001 From: Kumi Date: Wed, 23 Aug 2023 10:17:44 +0200 Subject: [PATCH] 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. --- src/pycarbontracer/classes/carbontracer.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/pycarbontracer/classes/carbontracer.py b/src/pycarbontracer/classes/carbontracer.py index 6296660..0250438 100644 --- a/src/pycarbontracer/classes/carbontracer.py +++ b/src/pycarbontracer/classes/carbontracer.py @@ -47,7 +47,7 @@ class CarbonTracer: 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. Args: @@ -63,7 +63,7 @@ class CarbonTracer: 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. Args: @@ -98,7 +98,7 @@ class CarbonTracer: 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. Args: