Пример #1
0
 def get_locations(self):
     logger.info("Getting locations.")
     self.location_set_version_id, self.location_metadata_version_id = \
         get_location_hierarchy_version(gbd_round_id=self.gbd_round_id,
                                        conn_def=self.conn_def)
     self.global_location_list, self.developed_location_list = \
         utils.get_locations_for_models(self.developed_model, self.location_set_version_id,
                                        conn_def=self.conn_def)
Пример #2
0
    return pd.concat(data_all).reset_index(drop=True)


# Get cause and model data
cause_data = get_cause_dict()
developed_model_properties = get_model_properties(developed_model)
global_model_properties = get_model_properties(global_model)
hybrid_model_properties = get_model_properties(model_version_id)

log_dir = LOG_DIRECTORY
l.setup_logging(log_dir, 'hybridizer')

try:

    # Get list of locations for global and developing model
    location_set_version_id, location_metadata_version_id = get_location_hierarchy_version(
        35, 2015)
    global_location_list, developed_location_list = get_locations_for_models(
        developed_model, location_set_version_id)

    print "Global locations:"
    print sorted(global_location_list)
    print "Developed locations:"
    print sorted(developed_location_list)

    # Loop through developed and developing models
    data_all = []
    global_draws_filepath = get_draws_filepath(global_model_properties,
                                               cause_data)
    data_all.append(
        transfer_draws_to_temp(global_draws_filepath, global_location_list))
Пример #3
0
# Get cause and model data for all 3 models
cause_data = get_cause_dict()
developed_model_properties = get_model_properties(developed_model)
global_model_properties = get_model_properties(global_model)
hybrid_model_properties = get_model_properties(model_version_id)

# set up the logging file
log_dir = 'FILEPATH'
l.setup_logging(log_dir, 'hybridizer')

try:

    # Get list of locations for global and developing model
    location_set_version_id, location_metadata_version_id = \
        get_location_hierarchy_version(server=server_name)
    global_location_list, developed_location_list = \
        get_locations_for_models(developed_model, location_set_version_id)

    print "Global locations:"
    print sorted(global_location_list)
    print "Developed locations:"
    print sorted(developed_location_list)

    # Go through data-rich and global models to concatenate all data
    data_all = []
    # global
    global_draws_filepath = get_draws_filepath(global_model_properties,
                                               cause_data)
    data_all.append(
        read_draws_by_location(global_draws_filepath, global_location_list))