ae51454c8dd6a76768d6a87589a80f75b1bfda49,brian2/equations/equations.py,Equations,check_units,#Equations#Any#Any#Any#,678

Before Change


        // Create a mapping with all identifier names to either their actual
        // value (for external identifiers) or their unit (for specifiers)
        unit_namespace = {}
        for name in self.identifiers | self.names:
            if name in specifiers:
                unit_namespace[name] = specifiers[name].unit
            else:
                // This raises an error if the identifier cannot be resolved
                unit_namespace[name] = namespace.resolve(name,
                                                         additional_namespace)

        for var, eq in self._equations.iteritems():
            if eq.eq_type == PARAMETER:
                // no need to check units for parameters
                continue

After Change


        DimensionMismatchError
            In case of any inconsistencies.
        """
        external = frozenset().union(*[expr.identifiers
                                     for _, expr in self.eq_expressions])
        external -= set(specifiers.keys()) 

        resolved_namespace = namespace.resolve_all(external,
                                                   additional_namespace,
                                                   strip_units=False) 

        for var, eq in self._equations.iteritems():
            if eq.eq_type == PARAMETER:
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 4

Instances


Project Name: brian-team/brian2
Commit Name: ae51454c8dd6a76768d6a87589a80f75b1bfda49
Time: 2013-05-03
Author: marcel.stimberg@ens.fr
File Name: brian2/equations/equations.py
Class Name: Equations
Method Name: check_units


Project Name: Featuretools/featuretools
Commit Name: c583ff130f7c37ad2e4077e82d7d61bf0d2ef6cf
Time: 2019-07-25
Author: chrisstadler@gmail.com
File Name: featuretools/tests/synthesis/test_deep_feature_synthesis.py
Class Name:
Method Name: test_commutative


Project Name: dit/dit
Commit Name: 146f5ddd1ac881fbebdeff83c0be0322bf7e1d74
Time: 2013-09-27
Author: chebee7i@gmail.com
File Name: dit/math/sigmaalgebra.py
Class Name:
Method Name: is_sigma_algebra__brute