Skip to content

docs(argcheck): fix typos and wording in doc strings#5369

Queued
njzjz-bot wants to merge 6 commits intodeepmodeling:masterfrom
njzjz-bothub:docs/argcheck-doc-typos
Queued

docs(argcheck): fix typos and wording in doc strings#5369
njzjz-bot wants to merge 6 commits intodeepmodeling:masterfrom
njzjz-bothub:docs/argcheck-doc-typos

Conversation

@njzjz-bot
Copy link
Copy Markdown
Contributor

@njzjz-bot njzjz-bot commented Apr 3, 2026

Problem

  • deepmd/utils/argcheck.py contains multiple doc string typos and awkward phrases.
  • Several repeated descriptions use inconsistent grammar, which makes the generated documentation harder to read.
  • Some DPA-related sections use internal shorthand such as repinit, repformer, repflow, g1, g2, h2, and tebd without enough explanation for first-time readers.

Change

  • Fix spelling and grammar issues in descriptor and fitting doc strings.
  • Normalize repeated wording for trainable flags, neighbor-selection descriptions, and embedding formulas.
  • Clarify DPA2/DPA3 terminology while keeping the original internal names for code-to-doc traceability.
  • Keep the change documentation-only with no behavior changes.

Notes

  • Verified the file still compiles with python3 -m compileall deepmd/utils/argcheck.py.

Authored by OpenClaw (model: custom-chat-jinzhezeng-group/gpt-5.4)

Summary by CodeRabbit

  • Documentation
    • Improved in-code parameter and argument descriptions for grammar, clarity, and consistent terminology. Reworded multi-line descriptions, standardized notation (e.g., identifiers and notation styling), and clarified expectations for model/descriptor configuration options. These changes are documentation-only; no behavioral, API, default, or interface changes were made.

Problem
- argcheck.py contains multiple doc string typos and awkward phrases
- some repeated descriptions are grammatically inconsistent and harder to read

Change
- fix spelling and grammar issues in descriptor and fitting doc strings
- normalize repeated wording for trainable flags, neighbor selection, and embedding descriptions
- keep the change documentation-only with no behavior changes

Authored by OpenClaw (model: custom-chat-jinzhezeng-group/gpt-5.4)
@github-actions github-actions bot added the Python label Apr 3, 2026
@dosubot dosubot bot added the Docs label Apr 3, 2026
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Apr 3, 2026

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

Docstrings for argument-schema declarations in deepmd/utils/argcheck.py were revised for grammar, phrasing, terminology, and formatting (e.g., verb conjugation, identifier quoting). No executable logic, types, defaults, function signatures, or public APIs were changed.

Changes

Cohort / File(s) Summary
Docstring updates
deepmd/utils/argcheck.py
Rewrote numerous doc_* literals and doc= strings for Argument(...) entries to correct grammar, spelling, phrasing, and identifier formatting (e.g., G, tebd, g1/g2/h2, repformer/repflow). No changes to code paths, types, defaults, signatures, or runtime behavior.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the main change: fixing typos and wording in documentation strings in the argcheck module.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
deepmd/utils/argcheck.py (1)

1-4270: ⚠️ Potential issue | 🟡 Minor

Add stacklevel=2 to the warnings.warn() call at line 95 to fix ruff linting error B028.

The ruff format check passes, but the linting check fails with one error:

B028 No explicit `stacklevel` keyword argument found
  --> deepmd/utils/argcheck.py:95:13
   |
95 |             warnings.warn(f"{key} has been removed and takes no effect.", FutureWarning)
   |             ^^^^^^^^^^^^^

Update the warnings.warn() call in the deprecate_argument_extra_check() function to include the stacklevel parameter:

Fix for line 95
warnings.warn(f"{key} has been removed and takes no effect.", FutureWarning, stacklevel=2)
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@deepmd/utils/argcheck.py` around lines 1 - 4270, The warnings.warn call
inside deprecate_argument_extra_check (specifically in the inner function
deprecate_something) lacks an explicit stacklevel which triggers ruff B028;
update that call to pass stacklevel=2 (i.e., warnings.warn(..., FutureWarning,
stacklevel=2)) so the warning points to the caller site.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Outside diff comments:
In `@deepmd/utils/argcheck.py`:
- Around line 1-4270: The warnings.warn call inside
deprecate_argument_extra_check (specifically in the inner function
deprecate_something) lacks an explicit stacklevel which triggers ruff B028;
update that call to pass stacklevel=2 (i.e., warnings.warn(..., FutureWarning,
stacklevel=2)) so the warning points to the caller site.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: b7809182-df02-4c7a-80dd-e74ab8c6c63e

📥 Commits

Reviewing files that changed from the base of the PR and between b02fd91 and b688534.

📒 Files selected for processing (1)
  • deepmd/utils/argcheck.py

Problem
- DPA-related doc strings still contain jargon-heavy names such as repinit, repformer, repflow, g1, g2, h2, and tebd.
- These terms are familiar to maintainers but harder for new readers to interpret from the generated documentation alone.

Change
- clarify DPA2 and DPA3 doc strings with short human-readable explanations
- keep internal names such as g1, g2, h2, repinit, repformer, repflow, and tebd for code-to-doc traceability
- improve wording for type-embedding and symmetrization-related options

Authored by OpenClaw (model: custom-chat-jinzhezeng-group/gpt-5.4)
Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@deepmd/utils/argcheck.py`:
- Line 1123: The doc string variable doc_update_g2_has_g1g1 contains a Unicode
multiplication sign ("g1 × g1"); update its value to use an unambiguous ASCII
token (e.g., "g1 x g1" or "g1 * g1") instead, then run ruff check . and ruff
format . to ensure the change satisfies RUF001 and formatting rules.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 66ccfe66-4c81-4a31-b7a9-fb5ece27f87c

📥 Commits

Reviewing files that changed from the base of the PR and between b688534 and 1e4e714.

📒 Files selected for processing (1)
  • deepmd/utils/argcheck.py

Problem
- ruff flags the multiplication sign in the clarified g1g1 doc string as an ambiguous unicode character.

Change
- replace the unicode multiplication sign with plain ASCII  in the doc string

Authored by OpenClaw (model: custom-chat-jinzhezeng-group/gpt-5.4)
@njzjz njzjz requested a review from Copilot April 3, 2026 14:49
Problem
- trim trailing whitespace.................................................Passed
fix end of files.........................................................Passed
check yaml...............................................................Passed
check json...............................................................Passed
check for added large files..............................................Passed
check for merge conflicts................................................Passed
check for broken symlinks................................................Passed
check toml...............................................................Passed
isort....................................................................Passed
ruff (legacy alias)......................................................Passed
ruff format..............................................................Passed
Velin....................................................................Passed
mdformat.................................................................Passed
clang-format.............................................................Passed
prettier.................................................................Passed
shfmt....................................................................Passed
cmake-format.............................................................Passed
bibtex-tidy..............................................................Passed
Insert license in comments...............................................Passed
Insert license in comments...............................................Passed
Insert license in comments...............................................Passed
Insert license in comments...............................................Passed
Disallow improper capitalization.........................................Passed
pylint...................................................................Passed reformatted  via .

Change
- apply the formatter output without changing behavior

Authored by OpenClaw (model: custom-chat-jinzhezeng-group/gpt-5.4)
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR improves the generated documentation for DeepMD model/descriptor argument schemas by fixing typos/grammar and clarifying several parameter descriptions (notably around DPA2/DPA3 blocks), without changing runtime behavior.

Changes:

  • Corrected typos and grammar in multiple descriptor/fitting argument doc strings.
  • Normalized repeated wording (e.g., “trainable” flags, neighbor selection descriptions, type-embedding terminology).
  • Added clearer DPA2/DPA3 (repinit/repformer/repflow, g1/g2/h2) explanations while retaining internal names.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Problem
- PR review comments pointed out unclear shape descriptions, awkward wording in auto selection, and missing line breaks in  bullet lists.

Change
- use explicit  shape descriptions for dipole and polarizability labels
- replace "wrapped up to 4 divisible" with "rounded up to a multiple of 4" throughout
- add explicit line breaks to  bullet lists and improve related wording

Authored by OpenClaw (model: custom-chat-jinzhezeng-group/gpt-5.4)
Problem
- One remaining PR review comment pointed out that  used the awkward phrase "frame lines".

Change
- rephrase the DOS shape description to use "frames (rows)" and clearer column wording

Authored by OpenClaw (model: custom-chat-jinzhezeng-group/gpt-5.4)
@njzjz njzjz requested review from iProzd and wanghan-iapcm April 3, 2026 15:06
@codecov
Copy link
Copy Markdown

codecov bot commented Apr 3, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 82.37%. Comparing base (b02fd91) to head (69b2b4a).

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #5369      +/-   ##
==========================================
- Coverage   82.37%   82.37%   -0.01%     
==========================================
  Files         812      812              
  Lines       83560    83560              
  Branches     4091     4090       -1     
==========================================
- Hits        68832    68829       -3     
  Misses      13507    13507              
- Partials     1221     1224       +3     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@iProzd iProzd added this pull request to the merge queue Apr 7, 2026
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Apr 7, 2026
@njzjz njzjz added this pull request to the merge queue Apr 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants