davidhallac/TICC

Returning output instead of writing to disk

Closed this issue · 0 comments

It would be useful if TICC could be used without generating extra files and directories. The following lines can be removed without any apparent change in functionality:

TICC/TICC_solver.py

Lines 62 to 68 in c8296df

str_NULL = prefix_string + "lam_sparse=" + str(lam_sparse) + "maxClusters=" +str(num_clusters+1)+"/"
if not os.path.exists(os.path.dirname(str_NULL)):
try:
os.makedirs(os.path.dirname(str_NULL))
except OSError as exc: # Guard against race condition of path already existing
if exc.errno != errno.EEXIST:
raise

Results are also written into results text-files which is not always what a user of this code wants (e.g. the second argument to the RunTicc). Maybe just supporting output_filename=None would be useful.