[BUG] cp2k: `TypeError: only 0-dimensional arrays can be converted to Python scalars`
bugcp2k
### Bug summary
The recent CI runs reported an error on CP2K tests: `TypeError: only 0-dimensional arrays can be converted to Python scalars`. See the log below.
### dpdata Version
devel
### Input Files, Running Commands, Error Log, etc.
```
======================================================================
ERROR: test_nframs (test_cp2k_aimd_output.TestCp2kAimdStressOutput.test_nframs)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/runner/work/dpdata/dpdata/tests/test_cp2k_aimd_output.py", line 23, in setUp
self.system_1 = dpdata.LabeledSystem("cp2k/aimd_stress", fmt="cp2k/aimd_output")
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/runner/work/dpdata/dpdata/dpdata/system.py", line 197, in __init__
self.from_fmt(
File "/home/runner/work/dpdata/dpdata/dpdata/system.py", line 234, in from_fmt
return self.from_fmt_obj(load_format(fmt), file_name, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/runner/work/dpdata/dpdata/dpdata/system.py", line 1224, in from_fmt_obj
data = fmtobj.from_labeled_system(file_name, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/runner/work/dpdata/dpdata/dpdata/plugins/cp2k.py", line 25, in from_labeled_system
return tuple(Cp2kSystems(log_file, xyz_file, restart))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/runner/work/dpdata/dpdata/dpdata/cp2k/output.py", line 67, in __next__
assert math.isclose(
^^^^^^^^^^^^^
TypeError: only 0-dimensional arrays can be converted to Python scalars
```
### Steps to Reproduce
Run the UT.
### Further Information, Files, and Links
_No response_
关闭于 2026-01-14 0 条评论