deepmodeling / dpdata

Manipulating multiple atomic simulation data formats, including DeePMD-kit, VASP, LAMMPS, ABACUS, etc.
https://docs.deepmodeling.com/projects/dpdata/
GNU Lesser General Public License v3.0
188 stars 128 forks source link

[BUG] The LabeledSystem would raise error when the abacus log file does not contain force #662

Open floatingCatty opened 1 month ago

floatingCatty commented 1 month ago

Bug summary

This is caused by the get_force function in image would return an empty list [[]] if the log does not contain force data. Then, calling np.newaxis would raise an error.

dpdata Version

0.2.17

Input Files, Running Commands, Error Log, etc.

image

Steps to Reproduce

Just calling LabledSystem on abacus scf output without setting the cal_force tag would do.

Further Information, Files, and Links

No response

njzjz commented 1 month ago

The function may need a better error message. LabeledSystem always needs the force as it's designed for machine learning.

floatingCatty commented 1 month ago

Yeah, but not all machine learning task using DFT data are dependent on force and energy. Therefore, this error may prohibit people who using dpdata as a post processing tool of structure information.

Jinzhe Zeng @.***> 于2024年5月31日周五 13:44写道:

The function may need a better error message. LabeledSystem always needs the force as it's designed for machine learning.

— Reply to this email directly, view it on GitHub https://github.com/deepmodeling/dpdata/issues/662#issuecomment-2141271516, or unsubscribe https://github.com/notifications/unsubscribe-auth/APKG4TOZCDOWX3BCWAHWAPTZFAE2TAVCNFSM6AAAAABIHNLT46VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCNBRGI3TCNJRGY . You are receiving this because you authored the thread.Message ID: @.***>

pxlxingliang commented 4 weeks ago

This bug will fixed in https://github.com/deepmodeling/dpdata/pull/669