Skip to content

docs: add CALYPSO model deviation arginfo - #1887

Open
njzjz-bot wants to merge 3 commits into
deepmodeling:masterfrom
njzjz-bot:openclaw/calypso-arginfo-fix
Open

docs: add CALYPSO model deviation arginfo#1887
njzjz-bot wants to merge 3 commits into
deepmodeling:masterfrom
njzjz-bot:openclaw/calypso-arginfo-fix

Conversation

@njzjz-bot

@njzjz-bot njzjz-bot commented Jun 17, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Add CALYPSO-specific model_devi_engine argument metadata for generated configuration docs.
  • Normalize single-item list values used by the existing CALYPSO examples before generating input.dat.
  • Allow scalar PSTRESS values by normalizing them to the pressure list used for CALYPSO work directories.

Context

This follows up on #1795. While reviewing that PR, I found two issues:

  • pre-commit failed on formatting/trailing whitespace;
  • several documented single-item list forms (for example PopSize: [5] and fmax: [0.01]) were not normalized before reaching make_calypso_input(), which expects scalar values.

Tests

  • uvx pre-commit run --files dpgen/generator/arginfo.py dpgen/generator/lib/make_calypso.py dpgen/generator/run.py tests/generator/test_calypso.py
  • uv run --with pytest pytest tests/generator/test_calypso.py -q

Authored by OpenClaw (version: 2026.5.28, model: custom-chat-jinzhezeng-group/gpt-5.5)

Summary by CodeRabbit

  • New Features

    • Enhanced CALYPSO model-deviation engine with comprehensive configuration options for structure generation, optimization parameters, and convergence criteria.
    • Improved input parameter handling with automatic normalization for more flexible configuration formats.
  • Tests

    • Added validation test for parameter normalization in model-deviation workflows.

Add CALYPSO-specific model deviation argument metadata and normalize single-item list values used by existing CALYPSO examples before generating input.dat files. This keeps the generated docs aligned with runtime behavior.

Authored by OpenClaw (version: 2026.5.28, model: custom-chat-jinzhezeng-group/gpt-5.5)
@codecov

codecov Bot commented Jun 17, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 91.83673% with 4 lines in your changes missing coverage. Please review.
✅ Project coverage is 50.12%. Comparing base (7af5246) to head (856a6e0).
⚠️ Report is 4 commits behind head on master.

Files with missing lines Patch % Lines
dpgen/generator/lib/make_calypso.py 84.21% 3 Missing ⚠️
dpgen/generator/run.py 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1887      +/-   ##
==========================================
+ Coverage   49.80%   50.12%   +0.31%     
==========================================
  Files          83       83              
  Lines       14986    15027      +41     
==========================================
+ Hits         7464     7532      +68     
+ Misses       7522     7495      -27     

☔ View full report in Codecov by Harness.
📢 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.

@coderabbitai

coderabbitai Bot commented Jun 17, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Warning

Review limit reached

Next included review available in 59 minutes.

View limit details

Limit details: You’ve used all 2 included reviews currently available.

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Learn how review limits work.

Review configuration:

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: baf3903c-fe1e-41cf-a0b9-fe4b8e821eb3

📥 Commits

Reviewing files that changed from the base of the PR and between 7af5246 and 856a6e0.

📒 Files selected for processing (5)
  • dpgen/generator/arginfo.py
  • dpgen/generator/lib/make_calypso.py
  • dpgen/generator/run.py
  • tests/generator/test_calypso.py
  • tests/test_calypso_arginfo.py
📝 Walkthrough

Walkthrough

Adds a complete model_devi_calypso_args() argument schema for the CALYPSO engine and wires it into model_devi_args(). Introduces two normalization helpers—_normalize_calypso_scalar and _normalize_calypso_pressures—applied inside _make_model_devi_native_calypso and run.py to standardize scalar/list input shapes. A new test validates single-item list acceptance.

Changes

CALYPSO Engine Schema and Input Normalization

Layer / File(s) Summary
CALYPSO arginfo schema and engine wiring
dpgen/generator/arginfo.py
Introduces model_devi_calypso_args() with a repeatable model_devi_jobs list schema covering species/composition, distance constraints, PSO/optimization controls, VSC options, and convergence targets, plus top-level calypso_input_path, model_devi_max_iter, and vsc fields. Wires it into the calypso variant of model_devi_engine in model_devi_args(), replacing the previous empty placeholder.
Normalization helpers, application, and test
dpgen/generator/lib/make_calypso.py, dpgen/generator/run.py, tests/generator/test_calypso.py
Adds _normalize_calypso_scalar (raises on multi-item lists, unwraps single-item lists) and _normalize_calypso_pressures (wraps non-list values into a list). Applies the scalar normalizer to Volume, PsoRatio, PopSize, MaxStep, ICode, MaxNumAtom, and fmax inside _make_model_devi_native_calypso, and the pressure normalizer to PSTRESS there and in run.py before per-pressure subdirectory generation. New test asserts correct input.dat output when job fields are single-element lists.

Sequence Diagram(s)

sequenceDiagram
  participant run.py
  participant _normalize_calypso_pressures
  participant _make_model_devi_native_calypso
  participant _normalize_calypso_scalar

  run.py->>_normalize_calypso_pressures: cur_job.get("PSTRESS", [0.0001])
  _normalize_calypso_pressures-->>run.py: normalized pressure list
  run.py->>_make_model_devi_native_calypso: job dict, work path per pressure
  _make_model_devi_native_calypso->>_normalize_calypso_scalar: scalar fields (PsoRatio, PopSize, etc.)
  _normalize_calypso_scalar-->>_make_model_devi_native_calypso: unwrapped scalar
  _make_model_devi_native_calypso->>_normalize_calypso_pressures: PSTRESS field
  _normalize_calypso_pressures-->>_make_model_devi_native_calypso: pressure list
  _make_model_devi_native_calypso-->>run.py: writes input.dat
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Title check ⚠️ Warning The PR title 'docs: add CALYPSO model deviation arginfo' is misleading; the changeset primarily implements normalization logic for single-item list values and pressure handling, with documentation metadata being only one aspect. Consider a more comprehensive title like 'Add CALYPSO model deviation arginfo and normalize input values' that reflects both documentation and functional changes.
Docstring Coverage ⚠️ Warning Docstring coverage is 18.18% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ 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.

@njzjz-bot njzjz-bot left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Verdict: Two blocking issues remain; do not merge yet. Because this PR was opened by the active njzjz-bot account, GitHub does not allow the author to submit a REQUEST_CHANGES review, so this COMMENT review records the blocking findings. The scalar/singleton-list normalization is a good direction and the targeted CALYPSO tests pass, but the schema omits runtime-required fields and external-input mode lacks conditional validation.

Note: The Codex quota is about to reset, so I am using the remaining tokens to review all open PRs in this repository.

Coding agent: Codex
Codex version: codex-cli 0.144.6
Model: gpt-5.6-sol
Reasoning effort: xhigh

Argument(
"model_devi_max_iter", int, optional=True, doc=doc_model_devi_max_iter
),
Argument("vsc", bool, optional=True, default=False, doc=doc_vsc_mode),

@njzjz-bot njzjz-bot Aug 10, 2026

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

[Blocking] The CALYPSO variant ends here, but the labeling stage still unconditionally reads model_devi_skip, model_devi_f_trust_lo, and model_devi_f_trust_hi in the FP configuration path. A minimal configuration generated from this arginfo can pass schema validation and then fail with KeyError during FP selection. Please add the common model-deviation post-processing fields (including applicable clean/adaptive/virial settings and defaults), preferably via a shared LAMMPS/CALYPSO helper, and add a regression test that reaches FP using only schema-required fields.

),
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

@njzjz-bot njzjz-bot Aug 10, 2026

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

[Blocking] The documentation says model_devi_max_iter is required in calypso_input_path mode, but this still allows it to be omitted. The runtime uses jdata.get("model_devi_max_iter"); a missing value does not trigger the existing except KeyError and instead fails at iter_index > None with TypeError. Add explicit conditional validation before iteration and a missing-value test. Making the field globally required would not be correct because native-job mode does not need it.

@njzjz-bot njzjz-bot left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Independent review C

I found no blocking correctness, regression, security, or API issue in this change. CI/check evidence was considered alongside the full patch and relevant surrounding implementation. A formal APPROVE state cannot be submitted because the active njzjz-bot account is the PR author; GitHub self-review rules permit only a COMMENT review here.

Coding agent: Codex
Codex version: codex-cli 0.151.0
Model: gpt-5.6-sol
Reasoning effort: xhigh

@njzjz-bot njzjz-bot left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Independent review B\n\nBlocking finding: the CALYPSO variant omits selection parameters required by normal workflows.\n\nGitHub does not permit njzjz-bot to APPROVE or REQUEST_CHANGES on its own pull request, so the formal state is blocked by the self-review rule and this finding is submitted as COMMENT.\n\nCoding agent: Codex\nCodex version: codex-cli 0.151.0\nModel: gpt-5.6-sol\nReasoning effort: xhigh

Comment thread dpgen/generator/arginfo.py

@njzjz-bot njzjz-bot left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Independent review A

No blocking findings after reviewing the full diff, relevant surrounding implementation/tests, and the current check rollup. GitHub does not permit njzjz-bot to approve or request changes on its own PR, so this COMMENT review records the no-blocking-findings conclusion; no formal approval state is claimed.

Coding agent: Codex
Codex version: codex-cli 0.151.0
Model: gpt-5.6-sol
Reasoning effort: xhigh

Coding-Agent: Codex
Codex-Version: codex-cli 0.151.0
Model: gpt-5.6-sol
Reasoning-Effort: xhigh

@njzjz-bot njzjz-bot left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Independent re-review B

The scalar normalization and pressure handling are useful, but the new strict CALYPSO schema still rejects an existing supported configuration because model_devi_dt is omitted. Further changes are required from this review.

Coding agent: Codex
Codex version: codex-cli 0.151.0
Model: gpt-5.6-sol
Reasoning effort: xhigh

Comment thread dpgen/generator/arginfo.py

@njzjz-bot njzjz-bot left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Independent re-review C

No changes remain from this independent pass. GitHub does not allow njzjz-bot to formally approve its own PR, so this review is submitted as COMMENT rather than APPROVE.

Coding agent: Codex
Codex version: codex-cli 0.151.0
Model: gpt-5.6-sol
Reasoning effort: xhigh

@njzjz-bot njzjz-bot left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Independent re-review A

One change remains at 1918088. The new strict CALYPSO variant rejects the repository's existing CALYPSO parameter spelling because model_devi_dt is not declared. Because this PR is authored by njzjz-bot, GitHub does not permit this account to request changes on its own PR; this COMMENT means changes remain from independent re-review A.

Coding agent: Codex
Codex version: codex-cli 0.151.0
Model: gpt-5.6-sol
Reasoning effort: xhigh

Comment thread dpgen/generator/arginfo.py
Coding-Agent: Codex
Codex-Version: codex-cli 0.151.0
Model: gpt-5.6-sol
Reasoning-Effort: xhigh
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant