eab2da81c65974e08b8245bbf8a052093f972df3,Pysb.py,Rule,__init__,#Rule#Any#Any#Any#Any#,287

Before Change



        if not all([isinstance(r, MonomerPattern) for r in reactants]):
            raise Exception("Reactants must all be MonomerPatterns")
        if not all([isinstance(p, MonomerPattern) for p in products]):
            raise Exception("Products must all be MonomerPatterns")
        if not isinstance(rate, Parameter):
            raise Exception("Rate must be a Parameter")

After Change



        // FIXME: This tuple thing is ugly (used to support >> and <> operators between ReactionPatterns).
        // This is how the reactant and product ReactionPatterns are passed, along with is_reversible.
        if not isinstance(reaction_pattern_set, tuple) and len(reaction_pattern_set) != 3:
            raise Exception("reaction_pattern_set must be a tuple of (ReactionPattern, ReactionPattern, Boolean)")

        try:
            reactant_pattern = as_reaction_pattern(reaction_pattern_set[0])
        except InvalidReactionPatternException as e:
            raise type(e)("Reactant does not look like a reaction pattern")

        try:
            product_pattern = as_reaction_pattern(reaction_pattern_set[1])
        except InvalidReactionPatternException as e:
            raise type(e)("Product does not look like a reaction pattern")

        self.is_reversible = reaction_pattern_set[2]

        if not isinstance(rate_forward, Parameter):
            raise Exception("Forward rate must be a Parameter")
        if self.is_reversible and not isinstance(rate_reverse, Parameter):
            raise Exception("Reverse rate must be a Parameter")

        self.reactant_pattern = reactant_pattern
        self.product_pattern = product_pattern
        self.rate_forward = rate_forward
        self.rate_reverse = rate_reverse
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 8

Instances


Project Name: pysb/pysb
Commit Name: eab2da81c65974e08b8245bbf8a052093f972df3
Time: 2009-08-09
Author: jmuhlich@bitflood.org
File Name: Pysb.py
Class Name: Rule
Method Name: __init__


Project Name: ContextLab/hypertools
Commit Name: 57341c920b62c30155a2dd36aa4ae6dd338a76c9
Time: 2017-05-31
Author: andrew.heusser@gmail.com
File Name: hypertools/plot/plot.py
Class Name:
Method Name: plot


Project Name: ContextLab/hypertools
Commit Name: 3e5f0e03cec31629d2a8db78751d80019aa629ce
Time: 2017-05-31
Author: andrew.heusser@gmail.com
File Name: hypertools/plot/plot.py
Class Name:
Method Name: plot