Beispiel #1
0
    def document(self, doc: libsbml.SBMLDocument) -> Dict[str, str]:
        """Info for SBMLDocument.

        :param doc: SBMLDocument
        :return: information dictionary for SBMLDocument
        """
        d = self.sbase_dict(doc)

        packages: Dict[str, Any] = {}
        packages["document"] = {
            "level": doc.getLevel(),
            "version": doc.getVersion()
        }

        plugins: List[Dict[str, Any]] = []
        for k in range(doc.getNumPlugins()):
            plugin: libsbml.SBMLDocumentPlugin = doc.getPlugin(k)
            prefix: str = plugin.getPrefix()
            version: int = plugin.getPackageVersion()
            plugins.append({"prefix": prefix, "version": version})

        packages["plugins"] = plugins

        d["packages"] = packages
        return d
Beispiel #2
0
    def info_document(self, doc: libsbml.SBMLDocument) -> Dict[str, str]:
        """Info dictionary for SBaseRef.

        :param doc: SBMLDocument
        :return: information dictionary for SBMLDocument
        """
        info = self.info_sbase(doc)
        packages = [
            f'<span class="package">L{doc.getLevel()}V{doc.getVersion()}</span>'
        ]

        for k in range(doc.getNumPlugins()):
            plugin = doc.getPlugin(k)
            prefix = plugin.getPrefix()
            version = plugin.getPackageVersion()
            packages.append(
                f'<span class="package">{prefix}-V{version}</span>')
        info["packages"] = " ".join(packages)
        return info