@@ -1747,8 +1747,10 @@ def _generate_acsf_from_data_fortran(self, xyz, classes):
1747
1747
1748
1748
initial_natoms = xyz .shape [1 ]
1749
1749
1750
+ # Hack to make fortran ACSF deal with dummy atoms (only if all the molecules are the same and the padding is at the end)
1750
1751
if 0 in classes :
1751
1752
idx_zeros = np .where (classes == 0 )[1 ]
1753
+
1752
1754
xyz = xyz [:, :idx_zeros [0 ], :]
1753
1755
classes = classes [:, :idx_zeros [0 ]]
1754
1756
@@ -2161,8 +2163,8 @@ def _check_representation_parameters(self, parameters):
2161
2163
2162
2164
elif self .representation_name == "acsf" :
2163
2165
2164
- acsf_parameters = { 'radial_cutoff ' : 10 .0 , 'angular_cutoff ' : 10 .0 , 'radial_rs ' : ( 0.0 , 0.1 , 0.2 ) ,
2165
- 'angular_rs' : ( 0.0 , 0.1 , 0.2 ), 'theta_s' : ( 3.0 , 2.0 ), ' zeta' : 3.0 , 'eta' : 2.0 }
2166
+ acsf_parameters = { 'rcut ' : 5 .0 , 'acut ' : 5 .0 , 'nRs2 ' : 5 , 'nRs3' : 5 , 'nTs' : 5 ,
2167
+ ' zeta' : 220.127 , 'eta' : 30.8065 }
2166
2168
2167
2169
for key , value in parameters .items ():
2168
2170
try :
@@ -2242,12 +2244,8 @@ def _fit_from_scratch(self, x, y, dy, classes):
2242
2244
2243
2245
x_approved , y_approved , dy_approved , classes_approved = self ._check_inputs (x , y , dy , classes )
2244
2246
2245
- # Obtaining the array of unique elements in all samples (excluding dummy atoms 0)
2246
- if 0 in classes_approved :
2247
- idx_zeros = np .where (classes_approved == 0 )[1 ]
2248
- classes_for_elements = classes_approved [:, :idx_zeros [0 ]]
2249
- else :
2250
- classes_for_elements = classes_approved
2247
+ # Putting a mask on all the 0 values
2248
+ classes_for_elements = np .ma .masked_equal (classes_approved , 0 ).compressed ()
2251
2249
2252
2250
self .elements , self .element_pairs = self ._get_elements_and_pairs (classes_for_elements )
2253
2251
0 commit comments