You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Implement a more high-level API which is easier to use for python programmers by
1. Suggest available parameters for specific mobility types (e.g. car, train) via tab completion
fromco2calculatorimportTrip, BusCarFuel# CO2 emissions for a trip by cartrip_by_car=Trip(distance=300).by_car(fuel_type=BusCarFuel.DIESEL)
# Same trip with different vehiclestrip=Trip(start='Heidelberg', end='Freiburg')
trip_train=trip.by_train()
trip_plane=trip.by_plane()
trip_bus=trip.by_bus()
# Result could be an object which contains the following information# Emissions trip_train.co2e# Distancetrip_train.distance# Meta information (e.g. emission factor and source)trip_train.emission_factortrip_train.emission_factor.source
2. List valid parameter combinations based on user specified parameters
This could look like this, but it would then require adding a calculate() method to the example above to enable multiple functions to be called for a specific transport mode.
fromco2calculatorimportTrip, BusCarFuel, Size# Calculate co2 emission using 'calculate()'Trip(distance=300).by_car(fuel_type=BusCarFuel.DIESEL).calculate()
# Get valid parameter options based on user chosen parameterstrip=Trip(start='Heidelberg', end='Freiburg')
# print options as dictionarytrip.by_car(fuel_type=BusCarFuel.DIESEL).get_options()
# Returns {'size': [Size.SMALL, Size.LARGE]}
Summary
Implement a more high-level API which is easier to use for python programmers by
1. Suggest available parameters for specific mobility types (e.g. car, train) via tab completion
2. List valid parameter combinations based on user specified parameters
This could look like this, but it would then require adding a
calculate()
method to the example above to enable multiple functions to be called for a specific transport mode.3. Analog for emissions from energy consumption
What do you think?
Reference Issues
No response
Unresolved questions
No response
The text was updated successfully, but these errors were encountered: