Skip to content

Commit

Permalink
Merge pull request #122 from yaml2sbml-dev/develop
Browse files Browse the repository at this point in the history
Version 0.2.2
  • Loading branch information
jvanhoefer authored Mar 21, 2021
2 parents 8f3bd49 + d680fdc commit 6f42ee5
Show file tree
Hide file tree
Showing 23 changed files with 392 additions and 137 deletions.
44 changes: 25 additions & 19 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,26 @@
name: CI

on: [pull_request]
# trigger
on:
pull_request:
push:
branches:
- master

jobs:
base:
runs-on: ubuntu-latest
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
include:
- os: ubuntu-latest
path: ~/.cache/pip
- os: macos-latest
path: ~/Library/Caches/pip
- os: windows-latest
path: ~\AppData\Local\pip\Cache
python-version: [3.6, 3.9]
runs-on: ${{ matrix.os }}

steps:
- name: Check out repository
Expand All @@ -19,10 +32,10 @@ jobs:
python-version: ${{ matrix.python-version }}

- name: Cache
uses: actions/cache@v1
uses: actions/cache@v2
with:
path: ~/.cache/pip
key: ${{ runner.os }}-${{ matrix.python-version }}-ci-base
path: ${{ matrix.path }}
key: ci-base-${{ runner.os }}-${{ matrix.python-version }}

- name: Install tox
run: pip install tox
Expand Down Expand Up @@ -55,17 +68,14 @@ jobs:
uses: actions/cache@v1
with:
path: ~/.cache/pip
key: ${{ runner.os }}-${{ matrix.python-version }}-ci-notebooks
key: ci-notebooks-${{ runner.os }}-${{ matrix.python-version }}

- name: Install apt dependencies
run: |
.github/workflows/install_deps.sh amici
- name: Install tox
run: pip install tox
- name: Install dependencies
run: .github/workflows/install_deps.sh amici

- name: Test notebooks
run: tox -e notebooks
timeout-minutes: 60

doc:
runs-on: ubuntu-latest
Expand All @@ -86,14 +96,10 @@ jobs:
uses: actions/cache@v1
with:
path: ~/.cache/pip
key: ${{ runner.os }}-${{ matrix.python-version }}-ci-doc

- name: Install apt dependencies
run: |
.github/workflows/install_deps.sh doc
key: ci-doc-${{ runner.os }}-${{ matrix.python-version }}

- name: Install tox
run: pip install tox
- name: Install dependencies
run: .github/workflows/install_deps.sh doc

- name: Test documentation build
run: tox -e doc
Expand Down
8 changes: 7 additions & 1 deletion .github/workflows/install_deps.sh
Original file line number Diff line number Diff line change
@@ -1,12 +1,18 @@
#!/bin/sh

# Install tox
pip install tox

# Update apt package lists
sudo apt-get update

# iterate over optional dependencies
for par in "$@"; do
case $par in
amici)
# for amici
sudo apt-get install \
swig3.0 libatlas-base-dev libhdf5-serial-dev
swig libatlas-base-dev libhdf5-serial-dev
;;

doc)
Expand Down
72 changes: 30 additions & 42 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
__pycache__/
**/__pycache__/
*.egg-info/

# PyCharm
Expand All @@ -12,44 +12,44 @@ yaml2sbml/tests/test_yaml2sbml/sbml_test.xml

### Files generated when running the notebooks (AMICI + PEtab files)

## Lotka Volterra Python
./doc/examples/Lotka_Volterra/Lotka_Volterra_python/amici_models
./doc/examples/Lotka_Volterra/Lotka_Volterra_python/amici_models/*
**/amici_models/
**/AMICI_models/

./doc/examples/Lotka_Volterra/Lotka_Volterra_python/Lotka_Volterra_AMICI
./doc/examples/Lotka_Volterra/Lotka_Volterra_python/Lotka_Volterra_AMICI/*
## FSP examples

./doc/examples/Lotka_Volterra/Lotka_Volterra_python/Lotka_Volterra_basic.xml
/doc/examples/Finite_State_Projection/gene_expression.xml

./doc/examples/Lotka_Volterra/Lotka_Volterra_python/Lotka_Volterra_PEtab/*
!./doc/examples/Lotka_Volterra/Lotka_Volterra_python/Lotka_Volterra_PEtab/measurement_table.tsv
## Format Features

## Lotka Volterra CLI
./doc/examples/Lotka_Volterra/Lotka_Volterra_CLI/Lotka_Volterra_PEtab/*
./doc/examples/Lotka_Volterra/Lotka_Volterra_CLI/Lotka_Volterra_PEtab.yml
./doc/examples/Lotka_Volterra/Lotka_Volterra_CLI/Lotka_Volterra_PEtab/*.xml
/doc/examples/Format_Features/functions_in_rhs.xml
/doc/examples/Format_Features/step_function.xml
/doc/examples/Format_Features/time_dependent_rhs.xml

## Lotka Volterra Model Editor
./doc/examples/Lotka_Volterra/Lotka_Volterra_Model_Editor/*.yaml
./doc/examples/Lotka_Volterra/Lotka_Volterra_Model_Editor/*.xml
./doc/examples/Lotka_Volterra/Lotka_Volterra_Model_Editor/Lotka_Volterra_PEtab
## Lotka Volterra

## Sorensen example
./doc/examples/Sorensen/*.xml
./doc/examples/Sorensen/amici_models
/doc/examples/Lotka_Volterra/Lotka_Volterra_CLI/Lotka_Volterra_PEtab.yml
/doc/examples/Lotka_Volterra/Lotka_Volterra_CLI/Lotka_Volterra_PEtab/
/doc/examples/Lotka_Volterra/Lotka_Volterra_CLI/Lotka_Volterra_basic.xml

## FSP examples
./doc/examples/Finite_State_Projection/amici_models
./doc/examples/Finite_State_Projection/*.xml
/doc/examples/Lotka_Volterra/Lotka_Volterra_Model_Editor/Lotka_Volterra_PEtab.yaml
/doc/examples/Lotka_Volterra/Lotka_Volterra_Model_Editor/Lotka_Volterra_PEtab/
/doc/examples/Lotka_Volterra/Lotka_Volterra_Model_Editor/Lotka_Volterra_basic.xml
/doc/examples/Lotka_Volterra/Lotka_Volterra_Model_Editor/Lotka_Volterra_basic.yaml

## Format Features
/doc/examples/Lotka_Volterra/Lotka_Volterra_python/Lotka_Volterra_AMICI/
/doc/examples/Lotka_Volterra/Lotka_Volterra_python/Lotka_Volterra_PEtab/Lotka_Volterra_with_observables.xml
/doc/examples/Lotka_Volterra/Lotka_Volterra_python/Lotka_Volterra_PEtab/experimental_conditions_Lotka_Volterra_with_observables.tsv
/doc/examples/Lotka_Volterra/Lotka_Volterra_python/Lotka_Volterra_PEtab/observables_Lotka_Volterra_with_observables.tsv
/doc/examples/Lotka_Volterra/Lotka_Volterra_python/Lotka_Volterra_PEtab/parameters_Lotka_Volterra_with_observables.tsv
/doc/examples/Lotka_Volterra/Lotka_Volterra_python/Lotka_Volterra_PEtab/problem.yml
/doc/examples/Lotka_Volterra/Lotka_Volterra_python/Lotka_Volterra_basic.xml

./doc/examples/Format_Features/__pycache__
./doc/examples/Format_Features/AMICI_models
## Sorensen

./doc/examples/Format_Features/*.xml
/doc/examples/Sorensen/Fig71_Sorensen1985.xml

### JupyterNotebooks ###

# gitignore template for Jupyter Notebooks
# website: http://jupyter.org/

Expand Down Expand Up @@ -91,21 +91,9 @@ Network Trash Folder
Temporary Items
.apdisk

# Gradle and Maven with auto-import
# When using Gradle or Maven with auto-import, you should exclude module files,
# since they will be recreated, and may cause churn. Uncomment if using
# auto-import.
# .idea/artifacts
# .idea/compiler.xml
# .idea/jarRepositories.xml
# .idea/modules.xml
# .idea/*.iml
# .idea/modules
# *.iml
# *.ipr

# CMake
cmake-build-*/
# Build
/build/
/dist/

# File-based project format
*.iws
Expand Down
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
[![codecov](https://codecov.io/gh/yaml2sbml-dev/yaml2sbml/branch/master/graph/badge.svg)](https://codecov.io/gh/yaml2sbml-dev/yaml2sbml)
[![Documentation Status](https://readthedocs.org/projects/yaml2sbml/badge/?version=latest)](https://yaml2sbml.readthedocs.io/en/latest/?badge=latest)
[![Codacy Badge](https://app.codacy.com/project/badge/Grade/632acdc8d4ef4f50bf69892b8862fd24)](https://www.codacy.com/gh/yaml2sbml-dev/yaml2sbml/dashboard?utm_source=github.com&utm_medium=referral&utm_content=yaml2sbml-dev/yaml2sbml&utm_campaign=Badge_Grade)
[![PyPI](https://badge.fury.io/py/yaml2sbml.svg)](https://badge.fury.io/py/yaml2sbml)

## Table of contents

Expand All @@ -22,7 +23,7 @@

`yaml2sbml` is a small package in Python to convert an ODE model specified in a YAML file into
[**SBML**](http://www.sbml.org/) for ODE simulation and into
[**PEtab**](https://github.com/martamatos/yaml2sbml) for parameter fitting. `yaml2sbml` offers:
[**PEtab**](https://github.com/PEtab-dev/PEtab/) for parameter fitting. `yaml2sbml` offers:


* a translator of ODE models specified in YAML into SBML/PEtab via a Python and a command-line interface;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,9 @@
" \n",
" model.add_ode(state_id = f\"x_{r}_{p}\", \n",
" right_hand_side=rhs,\n",
" initial_value=poisson.pmf(r, lambda_r)*poisson.pmf(p, lambda_p))\n",
" #convert from np.float to float\n",
" initial_value=float(poisson.pmf(r, lambda_r)*poisson.pmf(p, lambda_p))\n",
" )\n",
"\n",
"model.write_to_sbml('gene_expression.xml', overwrite=True)"
]
Expand Down

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions doc/examples/Sorensen/yaml2sbml_Sorensen.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,9 @@
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.7.1"
},
"execution": {
"timeout": 3600
}
},
"nbformat": 4,
Expand Down
6 changes: 3 additions & 3 deletions doc/format_specification.rst
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ odes
Define **ODEs** (and states). An ODE consists of a `stateId` (string), a `rightHandSide` (string, encoding a mathematical expression), and an `initial value`. Initial values can be either numerical values or parameter Ids.

For a more detailed description of the parsing of mathematical expressions ( for `rightHandSide`) we refer to the [corresponding section](#parsing-of-mathematical-equations) of this documentation.
For a more detailed description of the parsing of mathematical expressions ( for `rightHandSide`) we refer to the :ref:`corresponding section<Parsing of mathematical equations>` of this documentation.



Expand Down Expand Up @@ -130,7 +130,7 @@ observables \[optional\]
Define **observables**. Observables are not part of the SBML standard. If the SBML is generated via the `yaml2sbml.yaml2sbml` command and the `observables_as_assignments` flag is set to `True`, observables are represented as assignments to parameters of the form observable_<observable_id>.
If the SBML is created via `yaml2sbml.yaml2petab`, observables are represented in the PEtab observables table. The entries are written to the corresponding columns of the PEtab observable table. According to the PEtab standard, an observable table can take the following entries: `observableId, observableName, observableFormula, observableTransformation, noiseFormula, noiseDistribution`.

For a detailed discussion see the `corresponding part of the PEtab documentation <https://github.com/PEtab-dev/PEtab/blob/master/doc/documentation_data_format.rst#observables-table>`_.
For a detailed discussion see the corresponding part of the PEtab documentation <https://github.com/PEtab-dev/PEtab/blob/master/doc/documentation_data_format.rst#observables-table>`_.



Expand All @@ -157,7 +157,7 @@ The "trivial condition table" (if only one setup exists) is generated by:
- conditionId: condition1
For a detailed discussion see the `corresponding part of the PEtab documentation <https://github.com/PEtab-dev/PEtab/blob/master/doc/documentation_data_format.rst#condition-table>`_.
For a detailed discussion see the corresponding part of the `PEtab documentation <https://github.com/PEtab-dev/PEtab/blob/master/doc/documentation_data_format.rst#condition-table>`_.



Expand Down
6 changes: 5 additions & 1 deletion doc/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,16 @@ yaml2sbml
.. image:: https://app.codacy.com/project/badge/Grade/632acdc8d4ef4f50bf69892b8862fd24
:target: https://www.codacy.com/gh/yaml2sbml-dev/yaml2sbml/dashboard?utm_source=github.com&amp;utm_medium=referral&amp;utm_content=yaml2sbml-dev/yaml2sbml&amp;utm_campaign=Badge_Grade
:alt: Code quality
.. image:: https://badge.fury.io/py/yaml2sbml.svg
:target: https://badge.fury.io/py/yaml2sbml
:alt: PyPI

:Release: |version|
:Source code: https://github.com/yaml2sbml-dev/yaml2sbml

.. image:: logo/logo_yaml2sbml_long.png
:alt: yaml2sbml logo
:align: center
:scale: 30 %

**yaml2sbml** allows the user to convert a system of ODEs specified in a YAML_
file to SBML_.
Expand All @@ -44,6 +46,8 @@ converted to PEtab_.

release_notes
license
log
logo
contact

.. toctree::
Expand Down
15 changes: 15 additions & 0 deletions doc/logo.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
Logo
====

.. image:: logo/logo_yaml2sbml_long.png
:alt: yaml2sbml logo
:align: center

yaml2sbml's logo can be found in multiple variants in the
`doc/logo <https://github.com/yaml2sbml-dev/yaml2sbml/tree/main/doc/logo>`_
folder, in svg and png format.
It is made available under a Creative Commons CC0 1.0 Universal (CC0 1.0)
license, with the terms given in `doc/logo/LICENSE.md <https://github.com/yaml2sbml-dev/yaml2sbml/blob/master/doc/logo/LICENSE.md>`_.
We encourage to use it e.g. in presentations and posters.

We thank Elba Raimúndez for her contributions to the logo design.
Loading

0 comments on commit 6f42ee5

Please sign in to comment.