Skip to content

docs: add CALYPSO model deviation arginfo#1887

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

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

Conversation

@njzjz-bot

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

Copy link
Copy Markdown
Contributor

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.11111% with 4 lines in your changes missing coverage. Please review.
✅ Project coverage is 50.10%. Comparing base (7af5246) to head (fada1ca).

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.10%   +0.29%     
==========================================
  Files          83       83              
  Lines       14986    15023      +37     
==========================================
+ Hits         7464     7527      +63     
+ Misses       7522     7496      -26     

☔ 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

Caution

Review failed

Failed to post review comments

📝 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 and usage tips.

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