Exemplo n.º 1
0
def get_model_category_configs():
    """
    Returns dictionary where key is model category name and value is dictionary
    of model category attributes, including individual model config filename(s)
    """
    with open(os.path.join(misc.configs_dir(), 'yaml_configs.yaml')) as f:
        yaml_configs = yaml.load(f)

    with open(os.path.join(misc.configs_dir(), 'model_structure.yaml')) as f:
        model_category_configs = yaml.load(f)['models']

    for model_category, category_attributes in model_category_configs.items():
        category_attributes['config_filenames'] = yaml_configs[model_category]

    return model_category_configs
Exemplo n.º 2
0
def settings():
    with open(os.path.join(misc.configs_dir(), "settings.yaml")) as f:
        settings = yaml.load(f)
        # monkey patch on the settings object since it's pretty global
        # but will also be available as injectable
        orca.settings = settings
        return settings
Exemplo n.º 3
0
def settings():
    with open(os.path.join(misc.configs_dir(), "settings.yaml")) as f:
        settings = yaml.load(f)
        # monkey patch on the settings object since it's pretty global
        # but will also be available as injectable
        orca.settings = settings
        return settings
Exemplo n.º 4
0
def ual_settings():
    """ 
    This step loads the UAL settings, which are kept separate for clarity.
    
    Data expectations
    -----------------
    - 'configs' folder contains a file called 'ual_settings.yaml'
    - 'os.path' is expected to provide the root level of the urbansim instance, so be sure 
      to either (a) launch the python process from that directory, or (b) use os.chdir to 
      switch to that directory before running any model steps
    """
    with open(os.path.join(misc.configs_dir(), 'ual_settings.yaml')) as f:
        return yaml.load(f)
Exemplo n.º 5
0
def mapping():
    with open(os.path.join(misc.configs_dir(), "mapping.yaml")) as f:
        return yaml.load(f)
Exemplo n.º 6
0
def inputs():

    with open(os.path.join(misc.configs_dir(), "inputs.yaml")) as f:
        return yaml.load(f)
Exemplo n.º 7
0
def policy():
    with open(os.path.join(misc.configs_dir(), "policy.yaml")) as f:
        return yaml.load(f)
Exemplo n.º 8
0
def hazards():
    with open(os.path.join(misc.configs_dir(), "hazards.yaml")) as f:
        return yaml.load(f)
def settings():
    with open(os.path.join(misc.configs_dir(), "legacy_settings.yaml")) as f:
        settings = yaml.load(f)
        orca.settings = settings
        return settings
Exemplo n.º 10
0
def tables_in_base_year():
     h5store = pd.HDFStore(os.path.join(misc.data_dir(),  
                         yamlio.yaml_to_dict(str_or_buffer=os.path.join(misc.configs_dir(), 
                                                            "settings.yaml"))['store']), mode="r")
     store_table_names = orca.get_injectable('store_table_names_dict')
     return [t for t in orca.list_tables() if t in h5store or store_table_names.get(t, None) in h5store]
Exemplo n.º 11
0
 def func():
     with open(os.path.join(misc.configs_dir(), yaml_file)) as f:
         config = yaml.load(f)
         return config
Exemplo n.º 12
0
def settings():
    with open(os.path.join(misc.configs_dir(), "settings.yaml")) as f:
        settings = yaml.load(f)

        orca.settings = settings
        return settings