Skip to content

Commit e8bdc39

Browse files
committed
use stacklevel=2 for warning
1 parent e54c56c commit e8bdc39

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

deepmd/tf/fit/polar.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -576,7 +576,8 @@ def init_variables(
576576
)
577577
except GraphWithoutTensorError:
578578
warnings.warn(
579-
"You are trying to read a model trained with shift_diag=True, but the mean of the diagonal terms of the polarizability is not stored in the graph. This will lead to wrong inference results. You may train your model with the latest DeePMD-kit to avoid this issue."
579+
"You are trying to read a model trained with shift_diag=True, but the mean of the diagonal terms of the polarizability is not stored in the graph. This will lead to wrong inference results. You may train your model with the latest DeePMD-kit to avoid this issue.",
580+
stacklevel=2
580581
)
581582

582583
def enable_mixed_precision(self, mixed_prec: Optional[dict] = None) -> None:

0 commit comments

Comments
 (0)