unpickle_file

sofia_redux.toolkit.utilities.multiprocessing.unpickle_file(filename)[source]

Unpickle a string argument if it is a file, and return the result.

Parameters:
filenameobject or str

If the argument is a string and a valid file path, it will be unpickled and the result will be available in the result.

Returns:
obj, pickle_fileobject, str

If the argument passed in was not a string or an invalid file, the resulting output obj will be argument and pickle_file will be None. If argument was a valid file path to a pickle file, obj will be the unpickled result, and pickle`file will be argument.