Skip to content

Commit

Permalink
Fix "ValueError: The truth value of an empty array is ambiguous. Use …
Browse files Browse the repository at this point in the history
…`array.size > 0` to check that an array is not empty."

Signed-off-by: Jinzhe Zeng <[email protected]>
  • Loading branch information
njzjz authored Dec 19, 2024
1 parent c1c93fb commit c1d07a7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tests/test_abacus_pw_scf.py
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ def test_noforcestress_job(self):
# check below will not throw error
system_ch4 = dpdata.LabeledSystem("abacus.scf", fmt="abacus/scf")
# check the returned force is empty
self.assertFalse(system_ch4.data["forces"])
self.assertFalse(system_ch4.data["forces"].size)
self.assertTrue("virials" not in system_ch4.data)
# test append self
system_ch4.append(system_ch4)
Expand Down

0 comments on commit c1d07a7

Please sign in to comment.