1762cd0d2a62f55693774d655b0ae367008d7e2d,brian2/units/fundamentalunits.py,Quantity,prod,#Quantity#,1149

Before Change


        if not self.is_dimensionless():
            raise NotImplementedError("Product over array elements on quantities "
                                    "with dimensions is not implemented.")
        return Quantity(np.asarray(self).prod(*args, **kwds))

    def cumprod(self, *args, **kwds):
        if not self.is_dimensionless():
            raise NotImplementedError("Product over array elements on quantities "

After Change


        dim_exponent = np.ones_like(self).sum(*args, **kwds)
        // The result is possibly multidimensional but all entries should be
        // identical
        if dim_exponent.size > 1:
            dim_exponent = dim_exponent[0]
        return Quantity.with_dimensions(prod_result, self.dim ** dim_exponent)
    prod.__doc__ = np.ndarray.prod.__doc__        

    def cumprod(self, *args, **kwds):
        if not self.is_dimensionless():
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 5

Instances


Project Name: brian-team/brian2
Commit Name: 1762cd0d2a62f55693774d655b0ae367008d7e2d
Time: 2012-09-12
Author: marcel.stimberg@ens.fr
File Name: brian2/units/fundamentalunits.py
Class Name: Quantity
Method Name: prod


Project Name: brian-team/brian2
Commit Name: 4fc2fed2a6e3da28de4d77b4e3917952a0dfa562
Time: 2013-08-12
Author: marcel.stimberg@ens.fr
File Name: brian2/core/variables.py
Class Name: VariableView
Method Name: __repr__


Project Name: brian-team/brian2
Commit Name: fbabf9f5f90954bc9bffc79c822577d8d8fda143
Time: 2015-10-08
Author: marcel.stimberg@ens.fr
File Name: brian2/units/unitsafefunctions.py
Class Name:
Method Name: linspace