fix(generator): document CALYPSO model deviation args#1886
Conversation
Add CALYPSO-specific arginfo without accepting list-valued settings that the generator currently cannot consume, and keep the common model-deviation selection keys valid for CALYPSO runs. Authored by OpenClaw (model: custom-chat-jinzhezeng-group/gpt-5.5)
📝 WalkthroughWalkthroughAdds a new ChangesCALYPSO Model Deviation Schema
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 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.
Actionable comments posted: 1
🧹 Nitpick comments (1)
dpgen/generator/arginfo.py (1)
624-625: ⚡ Quick winUse a NumPy-style docstring for the new function
model_devi_calypso_args()currently uses a single-line docstring. Please switch to NumPy style (Returnssection at minimum) to match repository rules fordpgen/**/*.py.
As per coding guidelines, "Use Numpy-style docstrings for functions and classes".🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@dpgen/generator/arginfo.py` around lines 624 - 625, The function `model_devi_calypso_args()` currently uses a single-line docstring format. Convert it to NumPy-style docstring format by expanding the docstring to include a Returns section that documents the return type and description of what the function returns (a list of Argument objects). Follow the NumPy docstring convention used elsewhere in the dpgen module to maintain consistency with repository guidelines.Source: Coding guidelines
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@dpgen/generator/arginfo.py`:
- Around line 743-746: The Argument definition for "model_devi_max_iter" is
marked as optional=True, but it is required when "calypso_input_path" is
present, causing configs to pass validation but fail at runtime in
make_model_devi(). Either remove the optional=True flag to make
"model_devi_max_iter" always required, or add conditional validation logic that
enforces "model_devi_max_iter" as a required field specifically when
"calypso_input_path" is provided. Ensure the validation occurs early enough to
prevent runtime failures during CALYPSO execution.
---
Nitpick comments:
In `@dpgen/generator/arginfo.py`:
- Around line 624-625: The function `model_devi_calypso_args()` currently uses a
single-line docstring format. Convert it to NumPy-style docstring format by
expanding the docstring to include a Returns section that documents the return
type and description of what the function returns (a list of Argument objects).
Follow the NumPy docstring convention used elsewhere in the dpgen module to
maintain consistency with repository guidelines.
🪄 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: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 63159001-97bb-4015-89df-e9d024072d74
📒 Files selected for processing (1)
dpgen/generator/arginfo.py
| Argument("calypso_input_path", str, optional=True, doc=doc_calypso_input_path), | ||
| Argument( | ||
| "model_devi_max_iter", int, optional=True, doc=doc_model_devi_max_iter | ||
| ), |
There was a problem hiding this comment.
calypso_input_path mode can pass validation but still fail at runtime
model_devi_max_iter is optional here, but make_model_devi() uses it as the iteration bound when calypso_input_path is present. This allows a config that passes arginfo and then crashes/fails during iteration bound handling in CALYPSO mode. Please enforce this as a conditional requirement (calypso_input_path => model_devi_max_iter) in schema validation or via explicit early validation in the CALYPSO run path.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@dpgen/generator/arginfo.py` around lines 743 - 746, The Argument definition
for "model_devi_max_iter" is marked as optional=True, but it is required when
"calypso_input_path" is present, causing configs to pass validation but fail at
runtime in make_model_devi(). Either remove the optional=True flag to make
"model_devi_max_iter" always required, or add conditional validation logic that
enforces "model_devi_max_iter" as a required field specifically when
"calypso_input_path" is provided. Ensure the validation occurs early enough to
prevent runtime failures during CALYPSO execution.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #1886 +/- ##
==========================================
+ Coverage 49.80% 49.94% +0.14%
==========================================
Files 83 83
Lines 14986 15028 +42
==========================================
+ Hits 7464 7506 +42
Misses 7522 7522 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Problem
_make_model_devi_native_calypso()passes those values directly tomake_calypso_input(), which expects scalarPsoRatio,PopSize,MaxStep,ICode,fmax, etc.model_devi_skipand force/virial trust levels, so existing CALYPSO run parameter files can be rejected during strict argument checking.Change
master.PSTRESSas a pressure list.Validation
uvx ruff format dpgen/generator/arginfo.pyuvx ruff check dpgen/generator/arginfo.pyuvx --with dargs --with dpdispatcher --with packaging python - <<'PY' ...(importedrun_jdata_arginfo()and strict-checked a representative CALYPSO arginfo dictionary)uvx pre-commit run --files dpgen/generator/arginfo.pyAuthored by OpenClaw (model: custom-chat-jinzhezeng-group/gpt-5.5)
Summary by CodeRabbit
Release Notes