How to use the pysces.PyscesStoich.Stoich function in pysces

To help you get started, we’ve selected a few pysces examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github PySCeS / pysces / pysces / PyscesMiniModel.py View on Github external
def Stoichiometry_Init(self,nmatrix):
        """
        Stoichiometry_Init(nmatrix,load=0)

        Initialize the model stoichiometry. Given a stoichiometric matrix N, this method will return an instantiated PyscesStoich instance and status flag.
        and test it's correctness. The status flag indicates 0 = reanalyse stoichiometry or
        1 = complete structural analysis preloaded.

        Arguments:

        nmatrix: The input stoichiometric matrix, N
        load [default=0]: try to load a saved stoichiometry (1)

        """
        #print 'Instantiating new stoichiometry ...'
        stc = PyscesStoich.Stoich(nmatrix)
        status = 0
        return stc,status
github PySCeS / pysces / pysces / core2 / PyscesCore2Modules.py View on Github external
this distribution for specifics.

NO WARRANTY IS EXPRESSED OR IMPLIED.  USE AT YOUR OWN RISK.
Brett G. Olivier
"""
from __future__ import division, print_function
from __future__ import absolute_import
from __future__ import unicode_literals

from .version import __version__

# Structural Analysis module
from pysces.PyscesStoich import Stoich
from .PyscesCore2 import StructMatrix

class PyscesEnhancedStoich(Stoich):
    """PySCeS stoichiometry class for use with core2"""
    N = None
    Nr = None
    K = None
    K0 = None
    L = None
    L0 = None
    Gamma = None

    def __init__(self, core):
        Stoich.__init__(self, core.stoichiometric_matrix.array)
        self.species = core.stoichiometric_matrix.row
        self.reactions = core.stoichiometric_matrix.col

    def getNullSpaces(self):
        self.AnalyseK()
github PySCeS / pysces / pysces / PyscesStoich.py View on Github external
print('\nLzeromatrix:')
        sm,bg = self.MatrixValueCompare(self.lzeromatrix)
        print('Smallest value:  ', abs(sm))
        print('Largest value:   ', abs(bg))
        print('Ratio abs(bg/sm):', abs(bg/sm))

        print('\nPlease note: I\'ve found that for larger models the rank calculated by SVD in this test can become unstable and give incorrect results.')
        print(' ')

        if resultback:
            return u,s,vh


if __psyco_active__:
    psyco.bind(MathArrayFunc)
    psyco.bind(Stoich)
github PySCeS / pysces / pysces / core2 / PyscesCore2Modules.py View on Github external
def __init__(self, core):
        Stoich.__init__(self, core.stoichiometric_matrix.array)
        self.species = core.stoichiometric_matrix.row
        self.reactions = core.stoichiometric_matrix.col