Skip to content

[Code scan] Correct atomic-energy loss docs in dpmdargs fixture #125

Description

@njzjz

This issue was found by a Codex global code scan of the repository.

Affected code:

dargs/tests/dpmdargs.py

Lines 520 to 528 in b4db564

def loss_ener() -> list[Argument]:
doc_start_pref_e = start_pref("energy")
doc_limit_pref_e = limit_pref("energy")
doc_start_pref_f = start_pref("force")
doc_limit_pref_f = limit_pref("force")
doc_start_pref_v = start_pref("virial")
doc_limit_pref_v = limit_pref("virial")
doc_start_pref_ae = start_pref("atom_ener")
doc_start_pref_ae = limit_pref("atom_ener")

dargs/tests/dpmdargs.py

Lines 573 to 585 in b4db564

Argument(
"start_pref_ae",
[float, int],
optional=True,
default=0.00,
doc=doc_start_pref_v,
),
Argument(
"limit_pref_ae",
[float, int],
optional=True,
default=0.00,
doc=doc_limit_pref_v,

Problem:
The DeePMD-style fixture computes doc_start_pref_ae = start_pref("atom_ener"), then immediately overwrites the same variable with limit_pref("atom_ener"). Later, the start_pref_ae and limit_pref_ae arguments use the virial docs (doc_start_pref_v and doc_limit_pref_v) instead of the atomic-energy docs.

Observed behavior:
Generated fixture documentation describes atomic-energy loss prefactors as virial loss prefactors.

Expected behavior:
doc_limit_pref_ae should be assigned separately, and start_pref_ae / limit_pref_ae should use the atomic-energy doc variables.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Status
    Todo

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions