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

docs: improve error message for inconsistent type maps #4074

Merged
merged 1 commit into from
Aug 22, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion deepmd/utils/data_system.py
Original file line number Diff line number Diff line change
Expand Up @@ -613,7 +613,11 @@
min_len = min([len(ii), len(ret)])
for idx in range(min_len):
if ii[idx] != ret[idx]:
raise RuntimeError(f"inconsistent type map: {ret!s} {ii!s}")
raise RuntimeError(

Check warning on line 616 in deepmd/utils/data_system.py

View check run for this annotation

Codecov / codecov/patch

deepmd/utils/data_system.py#L616

Added line #L616 was not covered by tests
f"Inconsistent type map: {ret!s} {ii!s} in different data systems. "
"If you didn't set model/type_map, please set it, "
"since the type map of the model cannot be decided by data."
)
if len(ii) > len(ret):
ret = ii
return ret
Expand Down