def test_representation_transform(self):

        rep = SortedCoulombMatrix(**self.hypers)

        features = rep.transform([self.frame])

        test = features.get_features(rep)
示例#2
0
    "reference_data/CaCrP2O7_mvc-11955_symmetrized.json",
    "reference_data/small_molecule.json"
]

data = dict(filenames=fns_to_write, cutoffs=cutoffs, rep_info=[])
hypers = dict(central_decay=-1,
              interaction_cutoff=-1,
              interaction_decay=-1,
              size=10,
              sorting_algorithm='')

for fn in fns:
    for cutoff in cutoffs:
        print(fn, cutoff)
        data['rep_info'].append([])
        for sort in sorts:
            rep = SortedCoulombMatrix(cutoff, sorting_algorithm=sort)
            frame = [json2ase(load_json(fn))]
            features = rep.transform(frame)
            test = features.get_feature_matrix()
            hypers['size'] = rep.size
            print(rep.size)
            hypers['sorting_algorithm'] = sort
            data['rep_info'][-1].append(
                dict(feature_matrix=test.tolist(), hypers=copy(hypers)))

with open(
        os.path.join(path, "tests", "reference_data",
                     "sorted_coulomb_reference.ubjson"), 'wb') as f:
    ubjson.dump(data, f)