biosimulators_utils.report package — BioSimulators utils 0.1.154 documentation

# 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

  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

  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)

  Bases: `str`, `enum.Enum`

  Format of a report

  csv = 'csv'
  h5 = 'h5'
  hdf = 'h5'
  hdf5 = 'h5'
  tsv = 'tsv'
  xlsx = 'xlsx'

class biosimulators_utils.report.data_model.ReportResults

  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

  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

  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

  Bases: `object`

  Class for reading reports of simulation results

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

    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`

  run(report, base_path, rel_path, format=ReportFormat.h5)

    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

  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'>)

    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

  Bases: `biosimulators_utils.warnings.BioSimulatorsWarning`

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

exception biosimulators_utils.report.warnings.ExtraDataWarning

  Bases: `biosimulators_utils.warnings.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

  Bases: `biosimulators_utils.warnings.BioSimulatorsWarning`

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

exception biosimulators_utils.report.warnings.MissingReportMetadataWarning

  Bases: `biosimulators_utils.warnings.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

  Bases: `biosimulators_utils.warnings.BioSimulatorsWarning`

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