Skip to content

Commit

Permalink
Update scf.py
Browse files Browse the repository at this point in the history
Signed-off-by: Peng Xingliang <[email protected]>
  • Loading branch information
pxlxingliang authored Oct 28, 2023
1 parent edb6d2d commit ef675f3
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions dpdata/abacus/scf.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import os
import re
import warnings

import numpy as np

Expand Down Expand Up @@ -138,7 +139,7 @@ def collect_force(outlines):
if (
j >= i + 10
): # if can not find the first line of force in 10 lines, then stop
print("Warning: can not find the first line of force")
warnings.warn("Warning: can not find the first line of force")
noforce = True
break

Check warning on line 144 in dpdata/abacus/scf.py

View check run for this annotation

Codecov / codecov/patch

dpdata/abacus/scf.py#L142-L144

Added lines #L142 - L144 were not covered by tests
if noforce:
Expand Down Expand Up @@ -173,7 +174,7 @@ def collect_stress(outlines):
if (
j >= i + 10
): # if can not find the first line of stress in 10 lines, then stop
print("Warning: can not find the first line of stress")
warnings.warn("Warning: can not find the first line of stress")
nostress = True
break

Check warning on line 179 in dpdata/abacus/scf.py

View check run for this annotation

Codecov / codecov/patch

dpdata/abacus/scf.py#L177-L179

Added lines #L177 - L179 were not covered by tests
if nostress:
Expand Down

0 comments on commit ef675f3

Please sign in to comment.