cc410f68b6c1d1417322ec02e22ea7713ca0bc48,trackpy/locate_functions/brightfield_ring.py,,locate_brightfield_ring,#,18

Before Change


        return coords_df

    refined = {}
    for i, coords in coords_df.iterrows():
        positions = coords[pos_columns]
        result = refine_brightfield_ring(image, radius, positions,
                                         pos_columns=pos_columns, **kwargs)
        if result is None:
            if has_user_input:
                warnings.warn(("Lost particle {:d} (x={:.0f}, y={:.0f})" +
                               " after refinement.").format(i, coords["x"],
                                                            coords["y"]))
            continue

        // Make a copy of old coords and overwrite with result
        // In this way any extra columns from previous_coords are preserved
        new_coords = coords.copy()
        for column in result.index.tolist():
            // make a new column if necessary, otherwise overwrite
            new_coords[column] = result.get(column)
        refined[i] = new_coords

    columns = np.unique(np.concatenate((pos_columns, ["r"], coords_df.columns)))
    if len(refined) == 0:
        warnings.warn("No particles found in the image after refinement.")
        return DataFrame(columns=columns)

After Change


        return coords_df

    if not pool:
        refined = map(_get_refined_coords, [(coords, pos_columns, image, radius, kwargs, has_user_input) for _, coords in coords_df.iterrows()])
    else:
        refined = pool.map(_get_refined_coords, [(coords, pos_columns, image, radius, kwargs, has_user_input) for _, coords in coords_df.iterrows()])

    refined = [ref for ref in refined if ref is not None]

    columns = np.unique(np.concatenate((pos_columns, ["r"], coords_df.columns)))
    if len(refined) == 0:
        warnings.warn("No particles found in the image after refinement.")
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 7

Instances


Project Name: soft-matter/trackpy
Commit Name: cc410f68b6c1d1417322ec02e22ea7713ca0bc48
Time: 2020-03-18
Author: ruben@lighthacking.nl
File Name: trackpy/locate_functions/brightfield_ring.py
Class Name:
Method Name: locate_brightfield_ring


Project Name: daniellerch/aletheia
Commit Name: 1d275bddd7349b765db88c76ec7dcfdf85de0f42
Time: 2020-11-07
Author: kevin.clark@gmail.com
File Name: aletheialib/attacks.py
Class Name:
Method Name: difference


Project Name: dit/dit
Commit Name: 608fff2119f21191352ddf5d96eb82fc1ab099b0
Time: 2013-02-25
Author: chebee7i@gmail.com
File Name: dit/utils/misc.py
Class Name:
Method Name: partitions