@@ -386,7 +386,9 @@ def run_task(self, fw_spec):
386
386
self ._generate_outputs ()
387
387
388
388
def _verify_inputs (self ):
389
- user_incar = Incar .from_file (os .path .join (os .getcwd (), "INCAR" ))
389
+ cwd = os .getcwd ()
390
+ user_incar = Incar .from_file (os .path .join (cwd , "INCAR" ))
391
+ input_path = os .path .join (self ["ref_dir" ], "inputs" )
390
392
391
393
# Carry out some BASIC tests.
392
394
@@ -405,7 +407,7 @@ def _verify_inputs(self):
405
407
406
408
# Check KPOINTS
407
409
if self .get ("check_kpoints" , True ):
408
- user_kpoints = Kpoints .from_file (os .path .join (os . getcwd () , "KPOINTS" ))
410
+ user_kpoints = Kpoints .from_file (os .path .join (cwd , "KPOINTS" ))
409
411
ref_kpoints = Kpoints .from_file (
410
412
os .path .join (self ["ref_dir" ], "inputs" , "KPOINTS" )
411
413
)
@@ -414,17 +416,13 @@ def _verify_inputs(self):
414
416
or user_kpoints .num_kpts != ref_kpoints .num_kpts
415
417
):
416
418
raise ValueError (
417
- "KPOINT files are inconsistent! Paths are:\n {}\n {} with kpoints {} and {}" .format (
418
- os .getcwd (),
419
- os .path .join (self ["ref_dir" ], "inputs" ),
420
- user_kpoints ,
421
- ref_kpoints ,
422
- )
419
+ f"KPOINT files are inconsistent! Paths are:\n { cwd } \n { input_path } "
420
+ f"with kpoints { user_kpoints } and { ref_kpoints } "
423
421
)
424
422
425
423
# Check POSCAR
426
424
if self .get ("check_poscar" , True ):
427
- user_poscar = Poscar .from_file (os .path .join (os . getcwd () , "POSCAR" ))
425
+ user_poscar = Poscar .from_file (os .path .join (cwd , "POSCAR" ))
428
426
ref_poscar = Poscar .from_file (
429
427
os .path .join (self ["ref_dir" ], "inputs" , "POSCAR" )
430
428
)
@@ -433,22 +431,18 @@ def _verify_inputs(self):
433
431
or user_poscar .site_symbols != ref_poscar .site_symbols
434
432
):
435
433
raise ValueError (
436
- "POSCAR files are inconsistent! Paths are:\n {}\n {}" .format (
437
- os .getcwd (), os .path .join (self ["ref_dir" ], "inputs" )
438
- )
434
+ f"POSCAR files are inconsistent! Paths are:\n { cwd } \n { input_path } "
439
435
)
440
436
441
437
# Check POTCAR
442
438
if self .get ("check_potcar" , True ):
443
- user_potcar = Potcar .from_file (os .path .join (os . getcwd () , "POTCAR" ))
439
+ user_potcar = Potcar .from_file (os .path .join (cwd , "POTCAR" ))
444
440
ref_potcar = Potcar .from_file (
445
441
os .path .join (self ["ref_dir" ], "inputs" , "POTCAR" )
446
442
)
447
443
if user_potcar .symbols != ref_potcar .symbols :
448
444
raise ValueError (
449
- "POTCAR files are inconsistent! Paths are:\n {}\n {}" .format (
450
- os .getcwd (), os .path .join (self ["ref_dir" ], "inputs" )
451
- )
445
+ f"POTCAR files are inconsistent! Paths are:\n { cwd } \n { input_path } "
452
446
)
453
447
454
448
logger .info ("RunVaspFake: verified inputs successfully" )
0 commit comments