f5c6378c893d62a22808d52d94ebd4545f205e9a,regtests/lmbtr.py,LMBTRTests,test_flatten,#LMBTRTests#,327
Before Change
// K2 unflattened
desc = copy.deepcopy(default_desc_k2)
desc.flatten = False
feat = desc.create(system, positions=[0])[0]["k2"]
self.assertEqual(feat.shape, (n_elem, nk2))
// K2 flattened. The sparse matrix only supports 2D matrices, so the first
After Change
// Check that the elements in flattened and unflattened match
sorted_species = sorted(desc._atomic_numbers+[0])
for i_pos in range(len(system)):
for i_species in range(len(sorted_species)):
i_z = sorted_species[i_species]
slc = desc.get_location((0, i_z))
i_flat = feat_flat[i_pos, slc]
i_unflat = feat[i_pos]["k2"][i_species]
self.assertTrue(np.array_equal(i_flat, i_unflat))
def test_sparse(self):
Tests the sparse matrix creation.
// Dense
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 4
Instances
Project Name: SINGROUP/dscribe
Commit Name: f5c6378c893d62a22808d52d94ebd4545f205e9a
Time: 2020-03-10
Author: lauri.himanen@gmail.com
File Name: regtests/lmbtr.py
Class Name: LMBTRTests
Method Name: test_flatten
Project Name: comic/grand-challenge.org
Commit Name: 928eca284d5fba7d0551a77b32c656a265a35878
Time: 2018-08-27
Author: jamesmeakin@gmail.com
File Name: app/grandchallenge/core/management/commands/convertsubmissions.py
Class Name: Command
Method Name: handle
Project Name: SINGROUP/dscribe
Commit Name: a08692e8c722ac1c330ae9761c30d72cbfafcb82
Time: 2020-12-04
Author: lauri.himanen@gmail.com
File Name: regtests/derivatives.py
Class Name: SoapDerivativeTests
Method Name: test_numerical