Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] UT on post_cp2k failed. #597

Closed
wanghan-iapcm opened this issue Nov 25, 2021 · 1 comment
Closed

[BUG] UT on post_cp2k failed. #597

wanghan-iapcm opened this issue Nov 25, 2021 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@wanghan-iapcm
Copy link
Contributor

Summary

UT on post_cp2k failed.

DPGEN Version and Platform

on devel branch

Expected Behavior

UT passes

Actual Behavior

UT failed with error log:

test_atom_names (tests.generator.test_post_fp.TestPostCP2K) ... /home/wanghan/study/deep.md/venvs/py3.6-tf1.8/lib/python3.6/site-packages/dpdata/plugins/cp2k.py:27: ResourceWarning: unclosed file <_io.TextIOWrapper name='iter.000000/02.fp/task.000.000000/output' mode='r' encoding='UTF-8'>
  = dpdata.cp2k.output.get_frames(file_name)
ERROR

======================================================================
ERROR: test_atom_names (tests.generator.test_post_fp.TestPostCP2K)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/wanghan/study/deep.md/dpgen/tests/generator/test_post_fp.py", line 242, in setUp
    post_fp(0, jdata)
  File "/home/wanghan/study/deep.md/dpgen/dpgen/generator/run.py", line 2837, in post_fp
    post_fp_cp2k(iter_index, jdata)
  File "/home/wanghan/study/deep.md/dpgen/dpgen/generator/run.py", line 2762, in post_fp_cp2k
    all_sys.to_deepmd_raw(sys_data_path)
  File "/home/wanghan/study/deep.md/venvs/py3.6-tf1.8/lib/python3.6/site-packages/dpdata/system.py", line 1263, in to_format
    return self.to_fmt_obj(ff(), *args, **kwargs)
  File "/home/wanghan/study/deep.md/venvs/py3.6-tf1.8/lib/python3.6/site-packages/dpdata/system.py", line 903, in to_fmt_obj
    return fmtobj.to_labeled_system(self.data, *args, **kwargs)
  File "/home/wanghan/study/deep.md/venvs/py3.6-tf1.8/lib/python3.6/site-packages/dpdata/format.py", line 77, in to_labeled_system
    return self.to_system(data, *args, **kwargs)
  File "/home/wanghan/study/deep.md/venvs/py3.6-tf1.8/lib/python3.6/site-packages/dpdata/plugins/deepmd.py", line 18, in to_system
    dpdata.deepmd.raw.dump(file_name, data)
  File "/home/wanghan/study/deep.md/venvs/py3.6-tf1.8/lib/python3.6/site-packages/dpdata/deepmd/raw.py", line 64, in dump
    nframes = data['cells'].shape[0]
AttributeError: 'list' object has no attribute 'shape'

----------------------------------------------------------------------
Ran 1 test in 0.007s

FAILED (errors=1)

Steps to Reproduce

at dpgen source roor, run

python -m unittest tests.generator.test_post_fp.TestPostCP2K  -f -v
@wanghan-iapcm wanghan-iapcm added the bug Something isn't working label Nov 25, 2021
@wanghan-iapcm
Copy link
Contributor Author

Fixed by #598

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants