Skip to content

Commit

Permalink
fix a ff_style bug and simplify test_supergroup
Browse files Browse the repository at this point in the history
  • Loading branch information
qzhu2017 committed Aug 18, 2024
1 parent 24ad71c commit 85dec00
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 11 deletions.
2 changes: 1 addition & 1 deletion pyxtal/optimize/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -150,13 +150,13 @@ def __init__(
self.timeout = max_time * self.N_pop / self.ncpu

self.ff_opt = ff_opt
self.ff_style = ff_style

if info is not None:
self.atom_info = info
self.parameters = None
self.ff_opt = False
else:
self.ff_style = ff_style
self.ff_parameters = ff_parameters
self.reference_file = reference_file
self.parameters = ForceFieldParameters(self.smiles, style=ff_style, f_coef=1.0, s_coef=1.0, ncpu=self.ncpu)
Expand Down
23 changes: 13 additions & 10 deletions tests/test_supergroup.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ def test_by_group(self):
data = {
"BTO-Amm2": 221,
"BTO": 221,
"lt_cristobalite": 227,
#"lt_cristobalite": 227,
"NaSb3F10": 194,
}
for cif in data:
Expand Down Expand Up @@ -115,11 +115,11 @@ def test_long(self):
def test_long2(self):
paras = (
["P4_332", 155], # 1-4 splitting
["Fd3", 70], # 1-3
#["Fd3", 70], # 1-3
["Pm3", 47], # 1-3
["Fd3m", 166],
["R-3c", 15],
["R32", 5],
#["R32", 5],
["R-3", 147], # 1-3, k
["P4_332", 96], # 1-3
)
Expand Down Expand Up @@ -153,7 +153,7 @@ def test_multi(self):
data = {
"BTO": [123, 221],
"lt_cristobalite": [98, 210, 227],
"BTO-Amm2": [65, 123, 221],
#"BTO-Amm2": [65, 123, 221],
# "NaSb3F10": [186, 194],
# "NaSb3F10": [176, 194],
# "MPWO": [59, 71, 139, 225],
Expand Down Expand Up @@ -209,9 +209,12 @@ def test_get_disp_sets(self):
_, _, _, d = s1.get_disps_sets(s2, 1.0)
assert d < 0.15

s1 = pyxtal()
s1.from_seed(cif_path + "sim-0.vasp")
s2 = pyxtal()
s2.from_seed(cif_path + "sim-1.vasp")
_, _, _, d = s1.get_disps_sets(s2, 1.0, 0.3)
assert d < 0.02
#s1 = pyxtal()
#s1.from_seed(cif_path + "sim-0.vasp")
#s2 = pyxtal()
#s2.from_seed(cif_path + "sim-1.vasp")
#_, _, _, d = s1.get_disps_sets(s2, 1.0, 0.3)
#assert d < 0.02

if __name__ == "__main__":
unittest.main()

0 comments on commit 85dec00

Please sign in to comment.