|
41 | 41 | ) |
42 | 42 | from ...dpmodel.descriptor.test_descriptor import ( |
43 | 43 | DescriptorParamDPA1, |
44 | | - DescriptorParamDPA1List, |
| 44 | + DescriptorParamDPA1EnergyModelList, |
45 | 45 | DescriptorParamDPA2, |
46 | | - DescriptorParamDPA2List, |
| 46 | + DescriptorParamDPA2EnergyModelList, |
47 | 47 | DescriptorParamHybrid, |
48 | 48 | DescriptorParamHybridMixed, |
49 | 49 | DescriptorParamHybridMixedTTebd, |
50 | 50 | DescriptorParamSeA, |
51 | | - DescriptorParamSeAList, |
| 51 | + DescriptorParamSeAEnergyModelList, |
52 | 52 | DescriptorParamSeR, |
53 | | - DescriptorParamSeRList, |
| 53 | + DescriptorParamSeREnergyModelList, |
54 | 54 | DescriptorParamSeT, |
55 | | - DescriptorParamSeTList, |
| 55 | + DescriptorParamSeTEnergyModelList, |
56 | 56 | ) |
57 | 57 | from ...dpmodel.model.test_model import ( |
58 | 58 | skip_model_tests, |
@@ -81,29 +81,64 @@ def make_sel_type_from_atom_exclude_types(type_map, atom_exclude_types): |
81 | 81 | return sel_type.tolist() |
82 | 82 |
|
83 | 83 |
|
| 84 | +ENERGY_DESCRIPTOR_PARAMS = ( |
| 85 | + *[(param_func, DescrptSeA) for param_func in DescriptorParamSeAEnergyModelList], |
| 86 | + *[(param_func, DescrptSeR) for param_func in DescriptorParamSeREnergyModelList], |
| 87 | + *[(param_func, DescrptSeT) for param_func in DescriptorParamSeTEnergyModelList], |
| 88 | + *[(param_func, DescrptDPA1) for param_func in DescriptorParamDPA1EnergyModelList], |
| 89 | + *[(param_func, DescrptDPA2) for param_func in DescriptorParamDPA2EnergyModelList], |
| 90 | + (DescriptorParamHybrid, DescrptHybrid), |
| 91 | + (DescriptorParamHybridMixed, DescrptHybrid), |
| 92 | + (DescriptorParamHybridMixedTTebd, DescrptHybrid), |
| 93 | +) |
| 94 | + |
| 95 | +DEFAULT_DESCRIPTOR_PARAMS = ( |
| 96 | + (DescriptorParamSeA, DescrptSeA), |
| 97 | + (DescriptorParamSeR, DescrptSeR), |
| 98 | + (DescriptorParamSeT, DescrptSeT), |
| 99 | + (DescriptorParamDPA1, DescrptDPA1), |
| 100 | + (DescriptorParamDPA2, DescrptDPA2), |
| 101 | +) |
| 102 | + |
| 103 | +DEFAULT_DESCRIPTOR_PARAMS_WITH_HYBRID = ( |
| 104 | + *DEFAULT_DESCRIPTOR_PARAMS, |
| 105 | + (DescriptorParamHybrid, DescrptHybrid), |
| 106 | + (DescriptorParamHybridMixed, DescrptHybrid), |
| 107 | + (DescriptorParamHybridMixedTTebd, DescrptHybrid), |
| 108 | +) |
| 109 | + |
| 110 | +DEFAULT_VEC_DESCRIPTOR_PARAMS = ( |
| 111 | + (DescriptorParamSeA, DescrptSeA), |
| 112 | + (DescriptorParamDPA1, DescrptDPA1), |
| 113 | + (DescriptorParamDPA2, DescrptDPA2), |
| 114 | +) |
| 115 | + |
| 116 | +DEFAULT_VEC_DESCRIPTOR_PARAMS_WITH_HYBRID = ( |
| 117 | + *DEFAULT_VEC_DESCRIPTOR_PARAMS, |
| 118 | + (DescriptorParamHybrid, DescrptHybrid), |
| 119 | + (DescriptorParamHybridMixed, DescrptHybrid), |
| 120 | +) |
| 121 | + |
| 122 | +DEFAULT_DPA12_DESCRIPTOR_PARAMS = ( |
| 123 | + (DescriptorParamDPA1, DescrptDPA1), |
| 124 | + (DescriptorParamDPA2, DescrptDPA2), |
| 125 | +) |
| 126 | + |
| 127 | +DEFAULT_DPA12_DESCRIPTOR_PARAMS_WITH_HYBRID = ( |
| 128 | + *DEFAULT_DPA12_DESCRIPTOR_PARAMS, |
| 129 | + (DescriptorParamHybridMixed, DescrptHybrid), |
| 130 | + (DescriptorParamHybridMixedTTebd, DescrptHybrid), |
| 131 | +) |
| 132 | + |
| 133 | + |
84 | 134 | @parameterized( |
85 | 135 | des_parameterized=( |
86 | | - ( |
87 | | - *[(param_func, DescrptSeA) for param_func in DescriptorParamSeAList], |
88 | | - *[(param_func, DescrptSeR) for param_func in DescriptorParamSeRList], |
89 | | - *[(param_func, DescrptSeT) for param_func in DescriptorParamSeTList], |
90 | | - *[(param_func, DescrptDPA1) for param_func in DescriptorParamDPA1List], |
91 | | - *[(param_func, DescrptDPA2) for param_func in DescriptorParamDPA2List], |
92 | | - (DescriptorParamHybrid, DescrptHybrid), |
93 | | - (DescriptorParamHybridMixed, DescrptHybrid), |
94 | | - (DescriptorParamHybridMixedTTebd, DescrptHybrid), |
95 | | - ), # descrpt_class_param & class |
| 136 | + ENERGY_DESCRIPTOR_PARAMS, # descrpt_class_param & class |
96 | 137 | ((FittingParamEnergy, EnergyFittingNet),), # fitting_class_param & class |
97 | 138 | ([], [0]), # atom_exclude_types |
98 | 139 | ), |
99 | 140 | fit_parameterized=( |
100 | | - ( |
101 | | - (DescriptorParamSeA, DescrptSeA), |
102 | | - (DescriptorParamSeR, DescrptSeR), |
103 | | - (DescriptorParamSeT, DescrptSeT), |
104 | | - (DescriptorParamDPA1, DescrptDPA1), |
105 | | - (DescriptorParamDPA2, DescrptDPA2), |
106 | | - ), # descrpt_class_param & class |
| 141 | + DEFAULT_DESCRIPTOR_PARAMS, # descrpt_class_param & class |
107 | 142 | ( |
108 | 143 | *[(param_func, EnergyFittingNet) for param_func in FittingParamEnergyList], |
109 | 144 | ), # fitting_class_param & class |
@@ -158,27 +193,12 @@ def test_sel_type_from_atom_exclude_types(self): |
158 | 193 |
|
159 | 194 | @parameterized( |
160 | 195 | des_parameterized=( |
161 | | - ( |
162 | | - *[(param_func, DescrptSeA) for param_func in DescriptorParamSeAList], |
163 | | - *[(param_func, DescrptSeR) for param_func in DescriptorParamSeRList], |
164 | | - *[(param_func, DescrptSeT) for param_func in DescriptorParamSeTList], |
165 | | - *[(param_func, DescrptDPA1) for param_func in DescriptorParamDPA1List], |
166 | | - *[(param_func, DescrptDPA2) for param_func in DescriptorParamDPA2List], |
167 | | - (DescriptorParamHybrid, DescrptHybrid), |
168 | | - (DescriptorParamHybridMixed, DescrptHybrid), |
169 | | - (DescriptorParamHybridMixedTTebd, DescrptHybrid), |
170 | | - ), # descrpt_class_param & class |
| 196 | + DEFAULT_DESCRIPTOR_PARAMS_WITH_HYBRID, # descrpt_class_param & class |
171 | 197 | ((FittingParamDos, DOSFittingNet),), # fitting_class_param & class |
172 | 198 | ([], [0]), # atom_exclude_types |
173 | 199 | ), |
174 | 200 | fit_parameterized=( |
175 | | - ( |
176 | | - (DescriptorParamSeA, DescrptSeA), |
177 | | - (DescriptorParamSeR, DescrptSeR), |
178 | | - (DescriptorParamSeT, DescrptSeT), |
179 | | - (DescriptorParamDPA1, DescrptDPA1), |
180 | | - (DescriptorParamDPA2, DescrptDPA2), |
181 | | - ), # descrpt_class_param & class |
| 201 | + DEFAULT_DESCRIPTOR_PARAMS, # descrpt_class_param & class |
182 | 202 | ( |
183 | 203 | *[(param_func, DOSFittingNet) for param_func in FittingParamDosList], |
184 | 204 | ), # fitting_class_param & class |
@@ -233,22 +253,12 @@ def test_sel_type_from_atom_exclude_types(self): |
233 | 253 |
|
234 | 254 | @parameterized( |
235 | 255 | des_parameterized=( |
236 | | - ( |
237 | | - *[(param_func, DescrptSeA) for param_func in DescriptorParamSeAList], |
238 | | - *[(param_func, DescrptDPA1) for param_func in DescriptorParamDPA1List], |
239 | | - *[(param_func, DescrptDPA2) for param_func in DescriptorParamDPA2List], |
240 | | - (DescriptorParamHybrid, DescrptHybrid), |
241 | | - (DescriptorParamHybridMixed, DescrptHybrid), |
242 | | - ), # descrpt_class_param & class |
| 256 | + DEFAULT_VEC_DESCRIPTOR_PARAMS_WITH_HYBRID, # descrpt_class_param & class |
243 | 257 | ((FittingParamDipole, DipoleFitting),), # fitting_class_param & class |
244 | 258 | ([], [0]), # atom_exclude_types |
245 | 259 | ), |
246 | 260 | fit_parameterized=( |
247 | | - ( |
248 | | - (DescriptorParamSeA, DescrptSeA), |
249 | | - (DescriptorParamDPA1, DescrptDPA1), |
250 | | - (DescriptorParamDPA2, DescrptDPA2), |
251 | | - ), # descrpt_class_param & class |
| 261 | + DEFAULT_VEC_DESCRIPTOR_PARAMS, # descrpt_class_param & class |
252 | 262 | ( |
253 | 263 | *[(param_func, DipoleFitting) for param_func in FittingParamDipoleList], |
254 | 264 | ), # fitting_class_param & class |
@@ -304,22 +314,12 @@ def test_sel_type_from_atom_exclude_types(self): |
304 | 314 |
|
305 | 315 | @parameterized( |
306 | 316 | des_parameterized=( |
307 | | - ( |
308 | | - *[(param_func, DescrptSeA) for param_func in DescriptorParamSeAList], |
309 | | - *[(param_func, DescrptDPA1) for param_func in DescriptorParamDPA1List], |
310 | | - *[(param_func, DescrptDPA2) for param_func in DescriptorParamDPA2List], |
311 | | - (DescriptorParamHybrid, DescrptHybrid), |
312 | | - (DescriptorParamHybridMixed, DescrptHybrid), |
313 | | - ), # descrpt_class_param & class |
| 317 | + DEFAULT_VEC_DESCRIPTOR_PARAMS_WITH_HYBRID, # descrpt_class_param & class |
314 | 318 | ((FittingParamPolar, PolarFitting),), # fitting_class_param & class |
315 | 319 | ([], [0]), # atom_exclude_types |
316 | 320 | ), |
317 | 321 | fit_parameterized=( |
318 | | - ( |
319 | | - (DescriptorParamSeA, DescrptSeA), |
320 | | - (DescriptorParamDPA1, DescrptDPA1), |
321 | | - (DescriptorParamDPA2, DescrptDPA2), |
322 | | - ), # descrpt_class_param & class |
| 322 | + DEFAULT_VEC_DESCRIPTOR_PARAMS, # descrpt_class_param & class |
323 | 323 | ( |
324 | 324 | *[(param_func, PolarFitting) for param_func in FittingParamPolarList], |
325 | 325 | ), # fitting_class_param & class |
@@ -375,19 +375,11 @@ def test_sel_type_from_atom_exclude_types(self): |
375 | 375 |
|
376 | 376 | @parameterized( |
377 | 377 | des_parameterized=( |
378 | | - ( |
379 | | - *[(param_func, DescrptDPA1) for param_func in DescriptorParamDPA1List], |
380 | | - *[(param_func, DescrptDPA2) for param_func in DescriptorParamDPA2List], |
381 | | - (DescriptorParamHybridMixed, DescrptHybrid), |
382 | | - (DescriptorParamHybridMixedTTebd, DescrptHybrid), |
383 | | - ), # descrpt_class_param & class |
| 378 | + DEFAULT_DPA12_DESCRIPTOR_PARAMS_WITH_HYBRID, # descrpt_class_param & class |
384 | 379 | ((FittingParamEnergy, EnergyFittingNet),), # fitting_class_param & class |
385 | 380 | ), |
386 | 381 | fit_parameterized=( |
387 | | - ( |
388 | | - (DescriptorParamDPA1, DescrptDPA1), |
389 | | - (DescriptorParamDPA2, DescrptDPA2), |
390 | | - ), # descrpt_class_param & class |
| 382 | + DEFAULT_DPA12_DESCRIPTOR_PARAMS, # descrpt_class_param & class |
391 | 383 | ( |
392 | 384 | *[(param_func, EnergyFittingNet) for param_func in FittingParamEnergyList], |
393 | 385 | ), # fitting_class_param & class |
@@ -449,21 +441,15 @@ def setUpClass(cls) -> None: |
449 | 441 | @parameterized( |
450 | 442 | des_parameterized=( |
451 | 443 | ( |
452 | | - *[(param_func, DescrptSeA) for param_func in DescriptorParamSeAList], |
453 | | - *[(param_func, DescrptDPA1) for param_func in DescriptorParamDPA1List], |
454 | | - *[(param_func, DescrptDPA2) for param_func in DescriptorParamDPA2List], |
| 444 | + *DEFAULT_VEC_DESCRIPTOR_PARAMS, |
455 | 445 | (DescriptorParamHybridMixed, DescrptHybrid), |
456 | 446 | (DescriptorParamHybridMixedTTebd, DescrptHybrid), |
457 | 447 | ), # descrpt_class_param & class |
458 | 448 | ((FittingParamProperty, PropertyFittingNet),), # fitting_class_param & class |
459 | 449 | ([], [0]), # atom_exclude_types |
460 | 450 | ), |
461 | 451 | fit_parameterized=( |
462 | | - ( |
463 | | - (DescriptorParamSeA, DescrptSeA), |
464 | | - (DescriptorParamDPA1, DescrptDPA1), |
465 | | - (DescriptorParamDPA2, DescrptDPA2), |
466 | | - ), # descrpt_class_param & class |
| 452 | + DEFAULT_VEC_DESCRIPTOR_PARAMS, # descrpt_class_param & class |
467 | 453 | ( |
468 | 454 | *[ |
469 | 455 | (param_func, PropertyFittingNet) |
|
0 commit comments