From 52e2704cd34fd207af0dd2bfe7463193fa4592e2 Mon Sep 17 00:00:00 2001 From: Alexis Arnaudon Date: Fri, 17 Jan 2020 15:56:29 +0100 Subject: [PATCH 1/2] check if .asc files as input --- tmd/io/io.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/tmd/io/io.py b/tmd/io/io.py index b260679..a5a5814 100644 --- a/tmd/io/io.py +++ b/tmd/io/io.py @@ -54,9 +54,8 @@ def load_neuron(input_file, line_delimiter='\n', soma_type=None, that there are disconnected components ''' - tree_types_final = td.copy() if tree_types is not None: - tree_types_final.update(tree_types) + td.update(tree_types) # Definition of swc types from type_dict function if soma_type is None: @@ -103,7 +102,7 @@ def load_neuron(input_file, line_delimiter='\n', soma_type=None, for i in range(comp[0]): tree_ids = _np.where(comp[1] == i)[0] + len(soma_ids) tree = make_tree(data[tree_ids]) - neuron.append_tree(tree, td=tree_types_final) + neuron.append_tree(tree, td=td) return neuron @@ -122,6 +121,9 @@ def load_population(neurons, tree_types=None, name=None): pop = Population.Population(name=name) + if any([i.endswith(".asc") for i in files]): + raise Exception('You have some .asc files which cannot be used with TMD, please only use .h5 or .swc.') + files2load = [i for i in files if (i.endswith(".h5") or i.endswith(".swc"))] for i in files2load: From 402d49cb4a9ad7438e665e694c7bdfe076cd738c Mon Sep 17 00:00:00 2001 From: Alexis Arnaudon Date: Fri, 17 Jan 2020 15:56:29 +0100 Subject: [PATCH 2/2] check if .asc files as input --- tmd/io/io.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tmd/io/io.py b/tmd/io/io.py index b260679..295b28e 100644 --- a/tmd/io/io.py +++ b/tmd/io/io.py @@ -122,6 +122,9 @@ def load_population(neurons, tree_types=None, name=None): pop = Population.Population(name=name) + if any([i.endswith(".asc") for i in files]): + raise Exception('You have some .asc files which cannot be used with TMD, please only use .h5 or .swc.') + files2load = [i for i in files if (i.endswith(".h5") or i.endswith(".swc"))] for i in files2load: