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:
dictDictionary 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 variableSteady-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:
dictDictionary that maps the ids of data sets to their results (
numpy.ndarray)Keys (
str): ids of data setsValues (
numpy.ndarray): result of each data setSteady-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.EnumFormat of a report
- class biosimulators_utils.report.data_model.ReportResults[source]¶
Bases:
dictDictionary 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:
dictDictionary 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:
dictDictionary that maps the ids of variables (
Variable) to their results (numpy.ndarray)Keys (
str): ids of variables (Variable)Values (
numpy.ndarray): result of each variableSteady-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:
objectClass for reading reports of simulation results
- 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 formattype (
type) – type of report to get
- Returns
ids of reports
- Return type
listofstr
- run(report, base_path, rel_path, format=ReportFormat.h5)[source]¶
Read a report for a file
- Parameters
report (
Report) – reportbase_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_pathCSV: relative path to
base_pathHDF5: key within HDF5 file
format (
ReportFormat, optional) – report format
- Returns
report results
- Return type
DataSetResults
- class biosimulators_utils.report.io.ReportWriter[source]¶
Bases:
objectClass 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) – reportresults (
DataSetResults) – results of the data setsbase_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_pathCSV: relative path to
base_pathHDF5: key within HDF5 file
format (
ReportFormat, optional) – report formattype (
type) – type of output (e.g., subclass ofOutputsuch asReport,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:
biosimulators_utils.warnings.BioSimulatorsWarningWarning that a multidimensional report cannot be exported (e.g., to CSV, Excel, or TSV).
- exception biosimulators_utils.report.warnings.ExtraDataWarning[source]¶
Bases:
biosimulators_utils.warnings.BioSimulatorsWarningWarning 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:
biosimulators_utils.warnings.BioSimulatorsWarningWarning that a file does not contain data for one or more data sets of a report.
- exception biosimulators_utils.report.warnings.MissingReportMetadataWarning[source]¶
Bases:
biosimulators_utils.warnings.BioSimulatorsWarningWarning 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:
biosimulators_utils.warnings.BioSimulatorsWarningWarning that multiple data sets with a report have the same label