-
Notifications
You must be signed in to change notification settings - Fork 176
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
UT: add UT for create_disturb_abacus_dev
- Loading branch information
1 parent
5c17874
commit e4a4585
Showing
4 changed files
with
54 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
ATOMIC_SPECIES | ||
Al 26.982 Al.PD04.PBE.UPF | ||
|
||
NUMERICAL_ORBITAL | ||
./Al_gga_10au_100Ry_3s3p3d.orb | ||
|
||
LATTICE_CONSTANT | ||
1.889716 | ||
|
||
LATTICE_VECTORS | ||
1.42857 -2.47436 0.00000 | ||
1.42857 2.47436 0.00000 | ||
0.00000 0.00000 9.29698 | ||
|
||
ATOMIC_POSITIONS | ||
Direct | ||
Al | ||
0.0 | ||
4 | ||
0.0000000 0.0000000 0.5000000 1 1 1 | ||
0.6666670 0.3333330 0.7500000 1 1 1 | ||
0.0000000 0.0000000 0.0000000 1 1 1 | ||
0.3333330 0.6666670 0.2500000 1 1 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
import sys, os | ||
import unittest | ||
from dpgen.data.tools.create_random_disturb import create_disturbs_abacus_dev | ||
sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), '..'))) | ||
__package__ = 'data' | ||
from .context import * | ||
|
||
class TestPertAbacus(unittest.TestCase): | ||
def setUp(self): | ||
create_disturbs_abacus_dev(abacus_stru_file,1) | ||
def tearDown(self): | ||
if os.path.isfile('STRU.hcp1.abacus'): | ||
os.remove('STRU.hcp1.abacus') | ||
def test_stru(self): | ||
if os.path.isfile('STRU.hcp1.abacus'): | ||
stru1 = get_abacus_STRU('STRU.hcp1.abacus') | ||
stru0 = get_abacus_STRU(abacus_stru_file) | ||
self.assertEqual(stru0['atom_names'],stru1['atom_names']) | ||
self.assertEqual(stru0['atom_numbs'],stru1['atom_numbs']) | ||
self.assertEqual(stru0['atom_masses'],stru1['atom_masses']) | ||
#print(stru0['atom_numbs'],stru1['atom_numbs']) | ||
#print(stru0['coords'],stru1['coords']) | ||
#print(stru0['cells'],stru1['cells']) | ||
#print(stru0['atom_types'],stru1['atom_types']) | ||
def test_FileExist(self): | ||
self.assertTrue(os.path.isfile('STRU.hcp1.abacus')) | ||
|
||
if __name__ == '__main__': | ||
unittest.main() |