biosimulators_utils.report package#

Submodules#

biosimulators_utils.report.data_model module#

Data model for reports

Author:

Jonathan Karr <karr@mssm.edu>

Date:

2020-12-06

Copyright:

2020, Center for Reproducible Biomedical Modeling

License:

MIT

class biosimulators_utils.report.data_model.DataGeneratorResults[source]#

Bases: dict

Dictionary that maps the ids of data generators (DataGenerator) to their results (numpy.ndarray)

  • Keys (str): ids of data generators (DataGenerator)

  • Values (numpy.ndarray): result of each variable

    • Steady-state tasks of non-spatial models: results should be arrays of shape (1,)

    • One-step tasks of non-spatial models: results should be arrays of shape (2,)

    • Uniform time course tasks of non-spatial models: results should be arrays of shape (number_of_steps + 1,)

class biosimulators_utils.report.data_model.DataSetResults[source]#

Bases: dict

Dictionary that maps the ids of data sets to their results (numpy.ndarray)

  • Keys (str): ids of data sets

  • Values (numpy.ndarray): result of each data set

    • Steady-state tasks of non-spatial models: results should be arrays of shape (number of data sets, 1)

    • One-step tasks of non-spatial models: results should be arrays of shape (number of data sets, 2)

    • Uniform time course tasks of non-spatial models: results should be arrays of shape (number_of_steps + 1,)

class biosimulators_utils.report.data_model.ReportFormat(value)[source]#

Bases: str, Enum

Format of a report

__format__(format_spec)[source]#

Returns format using actual value type unless __str__ has been overridden.

csv = 'csv'[source]#
h5 = 'h5'[source]#
hdf = 'h5'[source]#
hdf5 = 'h5'[source]#
tsv = 'tsv'[source]#
xlsx = 'xlsx'[source]#
class biosimulators_utils.report.data_model.ReportResults[source]#

Bases: dict

Dictionary that maps the ids of reports (e.g., Report) to their results (DataSetResults)

  • Keys (str): ids of reports (e.g., Report)

  • Values (DataSetResults): result of each report

class biosimulators_utils.report.data_model.SedDocumentResults[source]#

Bases: dict

Dictionary that maps the locations of SED-ML documents (e.g., SedDocument) to their results (ReportResults)

  • Keys (str): locations of SED documents (e.g., SedDocument)

  • Values (ReportResults): result of each document

class biosimulators_utils.report.data_model.VariableResults[source]#

Bases: dict

Dictionary that maps the ids of variables (Variable) to their results (numpy.ndarray)

  • Keys (str): ids of variables (Variable)

  • Values (numpy.ndarray): result of each variable

    • Steady-state tasks of non-spatial models: results should be arrays of shape (1,)

    • One-step tasks of non-spatial models: results should be arrays of shape (2,)

    • Uniform time course tasks of non-spatial models: results should be arrays of shape (number_of_steps + 1,)

biosimulators_utils.report.io module#

Utilities for reading and writing reports

Author:

Jonathan Karr <karr@mssm.edu>

Date:

2020-12-06

Copyright:

2020, Center for Reproducible Biomedical Modeling

License:

MIT

class biosimulators_utils.report.io.ReportReader[source]#

Bases: object

Class for reading reports of simulation results

static append_report_id(type, report_ids, name, object)[source]#
get_ids(base_path, format=ReportFormat.h5, type=<class 'biosimulators_utils.sedml.data_model.Output'>)[source]#

Get the ids of the reports in a file

Parameters:
  • base_path (str) –

    path to save results

    • CSV: parent directory to save results

    • HDF5: file to save results

  • format (ReportFormat, optional) – report format

  • type (type) – type of report to get

Returns:

ids of reports

Return type:

list of str

static parse_dataset_str_list_values(raw_values: list)[source]#
static parse_dataset_str_value(raw_value)[source]#
run(report, base_path, rel_path, format=ReportFormat.h5)[source]#

Read a report for a file

Parameters:
  • report (Report) – report

  • base_path (str) –

    path to save results

    • CSV: parent directory to save results

    • HDF5: file to save results

  • rel_path (str) –

    path to save results relative to base_path

    • CSV: relative path to base_path

    • HDF5: key within HDF5 file

  • format (ReportFormat, optional) – report format

Returns:

report results

Return type:

DataSetResults

class biosimulators_utils.report.io.ReportWriter[source]#

Bases: object

Class for writing reports of simulation results

run(report, results, base_path, rel_path, format=ReportFormat.h5, type=<class 'biosimulators_utils.sedml.data_model.Report'>)[source]#

Save a report

Parameters:
  • report (Report) – report

  • results (DataSetResults) – results of the data sets

  • base_path (str) –

    path to save results

    • CSV: parent directory to save results

    • HDF5: file to save results

  • rel_path (str) –

    path to save results relative to base_path

    • CSV: relative path to base_path

    • HDF5: key within HDF5 file

  • format (ReportFormat, optional) – report format

  • type (type) – type of output (e.g., subclass of Output such as Report, Plot2D)

biosimulators_utils.report.warnings module#

Warnings for reports

Author:

Jonathan Karr <karr@mssm.edu>

Date:

2021-01-21

Copyright:

2021, Center for Reproducible Biomedical Modeling

License:

MIT

exception biosimulators_utils.report.warnings.CannotExportMultidimensionalTableWarning[source]#

Bases: BioSimulatorsWarning

Warning that a multidimensional report cannot be exported (e.g., to CSV, Excel, or TSV).

exception biosimulators_utils.report.warnings.ExtraDataWarning[source]#

Bases: BioSimulatorsWarning

Warning that a file contains additional data that could not be mapped to a data set of a report.

exception biosimulators_utils.report.warnings.MissingDataWarning[source]#

Bases: BioSimulatorsWarning

Warning that a file does not contain data for one or more data sets of a report.

exception biosimulators_utils.report.warnings.MissingReportMetadataWarning[source]#

Bases: BioSimulatorsWarning

Warning that an exported file of a report will not or does contain comprehensive metadata about the report such as the data type and shape of each data set.

exception biosimulators_utils.report.warnings.RepeatDataSetLabelsWarning[source]#

Bases: BioSimulatorsWarning

Warning that multiple data sets with a report have the same label