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:
|
|
|
Print total elapsed time (in minutes) elapsed from the reference point |
Get time (in seconds) elapsed from the epoch |
|
|
Unpickle object from a (binary) file |
|
Print total time elapsed from the beggining of the process from which the function is called |
|
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()