Skip to content

Conversation

felix5572
Copy link
Contributor

@felix5572 felix5572 commented Jun 11, 2025

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.

Copy link

coderabbitai bot commented Jun 11, 2025

📝 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
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~40 minutes

Possibly related PRs

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.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 5

🔭 Outside diff range comments (1)
dpti/hti_water.py (1)

67-78: ⚠️ Potential issue

Fallback may still return None → formatting crash

dict.get(... ) or dict.get(...) works, but if neither key exists the result is None; the subsequent f"{sigma_oo:f}" will raise TypeError: unsupported format string passed to NoneType.
Guard explicitly and fail fast with a helpful error.

-    sigma_oo = sparam.get("sigma_oo", None) or sparam.get("sigma_0_0")
-    sigma_oh = sparam.get("sigma_oh", None) or sparam.get("sigma_0_1")
-    sigma_hh = sparam.get("sigma_hh", None) or sparam.get("sigma_1_1")
+    try:
+        sigma_oo = sparam["sigma_oo"] if "sigma_oo" in sparam else sparam["sigma_0_0"]
+        sigma_oh = sparam["sigma_oh"] if "sigma_oh" in sparam else sparam["sigma_0_1"]
+        sigma_hh = sparam["sigma_hh"] if "sigma_hh" in sparam else sparam["sigma_1_1"]
+    except KeyError as exc:
+        raise KeyError(f"Missing LJ sigma parameter ({exc.args[0]}) in soft_param") from exc
🧹 Nitpick comments (7)
dpti/ti.py (1)

109-115: Duplicate thermo_modify emission – collapse to one call

thermo_modify format float %20.6f is identical for the nvt and npt branches. You can emit it once after the ensemble-selection block to avoid drift if the format string changes again.

-    if ens == "nvt":
-        ret += "thermo_style    custom step ke pe etotal enthalpy temp press vol c_allmsd[*]\n"
-        ret += "thermo_modify   format float %20.6f\n"
-    elif "npt" in ens:
-        ret += "thermo_style    custom step ke pe etotal enthalpy temp press vol c_allmsd[*]\n"
-        ret += "thermo_modify   format float %20.6f\n"
+    ret += "thermo_style    custom step ke pe etotal enthalpy temp press vol c_allmsd[*]\n"
+    ret += "thermo_modify   format float %20.6f\n"
+    if not (ens == "nvt" or "npt" in ens):
+        raise RuntimeError(f"unknown ensemble {ens}\n")

Keeps behaviour identical, trims two lines, and eliminates future copy-paste edits.

dpti/equi.py (1)

134-148: Default-arg addition is 👍 but please adjust “npt” check

Making if_dump_avg_posi optional is a backward-compatible improvement – thanks.
Minor nit while you touch this area:
elif ens == "npt-iso" or ens == "npt": is slightly harder to read and can surprise with precedence in more complex expressions. A tuple-membership test is clearer and avoids the stray evaluation cost.

-    elif ens == "npt-iso" or ens == "npt":
+    elif ens in ("npt-iso", "npt"):
🧰 Tools
🪛 Pylint (3.3.7)

[refactor] 139-139: Consider merging these comparisons with 'in' by using 'ens in ('npt-iso', 'npt')'. Use a set instead if elements are hashable.

(R1714)

tests/conftest.py (1)

6-15: Avoid hard-wiring project root into sys.path at position 0

Inserting the root at index 0 before std-lib & site-packages can shadow system modules and make import order subtly different from production.
Safer pattern:

if project_root not in sys.path:
    sys.path.append(project_root)   # append, don’t prepend

or rely on pytest --pyargs behaviour instead.

The verbose print statements also clutter test output; consider using config.hook.pytest_terminal_summary or the logging module.

examples/Sn_High_Pressure/command.sh (4)

2-4: Quote arguments and use consistent flag styles in the NPT stage.

Wrap JSON filenames and output paths in quotes to guard against spaces, and prefer long-form flags for clarity:

-dpti equi gen npt.json -e npt-xy -t 200 -p 20000  -o NPT_sim/
+dpti equi gen "npt.json" --ensemble "npt-xy" --temperature "200" --pressure "20000" --output "NPT_sim/"

7-9: Activate or clearly document directory navigation in the NVT stage.

Commented cd lines can confuse users. Either perform the cd and subsequent extract in a subshell or use pushd/popd, for example:

mkdir -p NVT_sim && (
  dpti equi gen "equi_settings.json" --ensemble "nvt" --temperature "200" --pressure "20000" --conf-npt "./NPT_sim/new_job/" --output "NVT_sim/"
  cd NVT_sim/new_job/ || exit 1
  dpti equi extract . -o "nvt_last_dump.lmp"
)

12-15: Remove or annotate commented alternative HTI commands.

The commented dpti hti_water and dpti hti_ice lines may mislead. Either delete them or add context:

# For aqueous systems:
# dpti hti_water gen hti_water.json -o HTI_water/
# For ice phases:
# dpti hti_ice gen hti_ice.json --scheme three-step -o HTI_ice/

18-19: Quote file paths and unify flag naming in the TI stage.

Consistently quote directory paths and use long-form flags to improve readability:

-dpti ti gen ti_settings.json -o TI_sim/
+dpti ti gen "ti_settings.json" --output "TI_sim/"

-dpti ti compute ./TI_sim/new_job/  --hti ../HTI_sim/new_job/
+dpti ti compute "./TI_sim/new_job/" --hti "../HTI_sim/new_job/"
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between ceea761 and 0deff46.

📒 Files selected for processing (17)
  • dpti/__init__.py (1 hunks)
  • dpti/equi.py (1 hunks)
  • dpti/hti_liq.py (1 hunks)
  • dpti/hti_water.py (1 hunks)
  • dpti/ti.py (1 hunks)
  • examples/Sn_High_Pressure/command.sh (1 hunks)
  • examples/Sn_High_Pressure/conf.lmp (1 hunks)
  • examples/Sn_High_Pressure/hti.json (1 hunks)
  • tests/benchmark_gdi/deepmd/0/in.lammps (1 hunks)
  • tests/benchmark_ti/path-p/in.lammps (1 hunks)
  • tests/benchmark_ti/path-p/task.000006/in.lammps (1 hunks)
  • tests/benchmark_ti/path-t/task.000006/in.lammps (1 hunks)
  • tests/benchmark_ti_water/new_job/task.000003/in.lammps (1 hunks)
  • tests/conftest.py (1 hunks)
  • tests/graph.pb (1 hunks)
  • tests/test_hti_ff_spring.py (1 hunks)
  • tests/test_ti_gen_lammps_input.py (2 hunks)
🧰 Additional context used
🧬 Code Graph Analysis (1)
tests/test_hti_ff_spring.py (1)
dpti/hti.py (1)
  • _ff_spring (241-257)
🪛 Pylint (3.3.7)
dpti/__init__.py

[error] 15-15: Undefined variable name 'workflows' in all

(E0603)

🪛 Shellcheck (0.10.0)
examples/Sn_High_Pressure/command.sh

[error] 1-1: Tips depend on target shell and yours is unknown. Add a shebang or a 'shell' directive.

(SC2148)

🔇 Additional comments (8)
examples/Sn_High_Pressure/conf.lmp (1)

1-1: Approve new LAMMPS config file.
The file correctly specifies beta.lmp as the input reference for the Sn_High_Pressure workflow.

Please confirm that conf.lmp is consumed by the command.sh script and documented in the example usage.

tests/benchmark_gdi/deepmd/0/in.lammps (1)

27-29: Format update looks correct

Switching to format float %20.6f matches the current LAMMPS syntax and is already reflected in the generator.

examples/Sn_High_Pressure/hti.json (1)

2-2: Confirm relative path for equi_conf

"equi_conf": "nvt_last_dump.lmp" assumes the file exists in the HTI job folder when the JSON is consumed. Double-check the preceding NVT step writes the dump there (or adjust to a relative/absolute path).

tests/graph.pb (1)

5-5: Helpful download hint

Thanks for adding the compressed-model URL – improves reproducibility.

dpti/hti_liq.py (1)

361-367: Assignment now safely guarded – looks good

Moving jdata["model"] = copied_model inside the if model: block prevents a KeyError when model is None. No further issues spotted.

tests/benchmark_ti/path-p/task.000006/in.lammps (1)

29-29: Syntax now matches LAMMPS docs

thermo_modify format float %20.6f is the correct order (format keyword first). 👍

tests/test_ti_gen_lammps_input.py (1)

65-65: Tests updated correctly

Expectations use the correct thermo_modify format float %20.6f string; aligns with generation logic.

Also applies to: 131-131

tests/benchmark_ti_water/new_job/task.000003/in.lammps (1)

30-30: Thermo format string change LGTM

Switching to format float %20.6f is consistent with other scripts and easier to read; no issues spotted.

Comment on lines +53 to +67
def test_spring_var_spring_multiple_element(self):
input = {"lamb": 0.20, "m_spring_k": [118.71, 207.2], "var_spring": False}
ret1 = textwrap.dedent(
"""\
group type_1 type 1
group type_2 type 2
fix l_spring_1 type_1 spring/self 1.1871000000e+02
fix_modify l_spring_1 energy yes
fix l_spring_2 type_2 spring/self 2.0720000000e+02
fix_modify l_spring_2 energy yes
variable l_spring equal f_l_spring_1+f_l_spring_2
"""
)
ret2 = dpti.hti._ff_spring(**input)
self.assertEqual(ret1, ret2)
Copy link

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

Duplicate scenario & misleading test name

test_spring_var_spring_multiple_element sets var_spring=False, so it exercises the same code path already covered by test_spring_multiple_element.
Either:

  1. Rename to reflect it is a non-varying spring with a different λ, or
  2. Change var_spring to True and update expected constants to k*(1-λ) so the varying-spring branch for multiple elements is actually tested.

Removing redundancy will keep the suite fast and intention-revealing.

🤖 Prompt for AI Agents
In tests/test_hti_ff_spring.py around lines 53 to 67, the test named
test_spring_var_spring_multiple_element sets var_spring to False, duplicating
the code path of test_spring_multiple_element. To fix this, either rename the
test to indicate it tests a non-varying spring with a different lambda value or
change var_spring to True and update the expected output constants to reflect
k*(1-lambda), ensuring the varying spring branch for multiple elements is
actually tested and removing redundancy.

@@ -0,0 +1,19 @@
# NPT
Copy link

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

Add a shebang and enable strict mode for portability and safety.

Without a shebang, the script may run under an unexpected shell. Enabling strict mode (-euo pipefail) ensures early failure on errors and prevents silent bugs.

Apply this diff:

+#!/usr/bin/env bash
+set -euo pipefail
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
# NPT
#!/usr/bin/env bash
set -euo pipefail
# NPT
🧰 Tools
🪛 Shellcheck (0.10.0)

[error] 1-1: Tips depend on target shell and yours is unknown. Add a shebang or a 'shell' directive.

(SC2148)

🤖 Prompt for AI Agents
In examples/Sn_High_Pressure/command.sh at line 1, add a shebang line (e.g.,
#!/bin/bash) at the very top of the script to specify the shell interpreter.
Immediately after the shebang, enable strict mode by adding set -euo pipefail to
ensure the script exits on errors, treats unset variables as errors, and fails
on pipeline errors for better safety and portability.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 0deff46 and ccf268c.

📒 Files selected for processing (12)
  • dpti/hti.py (1 hunks)
  • examples/water_SCAN/H2O-Phase-Diagram-model_compressed.pb (1 hunks)
  • examples/water_SCAN/ice04/command.sh (1 hunks)
  • examples/water_SCAN/ice04/conf.lmp (1 hunks)
  • examples/water_SCAN/ice04/graph.pb (1 hunks)
  • examples/water_SCAN/ice04/hti_ice.json (1 hunks)
  • examples/water_SCAN/ice04/ice04.lmp (1 hunks)
  • examples/water_SCAN/ice04/npt.json (1 hunks)
  • examples/water_SCAN/ice04/nvt.json (1 hunks)
  • examples/water_SCAN/ice04/path-p.json (1 hunks)
  • examples/water_SCAN/ice04/path-t.json (1 hunks)
  • tests/graph.pb (1 hunks)
✅ Files skipped from review due to trivial changes (9)
  • examples/water_SCAN/ice04/graph.pb
  • examples/water_SCAN/ice04/conf.lmp
  • examples/water_SCAN/H2O-Phase-Diagram-model_compressed.pb
  • examples/water_SCAN/ice04/ice04.lmp
  • examples/water_SCAN/ice04/nvt.json
  • examples/water_SCAN/ice04/npt.json
  • examples/water_SCAN/ice04/path-p.json
  • examples/water_SCAN/ice04/path-t.json
  • examples/water_SCAN/ice04/hti_ice.json
🚧 Files skipped from review as they are similar to previous changes (1)
  • tests/graph.pb
🧰 Additional context used
🧠 Learnings (3)
📓 Common learnings
Learnt from: Yi-FanLi
PR: deepmodeling/dpti#70
File: dpti/equi.py:57-59
Timestamp: 2024-10-08T15:32:11.479Z
Learning: The `gen_equi_header` function in `dpti/equi.py` now includes a `custom_variables` parameter to handle custom variables in the LAMMPS input file. Ensure that unit tests cover this functionality.
Learnt from: Yi-FanLi
PR: deepmodeling/dpti#70
File: dpti/equi.py:57-59
Timestamp: 2024-08-04T02:54:28.797Z
Learning: The `gen_equi_header` function in `dpti/equi.py` now includes a `custom_variables` parameter to handle custom variables in the LAMMPS input file. Ensure that unit tests cover this functionality.
Learnt from: Yi-FanLi
PR: deepmodeling/dpti#70
File: dpti/equi.py:179-180
Timestamp: 2024-10-08T15:32:11.479Z
Learning: The `gen_equi_force_field` function in `dpti/equi.py` now includes an `append` parameter to append a user-defined string to the model file name in the `pair_style` line of the LAMMPS input file.
Learnt from: Yi-FanLi
PR: deepmodeling/dpti#70
File: dpti/equi.py:179-180
Timestamp: 2024-08-04T02:53:14.784Z
Learning: The `gen_equi_force_field` function in `dpti/equi.py` now includes an `append` parameter to append a user-defined string to the model file name in the `pair_style` line of the LAMMPS input file.
Learnt from: Yi-FanLi
PR: deepmodeling/dpti#70
File: dpti/equi.py:179-180
Timestamp: 2024-10-08T15:32:11.479Z
Learning: The `gen_equi_header` function in `dpti/equi.py` now includes a `custom_variables` parameter to handle custom variables in the LAMMPS input file.
Learnt from: Yi-FanLi
PR: deepmodeling/dpti#70
File: dpti/equi.py:179-180
Timestamp: 2024-08-04T02:53:14.784Z
Learning: The `gen_equi_header` function in `dpti/equi.py` now includes a `custom_variables` parameter to handle custom variables in the LAMMPS input file.
dpti/hti.py (6)
Learnt from: Yi-FanLi
PR: deepmodeling/dpti#70
File: dpti/equi.py:57-59
Timestamp: 2024-10-08T15:32:11.479Z
Learning: The `gen_equi_header` function in `dpti/equi.py` now includes a `custom_variables` parameter to handle custom variables in the LAMMPS input file. Ensure that unit tests cover this functionality.
Learnt from: Yi-FanLi
PR: deepmodeling/dpti#70
File: dpti/equi.py:57-59
Timestamp: 2024-08-04T02:54:28.797Z
Learning: The `gen_equi_header` function in `dpti/equi.py` now includes a `custom_variables` parameter to handle custom variables in the LAMMPS input file. Ensure that unit tests cover this functionality.
Learnt from: Yi-FanLi
PR: deepmodeling/dpti#70
File: dpti/equi.py:179-180
Timestamp: 2024-10-08T15:32:11.479Z
Learning: The `gen_equi_header` function in `dpti/equi.py` now includes a `custom_variables` parameter to handle custom variables in the LAMMPS input file.
Learnt from: Yi-FanLi
PR: deepmodeling/dpti#70
File: dpti/equi.py:179-180
Timestamp: 2024-08-04T02:53:14.784Z
Learning: The `gen_equi_header` function in `dpti/equi.py` now includes a `custom_variables` parameter to handle custom variables in the LAMMPS input file.
Learnt from: Yi-FanLi
PR: deepmodeling/dpti#70
File: dpti/equi.py:179-180
Timestamp: 2024-10-08T15:32:11.479Z
Learning: The `gen_equi_force_field` function in `dpti/equi.py` now includes an `append` parameter to append a user-defined string to the model file name in the `pair_style` line of the LAMMPS input file.
Learnt from: Yi-FanLi
PR: deepmodeling/dpti#70
File: dpti/equi.py:179-180
Timestamp: 2024-08-04T02:53:14.784Z
Learning: The `gen_equi_force_field` function in `dpti/equi.py` now includes an `append` parameter to append a user-defined string to the model file name in the `pair_style` line of the LAMMPS input file.
examples/water_SCAN/ice04/command.sh (6)
Learnt from: Yi-FanLi
PR: deepmodeling/dpti#70
File: dpti/equi.py:179-180
Timestamp: 2024-10-08T15:32:11.479Z
Learning: The `gen_equi_force_field` function in `dpti/equi.py` now includes an `append` parameter to append a user-defined string to the model file name in the `pair_style` line of the LAMMPS input file.
Learnt from: Yi-FanLi
PR: deepmodeling/dpti#70
File: dpti/equi.py:179-180
Timestamp: 2024-08-04T02:53:14.784Z
Learning: The `gen_equi_force_field` function in `dpti/equi.py` now includes an `append` parameter to append a user-defined string to the model file name in the `pair_style` line of the LAMMPS input file.
Learnt from: Yi-FanLi
PR: deepmodeling/dpti#70
File: dpti/equi.py:179-180
Timestamp: 2024-10-08T15:32:11.479Z
Learning: The `gen_equi_header` function in `dpti/equi.py` now includes a `custom_variables` parameter to handle custom variables in the LAMMPS input file.
Learnt from: Yi-FanLi
PR: deepmodeling/dpti#70
File: dpti/equi.py:179-180
Timestamp: 2024-08-04T02:53:14.784Z
Learning: The `gen_equi_header` function in `dpti/equi.py` now includes a `custom_variables` parameter to handle custom variables in the LAMMPS input file.
Learnt from: Yi-FanLi
PR: deepmodeling/dpti#70
File: dpti/equi.py:57-59
Timestamp: 2024-10-08T15:32:11.479Z
Learning: The `gen_equi_header` function in `dpti/equi.py` now includes a `custom_variables` parameter to handle custom variables in the LAMMPS input file. Ensure that unit tests cover this functionality.
Learnt from: Yi-FanLi
PR: deepmodeling/dpti#70
File: dpti/equi.py:57-59
Timestamp: 2024-08-04T02:54:28.797Z
Learning: The `gen_equi_header` function in `dpti/equi.py` now includes a `custom_variables` parameter to handle custom variables in the LAMMPS input file. Ensure that unit tests cover this functionality.
🪛 Pylint (3.3.7)
dpti/hti.py

[refactor] 1336-1336: Consider using 'with' for resource-allocating operations

(R1732)


[refactor] 1338-1338: Consider using 'with' for resource-allocating operations

(R1732)

🪛 Shellcheck (0.10.0)
examples/water_SCAN/ice04/command.sh

[error] 1-1: Tips depend on target shell and yours is unknown. Add a shebang or a 'shell' directive.

(SC2148)

🔇 Additional comments (1)
examples/water_SCAN/ice04/command.sh (1)

6-37: Excellent workflow documentation and command structure.

The script provides a comprehensive and well-documented workflow for molecular dynamics simulations using the dpti tool. The step-by-step process from NPT/NVT equilibration through HTI and TI calculations is clearly structured and educational for users.

Comment on lines +1334 to +1338
# Try jdata.json first, then equi_settings.json for compatibility
try:
npt_in = json.load(open(os.path.join(npt, "jdata.json")))
except FileNotFoundError:
npt_in = json.load(open(os.path.join(npt, "equi_settings.json")))
Copy link

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

Improve resource management while maintaining the fallback logic.

The fallback mechanism from jdata.json to equi_settings.json is a good improvement for compatibility. However, the file opening should use context managers to ensure proper resource cleanup.

Apply this diff to improve resource management:

-            # Try jdata.json first, then equi_settings.json for compatibility
-            try:
-                npt_in = json.load(open(os.path.join(npt, "jdata.json")))
-            except FileNotFoundError:
-                npt_in = json.load(open(os.path.join(npt, "equi_settings.json")))
+            # Try jdata.json first, then equi_settings.json for compatibility
+            try:
+                with open(os.path.join(npt, "jdata.json")) as f:
+                    npt_in = json.load(f)
+            except FileNotFoundError:
+                with open(os.path.join(npt, "equi_settings.json")) as f:
+                    npt_in = json.load(f)
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
# Try jdata.json first, then equi_settings.json for compatibility
try:
npt_in = json.load(open(os.path.join(npt, "jdata.json")))
except FileNotFoundError:
npt_in = json.load(open(os.path.join(npt, "equi_settings.json")))
# Try jdata.json first, then equi_settings.json for compatibility
try:
with open(os.path.join(npt, "jdata.json")) as f:
npt_in = json.load(f)
except FileNotFoundError:
with open(os.path.join(npt, "equi_settings.json")) as f:
npt_in = json.load(f)
🧰 Tools
🪛 Pylint (3.3.7)

[refactor] 1336-1336: Consider using 'with' for resource-allocating operations

(R1732)


[refactor] 1338-1338: Consider using 'with' for resource-allocating operations

(R1732)

🤖 Prompt for AI Agents
In dpti/hti.py around lines 1334 to 1338, the code opens JSON files without
using context managers, which can lead to resource leaks. Refactor the file
opening statements to use 'with' blocks for both 'jdata.json' and
'equi_settings.json' to ensure files are properly closed after reading, while
preserving the fallback logic from 'jdata.json' to 'equi_settings.json'.

Comment on lines +1 to +5
# docker pull yfb222333/dpti-lammps-fep:latest
# docker run -it --gpus all dpti-lammps-fep:latest
# all in /opt/
# all files in /opt/dpti/examples/water_SCAN/ice04/

Copy link

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

Add shebang line for proper shell script execution.

The workflow documentation is excellent and provides clear guidance for users. However, the script should include a shebang line to specify the shell interpreter.

Add this line at the beginning of the file:

+#!/bin/bash
 # docker pull yfb222333/dpti-lammps-fep:latest
 #  docker run -it --gpus all dpti-lammps-fep:latest
 # all in /opt/
 # all files in /opt/dpti/examples/water_SCAN/ice04/
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
# docker pull yfb222333/dpti-lammps-fep:latest
# docker run -it --gpus all dpti-lammps-fep:latest
# all in /opt/
# all files in /opt/dpti/examples/water_SCAN/ice04/
#!/bin/bash
# docker pull yfb222333/dpti-lammps-fep:latest
# docker run -it --gpus all dpti-lammps-fep:latest
# all in /opt/
# all files in /opt/dpti/examples/water_SCAN/ice04/
🧰 Tools
🪛 Shellcheck (0.10.0)

[error] 1-1: Tips depend on target shell and yours is unknown. Add a shebang or a 'shell' directive.

(SC2148)

🤖 Prompt for AI Agents
In examples/water_SCAN/ice04/command.sh at the beginning of the file, add a
shebang line such as #!/bin/bash to specify the shell interpreter for proper
script execution.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between ccf268c and e3943b3.

📒 Files selected for processing (1)
  • examples/download_models.sh (1 hunks)
🧰 Additional context used
🧠 Learnings (1)
📓 Common learnings
Learnt from: Yi-FanLi
PR: deepmodeling/dpti#70
File: dpti/equi.py:57-59
Timestamp: 2024-10-08T15:32:11.479Z
Learning: The `gen_equi_header` function in `dpti/equi.py` now includes a `custom_variables` parameter to handle custom variables in the LAMMPS input file. Ensure that unit tests cover this functionality.
Learnt from: Yi-FanLi
PR: deepmodeling/dpti#70
File: dpti/equi.py:57-59
Timestamp: 2024-08-04T02:54:28.797Z
Learning: The `gen_equi_header` function in `dpti/equi.py` now includes a `custom_variables` parameter to handle custom variables in the LAMMPS input file. Ensure that unit tests cover this functionality.
Learnt from: Yi-FanLi
PR: deepmodeling/dpti#70
File: dpti/equi.py:179-180
Timestamp: 2024-10-08T15:32:11.479Z
Learning: The `gen_equi_force_field` function in `dpti/equi.py` now includes an `append` parameter to append a user-defined string to the model file name in the `pair_style` line of the LAMMPS input file.
Learnt from: Yi-FanLi
PR: deepmodeling/dpti#70
File: dpti/equi.py:179-180
Timestamp: 2024-08-04T02:53:14.784Z
Learning: The `gen_equi_force_field` function in `dpti/equi.py` now includes an `append` parameter to append a user-defined string to the model file name in the `pair_style` line of the LAMMPS input file.
Learnt from: Yi-FanLi
PR: deepmodeling/dpti#70
File: dpti/equi.py:179-180
Timestamp: 2024-10-08T15:32:11.479Z
Learning: The `gen_equi_header` function in `dpti/equi.py` now includes a `custom_variables` parameter to handle custom variables in the LAMMPS input file.
Learnt from: Yi-FanLi
PR: deepmodeling/dpti#70
File: dpti/equi.py:179-180
Timestamp: 2024-08-04T02:53:14.784Z
Learning: The `gen_equi_header` function in `dpti/equi.py` now includes a `custom_variables` parameter to handle custom variables in the LAMMPS input file.
🪛 Shellcheck (0.10.0)
examples/download_models.sh

[error] 1-1: Tips depend on target shell and yours is unknown. Add a shebang or a 'shell' directive.

(SC2148)

🔇 Additional comments (1)
examples/download_models.sh (1)

3-3: Verify URL spelling and remove superfluous whitespace

The path segment Phase-Dirgram looks like a typo of “Diagram”; a broken URL will silently create an HTML error page saved as H2O-Phase-Diagram-model_compressed.pb.
Also there’s an extra space after wget.

-wget  https://huggingface.co/Felix5572/Water-Ice-SCAN-Phase-Dirgram/resolve/main/graph.pb -O H2O-Phase-Diagram-model_compressed.pb
+wget https://huggingface.co/Felix5572/Water-Ice-SCAN-Phase-Diagram/resolve/main/graph.pb -O H2O-Phase-Diagram-model_compressed.pb

Please confirm the correct repository slug before merging.

@@ -0,0 +1,3 @@
wget https://huggingface.co/Felix5572/Sn-SCAN-Compressed/resolve/main/graph.pb -O Sn_SCAN_compressed.pb
Copy link

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

Add she-bang and fail-fast options for predictable execution

Without a she-bang the script’s interpreter is ambiguous (SC2148).
Insert a standard header and strict mode so any network/download failure aborts the script immediately.

+#!/usr/bin/env bash
+# Download compressed DeepPot models required by example workflows
+set -euo pipefail
+
 wget https://huggingface.co/Felix5572/Sn-SCAN-Compressed/resolve/main/graph.pb -O Sn_SCAN_compressed.pb
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
wget https://huggingface.co/Felix5572/Sn-SCAN-Compressed/resolve/main/graph.pb -O Sn_SCAN_compressed.pb
#!/usr/bin/env bash
# Download compressed DeepPot models required by example workflows
set -euo pipefail
wget https://huggingface.co/Felix5572/Sn-SCAN-Compressed/resolve/main/graph.pb -O Sn_SCAN_compressed.pb
🧰 Tools
🪛 Shellcheck (0.10.0)

[error] 1-1: Tips depend on target shell and yours is unknown. Add a shebang or a 'shell' directive.

(SC2148)

🤖 Prompt for AI Agents
In examples/download_models.sh at line 1, add a she-bang line (e.g.,
#!/bin/bash) at the top to specify the script interpreter explicitly. Also,
enable fail-fast behavior by adding set -e to the script so it exits immediately
on any command failure, ensuring predictable execution and proper error handling
during the download process.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between e3943b3 and 662f792.

📒 Files selected for processing (1)
  • pyproject.toml (1 hunks)
🧰 Additional context used
🧠 Learnings (1)
📓 Common learnings
Learnt from: Yi-FanLi
PR: deepmodeling/dpti#70
File: dpti/equi.py:57-59
Timestamp: 2024-10-08T15:32:11.479Z
Learning: The `gen_equi_header` function in `dpti/equi.py` now includes a `custom_variables` parameter to handle custom variables in the LAMMPS input file. Ensure that unit tests cover this functionality.
Learnt from: Yi-FanLi
PR: deepmodeling/dpti#70
File: dpti/equi.py:57-59
Timestamp: 2024-08-04T02:54:28.797Z
Learning: The `gen_equi_header` function in `dpti/equi.py` now includes a `custom_variables` parameter to handle custom variables in the LAMMPS input file. Ensure that unit tests cover this functionality.
Learnt from: Yi-FanLi
PR: deepmodeling/dpti#70
File: dpti/equi.py:179-180
Timestamp: 2024-10-08T15:32:11.479Z
Learning: The `gen_equi_force_field` function in `dpti/equi.py` now includes an `append` parameter to append a user-defined string to the model file name in the `pair_style` line of the LAMMPS input file.
Learnt from: Yi-FanLi
PR: deepmodeling/dpti#70
File: dpti/equi.py:179-180
Timestamp: 2024-08-04T02:53:14.784Z
Learning: The `gen_equi_force_field` function in `dpti/equi.py` now includes an `append` parameter to append a user-defined string to the model file name in the `pair_style` line of the LAMMPS input file.
Learnt from: Yi-FanLi
PR: deepmodeling/dpti#70
File: dpti/equi.py:179-180
Timestamp: 2024-10-08T15:32:11.479Z
Learning: The `gen_equi_header` function in `dpti/equi.py` now includes a `custom_variables` parameter to handle custom variables in the LAMMPS input file.
Learnt from: Yi-FanLi
PR: deepmodeling/dpti#70
File: dpti/equi.py:179-180
Timestamp: 2024-08-04T02:53:14.784Z
Learning: The `gen_equi_header` function in `dpti/equi.py` now includes a `custom_variables` parameter to handle custom variables in the LAMMPS input file.
🔇 Additional comments (1)
pyproject.toml (1)

23-23: Airflow removed from hard dependencies – confirm no runtime imports remain

apache-airflow is now merely commented out. If any module still executes import airflow (directly or transitively), end-users will hit ModuleNotFoundError.
• Grep the codebase for “airflow” and either (a) move it to an [project.optional-dependencies] airflow = [...] extra or (b) re-add it as a required dep.

"dargs",
"dpdispatcher >= 0.3",
"sqlalchemy >=1.4.28,<2.0",
"sqlalchemy",
Copy link

Choose a reason for hiding this comment

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

💡 Verification agent

🧩 Analysis chain

Unpinning sqlalchemy exposes you to breaking API changes in 2.x

The code previously limited SQLAlchemy to <2.0; lifting that guard allows automatic upgrade to 2.x, whose ORM and core APIs contain several backwards-incompatible changes (e.g., engine.execute removal). Unless the codebase has already been ported, keep the upper bound.

-    "sqlalchemy",
+    "sqlalchemy >=1.4.28, <2.0",

To confirm whether we’ve unbounded SQLAlchemy and if there are any calls that would break under 2.x, let’s check the dependency spec and look for engine.execute usages:


🏁 Script executed:

#!/bin/bash
# Show how SQLAlchemy is currently specified
grep -n "sqlalchemy" pyproject.toml

# Find any direct calls to the removed Engine.execute API
grep -R "engine.execute" -n .

Length of output: 249


Pin SQLAlchemy to <2.0 to avoid unintended 2.x breakages

We’ve confirmed that pyproject.toml currently has an unbounded SQLAlchemy dependency and there are no obvious calls to the removed Engine.execute, but SQLAlchemy 2.x introduces several incompatible changes beyond that (ORM query API, typing, deprecations, etc.). Unless the entire codebase has been audited and updated for 2.0, it’s safest to restore an upper bound:

--- pyproject.toml
@@ lines 29
-    "sqlalchemy",
+    "sqlalchemy >=1.4.28, <2.0",

Please pin the version until you complete a full 2.0 compatibility pass.

🤖 Prompt for AI Agents
In pyproject.toml at line 29, the SQLAlchemy dependency is currently unbounded,
which risks compatibility issues with SQLAlchemy 2.x. To fix this, modify the
dependency specification to pin SQLAlchemy to a version less than 2.0 by adding
an upper bound constraint like "<2.0" to the version specifier. This ensures the
project uses a compatible version until a full upgrade to 2.0 is completed.

@felix5572 felix5572 closed this Jul 24, 2025
@felix5572 felix5572 reopened this Jul 24, 2025
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🧹 Nitpick comments (8)
README.md (4)

55-58: Fix multiple typos in introduction paragraph

anaylze, scirpts, and a few grammar issues weaken credibility.

-At first, dpti is a collection of python scripts to generate LAMMPS input scripts and to anaylze results from LAMMPS logs.<br />
-<br />In dpti, there are many MD simulations tasks and scripts need to be run sequentially or concurrently. Before and after these MD simulation tasks, we may run a lot of MD scirpts to prepare the input files or analyze the logs to extract the useful data.<br />
+Initially, **dpti** was a collection of Python scripts that generated LAMMPS inputs and analysed the resulting logs.<br />
+<br />In **dpti**, many MD-simulation tasks must be run sequentially or concurrently. Before and after these tasks we often run helper scripts to prepare input files or analyse logs and extract useful data.<br />

60-82: Add language identifier to fenced block & fix spelling

MD040 is triggered here and “usefule” is misspelled.

-```
+dpti directory tree  
+```text
 dpti/ # main directory for dpti python modules
-dpti/lib/ usefule libs for numberical integration and analysis, free energy calculation, etc.
+dpti/lib/ useful libs for numerical integration and analysis, free-energy calculation, etc.
 # example dir structure
 ...

---

`98-128`: **Mark example script blocks as Bash for syntax highlighting**

```diff
-```
+# Navigate to the example directory
+```bash
 ...
-```
+# Common dpti one-liners
+```bash
 ...

---

`181-184`: **Specify language for single-line CLI snippet**

```diff
-```
+```bash
 dpti ti compute ./TI_sim/new_job/  --hti ../HTI_sim/new_job/

</blockquote></details>
<details>
<summary>workflow/README.md (4)</summary><blockquote>

`66-71`: **Add correct language tag for airflow config snippet**

```diff
-```
+```ini
 # sql_alchemy_conn = sqlite:////home/fengbo/airflow/airflow.db
 # sql_alchemy_conn = postgres://airflow:airflow@localhost:5432/airflow
 sql_alchemy_conn = postgresql+psycopg2://<user>:<password>@<host>:<port>/<db_name>

---

`75-81`: **Fenced block missing language identifier**

Mark the database-reset commands as bash to satisfy `MD040`.
```diff
-```
+```bash
 # reset db
 airflow db init
 ...

---

`165-166`: **Grammar: remove “and etc.”**

```diff
-**Parameters:** Given temperature(or the range), Given pressure(or therange), force field,Lammps simulation ensemble and etc.
+**Parameters:** Temperature (or range), pressure (or range), force field, LAMMPS simulation ensemble, etc.

178-226: Duplicate section – please deduplicate to reduce maintenance cost

Lines 178-226 repeat the “For airflow workflow / TI_Workflow” description almost verbatim from 125-173. Recommend deleting one copy to avoid divergence in future edits.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 2b030ca and ebf7b9d.

📒 Files selected for processing (3)
  • README.md (9 hunks)
  • tests/benchmark_ti/path-t/task.000006/in.lammps (1 hunks)
  • workflow/README.md (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • tests/benchmark_ti/path-t/task.000006/in.lammps
🧰 Additional context used
🧠 Learnings (2)
📓 Common learnings
Learnt from: Yi-FanLi
PR: deepmodeling/dpti#70
File: dpti/equi.py:57-59
Timestamp: 2024-08-04T02:54:28.797Z
Learning: The `gen_equi_header` function in `dpti/equi.py` now includes a `custom_variables` parameter to handle custom variables in the LAMMPS input file. Ensure that unit tests cover this functionality.
Learnt from: Yi-FanLi
PR: deepmodeling/dpti#70
File: dpti/equi.py:57-59
Timestamp: 2024-10-08T15:32:11.479Z
Learning: The `gen_equi_header` function in `dpti/equi.py` now includes a `custom_variables` parameter to handle custom variables in the LAMMPS input file. Ensure that unit tests cover this functionality.
Learnt from: Yi-FanLi
PR: deepmodeling/dpti#70
File: dpti/equi.py:179-180
Timestamp: 2024-10-08T15:32:11.479Z
Learning: The `gen_equi_force_field` function in `dpti/equi.py` now includes an `append` parameter to append a user-defined string to the model file name in the `pair_style` line of the LAMMPS input file.
Learnt from: Yi-FanLi
PR: deepmodeling/dpti#70
File: dpti/equi.py:179-180
Timestamp: 2024-08-04T02:53:14.784Z
Learning: The `gen_equi_force_field` function in `dpti/equi.py` now includes an `append` parameter to append a user-defined string to the model file name in the `pair_style` line of the LAMMPS input file.
README.md (6)

Learnt from: Yi-FanLi
PR: #70
File: dpti/equi.py:179-180
Timestamp: 2024-10-08T15:32:11.479Z
Learning: The gen_equi_force_field function in dpti/equi.py now includes an append parameter to append a user-defined string to the model file name in the pair_style line of the LAMMPS input file.

Learnt from: Yi-FanLi
PR: #70
File: dpti/equi.py:179-180
Timestamp: 2024-08-04T02:53:14.784Z
Learning: The gen_equi_force_field function in dpti/equi.py now includes an append parameter to append a user-defined string to the model file name in the pair_style line of the LAMMPS input file.

Learnt from: Yi-FanLi
PR: #70
File: dpti/equi.py:179-180
Timestamp: 2024-08-04T02:53:14.784Z
Learning: The gen_equi_header function in dpti/equi.py now includes a custom_variables parameter to handle custom variables in the LAMMPS input file.

Learnt from: Yi-FanLi
PR: #70
File: dpti/equi.py:179-180
Timestamp: 2024-10-08T15:32:11.479Z
Learning: The gen_equi_header function in dpti/equi.py now includes a custom_variables parameter to handle custom variables in the LAMMPS input file.

Learnt from: Yi-FanLi
PR: #70
File: dpti/equi.py:57-59
Timestamp: 2024-10-08T15:32:11.479Z
Learning: The gen_equi_header function in dpti/equi.py now includes a custom_variables parameter to handle custom variables in the LAMMPS input file. Ensure that unit tests cover this functionality.

Learnt from: Yi-FanLi
PR: #70
File: dpti/equi.py:57-59
Timestamp: 2024-08-04T02:54:28.797Z
Learning: The gen_equi_header function in dpti/equi.py now includes a custom_variables parameter to handle custom variables in the LAMMPS input file. Ensure that unit tests cover this functionality.

🪛 markdownlint-cli2 (0.17.2)
README.md

20-20: Bare URL used

(MD034, no-bare-urls)


23-23: Bare URL used

(MD034, no-bare-urls)


66-66: Fenced code blocks should have a language specified

(MD040, fenced-code-language)


98-98: Fenced code blocks should have a language specified

(MD040, fenced-code-language)


108-108: Fenced code blocks should have a language specified

(MD040, fenced-code-language)


182-182: Fenced code blocks should have a language specified

(MD040, fenced-code-language)


225-225: Bare URL used

(MD034, no-bare-urls)


307-307: Fenced code blocks should have a language specified

(MD040, fenced-code-language)

workflow/README.md

54-54: Multiple spaces after hash on atx style heading

(MD019, no-multiple-space-atx)


66-66: Fenced code blocks should have a language specified

(MD040, fenced-code-language)


75-75: Fenced code blocks should have a language specified

(MD040, fenced-code-language)


99-99: Spaces inside code span elements

(MD038, no-space-in-code)


114-114: Link fragments should be valid

(MD051, link-fragments)


114-114: Link fragments should be valid

(MD051, link-fragments)


120-120: Link fragments should be valid

(MD051, link-fragments)


122-122: Link fragments should be valid

(MD051, link-fragments)


125-125: Trailing punctuation in heading
Punctuation: ':'

(MD026, no-trailing-punctuation)


141-141: Fenced code blocks should have a language specified

(MD040, fenced-code-language)


147-147: Fenced code blocks should have a language specified

(MD040, fenced-code-language)


153-153: Fenced code blocks should have a language specified

(MD040, fenced-code-language)


174-174: Trailing punctuation in heading
Punctuation: '.'

(MD026, no-trailing-punctuation)


178-178: Multiple headings with the same content

(MD024, no-duplicate-heading)


178-178: Trailing punctuation in heading
Punctuation: ':'

(MD026, no-trailing-punctuation)


194-194: Fenced code blocks should have a language specified

(MD040, fenced-code-language)


200-200: Fenced code blocks should have a language specified

(MD040, fenced-code-language)


206-206: Fenced code blocks should have a language specified

(MD040, fenced-code-language)

🪛 LanguageTool
workflow/README.md

[style] ~165-~165: Write the name of the item after ‘and’ or use only “etc”.
Context: ... force field,Lammps simulation ensemble and etc. we implement a workflow called TI_tas...

(AND_ETC)


[style] ~218-~218: Write the name of the item after ‘and’ or use only “etc”.
Context: ... force field,Lammps simulation ensemble and etc. we implement a workflow called TI_tas...

(AND_ETC)

⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: build (3.9)

Comment on lines +13 to 27
useful links:

github README.md: [https://github.com/deepmodeling/dpti/README.md](https://github.com/deepmodeling/dpti/README.md)

some discussion notes: [https://www.yuque.com/dpti/manual/ilzmlb](https://www.yuque.com/dpti/manual/ilzmlb)
On Bohrium Platform:
Bohrium notebook:
The basic usage of dpti, commands and examples:
https://www.bohrium.com/notebooks/82544159178

intruction to free energy calculation:
Demo site:
https://www.bohrium.com/apps/dpti


intruction to free energy calculation via thermodynamic integration method:
[https://nb.bohrium.dp.tech/detail/18465833825](https://nb.bohrium.dp.tech/detail/18465833825)
Copy link

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

Standardise “Useful links” section & avoid bare URLs

Convert the free-form list into a proper Markdown heading + bullet list, fix the typo “intruction”, and wrap raw URLs with angle brackets to silence MD034.

- useful links:
- github README.md:  [https://github.com/deepmodeling/dpti/README.md](https://github.com/deepmodeling/dpti/README.md)
- On Bohrium Platform:
- Bohrium notebook:
- The basic usage of dpti, commands and examples:
- https://www.bohrium.com/notebooks/82544159178
- Demo site:
- https://www.bohrium.com/apps/dpti
- intruction to free energy calculation via thermodynamic integration method:
- [https://nb.bohrium.dp.tech/detail/18465833825](https://nb.bohrium.dp.tech/detail/18465833825)
+ ## Useful links
+ - GitHub README <https://github.com/deepmodeling/dpti/README.md>
+ - Bohrium notebook – basic usage & examples <https://www.bohrium.com/notebooks/82544159178>
+ - Online demo <https://www.bohrium.com/apps/dpti>
+ - Introduction to thermodynamic-integration free-energy calculation <https://nb.bohrium.dp.tech/detail/18465833825>
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
useful links:
github README.md: [https://github.com/deepmodeling/dpti/README.md](https://github.com/deepmodeling/dpti/README.md)
some discussion notes: [https://www.yuque.com/dpti/manual/ilzmlb](https://www.yuque.com/dpti/manual/ilzmlb)
On Bohrium Platform:
Bohrium notebook:
The basic usage of dpti, commands and examples:
https://www.bohrium.com/notebooks/82544159178
intruction to free energy calculation:
Demo site:
https://www.bohrium.com/apps/dpti
intruction to free energy calculation via thermodynamic integration method:
[https://nb.bohrium.dp.tech/detail/18465833825](https://nb.bohrium.dp.tech/detail/18465833825)
## Useful links
- GitHub README <https://github.com/deepmodeling/dpti/README.md>
- Bohrium notebook – basic usage & examples <https://www.bohrium.com/notebooks/82544159178>
- Online demo <https://www.bohrium.com/apps/dpti>
- Introduction to thermodynamic-integration free-energy calculation <https://nb.bohrium.dp.tech/detail/18465833825>
🧰 Tools
🪛 markdownlint-cli2 (0.17.2)

20-20: Bare URL used

(MD034, no-bare-urls)


23-23: Bare URL used

(MD034, no-bare-urls)

🤖 Prompt for AI Agents
In README.md around lines 13 to 27, standardize the "Useful links" section by
adding a proper Markdown heading, converting the list into bullet points,
correcting the typo "intruction" to "instruction," and wrapping all raw URLs in
angle brackets to prevent Markdown linting errors related to bare URLs.

Comment on lines +136 to +139
### TI_Workflow
We implement a workflow de
implemented at `workflow/DpFreeEnergy.py`

Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue

Incomplete sentence – clarify TI workflow description

-### TI_Workflow
-We implement a workflow de
-implemented at `workflow/DpFreeEnergy.py`
+### TI workflow
+The DAG `workflow/DpFreeEnergy.py` automates NPT → NVT → HTI → TI to obtain free-energy data.
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
### TI_Workflow
We implement a workflow de
implemented at `workflow/DpFreeEnergy.py`
### TI workflow
The DAG `workflow/DpFreeEnergy.py` automates NPT → NVT → HTI → TI to obtain free‐energy data.
🤖 Prompt for AI Agents
In workflow/README.md around lines 136 to 139, the description of the
TI_Workflow is incomplete and unclear. Complete the sentence to clearly explain
what the TI_Workflow is and how it is implemented, ensuring the explanation is
concise and informative for readers.

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