c02df66939452dded7d83ac2bb422db76212eb8a,rmgpy/tools/mergemodels.py,,combine_models,#,138

Before Change


    label_index_dict = {}
    for s in final_model.species:
        if s.label not in label_index_dict:
            label_index_dict[s.label] = [s.index]
        else:
            if s.index in label_index_dict[s.label]:
                // obtained a duplicate
                s.index = max(label_index_dict[s.label]) + 1
                print("Reindexed {0} due to dublicate labels and index".format(s.label))
            label_index_dict[s.label].append(s.index)

    return final_model

After Change


    // reindex the unique species (to avoid name conflicts on save)
    speciesIndex = 0
    for spec in final_model.species:
        if spec.label not in ["Ar", "N2", "Ne", "He"]:
            spec.index = speciesIndex + 1
            speciesIndex += 1
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 4

Instances


Project Name: ReactionMechanismGenerator/RMG-Py
Commit Name: c02df66939452dded7d83ac2bb422db76212eb8a
Time: 2020-04-26
Author: kspieker@mit.edu
File Name: rmgpy/tools/mergemodels.py
Class Name:
Method Name: combine_models


Project Name: coala/coala-bears
Commit Name: 97e98900c388126230d1eef0f2666fb1a5723944
Time: 2018-05-04
Author: viresh16118@iiitd.ac.in
File Name: bears/vcs/git/GitCommitBear.py
Class Name: GitCommitBear
Method Name: check_issue_reference


Project Name: tryolabs/luminoth
Commit Name: 3d76f1419df74f80369785cc962f1d143eb172de
Time: 2018-03-20
Author: joaquin.alori@gmail.com
File Name: luminoth/models/ssd/ssd_feature_extractor.py
Class Name: SSDFeatureExtractor
Method Name: __init__