c02df66939452dded7d83ac2bb422db76212eb8a,rmgpy/tools/mergemodels.py,,combine_models,#,138
Before Change
// ensure no species with same name and index
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
return final_model
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 7
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: EpistasisLab/penn-ml-benchmarks
Commit Name: e3fa5a3159781055c56c502407a45f3a44008819
Time: 2020-08-20
Author: weixuanf@upenn.edu
File Name: pmlb/pmlb.py
Class Name:
Method Name: fetch_data
Project Name: LCAV/pyroomacoustics
Commit Name: 5b82d130747a10559da252ab814aa411ceaca77e
Time: 2017-10-08
Author: fakufaku@gmail.com
File Name: pyroomacoustics/experimental/measure_ir.py
Class Name:
Method Name: