Ejemplo n.º 1
0
from copy import deepcopy

import pandas as pd
import json

from atc import flags

flights_data_flag = flags.create(
    'flights_data',
    flags.FlagType.STRING,
    "Full path to the trajectory file in json format",
    required=True)

if __name__ == '__main__':
    flags.parse_flags()
    print("Filepath :", flights_data_flag.value())
    flights = []
    flight_keys = [
        "Flight ID", "Ident", "Origin", "Destination",
        "Actual Arrival Time (UTC)"
    ]
    tract_keys = [
        "Time (UTC)",
        "Latitude",
        "Longitude",
        # "Altitude (ft)",
        # "Rate",
        # "Course",
        # "Direction",
        # "Facility Name",
        # "Facility Description",
Ejemplo n.º 2
0
import logging
from functools import partial
from multiprocessing.pool import Pool
from multiprocessing import Lock, Manager
from multiprocessing import cpu_count
from sklearn.utils import shuffle

from atc import flags
from atc.lib import AutomatedTrajectoryClustering
from atc.utils.progress_bar_utils import print_progress_bar

flights_data_flag = flags.create('flights_data',
                                 flags.FlagType.STRING,
                                 "Full path to the trajectory file",
                                 required=True)
logging_file_flag = flags.create('logging_file',
                                 flags.FlagType.STRING,
                                 "Full path to the logging file",
                                 required=True)
lat_column_flag = flags.create('lat_column',
                               flags.FlagType.STRING,
                               "Latitude column",
                               default='Lat')
lon_column_flag = flags.create('lon_column',
                               flags.FlagType.STRING,
                               "Longitude column",
                               default='Lon')
time_column_flag = flags.create('time_column',
                                flags.FlagType.STRING,
                                "Time column",
                                default='TRemains')
Ejemplo n.º 3
0
  >> Hello Mr. Chocolate
4. Use flagfile
  $ python py/tenpoint7/flags/flags_example.py --name=Chocolate --title=Mr. \
  --flagfile=py/tenpoint7/flags/flagfile_example
  >> Hello Mr. Chocolate
     How are you today?
5. Parameters in both flagfile and command line. Whatever appears later overrides.
  $ python py/tenpoint7/flags/flags_example.py --name=Chocolate --title=Mr. \
  --flagfile=py/tenpoint7/flags/flagfile_example --greeting='Go away!'
  >> Hello Mr. Chocolate
     Go away!
"""
from atc import flags

name = flags.create("name",
                    flags.FlagType.STRING,
                    'Name of the person',
                    required=True)
title = flags.create("title",
                     flags.FlagType.STRING,
                     'Title if available',
                     default='')
greeting = flags.create("greeting", flags.FlagType.STRING,
                        'Greeting message if available')


class FlagTest:
    def __init__(self):
        pass

    def say_something(self):
        print('Hello %s %s' % (title.value(), name.value()))