pysb / pysb

@@ -807,7 +807,7 @@
Loading
807 807
                    site_name, condition = ss, None
808 808
                site_conditions[site_name].append(condition)
809 809
810 -
        site_conditions = {k: v[0] if len(v) == 1 else tuple(v)
810 +
        site_conditions = {k: v[0] if len(v) == 1 else pysb.core.MultiState(*v)
811 811
                           for k, v in site_conditions.items()}
812 812
        monomer = model.monomers[monomer_name]
813 813
        monomer_compartment = model.compartments.get(monomer_compartment_name)

@@ -1,5 +1,6 @@
Loading
1 1
from pysb.testing import *
2 2
from pysb import *
3 +
from pysb.core import as_complex_pattern
3 4
from pysb.bng import *
4 5
import os
5 6
import unittest
@@ -218,6 +219,42 @@
Loading
218 219
    assert num_non_zeros == 0
219 220
220 221
222 +
@with_model
223 +
def test_multistate():
224 +
    Monomer('A', ['a', 'a'], {'a': ['u', 'p']})
225 +
    Parameter('k1', 100)
226 +
    Parameter('A_0', 200)
227 +
    Rule('r1', None >> A(a=MultiState('u', 'p')), k1)
228 +
    Initial(A(a=MultiState(('u', 1), 'p')) %
229 +
            A(a=MultiState(('u', 1), 'u')), A_0)
230 +
231 +
    generate_equations(model)
232 +
233 +
    assert model.species[0].is_equivalent_to(
234 +
        A(a=MultiState(('u', 1), 'p')) % A(a=MultiState(('u', 1), 'u')))
235 +
    assert model.species[1].is_equivalent_to(
236 +
        as_complex_pattern(A(a=MultiState('u', 'p'))))
237 +
238 +
239 +
@with_model
240 +
def test_multibonds():
241 +
    Monomer('A', ['a'])
242 +
    Monomer('B', ['b'])
243 +
    Parameter('k1', 100)
244 +
    Parameter('A_0', 200)
245 +
    Parameter('B_0', 50)
246 +
    Rule('r1', A(a=None) + A(a=None) + B(b=None) >>
247 +
            A(a=1) % A(a=[1, 2]) % B(b=2), k1)
248 +
    Initial(A(a=None), A_0)
249 +
    Initial(B(b=None), B_0)
250 +
251 +
    generate_equations(model)
252 +
253 +
    assert model.species[2].is_equivalent_to(
254 +
        A(a=1) % A(a=[1, 2]) % B(b=2)
255 +
    )
256 +
257 +
221 258
def _bng_print(expr):
222 259
    return BngPrinter(order='none').doprint(expr)
223 260
Files Coverage
pysb 79.45%
Project Totals (96 files) 79.45%
933.3
TRAVIS_PYTHON_VERSION=3.6
TRAVIS_OS_NAME=linux
933.2
TRAVIS_PYTHON_VERSION=3.6
TRAVIS_OS_NAME=linux
933.1
TRAVIS_PYTHON_VERSION=3.6
TRAVIS_OS_NAME=linux

No yaml found.

Create your codecov.yml to customize your Codecov experience

Sunburst
The inner-most circle is the entire project, moving away from the center are folders then, finally, a single file. The size and color of each slice is representing the number of statements and the coverage, respectively.
Icicle
The top section represents the entire project. Proceeding with folders and finally individual files. The size and color of each slice is representing the number of statements and the coverage, respectively.
Grid
Each block represents a single file in the project. The size and color of each block is represented by the number of statements and the coverage, respectively.
Loading