Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update builder #286

Merged
merged 1 commit into from
Oct 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion pyxtal/interface/ase_opt.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ def handler(signum, frame):
signal.signal(signal.SIGALRM, handler)
signal.alarm(timeout)
#logger.info(f"{label} start calculation")
_fmax = 1e+5

try:
#if True:
Expand Down Expand Up @@ -92,7 +93,7 @@ def handler(signum, frame):
tag = 'False' if struc is None else 'True'
logger.info(f"Finishing {label} {tag}")
#signal.alarm(0) # Cancel the alarm
return struc
return struc #, eng, _fmax

class ASE_optimizer:
"""
Expand Down
17 changes: 8 additions & 9 deletions pyxtal/lego/builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -1009,16 +1009,15 @@ def optimize_xtal(self, xtal, count=0, opt_type='local',
minimizers=minimizers,
filename=filename)
xtal, xs = result
status = xtal.check_validity(self.criteria, verbose=self.verbose)
sim1 = self.get_similarity(xtal)
#print("after optim", sim1, status)
if result is not None:
status = xtal.check_validity(self.criteria, verbose=self.verbose)
sim1 = self.get_similarity(xtal)
#print("after optim", sim1, status)
else:
xtal, xs, status, sim1 = None, None, False, None
else:
print("Lattice is None", xtal.get_xtal_string())
xtal = None
xs = None
status = False
sim1 = None
xs = None
print("Lattice is None")#, xtal.get_xtal_string())
xtal, xs, status, sim1 = None, None, False, None
#import sys; sys.exit()

if status:
Expand Down