当前位置: 首页>>代码示例>>Python>>正文


Python Path.dir_working方法代码示例

本文整理汇总了Python中Path.Path.dir_working方法的典型用法代码示例。如果您正苦于以下问题:Python Path.dir_working方法的具体用法?Python Path.dir_working怎么用?Python Path.dir_working使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Path.Path的用法示例。


在下文中一共展示了Path.dir_working方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: make_control

# 需要导入模块: from Path import Path [as 别名]
# 或者: from Path.Path import dir_working [as 别名]
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,
    )
开发者ID:rlowrance,项目名称:re-avm,代码行数:37,代码来源:parcels-features.py

示例2: make_control

# 需要导入模块: from Path import Path [as 别名]
# 或者: from Path.Path import dir_working [as 别名]
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,
    )
开发者ID:rlowrance,项目名称:re-avm,代码行数:30,代码来源:census-features.py

示例3: make_control

# 需要导入模块: from Path import Path [as 别名]
# 或者: from Path.Path import dir_working [as 别名]
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,
    )
开发者ID:rlowrance,项目名称:re-avm,代码行数:41,代码来源:transactions.py


注:本文中的Path.Path.dir_working方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。