biosimulators_utils.combine package — BioSimulators utils 0.1.154 documentation

# biosimulators_utils.combine package

## Submodules

## biosimulators_utils.combine.data_model module

Data model for 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.combine.data_model.CombineArchive(contents=None)

  Bases: `biosimulators_utils.combine.data_model.CombineArchiveBase`

  A COMBINE/OMEX archive

  contents

    contents of the archive

    Type

      `list` of `CombineArchiveContent`

  get_master_content()

    Get the master content of an archive

    Returns

      master content

    Return type

      `list` of `CombineArchiveContent`

  is_equal(other)

    Determine if two content items are equal

    Parameters

      other (`CombineArchiveContent`) – another content item

    Returns

      `True`, if two archives are equal

    Return type

      `bool`

  to_tuple()

    Tuple representation of a COMBINE/OMEX archive

    Returns

      tuple representation of a COMBINE/OMEX archive

    Return type

      `tuple` of `str`

class biosimulators_utils.combine.data_model.CombineArchiveBase

  Bases: `abc.ABC`

  A COMBINE/OMEX archive

class biosimulators_utils.combine.data_model.CombineArchiveContent(location=None, format=None, master=False)

  Bases: `biosimulators_utils.combine.data_model.CombineArchiveBase`

  A content item (e.g., file) in a COMBINE/OMEX archive

  location

    path to the content

    Type

      `str`

  format

    URL for the specification of the format of the content

    Type

      `str`

  master

    `True`, if the content is the “primary” content of the parent archive

    Type

      `bool`

  is_equal(other)

    Determine if two content items are equal

    Parameters

      other (`CombineArchiveContent`) – another content item

    Returns

      `True`, if two content items are equal

    Return type

      `bool`

  to_tuple()

    Tuple representation of a content item of a COMBINE/OMEX archive

    Returns

      tuple representation of a content item of a COMBINE/OMEX archive

    Return type

      `tuple` of `str`

class biosimulators_utils.combine.data_model.CombineArchiveContentFormat(value)

  Bases: `str`, `enum.Enum`

  Format for the content of COMBINE/OMEX archives

  ACTIONSCRIPT = 'http://purl.org/NET/mediatypes/text/x-actionscript'
  ADOBE_FLASH = 'http://purl.org/NET/mediatypes/application/x-shockwave-flash'
  AI = 'http://purl.org/NET/mediatypes/application/pdf'
  BMP = 'http://purl.org/NET/mediatypes/image/bmp'
  BNGL = 'http://purl.org/NET/mediatypes/text/bngl+plain'
  BOURNE_SHELL = 'http://purl.org/NET/mediatypes/text/x-sh'
  BioPAX = 'http://identifiers.org/combine.specifications/biopax'
  C = 'http://purl.org/NET/mediatypes/text/x-c'
  CPP_HEADER = 'http://purl.org/NET/mediatypes/text/x-c++hdr'
  CPP_SOURCE = 'http://purl.org/NET/mediatypes/text/x-c++src'
  CSS = 'http://purl.org/NET/mediatypes/text/css'
  CSV = 'http://purl.org/NET/mediatypes/text/csv'
  CellML = 'http://identifiers.org/combine.specifications/cellml'
  CopasiML = 'http://purl.org/NET/mediatypes/application/x-copasi'
  DLL = 'http://purl.org/NET/mediatypes/application/vnd.microsoft.portable-executable'
  DOC = 'http://purl.org/NET/mediatypes/application/msword'
  DOCX = 'http://purl.org/NET/mediatypes/application/vnd.openxmlformats-officedocument.wordprocessingml.document'
  EPS = 'http://purl.org/NET/mediatypes/application/postscript'
  Escher = 'http://purl.org/NET/mediatypes/application/escher+json'
  GIF = 'http://purl.org/NET/mediatypes/image/gif'
  GINML = 'http://purl.org/NET/mediatypes/application/ginml+xml'
  GMSH_MESH = 'http://purl.org/NET/mediatypes/model/mesh'
  GRAPHML = 'http://purl.org/NET/mediatypes/application/graphml+xml'
  HDF5 = 'http://purl.org/NET/mediatypes/application/x-hdf'
  HOC = 'http://purl.org/NET/mediatypes/text/x-hoc'
  HTML = 'http://purl.org/NET/mediatypes/text/html'
  ICO = 'http://purl.org/NET/mediatypes/image/x-icon'
  INI = 'http://purl.org/NET/mediatypes/text/x-ini'
  IPython_Notebook = 'http://purl.org/NET/mediatypes/application/x-ipynb+json'
  JAVASCRIPT = 'http://purl.org/NET/mediatypes/text/javascript'
  JAVA_ARCHIVE = 'http://purl.org/NET/mediatypes/application/java-archive'
  JAVA_CLASS = 'http://purl.org/NET/mediatypes/application/java-vm'
  JAVA_SOURCE = 'http://purl.org/NET/mediatypes/text/x-java'
  JPEG = 'http://purl.org/NET/mediatypes/image/jpeg'
  JSON = 'http://purl.org/NET/mediatypes/application/json'
  Kappa = 'http://purl.org/NET/mediatypes/text/x-kappa'
  LEMS = 'http://purl.org/NET/mediatypes/application/lems+xml'
  MASS = 'http://purl.org/NET/mediatypes/application/mass+json'
  MATLAB = 'http://purl.org/NET/mediatypes/text/x-matlab'
  MATLAB_DATA = 'http://purl.org/NET/mediatypes/application/x-matlab-data'
  MorpheusML = 'http://purl.org/NET/mediatypes/application/morpheusml+xml'
  NeuroML = 'http://identifiers.org/combine.specifications/neuroml'
  NuML = 'http://purl.org/NET/mediatypes/application/numl+xml'
  ODT = 'http://purl.org/NET/mediatypes/application/vnd.oasis.opendocument.text'
  OMEX = 'http://identifiers.org/combine.specifications/omex'
  OMEX_MANIFEST = 'http://identifiers.org/combine.specifications/omex-manifest'
  OMEX_METADATA = 'http://identifiers.org/combine.specifications/omex-metadata'
  OTHER = 'http://purl.org/NET/mediatypes/application/octet-stream'
  OWL = 'http://purl.org/NET/mediatypes/application/rdf+xml'
  PDF = 'http://purl.org/NET/mediatypes/application/PDF'
  PERL = 'http://purl.org/NET/mediatypes/text/x-perl'
  PHP = 'http://purl.org/NET/mediatypes/application/x-httpd-php'
  PNG = 'http://purl.org/NET/mediatypes/image/png'
  PPT = 'http://purl.org/NET/mediatypes/application/vnd.ms-powerpoint'
  PPTX = 'http://purl.org/NET/mediatypes/application/vnd.openxmlformats-officedocument.presentationml.presentation'
  PSD = 'http://purl.org/NET/mediatypes/image/vnd.adobe.photoshop'
  Python = 'http://purl.org/NET/mediatypes/application/x-python-code'
  QUICKTIME = 'http://purl.org/NET/mediatypes/video/quicktime'
  R = 'http://purl.org/NET/mediatypes/text/x-r'
  RBA = 'http://purl.org/NET/mediatypes/application/rba+zip'
  RDF_XML = 'http://purl.org/NET/mediatypes/application/rdf+xml'
  RST = 'http://purl.org/NET/mediatypes/text/x-rst'
  RUBY = 'http://purl.org/NET/mediatypes/text/x-ruby'
  R_Project = 'http://purl.org/NET/mediatypes/application/x-r-project'
  SBGN = 'http://identifiers.org/combine.specifications/sbgn'
  SBML = 'http://identifiers.org/combine.specifications/sbml'
  SBOL = 'http://identifiers.org/combine.specifications/sbol'
  SBOL_VISUAL = 'http://identifiers.org/combine.specifications/sbol-visual'
  SED_ML = 'http://identifiers.org/combine.specifications/sed-ml'
  SHOCKWAVE_FLASH = 'http://purl.org/NET/mediatypes/application/x-shockwave-flash'
  SO = 'http://purl.org/NET/mediatypes/application/x-sharedlib'
  SQL = 'http://purl.org/NET/mediatypes/application/sql'
  SVG = 'http://purl.org/NET/mediatypes/image/svg+xml'
  SVGZ = 'http://purl.org/NET/mediatypes/image/svg+xml-compressed'
  Scilab = 'http://purl.org/NET/mediatypes/application/x-scilab'
  SimBiology_Project = 'http://purl.org/NET/mediatypes/application/x-sbproj'
  Smoldyn = 'http://purl.org/NET/mediatypes/text/smoldyn+plain'
  TEXT = 'http://purl.org/NET/mediatypes/text/plain'
  TIFF = 'http://purl.org/NET/mediatypes/image/tiff'
  TSV = 'http://purl.org/NET/mediatypes/text/tab-separated-values'
  VCML = 'http://purl.org/NET/mediatypes/application/vcml+xml'
  Vega = 'http://purl.org/NET/mediatypes/application/vnd.vega.v5+json'
  Vega_Lite = 'http://purl.org/NET/mediatypes/application/vnd.vegalite.v3+json'
  WEBP = 'http://purl.org/NET/mediatypes/image/webp'
  XLS = 'http://purl.org/NET/mediatypes/application/vnd.ms-excel'
  XLSX = 'http://purl.org/NET/mediatypes/application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'
  XML = 'http://purl.org/NET/mediatypes/application/xml'
  XPP = 'http://purl.org/NET/mediatypes/text/x-xpp'
  XSL = 'http://purl.org/NET/mediatypes/application/xslfo+xml'
  XUL = 'http://purl.org/NET/mediatypes/text/xul'
  XYZ = 'http://purl.org/NET/mediatypes/chemical/x-xyz'
  YAML = 'http://purl.org/NET/mediatypes/application/x-yaml'
  ZGINML = 'http://purl.org/NET/mediatypes/application/zginml+zip'
  ZIP = 'http://purl.org/NET/mediatypes/application/zip'
  pharmML = 'http://purl.org/NET/mediatypes/application/pharmml+xml'

class biosimulators_utils.combine.data_model.CombineArchiveContentFormatPattern(value)

  Bases: `str`, `enum.Enum`

  Format for the content of COMBINE/OMEX archives

  ACTIONSCRIPT = '^https?://purl\\.org/NET/mediatypes/text/x-actionscript$'
  ADOBE_FLASH = '^https?://purl\\.org/NET/mediatypes/(application/x-shockwave-flash|application/vnd\\.adobe\\.flash-movie)$'
  AI = '^https?://purl\\.org/NET/mediatypes/(application/pdf|application/postscript)$'
  BMP = '^https?://purl\\.org/NET/mediatypes/image/bmp$'
  BNGL = '^https?://purl\\.org/NET/mediatypes/text/bngl\\+plain($|\\.)'
  BOURNE_SHELL = '^https?://purl\\.org/NET/mediatypes/(text/x-sh|application/x-sh)$'
  BioPAX = '^https?://identifiers\\.org/combine\\.specifications/biopax($|\\.)'
  C = '^https?://purl\\.org/NET/mediatypes/text/x-c$'
  CPP_HEADER = '^https?://purl\\.org/NET/mediatypes/text/x-c\\+\\+hdr$'
  CPP_SOURCE = '^https?://purl\\.org/NET/mediatypes/text/x-c\\+\\+src$'
  CSS = '^https?://purl\\.org/NET/mediatypes/text/css$'
  CSV = '^https?://purl\\.org/NET/mediatypes/text/csv$'
  CellML = '^https?://identifiers\\.org/combine\\.specifications/cellml($|\\.)'
  CopasiML = '^https?://purl\\.org/NET/mediatypes/application/x-copasi$'
  DLL = '^https?://purl\\.org/NET/mediatypes/application/vnd\\.microsoft\\.portable-executable$'
  DOC = '^https?://purl\\.org/NET/mediatypes/application/msword$'
  DOCX = '^https?://purl\\.org/NET/mediatypes/application/vnd\\.openxmlformats-officedocument\\.wordprocessingml\\.document$'
  EPS = '^https?://purl\\.org/NET/mediatypes/(application/postscript|application/eps|application/x-eps|image/eps|image/x-eps)$'
  Escher = '^https?://purl\\.org/NET/mediatypes/application/escher\\+json$'
  GIF = '^https?://purl\\.org/NET/mediatypes/image/gif$'
  GINML = '^https?://purl\\.org/NET/mediatypes/application/ginml\\+xml$'
  GMSH_MESH = '^https?://purl\\.org/NET/mediatypes/model/mesh$'
  GRAPHML = '^https?://purl\\.org/NET/mediatypes/(application/graphml\\+xml|application/x-graphml\\+xml)$'
  HDF5 = '^https?://purl\\.org/NET/mediatypes/application/x-hdf5?$'
  HOC = '^https?://purl\\.org/NET/mediatypes/text/x-hoc$'
  HTML = '^https?://purl\\.org/NET/mediatypes/(text/html|application/xhtml\\+xml)$'
  ICO = '^https?://purl\\.org/NET/mediatypes/(image/x-icon|image/vnd\\.microsoft\\.icon)$'
  INI = '^https?://purl\\.org/NET/mediatypes/text/x-ini$'
  IPython_Notebook = '^https?://purl\\.org/NET/mediatypes/application/x-ipynb\\+json$'
  JAVASCRIPT = '^https?://purl\\.org/NET/mediatypes/(text/javascript|text/x-javascript|application/javascript|application/x-javascript)$'
  JAVA_ARCHIVE = '^https?://purl\\.org/NET/mediatypes/(application/java-archive|application/x-java-archive|application/jar|application/x-jar)$'
  JAVA_CLASS = '^https?://purl\\.org/NET/mediatypes/(application/java-vm|application/x-java-vm|application/java|application/x-java)$'
  JAVA_SOURCE = '^https?://purl\\.org/NET/mediatypes/(text/x-java|text/x-java-source)$'
  JPEG = '^https?://purl\\.org/NET/mediatypes/image/jpeg$'
  JSON = '^https?://purl\\.org/NET/mediatypes/application/json$'
  Kappa = '^https?://purl\\.org/NET/mediatypes/text/x-kappa$'
  LEMS = '^https?://purl\\.org/NET/mediatypes/application/lems\\+xml$'
  MASS = '^https?://purl\\.org/NET/mediatypes/application/mass\\+json$'
  MATLAB = '^https?://purl\\.org/NET/mediatypes/text/x-matlab$'
  MATLAB_DATA = '^https?://purl\\.org/NET/mediatypes/application/x-matlab-data$'
  MorpheusML = '^https?://purl\\.org/NET/mediatypes/application/morpheusml\\+xml$'
  NeuroML = '^https?://identifiers\\.org/combine\\.specifications/neuroml($|\\.)'
  NuML = '^https?://purl\\.org/NET/mediatypes/application/numl\\+xml$'
  ODT = '^https?://purl\\.org/NET/mediatypes/application/vnd\\.oasis\\.opendocument\\.text$'
  OMEX = '^https?://identifiers\\.org/combine\\.specifications/omex($|\\.)'
  OMEX_MANIFEST = '^https?://identifiers\\.org/combine\\.specifications/omex-manifest($|\\.)'
  OMEX_METADATA = '^https?://identifiers\\.org/combine\\.specifications/omex-metadata($|\\.)'
  OTHER = '^https?://purl\\.org/NET/mediatypes/application/octet-stream$'
  OWL = '^https?://purl\\.org/NET/mediatypes/application/rdf\\+xml$'
  PDF = '^https?://purl\\.org/NET/mediatypes/application/pdf$'
  PERL = '^https?://purl\\.org/NET/mediatypes/(text/x-perl|application/x-perl)$'
  PHP = '^https?://purl\\.org/NET/mediatypes/(application/x-httpd-php|application/x-httpd-php-source|application/x-php|text/x-php)$'
  PNG = '^https?://purl\\.org/NET/mediatypes/image/png$'
  PPT = '^https?://purl\\.org/NET/mediatypes/application/vnd\\.ms-powerpoint$'
  PPTX = '^https?://purl\\.org/NET/mediatypes/application/vnd\\.openxmlformats-officedocument\\.presentationml\\.presentation$'
  PSD = '^https?://purl\\.org/NET/mediatypes/(image/vnd\\.adobe\\.photoshop|image/psd|image/x-psd|application/photoshop|application/x-photoshop|application/psd|application/x-psd)$'
  Python = '^https?://purl\\.org/NET/mediatypes/application/x-python-code$'
  QUICKTIME = '^https?://purl\\.org/NET/mediatypes/(video/quicktime|image/mov)$'
  R = '^https?://purl\\.org/NET/mediatypes/text/x-r$'
  RBA = '^https?://purl\\.org/NET/mediatypes/application/rba\\+zip$'
  RDF_XML = '^https?://purl\\.org/NET/mediatypes/application/rdf\\+xml$'
  RST = '^https?://purl\\.org/NET/mediatypes/text/x-rst$'
  RUBY = '^https?://purl\\.org/NET/mediatypes/text/x-ruby$'
  R_Project = '^https?://purl\\.org/NET/mediatypes/application/x-r-project$'
  SBGN = '^https?://identifiers\\.org/combine\\.specifications/sbgn($|\\.)'
  SBML = '^https?://identifiers\\.org/combine\\.specifications/sbml($|\\.)'
  SBOL = '^https?://identifiers\\.org/combine\\.specifications/sbol($|\\.)'
  SBOL_VISUAL = '^https?://identifiers\\.org/combine\\.specifications/sbol-visual($|\\.)'
  SED_ML = '^https?://identifiers\\.org/combine\\.specifications/sed\\-?ml($|\\.)'
  SHOCKWAVE_FLASH = '^https?://purl\\.org/NET/mediatypes/(application/x-shockwave-flash|application/vnd\\.adobe\\.flash-movie)$'
  SO = '^https?://purl\\.org/NET/mediatypes/application/x-sharedlib$'
  SQL = '^https?://purl\\.org/NET/mediatypes/application/sql$'
  SVG = '^https?://purl\\.org/NET/mediatypes/image/svg\\+xml$'
  SVGZ = '^https?://purl\\.org/NET/mediatypes/image/svg\\+xml(-compressed)?$'
  Scilab = '^https?://purl\\.org/NET/mediatypes/application/x-scilab$'
  SimBiology_Project = '^https?://purl\\.org/NET/mediatypes/application/x-sbproj$'
  Smoldyn = '^https?://purl\\.org/NET/mediatypes/text/smoldyn\\+plain$'
  TEXT = '^https?://purl\\.org/NET/mediatypes/text/plain$'
  TIFF = '^https?://purl\\.org/NET/mediatypes/image/tiff$'
  TSV = '^https?://purl\\.org/NET/mediatypes/text/tab-separated-values$'
  VCML = '^https?://purl\\.org/NET/mediatypes/application/vcml\\+xml$'
  Vega = '^https?://purl\\.org/NET/mediatypes/application/vnd\\.vega\\.v5\\+json$'
  Vega_Lite = '^https?://purl\\.org/NET/mediatypes/application/vnd\\.vegalite\\.v3\\+json$'
  WEBP = '^https?://purl\\.org/NET/mediatypes/image/webp$'
  XLS = '^https?://purl\\.org/NET/mediatypes/application/vnd\\.ms-excel$'
  XLSX = '^https?://purl\\.org/NET/mediatypes/application/vnd\\.openxmlformats-officedocument\\.spreadsheetml\\.sheet$'
  XML = '^https?://purl\\.org/NET/mediatypes/application/xml$'
  XPP = '^https?://purl\\.org/NET/mediatypes/text/x-xpp$'
  XSL = '^https?://purl\\.org/NET/mediatypes/(application/xslfo\\+xml|text/xsl)$'
  XUL = '^https?://purl\\.org/NET/mediatypes/text/xul$'
  XYZ = '^https?://purl\\.org/NET/mediatypes/chemical/x-xyz$'
  YAML = '^https?://purl\\.org/NET/mediatypes/application/x-yaml$'
  ZGINML = '^https?://purl\\.org/NET/mediatypes/application/zginml\\+zip$'
  ZIP = '^https?://purl\\.org/NET/mediatypes/application/zip$'
  pharmML = '^https?://purl\\.org/NET/mediatypes/application/pharmml\\+xml$'

## biosimulators_utils.combine.exceptions module

Exceptions for COMBINE/OMEX archives

Author

  Jonathan Karr <karr@mssm.edu>

Date

  2021-01-12

Copyright

  2021, Center for Reproducible Biomedical Modeling

License

  MIT

exception biosimulators_utils.combine.exceptions.CombineArchiveExecutionError

  Bases: `biosimulators_utils.exceptions.BioSimulatorsException`

  Error that a SED document could not be executed

exception biosimulators_utils.combine.exceptions.NoSedmlError

  Bases: `biosimulators_utils.exceptions.BioSimulatorsException`

  Error that a COMBINE/OMEX archive does not contain any SED-ML files

## biosimulators_utils.combine.exec module

Utilities for executing tasks in SED-ML files in COMBINE/OMEX archives

Author

  Jonathan Karr <karr@mssm.edu>

Date

  2020-12-06

Copyright

  2020, Center for Reproducible Biomedical Modeling

License

  MIT

biosimulators_utils.combine.exec.exec_sedml_docs_in_archive(sed_doc_executer, archive_filename, out_dir, apply_xml_model_changes=False, sed_doc_executer_supported_features=(<class 'biosimulators_utils.sedml.data_model.Task'>, <class 'biosimulators_utils.sedml.data_model.Report'>, <class 'biosimulators_utils.sedml.data_model.DataSet'>, <class 'biosimulators_utils.sedml.data_model.Plot2D'>, <class 'biosimulators_utils.sedml.data_model.Curve'>, <class 'biosimulators_utils.sedml.data_model.Plot3D'>, <class 'biosimulators_utils.sedml.data_model.Surface'>), sed_doc_executer_logged_features=(<class 'biosimulators_utils.sedml.data_model.Task'>, <class 'biosimulators_utils.sedml.data_model.Report'>, <class 'biosimulators_utils.sedml.data_model.DataSet'>, <class 'biosimulators_utils.sedml.data_model.Plot2D'>, <class 'biosimulators_utils.sedml.data_model.Curve'>, <class 'biosimulators_utils.sedml.data_model.Plot3D'>, <class 'biosimulators_utils.sedml.data_model.Surface'>), log_level=StandardOutputErrorCapturerLevel.c, config=None)

  Execute the SED-ML files in a COMBINE/OMEX archive (execute tasks and save outputs)

  Parameters

    - sed_doc_executer (`types.FunctionType`) –

      function to execute each SED document in the archive. The function must implement the following interface:

          def sed_doc_executer(doc, working_dir, base_out_path, rel_out_path=None,
                       apply_xml_model_changes=False,
                       log=None, log_level=StandardOutputErrorCapturerLevel.c, indent=0, config=None):
              ''' Execute the tasks specified in a SED document and generate the specified outputs

              Args:
                  doc (:obj:`SedDocument` of :obj:`str`): SED document or a path to SED-ML file which defines a SED document
                  working_dir (:obj:`str`): working directory of the SED document (path relative to which models are located)

                  out_path (:obj:`str`): path to store the outputs

                      * CSV: directory in which to save outputs to files
                        ``{out_path}/{rel_out_path}/{report.id}.csv``
                      * HDF5: directory in which to save a single HDF5 file (``{out_path}/reports.h5``),
                        with reports at keys ``{rel_out_path}/{report.id}`` within the HDF5 file

                  rel_out_path (:obj:`str`, optional): path relative to :obj:`out_path` to store the outputs
                  apply_xml_model_changes (:obj:`bool`, optional): if :obj:`True`, apply any model changes specified in the SED-ML file
                  log (:obj:`SedDocumentLog`, optional): execution status of document
                  log_level (:obj:`StandardOutputErrorCapturerLevel`, optional): level at which to log output
                  indent (:obj:`int`, optional): degree to indent status messages
                  config (:obj:`Config`, optional): BioSimulators common configuration
              '''

    - archive_filename (`str`) – path to COMBINE/OMEX archive

    - out_dir (`str`) –

      path to store the outputs of the archive

      - CSV: directory in which to save outputs to files `{ out_dir }/{ relative-path-to-SED-ML-file-within-archive }/{ report.id }.csv`

      - HDF5: directory in which to save a single HDF5 file (`{ out_dir }/reports.h5`), with reports at keys `{ relative-path-to-SED-ML-file-within-archive }/{ report.id }` within the HDF5 file

    - apply_xml_model_changes (`bool`) – if `True`, apply any model changes specified in the SED-ML files before calling `task_executer`.

    - sed_doc_executer_supported_features (`list` of `type`, optional) – list of the types of elements that the SED document executer supports. Default: tasks, reports, plots, data sets, curves, and surfaces.

    - sed_doc_executer_logged_features (`list` of `type`, optional) – list of the types fo elements which that the SED document executer logs. Default: tasks, reports, plots, data sets, curves, and surfaces.

    - log_level (`StandardOutputErrorCapturerLevel`, optional) – level at which to log output

    - config (`Config`) – configuration

  Returns

    - `SedDocumentResults`: results

    - `CombineArchiveLog`: log

  Return type

    `tuple`

## biosimulators_utils.combine.io module

Utilities for reading and writing 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.combine.io.CombineArchiveReader

  Bases: `object`

  Reader for COMBINE/OMEX archives

  errors

    errors

    Type

      nested `list` of `str`

  warnings

    warnings

    Type

      nested `list` of `str`

  NONE_DATETIME = '2000-01-01T00:00:00Z'
  read_manifest(filename, archive_filename=None, config=None)

    Read the contents of an OMEX manifest file

    Parameters

      - filename (`str`) – path to OMEX manifest file

      - archive_filename (`str`, option) – path to COMBINE archive

      - config (`Config`, optional) – configuration

    Returns

      contents of the OMEX manifest file

    Return type

      `list` of `CombineArchiveContent`

  run(in_file, out_dir, include_omex_metadata_files=True, config=None)

    Read an archive from a file

    Parameters

      - in_file (`str`) – path to archive

      - out_dir (`str`) – directory where the contents of the archive should be unpacked

      - include_omex_metadata_files (`bool`, optional) – whether to include the OMEX metadata file as part of the contents of the archive

      - config (`Config`, optional) – configuration

    Returns

      description of archive

    Return type

      `CombineArchive`

    Raises

      ValueError – archive is invalid

class biosimulators_utils.combine.io.CombineArchiveWriter

  Bases: `object`

  Writer for COMBINE/OMEX archives

  errors

    errors

    Type

      nested `list` of `str`

  warnings

    warnings

    Type

      nested `list` of `str`

  run(archive, in_dir, out_file)

    Write an archive to a file

    Parameters

      - archive (`CombineArchive`) – description of archive

      - in_dir (`str`) – directory which contains the files in the archive

      - out_file (`str`) – path to save archive

    Raises

      AssertionError – if files could not be added to the archive or the archive could not be saved

  write_manifest(contents, filename)

    Write an OMEX manifest file

    Parameters

      - contents (`list` of `CombineArchiveContent`) – contents of a COMBINE/OMEX archive

      - filename (`str`) – path to OMEX manifest file

class biosimulators_utils.combine.io.CombineArchiveZipReader

  Bases: `object`

  Create a COMBINE/OMEX archive object from a plain zip archive. Set the format of files with the extension `.sedml` to `CombineArchiveContentFormat.SED_ML.value`.

  classmethod run(in_file, out_dir=None)

    Read an archive from a zip file

    Parameters

      - in_file (`str`) – path to archive

      - out_dir (`str`, optional) – directory where the contents of the archive should be unpacked

    Returns

      description of the archive

    Return type

      `CombineArchive`

    Raises

      ValueError – archive is invalid

## biosimulators_utils.combine.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

biosimulators_utils.combine.utils.get_sedml_contents(archive, include_all_sed_docs_when_no_sed_doc_is_master=True, always_include_all_sed_docs=False)

  Get the SED-ML files in an archive

  Parameters

    - archive (`CombineArchive`) – COMBINE/OMEX archive

    - include_all_sed_docs_when_no_sed_doc_is_master (`bool`, optional) – if `true` and no SED document has `master="true"`, return all SED documents.

    - always_include_all_sed_docs (`bool`, optional) – if `true`, return all SED documents, regardless of whether they have `master="true"` or not.

  Returns

    SED-ML files in a COMBINE/OMEX archive

  Return type

    `list` of `CombineArchiveContent`

biosimulators_utils.combine.utils.get_summary_sedml_contents(archive, archive_dir, include_all_sed_docs_when_no_sed_doc_is_master=True, always_include_all_sed_docs=False, config=None)

  Get a summary of the SED-ML content in a COMBINE/OMEX archive

  Parameters

    - archive (`CombineArchive`) – COMBINE/OMEX archive

    - archive_dir (`str`) – path where the content of the archive is located

    - include_all_sed_docs_when_no_sed_doc_is_master (`bool`, optional) – if `true` and no SED document has `master="true"`, return all SED documents.

    - always_include_all_sed_docs (`bool`, optional) – if `true`, return all SED documents, regardless of whether they have `master="true"` or not.

    - config (`Config`, optional) – whether to fail on missing includes

  Returns

    summary of the SED-ML content in a COMBINE/OMEX archive

  Return type

    `str`

## biosimulators_utils.combine.validation module

Methods for validating COMBINE archives

Author

  Jonathan Karr <karr@mssm.edu>

Date

  2021-04-16

Copyright

  2021, Center for Reproducible Biomedical Modeling

License

  MIT

biosimulators_utils.combine.validation.validate(archive, archive_dirname, include_all_sed_docs_when_no_sed_doc_is_master=True, always_include_all_sed_docs=False, formats_to_validate=[<CombineArchiveContentFormat.SED_ML: 'http://identifiers.org/combine.specifications/sed-ml'>], validate_models_with_languages=True, config=None)

  Validate a COMBINE/OMEX archive and the SED-ML and model documents it contains

  Parameters

    - archive (`CombineArchive`) – COMBINE/OMEX archive

    - archive_dirname (`str`) – directory with the content of the archive

    - include_all_sed_docs_when_no_sed_doc_is_master (`bool`, optional) – if `true` and no SED document has `master="true"`, return all SED documents.

    - always_include_all_sed_docs (`bool`, optional) – if `true`, return all SED documents, regardless of whether they have `master="true"` or not.

    - formats_to_validate (`list` of `CombineArchiveContentFormat`, optional) – list for formats of files to validate

    - validate_models_with_languages (`bool`, optional) – if `True`, validate models

    - config (`Config`, optional) – configuration

  Returns

    - nested `list` of `str`: nested list of errors with the archive

    - nested `list` of `str`: nested list of warnings with the archive

  Return type

    `tuple`

biosimulators_utils.combine.validation.validate_content(content, archive_dirname, formats_to_validate=[<CombineArchiveContentFormat.SED_ML: 'http://identifiers.org/combine.specifications/sed-ml'>], validate_models_with_languages=True, config=None)

  Validate an item of a COMBINE/OMEX archive

  Parameters

    - content (`CombineArchiveContent`) – item of a COMBINE/OMEX archive

    - archive_dirname (`str`) – directory with the content of the archive

    - formats_to_validate (`list` of `CombineArchiveContentFormat`, optional) – list for formats of files to validate

    - validate_models_with_languages (`bool`, optional) – if `True`, validate models

    - config (`Config`, optional) – configuration

  Returns

    - nested `list` of `str`: nested list of errors with the archive

    - nested `list` of `str`: nested list of warnings with the archive

  Return type

    `tuple`

biosimulators_utils.combine.validation.validate_format(format)

  Validate a COMBINE of an element of a COMBINE/OMEX archive

  Parameters

    format (`str`) – format

  Returns

    nested list of errors with the archive

  Return type

    nested `list` of `str`