Skip to content

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

@Kumaezenjae

Description

@Kumaezenjae

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 = "--"

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions