From 0a3839d67110b805b315cb7f46e4205d919bee7d Mon Sep 17 00:00:00 2001 From: Marvin Poul Date: Sat, 28 Oct 2023 13:14:57 +0200 Subject: [PATCH] Catch error if fit doesn't find equilibrium volume --- pyiron_atomistics/atomistics/master/quasi.py | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/pyiron_atomistics/atomistics/master/quasi.py b/pyiron_atomistics/atomistics/master/quasi.py index 5ea83ef3f..033268b92 100644 --- a/pyiron_atomistics/atomistics/master/quasi.py +++ b/pyiron_atomistics/atomistics/master/quasi.py @@ -183,10 +183,17 @@ def optimise_volume(self, bulk_eng): fit_funct=fit, x=v, save_range=0.0, return_ind=True ) - v0_lst.append(v0) - free_eng_lst.append(fit([v0])) - entropy_lst.append(entropy[ind]) - cv_lst.append(cv[ind]) + if v0 is not None: + v0_lst.append(v0) + free_eng_lst.append(fit(v0)) + entropy_lst.append(entropy[ind]) + cv_lst.append(cv[ind]) + else: + v0_lst.append(np.nan) + free_eng_lst.append(np.nan) + entropy_lst.append(np.nan) + cv_lst.append(np.nan) + return v0_lst, free_eng_lst, entropy_lst, cv_lst def plot_free_energy_volume_temperature(