Skip to content

Commit 4d3fd1e

Browse files
committedApr 18, 2024
Fix latex labels
1 parent fc290bf commit 4d3fd1e

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed
 

‎abipy/flowtk/psrepos.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -556,7 +556,7 @@ def get_all_registered_repos():
556556
_mk_onc(xc_name="PBEsol", relativity_type="FR", version="0.4"),
557557
_mk_onc(xc_name="PBE", relativity_type="SR", version="0.4"),
558558
#_mk_onc(xc_name="PBE", relativity_type="FR", version="0.4"), FIXME: checksum fails
559-
#_mk_onc(xc_name="LDA", relativity_type="SR", version="0.3"), FIXME: djrepo is not easy to regenerate
559+
_mk_onc(xc_name="LDA", relativity_type="SR", version="0.3"), #FIXME: djrepo is not easy to regenerate
560560
_mk_onc(xc_name="LDA", relativity_type="SR", version="0.4"),
561561
#_mk_onc(xc_name="LDA", relativity_type="FR", version="0.4"),
562562
]

‎abipy/ml/aseml.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -835,7 +835,7 @@ def plot_stresses(self, fontsize=6, **kwargs):
835835
ax.set_xlabel(f"{key1} {s_tex}", fontsize=fontsize)
836836
ax.set_title(f"{key1}/{key2} MAE: {stats.MAE:.6f}", fontsize=fontsize)
837837

838-
if "title" not in kwargs: fig.suptitle(f"Stresses in (eV/Ang^2) for {self.structure.latex_formula}")
838+
if "title" not in kwargs: fig.suptitle(f"Stresses in (eV/Ang$^3$) for {self.structure.latex_formula}")
839839
return fig
840840

841841
@add_fig_kwargs
@@ -991,7 +991,7 @@ def plot_stress_traj(self, delta_mode=True, markersize=2, fontsize=6, **kwargs):
991991
grid=True, legend=not delta_mode, legend_loc="upper left",
992992
ylabel=f"$|\Delta \sigma_{voigt_comp_tex}|$ " if delta_mode else "$\sigma$ ")
993993

994-
head = r"$\Delta \sigma$ (eV/Ang$^2$)" if delta_mode else "Stress tensor (eV/Ang$^2$)"
994+
head = r"$\Delta \sigma$ (eV/Ang$^3$)" if delta_mode else "Stress tensor (eV/Ang$^3$)"
995995
if "title" not in kwargs: fig.suptitle(f"{head} for {self.structure.latex_formula}")
996996

997997
return fig
@@ -1535,14 +1535,16 @@ class MyM3GNetCalculator(_MyCalculator, M3GNetCalculator):
15351535
if self.model_path is not None:
15361536
self._model = matgl.load_model(self.model_path)
15371537
else:
1538-
model_name = "M3GNet-MP-2021.2.8-PES" if self.model_name is None else self.model_name
1538+
#model_name = "M3GNet-MP-2021.2.8-PES" if self.model_name is None else self.model_name
1539+
model_name = "M3GNet-MP-2021.2.8-DIRECT-PES" if self.model_name is None else self.model_name
15391540
self._model = matgl.load_model(model_name)
15401541

15411542
class MyM3GNetCalculator(_MyCalculator, M3GNetCalculator):
15421543
"""Add abi_forces and abi_stress"""
15431544

15441545
cls = MyM3GNetCalculator if with_delta else M3GNetCalculator
1545-
calc = cls(potential=self._model)
1546+
# stress_weight (float): conversion factor from GPa to eV/A^3, if it is set to 1.0, the unit is in GPa
1547+
calc = cls(potential=self._model, stress_weight= 1/abu.eVA3_GPa)
15461548

15471549
elif self.nn_type == "chgnet":
15481550
try:

0 commit comments

Comments
 (0)