Saving Result file ignores outdir if a filename is specified
If a user wants to manually save a result file with the save_to_file
method and specifies both an outdir and filename, the outdir gets ignored and the file is just saved to the local directory with the filename specified as if it is the full path (e.g. this line). If filename is not specified as an input, then it is written as a local variable as if it were the full path name here. Maybe if an outdir and filename are both specified, then a path_to_file = os.path.join(outdir, filename)
and the json/hdf5 should be dumped to path_to_file
. Then this loop should be changed to path_to_file = result_file_name(outdir, self.label, extension, gzip)
. Unless for some reason it is sometimes expected that filename should contain the outdir in it as well.