Skip to content

[Code scan] Fix dptb test argument mismatch that raises before testing starts #358

Description

@njzjz

This issue is part of a Codex global repository scan.

Problem:
The test CLI parser defines INPUT, init_model, and output, then dispatches dict_args into _test(). _test() requires use_correction with no default, and the parser never supplies it.

Code references:
https://github.com/deepmodeling/deeptb/blob/86c60c73996f0dd961c3138f2e88424382cb734e/dptb/entrypoints/main.py#L260-L287
https://github.com/deepmodeling/deeptb/blob/86c60c73996f0dd961c3138f2e88424382cb734e/dptb/entrypoints/main.py#L600-L601
https://github.com/deepmodeling/deeptb/blob/86c60c73996f0dd961c3138f2e88424382cb734e/dptb/entrypoints/test.py#L22-L29

Impact:
dptb test ... raises TypeError: _test() missing 1 required positional argument: 'use_correction' before testing starts.

Suggested fix:
Either add a parser option for use_correction, or give _test() a default such as use_correction: Optional[str] = None.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    Status
    Todo

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions