From 1809ce37c325e69d972af137ad48f80f8057b6e1 Mon Sep 17 00:00:00 2001 From: Jack Greenlee Date: Wed, 23 Oct 2024 18:16:40 -0400 Subject: [PATCH] don't use keyword args to calc_footprint (for JS compat) keyword arguments only work properly in Transcrypt if we have the `__kwargs__` pragma enabled on the funtion that accepts them. Since we are giving all the arguments here, it's easy enough to just pass them as positional arguments, eliminating the need for keyword arguments here --- src/emcommon/metrics/footprint/footprint_calculations.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/emcommon/metrics/footprint/footprint_calculations.py b/src/emcommon/metrics/footprint/footprint_calculations.py index a43bf68..868e598 100644 --- a/src/emcommon/metrics/footprint/footprint_calculations.py +++ b/src/emcommon/metrics/footprint/footprint_calculations.py @@ -31,10 +31,10 @@ async def calc_footprint_for_trip(trip, label_options, mode_key='mode', mode_val trip['distance'], emcmfu.year_of_trip(trip), trip['start_loc']['coordinates'], - uace=trip.get('uace_region'), - egrid_region=trip.get('egrid_region'), - passengers=rich_mode.get('passengers', 1), - metadata={'trip_id': trip['_id']} + trip.get('uace_region'), + trip.get('egrid_region'), + rich_mode.get('passengers', 1), + {'trip_id': trip['_id']} ) # If is_uncertain, the kwh and kg_co2 values represent the upper bound (worst-case scenario) # Mark them as them uncertain, then set the main values to 0 to represent the lower bound.