Skip to content

Commit

Permalink
zenodo information added
Browse files Browse the repository at this point in the history
  • Loading branch information
matthiaskoenig committed Sep 27, 2021
1 parent 86a7f9f commit 788dc89
Show file tree
Hide file tree
Showing 23 changed files with 161 additions and 106 deletions.
31 changes: 31 additions & 0 deletions .zenodo.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
{
"upload_type": "software",
"title": "sbmlsim: SBML simulation made easy",
"creators": [
{
"orcid": "0000-0003-1725-179X",
"affiliation": "Humboldt-University Berlin, Institute for Theoretical Biology, Berlin",
"name": "König, Matthias"
}
],
"description": "<p><code>sbmlsim</code> is a collection of python utilities to simplify simulations with <a href=\"http://www.sbml.org\">SBML</a> models implemented on top of <code><a href=\"http://libroadrunner.org/\">roadrunner</a></code> and other libraries with source code available from <a href=\"https://github.com/matthiaskoenig/sbmlsim\">https://github.com/matthiaskoenig/sbmlsim</a></p>\n<p>Features include among others<ul><li>simulation experiments</li><li>simulation reports</a></li><li>parameter fitting</li></ul></p>\n<p>The documentation is available on <a href=\"https://sbmlsim.readthedocs.io\">https://sbmlsim.readthedocs.io</a></p>\n<p>If you have any questions or issues please <a href=\"https://github.com/matthiaskoenig/sbmlsim/issues\">open an issue</a></p>\n<h2>Funding</h2><p>Matthias König is supported by the Federal Ministry of Education and Research (BMBF, Germany) within the research network Systems Medicine of the Liver (<strong>LiSyM</strong>, grant number 031L0054) and by the German Research Foundation (DFG) within the Research Unit Programme FOR 5151 <strong><a href=\"https://qualiperf.de\">QuaLiPerF</a></strong> (Quantifying Liver Perfusion-Function Relationship in Complex Resection - A Systems Medicine Approach)\" by grant number 436883643. Matthias König has received funds from the EOSCsecretariat.eu which has received funding from the European Union's Horizon Programme call H2020-INFRAEOSC-05-2018-2019, grant Agreement number 831644.</p>",
"access_right": "open",
"license": "LGPL-3.0",
"keywords": [
"modeling",
"standardization",
"SBML",
"SED-ML",
"COMBINE"
],
"communities": [
{
"identifier": "eoscsecretariat"
}
],
"grants": [
{
"id": "831644"
}
]
}
2 changes: 1 addition & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ sbmlsim: SBML simulation made easy
:alt: Black


sbmlsim is a collection of python utilities to to simplify simulations with
sbmlsim is a collection of python utilities to simplify simulations with
`SBML <http://www.sbml.org>`__ models implemented on top of
`roadrunner <http://libroadrunner.org/>`__. Source code is available from
`https://github.com/matthiaskoenig/sbmlsim <https://github.com/matthiaskoenig/sbmlsim>`__.
Expand Down
3 changes: 3 additions & 0 deletions release-notes/0.2.1.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Release notes for sbmlsim 0.2.1
- bugfix release
- zenodo information for EOSC
7 changes: 5 additions & 2 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -30,23 +30,26 @@ classifiers =
Operating System :: OS Independent
Programming Language :: Python :: 3.7
Programming Language :: Python :: 3.8
Programming Language :: Python :: 3.9
Programming Language :: Python :: Implementation :: CPython
Topic :: Scientific/Engineering
Topic :: Scientific/Engineering :: Bio-Informatics
license = LGPL-3.0
description = sbmlsim are utilities for simulation of SBML.
description = sbmlsim are utilities for the simulation of SBML models.
long_description = file: README.rst
long_description_content_type = text/x-rst
keywords =
modeling
standardization
SBML
SED-ML
COMBINE

[options]
zip_safe = True
python_requires = >=3.7
install_requires =
sbmlutils>=0.5.1
sbmlutils>=0.5.4
numpy>=1.21
depinfo>=0.1.7
scipy>=1.7
Expand Down
2 changes: 1 addition & 1 deletion src/sbmlsim/combine/mathml.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ def expr_from_formula(formula: str):


def evaluate(astnode: libsbml.ASTNode, variables: Dict):
"""Evaluate the astnode with values """
"""Evaluate the astnode with values"""
expr = parse_astnode(astnode)
f = lambdify(args=list(expr.free_symbols), expr=expr)
res = f(**variables)
Expand Down
2 changes: 1 addition & 1 deletion src/sbmlsim/combine/omex.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ def __init__(


class Entry:
""" Helper class to store content to create an OmexEntry."""
"""Helper class to store content to create an OmexEntry."""

def __init__(
self,
Expand Down
2 changes: 1 addition & 1 deletion src/sbmlsim/combine/sedml/data.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@


class DataDescriptionParser(object):
""" Class for parsing DataDescriptions. """
"""Class for parsing DataDescriptions."""

FORMAT_URN = "urn:sedml:format:"
FORMAT_NUML = "urn:sedml:format:numl"
Expand Down
2 changes: 1 addition & 1 deletion src/sbmlsim/combine/sedml/kisao.py
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ def integrator_from_kisao(kisao):


def algorithm_parameter_to_parameter_key(par):
""" Resolve the mapping between parameter keys and roadrunner integrator keys."""
"""Resolve the mapping between parameter keys and roadrunner integrator keys."""
ParameterKey = namedtuple("ParameterKey", "key value dtype")
kisao = par.getKisaoID()
value = par.getValue()
Expand Down
35 changes: 14 additions & 21 deletions src/sbmlsim/combine/sedml/parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@
import warnings
from collections import OrderedDict, namedtuple
from pathlib import Path
from typing import Dict, List, Union, Optional
from typing import Dict, List, Optional, Union

import libsedml
import numpy as np
Expand All @@ -106,12 +106,12 @@
from sbmlsim.combine.sedml.io import read_sedml
from sbmlsim.combine.sedml.kisao import is_supported_algorithm_for_simulation_type
from sbmlsim.combine.sedml.task import Stack, TaskNode, TaskTree
from sbmlsim.data import DataSet, Data
from sbmlsim.data import Data, DataSet
from sbmlsim.experiment import ExperimentDict, SimulationExperiment
from sbmlsim.model import model_resources
from sbmlsim.model.model import AbstractModel
from sbmlsim.plot import Figure, Plot, Axis, Curve
from sbmlsim.simulation import ScanSim, TimecourseSim, Timecourse, AbstractSim
from sbmlsim.plot import Axis, Curve, Figure, Plot
from sbmlsim.simulation import AbstractSim, ScanSim, Timecourse, TimecourseSim
from sbmlsim.task import Task
from sbmlsim.units import UnitRegistry

Expand Down Expand Up @@ -139,7 +139,7 @@ def experiment_from_omex(omex_path: Path):


class SEDMLParser(object):
""" Parsing SED-ML in internal format."""
"""Parsing SED-ML in internal format."""

def __init__(self, sed_doc: libsedml.SedDocument, working_dir: Path):
"""Parses information from SedDocument."""
Expand Down Expand Up @@ -255,7 +255,6 @@ def f_figures(obj) -> Dict[str, Figure]:
curve.y._register_data()
# FIXME: also for xerr and yerr


# --- MODELS ---
@staticmethod
def parse_xpath_target(xpath: str) -> str:
Expand Down Expand Up @@ -431,7 +430,7 @@ def parse_change(self, sed_change: libsedml.SedChange) -> Dict:
return {}

def parse_simulation(self, sed_sim: libsedml.SedSimulation) -> Union[TimecourseSim]:
""" Parse simulation information."""
"""Parse simulation information."""
sim_type = sed_sim.getTypeCode()
algorithm = sed_sim.getAlgorithm()
if algorithm is None:
Expand Down Expand Up @@ -466,10 +465,10 @@ def parse_simulation(self, sed_sim: libsedml.SedSimulation) -> Union[TimecourseS
Timecourse(
start=initial_time,
end=output_end_time,
steps=number_of_points-1,
steps=number_of_points - 1,
),
],
time_offset=output_start_time
time_offset=output_start_time,
)
return tcsim

Expand All @@ -492,7 +491,7 @@ def parse_simulation(self, sed_sim: libsedml.SedSimulation) -> Union[TimecourseS
# TODO/FIXME: handle all the algorithm parameters as integrator parameters

def parse_task(self, sed_task: libsedml.SedAbstractTask) -> Task:
""" Parse arbitrary task (repeated or simple, or simple repeated)."""
"""Parse arbitrary task (repeated or simple, or simple repeated)."""
# If no DataGenerator references the task, no execution is necessary
dgs = self.data_generators_for_task(sed_task)
if len(dgs) == 0:
Expand Down Expand Up @@ -569,13 +568,11 @@ def _parse_simple_repeated_task(self, node: TaskNode):
# forLines.append("{}.extend({})".format(task.getId(), t.getId()))

def parse_figure(self, sed_output: libsedml.SedOutput) -> Figure:
""" Parse simulation information."""
"""Parse simulation information."""
type_code = sed_output.getTypeCode()
if type_code == libsedml.SEDML_OUTPUT_PLOT2D:
sed_plot2d: libsedml.SedPlot = sed_output
plots = [
self.parse_plot2d(sed_plot2d)
]
plots = [self.parse_plot2d(sed_plot2d)]
f = Figure(
experiment=None,
sid=sed_plot2d.getId(),
Expand Down Expand Up @@ -657,11 +654,7 @@ def data_from_datagenerator(self, sed_dg_ref: Optional[str]) -> Optional[Data]:
elif sed_var.isSetTarget():
index = self.parse_xpath_target(sed_var.getTarget())

return Data(
experiment=self.exp_class,
index=index,
task=task_id
)
return Data(experiment=self.exp_class, index=index, task=task_id)

def _parse_repeated_task(self, node: TaskNode):
print("repeated task")
Expand All @@ -673,7 +666,7 @@ def data_generators_for_task(
self,
sed_task: libsedml.SedTask,
) -> List[libsedml.SedDataGenerator]:
""" Get the DataGenerators which reference the given task."""
"""Get the DataGenerators which reference the given task."""
sed_dgs = []
for (
sed_dg
Expand Down Expand Up @@ -711,7 +704,7 @@ def selections_for_task(self, sed_task: libsedml.SedTask):

@staticmethod
def get_ordered_subtasks(sed_task: libsedml.SedTask) -> List[libsedml.SedTask]:
""" Ordered list of subtasks for task."""
"""Ordered list of subtasks for task."""
subtasks = sed_task.getListOfSubTasks()
subtask_order = [st.getOrder() for st in subtasks]

Expand Down
8 changes: 4 additions & 4 deletions src/sbmlsim/combine/sedml/task.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@


class TaskNode(object):
"""Tree implementation of task tree. """
"""Tree implementation of task tree."""

def __init__(self, task: libsedml.SedAbstractTask, depth: int):
self.task = task
Expand All @@ -28,7 +28,7 @@ def info(self) -> str:
return f"<[{self.depth}] {self.task.getId()} ({self.task.getElementName()})>"

def __iter__(self):
""" Depth-first iterator which yields TaskNodes."""
"""Depth-first iterator which yields TaskNodes."""
yield self
for child in self.children:
for node in child:
Expand All @@ -39,7 +39,7 @@ def __repr__(self) -> str:


class Stack(object):
""" Stack implementation for nodes."""
"""Stack implementation for nodes."""

def __init__(self):
self.items = []
Expand Down Expand Up @@ -99,7 +99,7 @@ def add_children(node):

@staticmethod
def parse_task_tree(doc: libsedml.SedDocument, tree: TaskNode):
""" Python code generation from task tree. """
"""Python code generation from task tree."""


class Test(object):
Expand Down
22 changes: 11 additions & 11 deletions src/sbmlsim/combine/sedml/tesedml.py
Original file line number Diff line number Diff line change
Expand Up @@ -410,7 +410,7 @@ def executeCombineArchive(


class SEDMLCodeFactory(object):
""" Code Factory generating executable code."""
"""Code Factory generating executable code."""

# template location
TEMPLATE_DIR = os.path.join(os.path.dirname(os.path.abspath(__file__)), "templates")
Expand Down Expand Up @@ -748,7 +748,7 @@ def taskToPython(doc, task):
return SEDMLCodeFactory.taskTreeToPython(doc, tree=taskTree)

class TaskNode(object):
""" Tree implementation of task tree. """
"""Tree implementation of task tree."""

def __init__(self, task, depth):
self.task = task
Expand Down Expand Up @@ -780,14 +780,14 @@ def info(self):
)

def __iter__(self):
""" Depth-first iterator which yields TaskNodes."""
"""Depth-first iterator which yields TaskNodes."""
yield self
for child in self.children:
for node in child:
yield node

class Stack(object):
""" Stack implementation for nodes."""
"""Stack implementation for nodes."""

def __init__(self):
self.items = []
Expand Down Expand Up @@ -843,7 +843,7 @@ def add_children(node):

@staticmethod
def getOrderedSubtasks(task):
""" Ordered list of subtasks for task."""
"""Ordered list of subtasks for task."""
subtasks = task.getListOfSubTasks()
subtaskOrder = [st.getOrder() for st in subtasks]
# sort by order, if all subtasks have order (not required)
Expand All @@ -853,7 +853,7 @@ def getOrderedSubtasks(task):

@staticmethod
def taskTreeToPython(doc, tree):
""" Python code generation from task tree. """
"""Python code generation from task tree."""

# go forward through task tree
lines = []
Expand Down Expand Up @@ -1424,7 +1424,7 @@ def getIntegratorNameForKisaoID(kid):

@staticmethod
def algorithmParameterToParameterKey(par):
""" Resolve the mapping between parameter keys and roadrunner integrator keys."""
"""Resolve the mapping between parameter keys and roadrunner integrator keys."""
ParameterKey = namedtuple("ParameterKey", "key value dtype")
kid = par.getKisaoID()
value = par.getValue()
Expand Down Expand Up @@ -1672,7 +1672,7 @@ def dataGeneratorToPython(doc, generator):
return "\n".join(lines)

def outputToPython(self, doc, output):
""" Create output """
"""Create output"""
lines = []
typeCode = output.getTypeCode()
if typeCode == libsedml.SEDML_OUTPUT_REPORT:
Expand Down Expand Up @@ -2019,7 +2019,7 @@ def outputPlot3DToPython(self, doc, output):

##################################################################################################
class SEDMLTools(object):
""" Helper functions to work with sedml. """
"""Helper functions to work with sedml."""

INPUT_TYPE_STR = "SEDML_STRING"
INPUT_TYPE_FILE_SEDML = "SEDML_FILE"
Expand Down Expand Up @@ -2227,7 +2227,7 @@ def terminate_trace(trace):


def fix_endpoints(x, y, color, tag, fig):
""" Adds endpoint markers wherever there is a discontinuity in the data."""
"""Adds endpoint markers wherever there is a discontinuity in the data."""
warnings.warn("don't use this", DeprecationWarning)
# expect x and y to be 1d
if len(x.shape) > 1:
Expand Down Expand Up @@ -2287,7 +2287,7 @@ def fix_endpoints(x, y, color, tag, fig):
from tellurium.tests.testdata import OMEX_TEST_DIR, SEDML_TEST_DIR

def testInput(sedmlInput):
""" Test function run on inputStr. """
"""Test function run on inputStr."""
print("\n", "*" * 100)
print(sedmlInput)
print("*" * 100)
Expand Down
4 changes: 3 additions & 1 deletion src/sbmlsim/data.py
Original file line number Diff line number Diff line change
Expand Up @@ -369,7 +369,9 @@ def from_df(
if f"mean_{err_key}" in df.columns:
# remove existing mean_sd column
del df[f"mean_{err_key}"]
logger.warning(f"Removing existing column: `mean_{err_key}`from DataSet.")
logger.warning(
f"Removing existing column: `mean_{err_key}`from DataSet."
)

df.rename(
columns={f"{err_key}": f"mean_{err_key}"},
Expand Down
2 changes: 1 addition & 1 deletion src/sbmlsim/examples/example_timecourse.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@


def run_timecourse_examples():
""" Run various timecourses. """
"""Run various timecourses."""
simulator = Simulator(MODEL_REPRESSILATOR)

# 1. simple timecourse simulation
Expand Down
2 changes: 1 addition & 1 deletion src/sbmlsim/examples/example_units.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@


def run_demo_example():
""" Run various timecourses. """
"""Run various timecourses."""
simulator = Simulator(MODEL_DEMO)
# build quantities using the unit registry for the model
Q_ = simulator.Q_
Expand Down

0 comments on commit 788dc89

Please sign in to comment.