micom.workflows.core
#
Makes it easier to run analyses on several samples in parallel.
Module Contents#
Functions#
|
Save growth results to a file. |
|
Load growth results from a file. |
|
Run analyses for several samples in parallel. |
Attributes#
- micom.workflows.core.save_results(results, path)[source]#
Save growth results to a file.
This will write all tables as CSV into a single ZIP file.
- Parameters:
results (GrowthResults) – The results as returned from grow.
path (str) – A filepath for the generated file. Should end in .zip.
- micom.workflows.core.load_results(path)[source]#
Load growth results from a file.
- Parameters:
path (str) – Path to saved GrowthResults.
- Returns:
The saved GrowthResults.
- Return type:
GrowthResults
- micom.workflows.core.workflow(func, args, threads=4, description=None, progress=True)[source]#
Run analyses for several samples in parallel.
This will analyze several samples in parallel. Includes a workaround for optlang memory leak.
- Parameters:
func (function) – A function that takes a single argument (can be any object) and that performs your analysis for a single sample.
args (array-like object) – An array-like object (list, tuple, numpy array, pandas Series, etc.) that contains the arguments for each sample.
threads (positive int) – How many samples to analyze in parallel at once.
description (str) – The dewscription shown in front of the progress bar.
progress (bool) – Whether to show a progress bar.