Skip to content

Conversation

Copilot
Copy link
Contributor

@Copilot Copilot AI commented Aug 22, 2025

This PR replaces the placeholder CALYPSO implementation in model_devi_args() with comprehensive argument definitions that reflect the actual usage in the codebase.

Problem

The CALYPSO variant in dpgen.generator.arginfo.model_devi_args() had an empty argument list [] and placeholder documentation "TODO: add doc", making it impossible for users to properly configure CALYPSO-based model deviation tasks.

Solution

Added a complete model_devi_calypso_args() function that defines all CALYPSO-specific parameters based on:

  • Real usage patterns in /examples/run/dp-calypso-vasp/param.json
  • Implementation details in /dpgen/generator/lib/make_calypso.py
  • Test cases in /tests/generator/test_calypso.py

Key Features

  • Complete parameter coverage: All 16 CALYPSO parameters including crystal structure settings, optimization controls, and variable stoichiometry options
  • Flexible typing: Supports both single values and lists (e.g., PopSize: 30 or PopSize: [30, 50]) as used in practice
  • Two operational modes:
    • Native mode: Define structures via model_devi_jobs with detailed parameter specifications
    • External mode: Use pre-existing input.dat files via calypso_input_path + model_devi_max_iter
  • Comprehensive documentation: Each parameter includes detailed descriptions with units and valid ranges

Parameters Added

  • Crystal structure: NameOfAtoms, NumberOfAtoms, NumberOfFormula, Volume, DistanceOfIon
  • Optimization settings: PopSize, MaxStep, ICode, PsoRatio, Split
  • Variable stoichiometry control: VSC, MaxNumAtom, CtrlRange
  • Physical conditions: PSTRESS (pressure), fmax (force convergence)
  • External file mode: calypso_input_path, model_devi_max_iter, vsc

Validation

All parameters have been validated against real usage:

  • ✅ Matches example configurations in /examples/run/dp-calypso-vasp/
  • ✅ Covers all test cases in /tests/generator/test_calypso.py
  • ✅ Aligns with implementation in /dpgen/generator/lib/make_calypso.py
  • ✅ Supports both single values and list formats as used in practice

This change enables proper documentation generation and validation for CALYPSO workflows while maintaining full backward compatibility.

Fixes #773.


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

@Copilot Copilot AI changed the title [WIP] [Documentation] add model_devi Variant calypso [Documentation] Add comprehensive CALYPSO model_devi arguments Aug 22, 2025
@Copilot Copilot AI requested a review from njzjz August 22, 2025 15:38
Copilot finished work on behalf of njzjz August 22, 2025 15:38
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.

[Documentation] add model_devi Variant calypso

2 participants