Commit 9eb146fe by Andrea Mancini

Update create_dataset.py

parent 6fc39553
...@@ -105,19 +105,21 @@ def main(args): ...@@ -105,19 +105,21 @@ def main(args):
raise Exception("Either depth or node_list must be provided") raise Exception("Either depth or node_list must be provided")
elif depth and len(node_list) > 0: elif depth is not None and len(node_list) > 0:
raise Exception("Only one between depth and node list is required") raise Exception("Only one between depth and node list is required")
tree = Tree(args.tree) tree = Tree(args.tree)
if depth is not None:
if depthi is not None:
class2seqs = define_classes_at_depth(args.ifpath, tree, depth) class2seqs = define_classes_at_depth(args.ifpath, tree, depth)
elif len(node_list) > 0: elif len(node_list) > 0:
if class_ids and len(class_ids) != len(node_list):
raise ValueError("Number of class_ids must match number of nodes")
class2seqs = define_classes_from_list(args.ifpath, tree, node_list, args.class_ids) class2seqs = define_classes_from_list(args.ifpath, tree, node_list, args.class_ids)
save_to_csv(class2seqs, args.ofpath) save_to_csv(class2seqs, args.ofpath)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment