From 5bb4774580c6bc05a1994640edde5aba0b13ce85 Mon Sep 17 00:00:00 2001 From: Matteo Giantomassi Date: Wed, 20 Mar 2024 23:05:58 +0100 Subject: [PATCH] don't show figures in abiml validate --- abipy/scripts/abiml.py | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/abipy/scripts/abiml.py b/abipy/scripts/abiml.py index beb8b3ff8..0c650e204 100755 --- a/abipy/scripts/abiml.py +++ b/abipy/scripts/abiml.py @@ -619,19 +619,26 @@ def validate(ctx, filepaths, print(ml_comp) c = ml_comp.run(nprocs=nprocs) - show = True if exposer != "None": - from abipy.tools.plotting import Exposer + show = True + show = False with_stress = True + with_stress = False + on_traj = True + from abipy.tools.plotting import Exposer with Exposer.as_exposer(exposer, title=" ".join(os.path.basename(p) for p in filepaths)) as e: e(c.plot_energies(show=show, savefig="energies.png")) - e(c.plot_forces(delta_mode=True, show=show, savefig="forces.png")) - e(c.plot_energies_traj(delta_mode=True, show=show, savefig="energies_traj.png")) - e(c.plot_energies_traj(delta_mode=False, show=show, savefig="energies_traj_with_delta.png")) + if on_traj: + e(c.plot_energies_traj(delta_mode=True, show=show, savefig="energies_traj.png")) + e(c.plot_energies_traj(delta_mode=False, show=show, savefig="energies_traj_delta_mode.png")) + e(c.plot_forces(delta_mode=False, show=show, savefig="forces.png")) + e(c.plot_forces(delta_mode=True, show=show, savefig="forces_delta.png")) + if on_traj: + e(c.plot_forces_traj(delta_mode=True, show=show, savefig="forces_traj_delta_mode.png")) if with_stress: - e(c.plot_stresses(delta_mode=True, show=show, savefig="stresses.png")) - e(c.plot_forces_traj(delta_mode=True, show=show, savefig="forces_traj.png")) - e(c.plot_stress_traj(delta_mode=True, show=show, savefig="stress_traj.png")) + e(c.plot_stresses(delta_mode=True, show=show, savefig="stresses_delta_mode.png")) + if on_traj: + e(c.plot_stress_traj(delta_mode=True, show=show, savefig="stress_traj_delta_mode.png")) return 0