biosimulators_utils.log package#
Submodules#
biosimulators_utils.log.data_model module#
Data model for the execution status of COMBINE/OMEX archives
- Author:
Jonathan Karr <karr@mssm.edu>
- Date:
2020-12-06
- Copyright:
2020, Center for Reproducible Biomedical Modeling
- License:
MIT
- class biosimulators_utils.log.data_model.CombineArchiveLog(id=None, status=None, exception=None, skip_reason=None, output=None, duration=None, sed_documents=None, out_dir=None)[source]#
Bases:
Log
Log of a COMBINE/OMEX archive
- sed_documents[source]#
execution status of each SED document in the archive
- Type:
dict
ofstr
toSedDocumentLog
- class biosimulators_utils.log.data_model.Log(id=None, status=None, exception=None, skip_reason=None, output=None, duration=None, parent=None, out_dir=None)[source]#
Bases:
object
Log of a COMBINE/OMEX archive or one of its components
- class biosimulators_utils.log.data_model.OutputLog(id=None, status=None, exception=None, skip_reason=None, output=None, duration=None, parent=None, out_dir=None)[source]#
Bases:
Log
Log of a SED output
- class biosimulators_utils.log.data_model.Plot2DLog(id=None, status=None, exception=None, skip_reason=None, output=None, duration=None, curves=None, parent=None, out_dir=None)[source]#
Bases:
OutputLog
Log of a 2D SED plot
- class biosimulators_utils.log.data_model.Plot3DLog(id=None, status=None, exception=None, skip_reason=None, output=None, duration=None, surfaces=None, parent=None, out_dir=None)[source]#
Bases:
OutputLog
Log of a 3D SED plot
- class biosimulators_utils.log.data_model.ReportLog(id=None, status=None, exception=None, skip_reason=None, output=None, duration=None, data_sets=None, parent=None, out_dir=None)[source]#
Bases:
OutputLog
Log of a SED report
- class biosimulators_utils.log.data_model.SedDocumentLog(location=None, status=None, exception=None, skip_reason=None, output=None, duration=None, tasks=None, outputs=None, parent=None, out_dir=None)[source]#
Bases:
Log
Log of a SED document
- class biosimulators_utils.log.data_model.StandardOutputErrorCapturerLevel(value)[source]#
Bases:
int
,Enum
Level at which stdout/stderr should be captured
- class biosimulators_utils.log.data_model.Status(value)[source]#
Bases:
str
,Enum
Status of COMBINE/OMEX archive or one of its components
biosimulators_utils.log.utils module#
Utilities for working with COMBINE/OMEX archives
- Author:
Jonathan Karr <karr@mssm.edu>
- Date:
2020-12-06
- Copyright:
2020, Center for Reproducible Biomedical Modeling
- License:
MIT
- class biosimulators_utils.log.utils.StandardOutputErrorCapturer(level=StandardOutputErrorCapturerLevel.c, relay=False, termination_delay=0.01, disabled=False)[source]#
Bases:
AbstractContextManager
Context manager for capturing standard output/error. When
capturer
is available (i.e., Linux, MacOS, Unix),capturer
is used to capture standard output/error. Whencapturer
is not available (i.e. Windows), this context manager issues a warn and collects no output. The purpose of this context manager is to encapsulate the handling of whethercapturer
is or isn’t available so that the other modules can work seamless in Linux, as well as Windows (except without the ability to log standard output/error).- level[source]#
level at which stdout/stderr should be captured
- Type:
StandardOutputErrorCapturerLevel
, optional
- relay[source]#
if
True
, collect the standard output/error streams and continue to pass them along. ifFalse
, collect the stream, squash them, and do not pass them along.- Type:
bool
- biosimulators_utils.log.utils.get_summary_combine_archive_log(log)[source]#
Get a summary of the log of a COMBINE/OMEX archive
- Parameters:
log (
CombineArchiveLog
) – log of a COMBINE/OMEX archive- Returns:
summary of the log
- Return type:
str
- biosimulators_utils.log.utils.init_combine_archive_log(archive, archive_dir, supported_features=(<class 'biosimulators_utils.sedml.data_model.SedDocument'>, <class 'biosimulators_utils.sedml.data_model.Task'>, <class 'biosimulators_utils.sedml.data_model.Report'>, <class 'biosimulators_utils.sedml.data_model.Plot2D'>, <class 'biosimulators_utils.sedml.data_model.Plot3D'>, <class 'biosimulators_utils.sedml.data_model.DataSet'>, <class 'biosimulators_utils.sedml.data_model.Curve'>, <class 'biosimulators_utils.sedml.data_model.Surface'>), logged_features=(<class 'biosimulators_utils.sedml.data_model.SedDocument'>, <class 'biosimulators_utils.sedml.data_model.Task'>, <class 'biosimulators_utils.sedml.data_model.Report'>, <class 'biosimulators_utils.sedml.data_model.Plot2D'>, <class 'biosimulators_utils.sedml.data_model.Plot3D'>, <class 'biosimulators_utils.sedml.data_model.DataSet'>, <class 'biosimulators_utils.sedml.data_model.Curve'>, <class 'biosimulators_utils.sedml.data_model.Surface'>), config=None)[source]#
Initialize a log of a COMBINE/OMEX archive
- Parameters:
archive (
CombineArchive
) – COMBINE/OMEX archivearchive_dir (
str
) – path where the content of the archive is locatedsupported_features (
list
oftype
, optional) – list of supported elements. Default: COMBINE/OMEX archives and SED documents, tasks, reports, plots, data sets, curves, and surfaces.logged_features (
list
oftype
, optional) – list of elements which will be logged. Default: COMBINE/OMEX archives and SED documents, tasks, reports, plots, data sets, curves, and surfaces.config (
Config
, optional) – whether to fail on missing includes
- Returns:
initialized log of a COMBINE/OMEX archive
- Return type:
CombineArchiveLog
- biosimulators_utils.log.utils.init_output_log(output, supported_features=(<class 'biosimulators_utils.sedml.data_model.DataSet'>, <class 'biosimulators_utils.sedml.data_model.Curve'>, <class 'biosimulators_utils.sedml.data_model.Surface'>), logged_features=(<class 'biosimulators_utils.sedml.data_model.DataSet'>, <class 'biosimulators_utils.sedml.data_model.Curve'>, <class 'biosimulators_utils.sedml.data_model.Surface'>))[source]#
Initialize a log of an output
- Parameters:
output (
Output
) – a SED outputsupported_features (
list
oftype
, optional) – list of supported elements. Default: data sets, curves, and surfaces.logged_features (
list
oftype
, optional) – list of elements which will be logged. Default: data sets, curves, and surfaces.
- Returns:
initialized log of a SED document
- Return type:
OutputLog
- biosimulators_utils.log.utils.init_plot2d_log(plot, supported_features=<class 'biosimulators_utils.sedml.data_model.Curve'>, logged_features=<class 'biosimulators_utils.sedml.data_model.Curve'>)[source]#
Initialize a log of a 2D plot
- Parameters:
plot (
Plot2D
) – a SED 2D plotsupported_features (
list
oftype
, optional) – list of supported elements. Default: curves.logged_features (
list
oftype
, optional) – list of elements which will be logged. Default: curves.
- Returns:
initialized log of a 2D plot
- Return type:
Plot2DLog
- biosimulators_utils.log.utils.init_plot3d_log(plot, supported_features=<class 'biosimulators_utils.sedml.data_model.Surface'>, logged_features=<class 'biosimulators_utils.sedml.data_model.Surface'>)[source]#
Initialize a log of a 3D plot
- Parameters:
plot (
Plot3D
) – a SED 3D plotsupported_features (
list
oftype
, optional) – list of supported elements. Default: surfaces.logged_features (
list
oftype
, optional) – list of elements which will be logged. Default: surfaces.
- Returns:
initialized log of a 3D plot
- Return type:
Plot3DLog
- biosimulators_utils.log.utils.init_report_log(report, supported_features=(<class 'biosimulators_utils.sedml.data_model.DataSet'>, <class 'biosimulators_utils.sedml.data_model.Curve'>, <class 'biosimulators_utils.sedml.data_model.Surface'>), logged_features=(<class 'biosimulators_utils.sedml.data_model.DataSet'>, <class 'biosimulators_utils.sedml.data_model.Curve'>, <class 'biosimulators_utils.sedml.data_model.Surface'>))[source]#
Initialize a log of a report
- Parameters:
report (
Report
) – a SED reportsupported_features (
list
oftype
, optional) – list of supported elements. Default: data sets.logged_features (
list
oftype
, optional) – list of elements which will be logged. Default: data sets.
- Returns:
initialized log of a report
- Return type:
ReportLog
- biosimulators_utils.log.utils.init_sed_document_log(doc, supported_features=(<class 'biosimulators_utils.sedml.data_model.Task'>, <class 'biosimulators_utils.sedml.data_model.Report'>, <class 'biosimulators_utils.sedml.data_model.Plot2D'>, <class 'biosimulators_utils.sedml.data_model.Plot3D'>, <class 'biosimulators_utils.sedml.data_model.DataSet'>, <class 'biosimulators_utils.sedml.data_model.Curve'>, <class 'biosimulators_utils.sedml.data_model.Surface'>), logged_features=(<class 'biosimulators_utils.sedml.data_model.Task'>, <class 'biosimulators_utils.sedml.data_model.Report'>, <class 'biosimulators_utils.sedml.data_model.Plot2D'>, <class 'biosimulators_utils.sedml.data_model.Plot3D'>, <class 'biosimulators_utils.sedml.data_model.DataSet'>, <class 'biosimulators_utils.sedml.data_model.Curve'>, <class 'biosimulators_utils.sedml.data_model.Surface'>))[source]#
Initialize a log of a SED document
- Parameters:
doc (
SedDocument
) – SED documentsupported_features (
list
oftype
, optional) – list of supported elements. Default: tasks, reports, plots, data sets, curves, and surfaces.logged_features (
list
oftype
, optional) – list of SED elements which will be logged. Default: tasks, reports, plots, data sets, curves, and surfaces.
- Returns:
initialized log of a SED document
- Return type:
SedDocumentLog
- biosimulators_utils.log.utils.init_task_log(task, supported_features=(), logged_features=())[source]#
Initialize a log of a task
- Parameters:
output (
Task
) – a SED tasksupported_features (
list
oftype
, optional) – list of supported elements. Default: empty list.logged_features (
list
oftype
, optional) – list of elements which will be logged. Default: empty list.
- Returns:
initialized log of a SED document
- Return type:
OutputLog
biosimulators_utils.log.warnings module#
Warnings for logging
- Author:
Jonathan Karr <karr@mssm.edu>
- Date:
2021-02-04
- Copyright:
2021, Center for Reproducible Biomedical Modeling
- License:
MIT
- exception biosimulators_utils.log.warnings.StandardOutputNotLoggedWarning[source]#
Bases:
BioSimulatorsWarning
Warning that standard output and error could not be logged