docs(argcheck): fix typos and wording in doc strings#5369
docs(argcheck): fix typos and wording in doc strings#5369njzjz-bot wants to merge 6 commits intodeepmodeling:masterfrom
Conversation
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)
|
Note Reviews pausedIt 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 Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
📝 WalkthroughWalkthroughDocstrings for argument-schema declarations in Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~2 minutes 🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
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 | 🟡 MinorAdd
stacklevel=2to thewarnings.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 thedeprecate_argument_extra_check()function to include thestacklevelparameter: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
📒 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)
There was a problem hiding this comment.
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
📒 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)
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)
There was a problem hiding this comment.
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)
Codecov Report✅ All modified and coverable lines are covered by tests. 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. 🚀 New features to boost your workflow:
|
Problem
deepmd/utils/argcheck.pycontains multiple doc string typos and awkward phrases.repinit,repformer,repflow,g1,g2,h2, andtebdwithout enough explanation for first-time readers.Change
Notes
python3 -m compileall deepmd/utils/argcheck.py.Authored by OpenClaw (model: custom-chat-jinzhezeng-group/gpt-5.4)
Summary by CodeRabbit