dpti icon indicating copy to clipboard operation
dpti copied to clipboard

And example CLI command and fix small bugs

Open felix5572 opened this issue 7 months ago • 1 comments

Summary by CodeRabbit

  • New Features

    • Added example workflows, configuration files, and scripts for Sn high-pressure and water phase diagram simulations, including step-by-step guides for running NPT, NVT, HTI, and TI simulations.
    • Introduced scripts to automate model downloads and simulation workflows.
    • Added new compressed model files and LAMMPS data/configuration files for water and ice systems.
  • Bug Fixes

    • Improved compatibility in handling missing files and parameter key fallbacks in simulation setup and Gibbs free energy calculations.
    • Updated formatting for thermodynamic output in LAMMPS input scripts and tests for consistency.
  • Documentation

    • Major README overhaul: clarified usage, simplified setup instructions, updated links, and removed outdated Airflow content.
    • Added a detailed (deprecated) workflow README for Airflow-based free energy calculations.
  • Chores

    • Updated dependencies by commenting out Airflow and relaxing SQLAlchemy version constraints.
    • Enhanced test configuration and coverage with new hooks and updated test expectations.

felix5572 avatar Jun 11 '25 15:06 felix5572

📝 Walkthrough

Walkthrough

This update introduces new example files and scripts for molecular simulation workflows, adjusts parameter handling and output formatting in core modules, enhances test configuration and coverage, and revises documentation for clarity and current usage. The changes also improve compatibility with varying input conventions and simplify dependency management in the project configuration.

Changes

File(s) Change Summary
dpti/equi.py Updated gen_equi_ensemble_settings signature to set if_dump_avg_posi default to False.
dpti/hti_liq.py Moved assignment to jdata["model"] inside conditional to avoid errors when model is None.
dpti/hti_water.py Added fallback mechanism for sigma parameter keys in three functions, supporting alternate dictionary key names.
dpti/ti.py
tests/benchmark_gdi/deepmd/0/in.lammps
tests/benchmark_ti/path-p/in.lammps
tests/benchmark_ti/path-p/task.000006/in.lammps
tests/benchmark_ti/path-t/task.000006/in.lammps
tests/benchmark_ti_water/new_job/task.000003/in.lammps
tests/test_ti_gen_lammps_input.py
Changed LAMMPS thermo_modify format from 4*8 %20.6f to float %20.6f in code and tests.
dpti/hti.py Added fallback to load equi_settings.json if jdata.json is missing when computing Gibbs free energy.
examples/Sn_High_Pressure/command.sh
examples/water_SCAN/ice04/command.sh
examples/download_models.sh
Added new shell scripts for running simulation workflows and downloading models.
examples/Sn_High_Pressure/conf.lmp
examples/Sn_High_Pressure/hti.json
Added/modified configuration and reference files for Sn high-pressure example.
examples/water_SCAN/H2O-Phase-Diagram-model_compressed.pb
examples/water_SCAN/ice04/ice04.lmp
Added compressed model and LAMMPS data files for water/ice example.
examples/water_SCAN/ice04/graph.pb
examples/Sn_High_Pressure/conf.lmp
Added reference files pointing to model files.
examples/water_SCAN/ice04/hti_ice.json
examples/water_SCAN/ice04/npt.json
examples/water_SCAN/ice04/nvt.json
examples/water_SCAN/ice04/path-p.json
examples/water_SCAN/ice04/path-t.json
Added new configuration JSON files for water/ice simulation workflows.
pyproject.toml Commented out apache-airflow dependency and removed sqlalchemy version constraint.
README.md Major revision: updated links, directory overview, example CLI commands, removed Airflow workflow instructions, updated Docker usage, and clarified documentation.
workflow/README.md Added detailed, deprecated Airflow workflow setup and usage documentation.
tests/conftest.py Added pytest_configure to print environment info and adjust sys.path for test imports.
tests/graph.pb Added comments with Huggingface model download URLs.
tests/test_hti_ff_spring.py Moved and updated test method for multi-element spring constant, adjusting expected values.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant ShellScript
    participant dpti_CLI
    participant LAMMPS
    participant OutputFiles

    User->>ShellScript: Run command.sh
    ShellScript->>dpti_CLI: dpti generate NPT/NVT/HTI/TI input files
    dpti_CLI->>OutputFiles: Write simulation input files
    ShellScript->>LAMMPS: Submit simulation jobs
    LAMMPS->>OutputFiles: Produce simulation results
    ShellScript->>dpti_CLI: dpti extract/compute (e.g., Gibbs free energy)
    dpti_CLI->>OutputFiles: Write processed results

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~40 minutes

Possibly related PRs

  • deepmodeling/dpti#90: Modifies gen_equi_ensemble_settings with conditional logic for if_dump_avg_posi and updates related function calls, directly relating to the function signature change in this PR.

[!NOTE]

⚡️ Unit Test Generation is now available in beta!

Learn more here, or try it out under "Finishing Touches" below.

✨ Finishing Touches
🧪 Generate unit tests
  • [ ] Create PR with unit tests
  • [ ] Post copyable unit tests in a comment

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
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai generate unit tests to generate unit tests for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

coderabbitai[bot] avatar Jun 11 '25 15:06 coderabbitai[bot]