a1a0d2e3010f8ade39317709a684bd431d5eef3c,brian2/units/fundamentalunits.py,UnitRegistry,__getitem__,#UnitRegistry#Any#,2037

Before Change


        floatreps = np.tile(x_flat, (len(matching), 1)).T / matching_values
        good_reps = np.sum((np.abs(floatreps) >= 0.1) & (np.abs(floatreps) < 1000),
                           axis=0)
        if any(good_reps):
            return matching[good_reps.argmax()]
        else:
            return matching[0]

def register_new_unit(u):
    Register a new unit for automatic displaying of quantities

    Parameters

After Change


        floatreps = np.tile(np.abs(x_flat), (len(matching), 1)).T / matching_values
        // ignore zeros, they are well represented in any unit
        floatreps[floatreps == 0] = np.nan
        if np.all(np.isnan(floatreps)):
            return matching[0]  // all zeros, use the base unit

        deviations = np.nansum((np.log10(floatreps) - 1)**2, axis=0)
        return matching[deviations.argmin()]

def register_new_unit(u):
    Register a new unit for automatic displaying of quantities
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 4

Instances


Project Name: brian-team/brian2
Commit Name: a1a0d2e3010f8ade39317709a684bd431d5eef3c
Time: 2014-10-02
Author: marcel.stimberg@ens.fr
File Name: brian2/units/fundamentalunits.py
Class Name: UnitRegistry
Method Name: __getitem__


Project Name: bashtage/linearmodels
Commit Name: 34e7e918bd4fc09f643e8bb448e875a9bcb7e841
Time: 2017-03-29
Author: kevin.k.sheppard@gmail.com
File Name: linearmodels/panel/data.py
Class Name: PanelData
Method Name: demean


Project Name: biolab/orange3
Commit Name: 8a76580ec839cf6fff9364ff1f4794e86834cbe6
Time: 2016-07-15
Author: niko.colneric@gmail.com
File Name: Orange/statistics/util.py
Class Name:
Method Name: stats