2020 get_finetune_rules ,
2121)
2222from deepmd .utils .compat import (
23- convert_optimizer_to_new_format ,
23+ convert_optimizer_v31_to_v32 ,
2424)
2525
2626from .model .test_permutation import (
@@ -182,7 +182,7 @@ def setUp(self) -> None:
182182 with open (input_json ) as f :
183183 self .config = json .load (f )
184184 # Backward compatibility: convert old optimizer format
185- self .config = convert_optimizer_to_new_format (self .config , warning = False )
185+ self .config = convert_optimizer_v31_to_v32 (self .config , warning = False )
186186 data_file = [str (Path (__file__ ).parent / "water/data/data_0" )]
187187 self .config ["training" ]["training_data" ]["systems" ] = data_file
188188 self .config ["training" ]["validation_data" ]["systems" ] = data_file
@@ -220,7 +220,7 @@ def setUp(self) -> None:
220220 input_json = str (Path (__file__ ).parent / "dos/input.json" )
221221 with open (input_json ) as f :
222222 self .config = json .load (f )
223- self .config = convert_optimizer_to_new_format (self .config , warning = False )
223+ self .config = convert_optimizer_v31_to_v32 (self .config , warning = False )
224224 data_file = [str (Path (__file__ ).parent / "dos/data/atomic_system" )]
225225 self .config ["training" ]["training_data" ]["systems" ] = data_file
226226 self .config ["training" ]["validation_data" ]["systems" ] = data_file
@@ -239,7 +239,7 @@ def setUp(self) -> None:
239239 input_json = str (Path (__file__ ).parent / "water/zbl.json" )
240240 with open (input_json ) as f :
241241 self .config = json .load (f )
242- self .config = convert_optimizer_to_new_format (self .config , warning = False )
242+ self .config = convert_optimizer_v31_to_v32 (self .config , warning = False )
243243 data_file = [str (Path (__file__ ).parent / "water/data/data_0" )]
244244 self .config ["training" ]["training_data" ]["systems" ] = data_file
245245 self .config ["training" ]["validation_data" ]["systems" ] = data_file
@@ -258,7 +258,7 @@ def setUp(self) -> None:
258258 input_json = str (Path (__file__ ).parent / "water/se_atten.json" )
259259 with open (input_json ) as f :
260260 self .config = json .load (f )
261- self .config = convert_optimizer_to_new_format (self .config , warning = False )
261+ self .config = convert_optimizer_v31_to_v32 (self .config , warning = False )
262262 data_file = [str (Path (__file__ ).parent / "water/data/data_0" )]
263263 self .config ["training" ]["training_data" ]["systems" ] = data_file
264264 self .config ["training" ]["validation_data" ]["systems" ] = data_file
@@ -280,7 +280,7 @@ def setUp(self) -> None:
280280 input_json = str (Path (__file__ ).parent / "water/se_atten.json" )
281281 with open (input_json ) as f :
282282 self .config = json .load (f )
283- self .config = convert_optimizer_to_new_format (self .config , warning = False )
283+ self .config = convert_optimizer_v31_to_v32 (self .config , warning = False )
284284 data_file = [str (Path (__file__ ).parent / "water/data/data_0" )]
285285 self .config ["training" ]["training_data" ]["systems" ] = data_file
286286 self .config ["training" ]["validation_data" ]["systems" ] = data_file
@@ -293,9 +293,7 @@ def setUp(self) -> None:
293293 input_json_zbl = str (Path (__file__ ).parent / "water/zbl.json" )
294294 with open (input_json_zbl ) as f :
295295 self .config_zbl = json .load (f )
296- self .config_zbl = convert_optimizer_to_new_format (
297- self .config_zbl , warning = False
298- )
296+ self .config_zbl = convert_optimizer_v31_to_v32 (self .config_zbl , warning = False )
299297 data_file = [str (Path (__file__ ).parent / "water/data/data_0" )]
300298 self .config_zbl ["training" ]["training_data" ]["systems" ] = data_file
301299 self .config_zbl ["training" ]["validation_data" ]["systems" ] = data_file
@@ -312,7 +310,7 @@ def setUp(self) -> None:
312310 input_json = str (Path (__file__ ).parent / "water/se_atten.json" )
313311 with open (input_json ) as f :
314312 self .config = json .load (f )
315- self .config = convert_optimizer_to_new_format (self .config , warning = False )
313+ self .config = convert_optimizer_v31_to_v32 (self .config , warning = False )
316314 data_file = [str (Path (__file__ ).parent / "water/data/data_0" )]
317315 self .config ["training" ]["training_data" ]["systems" ] = data_file
318316 self .config ["training" ]["validation_data" ]["systems" ] = data_file
@@ -330,7 +328,7 @@ def setUp(self) -> None:
330328 input_json = str (Path (__file__ ).parent / "water/se_atten.json" )
331329 with open (input_json ) as f :
332330 self .config = json .load (f )
333- self .config = convert_optimizer_to_new_format (self .config , warning = False )
331+ self .config = convert_optimizer_v31_to_v32 (self .config , warning = False )
334332 data_file = [str (Path (__file__ ).parent / "water/data/data_0" )]
335333 self .config ["training" ]["training_data" ]["systems" ] = data_file
336334 self .config ["training" ]["validation_data" ]["systems" ] = data_file
@@ -347,7 +345,7 @@ def setUp(self) -> None:
347345 input_json = str (Path (__file__ ).parent / "water_tensor/se_e2_a.json" )
348346 with open (input_json ) as f :
349347 self .config = json .load (f )
350- self .config = convert_optimizer_to_new_format (self .config , warning = False )
348+ self .config = convert_optimizer_v31_to_v32 (self .config , warning = False )
351349 data_file_atomic = str (
352350 Path (__file__ ).parent / "water_tensor/dipole/atomic_system"
353351 )
@@ -377,7 +375,7 @@ def setUp(self) -> None:
377375 input_json = str (Path (__file__ ).parent / "water_tensor/se_e2_a.json" )
378376 with open (input_json ) as f :
379377 self .config = json .load (f )
380- self .config = convert_optimizer_to_new_format (self .config , warning = False )
378+ self .config = convert_optimizer_v31_to_v32 (self .config , warning = False )
381379 data_file_atomic = str (
382380 Path (__file__ ).parent / "water_tensor/dipole/atomic_system"
383381 )
@@ -407,7 +405,7 @@ def setUp(self) -> None:
407405 input_json = str (Path (__file__ ).parent / "water_tensor/se_e2_a.json" )
408406 with open (input_json ) as f :
409407 self .config = json .load (f )
410- self .config = convert_optimizer_to_new_format (self .config , warning = False )
408+ self .config = convert_optimizer_v31_to_v32 (self .config , warning = False )
411409 data_file_atomic = str (
412410 Path (__file__ ).parent / "water_tensor/dipole/atomic_system"
413411 )
@@ -437,7 +435,7 @@ def setUp(self) -> None:
437435 input_json = str (Path (__file__ ).parent / "water_tensor/se_e2_a.json" )
438436 with open (input_json ) as f :
439437 self .config = json .load (f )
440- self .config = convert_optimizer_to_new_format (self .config , warning = False )
438+ self .config = convert_optimizer_v31_to_v32 (self .config , warning = False )
441439 data_file_atomic = str (
442440 Path (__file__ ).parent / "water_tensor/polar/atomic_system"
443441 )
@@ -472,7 +470,7 @@ def setUp(self) -> None:
472470 input_json = str (Path (__file__ ).parent / "water_tensor/se_e2_a.json" )
473471 with open (input_json ) as f :
474472 self .config = json .load (f )
475- self .config = convert_optimizer_to_new_format (self .config , warning = False )
473+ self .config = convert_optimizer_v31_to_v32 (self .config , warning = False )
476474 data_file_atomic = str (
477475 Path (__file__ ).parent / "water_tensor/polar/atomic_system"
478476 )
@@ -507,7 +505,7 @@ def setUp(self) -> None:
507505 input_json = str (Path (__file__ ).parent / "water_tensor/se_e2_a.json" )
508506 with open (input_json ) as f :
509507 self .config = json .load (f )
510- self .config = convert_optimizer_to_new_format (self .config , warning = False )
508+ self .config = convert_optimizer_v31_to_v32 (self .config , warning = False )
511509 data_file_atomic = str (
512510 Path (__file__ ).parent / "water_tensor/polar/atomic_system"
513511 )
@@ -542,7 +540,7 @@ def setUp(self) -> None:
542540 input_json = str (Path (__file__ ).parent / "water/se_atten.json" )
543541 with open (input_json ) as f :
544542 self .config = json .load (f )
545- self .config = convert_optimizer_to_new_format (self .config , warning = False )
543+ self .config = convert_optimizer_v31_to_v32 (self .config , warning = False )
546544 data_file = [str (Path (__file__ ).parent / "water/data/data_0" )]
547545 self .config ["training" ]["training_data" ]["systems" ] = data_file
548546 self .config ["training" ]["validation_data" ]["systems" ] = data_file
@@ -554,7 +552,7 @@ def setUp(self) -> None:
554552 property_input = str (Path (__file__ ).parent / "property/input.json" )
555553 with open (property_input ) as f :
556554 self .config_property = json .load (f )
557- self .config_property = convert_optimizer_to_new_format (
555+ self .config_property = convert_optimizer_v31_to_v32 (
558556 self .config_property , warning = False
559557 )
560558 prop_data_file = [str (Path (__file__ ).parent / "property/double" )]
@@ -614,7 +612,7 @@ def setUp(self) -> None:
614612 input_json = str (Path (__file__ ).parent / "water/se_atten.json" )
615613 with open (input_json ) as f :
616614 self .config = json .load (f )
617- self .config = convert_optimizer_to_new_format (self .config , warning = False )
615+ self .config = convert_optimizer_v31_to_v32 (self .config , warning = False )
618616 self .config ["training" ]["training_data" ]["rglob_patterns" ] = [
619617 "water/data/data_*"
620618 ]
0 commit comments