def make_output_path_graph(out_dir, subject, str_prefixes):
"Constructs path to save a multigraph to disk."
if out_dir is not None:
# get outpath returned from hiwenet, based on dist name and all other parameters
# choose out_dir name based on dist name and all other parameters
out_subject_dir = pjoin(out_dir, subject)
if not pexists(out_subject_dir):
os.mkdir(out_subject_dir)
if isinstance(str_prefixes, str):
str_prefixes = [str_prefixes, ]
out_file_name = '{}_graynet.graphml'.format('_'.join(str_prefixes))
out_weights_path = pjoin(out_subject_dir, out_file_name)
else:
out_weights_path = None
return out_weights_path
评论列表
文章目录