9ae556a817f4b972d8c3b678db96e712f814470f,brian2/units/fundamentalunits.py,Quantity,__add__,#Quantity#Any#,1094

Before Change


            return NotImplemented

    def __add__(self, other):
        if isinstance(other, np.ndarray) or is_scalar_type(other):
            fail_for_dimension_mismatch(self, other, "Addition")
            return Quantity.with_dimensions(np.asarray(self)+np.asarray(other),
                                            self.dim)
        else:
            return NotImplemented

    def __radd__(self, other):
        return self.__add__(other)

    def __iadd__(self, other):

After Change


    def __mod__(self, other):
        return self._binary_operation(other, operator.mod, fail_for_mismatch=True, message="Modulo")

    def __add__(self, other):
        return self._binary_operation(other, operator.add, fail_for_mismatch=True, message="Addition")

    def __radd__(self, other):
        return self.__add__(other)
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 16

Instances


Project Name: brian-team/brian2
Commit Name: 9ae556a817f4b972d8c3b678db96e712f814470f
Time: 2012-11-29
Author: marcel.stimberg@ens.fr
File Name: brian2/units/fundamentalunits.py
Class Name: Quantity
Method Name: __add__


Project Name: brian-team/brian2
Commit Name: 9ae556a817f4b972d8c3b678db96e712f814470f
Time: 2012-11-29
Author: marcel.stimberg@ens.fr
File Name: brian2/units/fundamentalunits.py
Class Name: Quantity
Method Name: __mod__


Project Name: brian-team/brian2
Commit Name: 9ae556a817f4b972d8c3b678db96e712f814470f
Time: 2012-11-29
Author: marcel.stimberg@ens.fr
File Name: brian2/units/fundamentalunits.py
Class Name: Quantity
Method Name: __sub__


Project Name: brian-team/brian2
Commit Name: 9ae556a817f4b972d8c3b678db96e712f814470f
Time: 2012-11-29
Author: marcel.stimberg@ens.fr
File Name: brian2/units/fundamentalunits.py
Class Name: Quantity
Method Name: __add__