[WIP]rewrite workflow implementation. Add prefect framework. prepare for paper.
rewrite workflow implementation. Add prefect framework. prepare for paper.
Summary by CodeRabbit
-
New Features
- Introduced a comprehensive simulation framework that supports diverse thermodynamic integration and free energy calculations, including molecular dynamics workflows for liquids, water, and ice.
- Enhanced command-line interfaces and configuration options for generating, executing, and analyzing simulation tasks.
- Added advanced visualization tools to plot Gibbs free energy surfaces and compare simulation results.
- Improved infrastructure for dependency management, job execution, and file operations.
-
Tests & Examples
- Provided sample workflows and testing routines to demonstrate and validate the new features.
📝 Walkthrough
Walkthrough
This pull request introduces a comprehensive set of new modules and functionalities for molecular dynamics free energy calculations and thermodynamic integration. New simulation modules and workflows have been added to generate LAMMPS input files, manage simulation tasks, process results, and provide analysis and visualization tools. Additional infrastructure includes CLI interfaces, dependency‑injection services, report generators, file handlers, and utility scripts. The changes also update package inclusion patterns and add example configurations, LAMMPS data files, and testing workflows to support various simulation setups (e.g., high-pressure liquids and water–ice phase diagrams).
Changes
| File(s) | Change Summary |
|---|---|
dpti/hti_liq.py, dpti/ti.py, dpti/ti_water.py |
New simulation modules implementing Hamiltonian thermodynamic integration, LAMMPS input generation, task management, CLI handling, and water-specific integration workflows. |
dpti/workflows/{__init__.py, flows/base_flow.py, flows/flow_settings.py, flows/free_energy_ti_line.py},dpti/workflows/prefect/prefect_task_hash.py,dpti/workflows/service/{di.py, dpdispatcher_configs.py, file_handler.py, job_executor.py, report_generator.py, workflow_decorator.py, workflow_service_module.py} |
New workflow infrastructure including base flow classes, dynamic module imports, dependency injection, file handling, job execution, report generation, task decoration, and service module definitions. |
dpti/workflows/simulations/{base.py, equi_sim.py, hti_sim.py, result_base.py, ti_sim.py} |
New simulation framework components for NPT/NVT, HTI, and TI simulations with base classes, settings, input generators, result extractors, and utility functions for thermodynamic calculations. |
dpti/workflows/analyze/{build_gibbs_surface.py, compare_ti_plot.py} |
New analysis tools for constructing Gibbs free energy surfaces and comparing thermodynamic integration results through visualization and statistical functions. |
dpti/workflows/examples/{prefect_example_cmd.sh, Sn_SCAN_high_pressure/*, Water_Ice_Phase_Diagram/*} |
New example files including YAML configuration files, LAMMPS data files, shell scripts for deployment and file downloads, illustrating simulation setups for high-pressure systems and water–ice phase diagrams. |
pyproject.toml |
Updated package inclusion patterns to add "examples/*" and "jsons/*" alongside the existing "dpti*" pattern. |
.cursor/rules/dpti-default-ai-rules.mdc |
New guidelines and rule definitions for developing molecular dynamics free energy calculation applications. |
dpti/aitools/codebase/collect_py_files_context.py |
New utility script to collect, group, and save Python file contents from a specified directory into JSON format. |
tests/workflows/flows/test_flow_instance_method.py |
New test file defining a greeting workflow with instance methods and helper functions for Prefect flow integration. |
dpti/gdi.py |
Modified file path references for LAMMPS input files from "out.lmp" to "final.lmp", added debug print statements for task submission metadata, broadened backward file matching patterns, and enforced float casting for pressure and temperature parameters in GibbsDuhemFunc. |
.gitignore |
Added rule to ignore all directories matching *_*/ under dpti/workflows/examples/Sn_beta_quicktest/. |
Sequence Diagram(s)
sequenceDiagram
participant U as User
participant CLI as CLI Handler
participant WS as Workflow Service
participant SIM as Simulation Engine
participant REP as Report Generator
U->>CLI: Invoke simulation command
CLI->>WS: Initialize workflow (job generation, task creation)
WS->>SIM: Prepare simulation (LAMMPS input, configuration)
SIM->>SIM: Execute simulation tasks (NPT/NVT/HTI/TI)
SIM->>WS: Return simulation results
WS->>REP: Process results and generate reports
REP-->>U: Return report and artifacts
[!NOTE]
⚡️ AI Code Reviews for VS Code, Cursor, Windsurf
CodeRabbit now has a plugin for VS Code, Cursor and Windsurf. This brings AI code reviews directly in the code editor. Each commit is reviewed immediately, finding bugs before the PR is raised. Seamless context handoff to your AI code agent ensures that you can easily incorporate review feedback. Learn more here.
✨ Finishing Touches
- [ ] 📝 Generate Docstrings
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.
🪧 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
@coderabbitaiin a new review comment at the desired location with your query. Examples:-
@coderabbitai explain this code block. -
@coderabbitai modularize this function.
-
- PR comments: Tag
@coderabbitaiin 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 pauseto pause the reviews on a PR. -
@coderabbitai resumeto resume the paused reviews. -
@coderabbitai reviewto trigger an incremental review. This is useful when automatic reviews are disabled for the repository. -
@coderabbitai full reviewto do a full review from scratch and review all the files again. -
@coderabbitai summaryto regenerate the summary of the PR. -
@coderabbitai generate docstringsto generate docstrings for this PR. -
@coderabbitai generate sequence diagramto generate a sequence diagram of the changes in this PR. -
@coderabbitai resolveresolve all the CodeRabbit review comments. -
@coderabbitai configurationto show the current CodeRabbit configuration for the repository. -
@coderabbitai helpto get help.
Other keywords and placeholders
- Add
@coderabbitai ignoreanywhere in the PR description to prevent this PR from being reviewed. - Add
@coderabbitai summaryto generate the high-level summary at a specific location in the PR description. - Add
@coderabbitaianywhere in the PR title to generate the title automatically.
CodeRabbit Configuration File (.coderabbit.yaml)
- You can programmatically configure CodeRabbit by adding a
.coderabbit.yamlfile 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.