micom.workflows.results

A class for tracking results for growth simulations.

Attributes

Classes

Functions

save_results(results, path)

Save growth results to a file.

load_results(path)

Load growth results from a file.

combine_results(→ GrowthResults)

Combine several GrowthResults.

Module Contents

micom.workflows.results.DIRECTION[source]
class micom.workflows.results.GrowthResults[source]
growth_rates: pandas.DataFrame[source]
exchanges: pandas.DataFrame[source]
annotations: pandas.DataFrame[source]
save(path: str)[source]

Save growth results to a file.

This will write all tables as CSV into a single ZIP file.

Parameters:

path (str) – A filepath for the generated file. Should end in .zip.

static load(path: str) GrowthResults[source]

Load growth results from a file.

Parameters:

path (str) – Path to saved GrowthResults.

Returns:

The loaded growth results.

Return type:

GrowthResults

__add__(other: GrowthResults) GrowthResults[source]

Combine two GrowthResults objects.

Parameters:

other (GrowthResults) – The other result to merge with the current one.

Returns:

A merged growth result containing data from both.

Return type:

GrowthResult

static from_solution(sol: micom.solution.CommunitySolution, com: micom.community.Community) GrowthResults[source]

Convert a solution to growth results.

micom.workflows.results.save_results(results: GrowthResults, path: str)[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.results.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.results.combine_results(it: Iterable[GrowthResults]) GrowthResults[source]

Combine several GrowthResults.

Parameters:

it (Iterable of GrowthResults) – The growth results to combine.

Returns:

The merged results.

Return type:

GrowthResults