1edd1496383e7ae0374ec5dd8b455d58077e1d62,cnvlib/_merge.py,,_merge_overlapping,#Any#Any#,41
Before Change
def _merge_overlapping(table, combiners):
Merge overlapping regions within a group.
// Short-circuit the simple, common cases
if len(table) == 1:
return table
if table["start"].nunique() == table["end"].nunique() == 1:
return _squash_rows(table, combiners)
After Change
// advantage of the grouping and sorting already done, and don"t repeat
// pandas" traversal and inferences.
// ENH: Find & use a lower-level, 1-pass pandas function
keyed_groups = itertools.izip(_nonoverlapping_groups(table),
table.itertuples(index=False))
merged_rows = [_squash_tuples(row_group, combiners)
for _key, row_group in itertools.groupby(keyed_groups,
lambda x: x[0])]
return pd.DataFrame.from_records(merged_rows, columns=merged_rows [0 ]._fields)
def _nonoverlapping_groups(table):
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 5
Instances Project Name: etal/cnvkit
Commit Name: 1edd1496383e7ae0374ec5dd8b455d58077e1d62
Time: 2016-10-30
Author: eric.talevich@gmail.com
File Name: cnvlib/_merge.py
Class Name:
Method Name: _merge_overlapping
Project Name: scipy/scipy
Commit Name: b127d30a0a0a3d3d7ad94dd629d2e673b6477cc8
Time: 2016-02-16
Author: tyler.je.reddy@gmail.com
File Name: scipy/spatial/_spherical_voronoi.py
Class Name: SphericalVoronoi
Method Name: _calc_vertices_regions
Project Name: mittagessen/kraken
Commit Name: 6e6c12425a787d8c954ce5c31ceed59cdd531001
Time: 2018-05-20
Author: mittagessen@l.unchti.me
File Name: kraken/lib/ctc_decoder.py
Class Name:
Method Name: greedy_decoder