def make_control(argv): # return a Bunch print argv if len(argv) not in (3, 4): usage('invalid number of arguments') pcl = ParseCommandLine(argv) arg = Bunch( base_name=argv[0].split('.')[0], geo=pcl.get_arg('--geo'), test=pcl.has_arg('--test'), ) if arg.geo is None: usage('missing --arg') if arg.geo not in ('census_tract', 'zip5'): usage('invalid GEO value: ', + arg.geo) random_seed = 123456 random.seed(random_seed) path = Path() # use the default dir_input debug = False return Bunch( arg=arg, debug=debug, max_sale_price=85e6, # according to Wall Street Journal path=path, path_out_csv=path.dir_working() + arg.base_name + '-' + arg.geo + '.csv', path_out_occurs=path.dir_working() + arg.base_name + '-' + arg.geo + '-occurs.pickle', random_seed=random_seed, test=arg.test, )
def make_control(argv): # return a Bunch print argv if len(argv) not in (1, 2): usage('invalid number of arguments') pcl = ParseCommandLine(argv) arg = Bunch( base_name=argv[0].split('.')[0], test=pcl.has_arg('--test'), ) random_seed = 123456 random.seed(random_seed) path = Path() # use the default dir_input debug = False return Bunch( arg=arg, debug=debug, path=path, path_out=path.dir_working() + arg.base_name + '-' + 'derived.csv', random_seed=random_seed, test=arg.test, )
def make_control(argv): # return a Bunch print argv if len(argv) not in (1, 2): usage('invalid number of arguments') pcl = ParseCommandLine(argv) if pcl.has_arg('--help'): usage() arg = Bunch( base_name=argv[0].split('.')[0], test=pcl.has_arg('--test'), ) random_seed = 123456 random.seed(random_seed) path = Path() # use the default dir_input debug = False file_out_transactions = (('testing-' if arg.test else '') + arg.base_name + '-al-g-sfr' + '.csv') return Bunch( arg=arg, debug=debug, max_sale_price=85e6, # according to Wall Street Journal path=path, path_in_census_features=path.dir_working() + 'census-features-derived.csv', path_in_parcels_features_census_tract=path.dir_working() + 'parcels-features-census_tract.csv', path_in_parcels_features_zip5=path.dir_working() + 'parcels-features-zip5.csv', path_out_transactions=path.dir_working() + file_out_transactions, random_seed=random_seed, test=arg.test, )
def make_control(argv): # return a Bunch print argv if len(argv) not in (1, 2): usage('invalid number of arguments') pcl = ParseCommandLine(argv) if pcl.has_arg('--help'): usage() arg = Bunch( base_name=argv[0].split('.')[0], test=pcl.has_arg('--test'), ) random_seed = 123456 random.seed(random_seed) path = Path() # use the default dir_input debug = False file_out_transactions = ( ('testing-' if arg.test else '') + arg.base_name + '-al-g-sfr' + '.csv' ) return Bunch( arg=arg, debug=debug, max_sale_price=85e6, # according to Wall Street Journal path=path, path_in_census_features=path.dir_working() + 'census-features-derived.csv', path_in_parcels_features_census_tract=path.dir_working() + 'parcels-features-census_tract.csv', path_in_parcels_features_zip5=path.dir_working() + 'parcels-features-zip5.csv', path_out_transactions=path.dir_working() + file_out_transactions, random_seed=random_seed, test=arg.test, )
def make_control(argv): # return a Bunch print argv if len(argv) not in (3, 4): usage('invalid number of arguments') pcl = ParseCommandLine(argv) arg = Bunch( base_name=argv[0].split('.')[0], geo=pcl.get_arg('--geo'), test=pcl.has_arg('--test'), ) if arg.geo is None: usage('missing --arg') if arg.geo not in ('census_tract', 'zip5'): usage('invalid GEO value: ', +arg.geo) random_seed = 123456 random.seed(random_seed) path = Path() # use the default dir_input debug = False return Bunch( arg=arg, debug=debug, max_sale_price=85e6, # according to Wall Street Journal path=path, path_out_csv=path.dir_working() + arg.base_name + '-' + arg.geo + '.csv', path_out_occurs=path.dir_working() + arg.base_name + '-' + arg.geo + '-occurs.pickle', random_seed=random_seed, test=arg.test, )