Generic functions

A set of generic tools grouped here are used by the Class of DigitalCellSorter.

Submodule GenericFunctions

Ggeneral functions for conveniece of use

Functions:

extractFromZipOfGz(filepath[, …])

getElapsedTime(start)

Print total elapsed time (in minutes) elapsed from the reference point

getStartTime()

Get time (in seconds) elapsed from the epoch

read(fileName[, compressed, jsonFormat])

Unpickle object from a (binary) file

timeMark()

Print total time elapsed from the beggining of the process from which the function is called

write(data, fileName[, compressed, jsonFormat])

Pickle object into a (binary) file

write(data, fileName, compressed=False, jsonFormat=False)[source]

Pickle object into a (binary) file

Parameters:

data: any Pyhton object, e.g. list, dictionary, file, method, variable, etc. fileName: path and name of the file to store binary data in

Returns:

None

Usage:

data = [[‘A’, ‘B’, ‘C’], pd.DataFrame()] write(data, os.path.join(‘some dir 1’, ‘some dir 2’, ‘File with my data’))

read(fileName, compressed=False, jsonFormat=False)[source]

Unpickle object from a (binary) file

Parameters:

fileName: path and name of the file with binary data stored in

Returns:

Data stored in the provided file

Usage:

read(os.path.join(‘some dir 1’, ‘some dir 2’, ‘File with my data’))

timeMark()[source]

Print total time elapsed from the beggining of the process from which the function is called

Parameters:

None

Returns:

None

Usage:

timeMark()

getStartTime()[source]

Get time (in seconds) elapsed from the epoch

Parameters:

None

Returns:

Time (in seconds)

Usage:

start = getStartTime()

getElapsedTime(start)[source]

Print total elapsed time (in minutes) elapsed from the reference point

Parameters:
start: float or int

Reference time (in seconds)

Returns:

None

Usage:

getElapsedTime(start)

extractFromZipOfGz(filepath, removeDownloadedZipFile=False)[source]