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

_classify_arg updates for google flights presentation as of 8/16/24 #30

Open
Kumaezenjae opened this issue Aug 16, 2024 · 0 comments
Open

Comments

@Kumaezenjae
Copy link

in flight.py, the _classify_arg() function may benefit from these changes or similar ones:

  • CO2 condition
    Change endswith to in, some entries have CO2e
    elif 'CO2' in arg and self._co2 is None:
  • Emissions condition
    Change endswith to in and handle or omit case sensitivity on E
    elif 'missions' in arg and self._emissions is None:
  • Stops condition
    Add possibility of minutes without hours in stop time
    elif (('hr' in arg or 'min' in arg) and arg[-3:].isupper()) or (len(arg.split(', ')) > 1 and arg.isupper()):
    Add additional stop condition which catches layovers reported as an airport without a duration
    elif len(arg) == 3 and arg.isupper() and not self._origin is None and not self._dest is None:
    self._stops = arg
  • Airlines condition
    Adjust criteria to catch and omit a few more different cases that were appearing in results
    elif len(arg) > 3 and arg != 'Separate tickets booked together' and arg != 'Change of airport' and not 'hr' in arg and not 'min' in arg:

in flight.py, the _parse_args() function may benefit from this change and similar ones:

  • Airline Placeholder
    After parsing, put in a placeholder for missing airline
    if self._airline is None or self._airline == "" or len(self._airline) < 2:
    self._airline = "--"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant