Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/jinlhr542/pymatgen
Browse files Browse the repository at this point in the history
  • Loading branch information
jinlhr542 committed Aug 8, 2024
2 parents 83d0b4a + f9bb6fc commit dcfeb00
Showing 1 changed file with 21 additions and 21 deletions.
42 changes: 21 additions & 21 deletions tests/analysis/interfaces/test_coherent_interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,30 +48,30 @@ def test_coherent_interface_builder(self):
# no apparent reason. The author should fix this.
assert len(list(builder.get_interfaces(termination=("O2_Pmmm_1", "Si_R-3m_1")))) >= 6

class TestCoherentInterfaceBuilder(unittest.TestCase):

class TestCoherentInterfaceBuilder(unittest.TestCase):
def setUp(self):
#build substrate & film structure
# build substrate & film structure
basis = [[0, 0, 0], [0.25, 0.25, 0.25]]
self.substrate = Structure(
Lattice.cubic(a=5.431),
["Si", "Si"],
basis)
self.film = substrate = Structure(
Lattice.cubic(a=5.658),
["Ge", "Ge"],
basis)
self.substrate = Structure(Lattice.cubic(a=5.431), ["Si", "Si"], basis)
self.film = Structure(Lattice.cubic(a=5.658), ["Ge", "Ge"], basis)

def test_termination_searching(self):
sub_analyzer = SubstrateAnalyzer()
matches = list(sub_analyzer.calculate(substrate = self.substrate, film = self.film))
cib = CoherentInterfaceBuilder(film_structure = self.film,
substrate_structure=self.substrate,
film_miller=matches[0].film_miller,
substrate_miller=matches[0].substrate_miller,
zslgen=sub_analyzer,termination_ftol=1e-4,label_index=True,\
filting_out_sym_slabs=False)
self.assertTrue(cib.terminations == [('1_Ge_P4/mmm_1', '1_Si_P4/mmm_1'),\
('1_Ge_P4/mmm_1', '2_Si_P4/mmm_1'),\
('2_Ge_P4/mmm_1', '1_Si_P4/mmm_1'),\
('2_Ge_P4/mmm_1', '2_Si_P4/mmm_1')], 'termination results wrong')
matches = list(sub_analyzer.calculate(substrate=self.substrate, film=self.film))
cib = CoherentInterfaceBuilder(
film_structure=self.film,
substrate_structure=self.substrate,
film_miller=matches[0].film_miller,
substrate_miller=matches[0].substrate_miller,
zslgen=sub_analyzer,
termination_ftol=1e-4,
label_index=True,
filting_out_sym_slabs=False,
)
assert cib.terminations == [
("1_Ge_P4/mmm_1", "1_Si_P4/mmm_1"),
("1_Ge_P4/mmm_1", "2_Si_P4/mmm_1"),
("2_Ge_P4/mmm_1", "1_Si_P4/mmm_1"),
("2_Ge_P4/mmm_1", "2_Si_P4/mmm_1"),
], "termination results wrong"

0 comments on commit dcfeb00

Please sign in to comment.