def preprocess_edge_types(network, edge_population): # Fix for sonata/300_pointneurons EdgeAdaptor.preprocess_edge_types(network, edge_population) edge_types_table = edge_population.types_table edge_type_ids = np.unique(edge_population.type_ids) for et_id in edge_type_ids: edge_type = edge_types_table[et_id] if 'model_template' in edge_types_table.columns: model_template = edge_type['model_template'] if model_template.startswith('nest'): edge_type['model_template'] = model_template[5:]
def patch_adaptor(adaptor, edge_group): edge_adaptor = EdgeAdaptor.patch_adaptor(adaptor, edge_group) if 'weight_function' not in edge_group.all_columns and 'syn_weight' in edge_group.all_columns: adaptor.syn_weight = types.MethodType(point_syn_weight, adaptor) return edge_adaptor
def patch_adaptor(cls, adaptor, edge_group): edge_adaptor = EdgeAdaptor.patch_adaptor(adaptor, edge_group) if 'sec_id' in edge_group.all_columns: edge_adaptor.aff_sec_id = types.MethodType(aff_sec_id_old, adaptor) elif 'afferent_section_id' in edge_group.all_columns: edge_adaptor.aff_sec_id = types.MethodType(aff_sec_id, adaptor) else: edge_adaptor.aff_sec_id = types.MethodType(ret_none_function, adaptor) if 'sec_x' in edge_group.all_columns: edge_adaptor.aff_sec_pos = types.MethodType( aff_sec_pos_old, adaptor) elif 'afferent_section_pos' in edge_group.all_columns: edge_adaptor.aff_sec_pos = types.MethodType(aff_sec_pos, adaptor) else: edge_adaptor.aff_sec_pos = types.MethodType( ret_none_function, adaptor) return edge_adaptor