Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

List valid parameter combinations based on user specified parameters #203

Open
redfrexx opened this issue Jan 16, 2025 · 0 comments
Open
Labels
prio3 Lowest Priority: Do later

Comments

@redfrexx
Copy link
Member

redfrexx commented Jan 16, 2025

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.

from co2calculator import Trip, 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 parameters
trip = Trip(start='Heidelberg', end='Freiburg')
# print options as dictionary
trip.by_car(fuel_type=BusCarFuel.DIESEL).get_options()
# Returns {'size': [Size.SMALL, Size.LARGE]}
@redfrexx redfrexx added the prio3 Lowest Priority: Do later label Jan 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
prio3 Lowest Priority: Do later
Projects
None yet
Development

No branches or pull requests

1 participant