Skip to content

Commit

Permalink
don't show figures in abiml validate
Browse files Browse the repository at this point in the history
  • Loading branch information
gmatteo committed Mar 20, 2024
1 parent c565624 commit 5bb4774
Showing 1 changed file with 15 additions and 8 deletions.
23 changes: 15 additions & 8 deletions abipy/scripts/abiml.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit 5bb4774

Please sign in to comment.