Skip to content

Conversation

OutisLi
Copy link
Contributor

@OutisLi OutisLi commented Sep 16, 2025

change the unit eV/A to eV/Å for dp test

Summary by CodeRabbit

  • Bug Fixes
    • Standardized unit display from eV/A and eV/A^2 to eV/Å and eV/Å^2 across all distance-related logs. Affects force metrics (MAE/RMSE, weighted, per-atom), Hessian, WFC, polarizability, dipole, and corresponding system-average summaries. Improves readability, aligns with scientific notation, and removes ambiguity in reported units. No changes to calculations or results—only log message text was updated.

@Copilot Copilot AI review requested due to automatic review settings September 16, 2025 08:52
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR updates the unit notation in logging output from "eV/A" to "eV/Å" (using the proper angstrom symbol) for the dp test command. The change ensures correct scientific notation for force, hessian, dipole, polarizability, and WFC measurements.

  • Updates force units from "eV/A" to "eV/Å" in logging statements
  • Updates hessian units from "eV/A^2" to "eV/Å^2" in logging statements
  • Updates dipole, polarizability, and WFC units from "eV/A" to "eV/Å" in logging statements

Copy link
Contributor

coderabbitai bot commented Sep 16, 2025

📝 Walkthrough

Walkthrough

Replaced occurrences of "eV/A" and "eV/A^2" with "eV/Å" and "eV/Å^2" in log/output strings within deepmd/entrypoints/test.py. No logic, data structure, or control-flow changes.

Changes

Cohort / File(s) Summary of Changes
Logging unit text updates
deepmd/entrypoints/test.py
Updated displayed units from eV/A and eV/A^2 to eV/Å and eV/Å^2 across force, hessian, WFC, polarizability, and dipole log messages; no code logic modifications.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title Check ✅ Passed The title "fix: change eV/A to eV/Å for dp test" is a concise, single-sentence summary that accurately describes the primary change (updating unit notation in test log messages) and aligns with the PR summary and file-level changes, making it clear to reviewers what the fix does.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
✨ Finishing touches
  • 📝 Generate Docstrings
🧪 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

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Contributor

@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 (1)
deepmd/entrypoints/test.py (1)

1072-1074: Fix missing f-strings in WFC logs (values not interpolated).

Both lines print the braces literally today. Make them f-strings.

-    log.info("# number of test data : {numb_test:d} ")
-    log.info("WFC  RMSE : {rmse_f:e} eV/Å")
+    log.info(f"# number of test data : {numb_test:d} ")
+    log.info(f"WFC  RMSE : {rmse_f:e} eV/Å")
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between dd55dff and 723d9cf.

📒 Files selected for processing (1)
  • deepmd/entrypoints/test.py (7 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
**/*.py

📄 CodeRabbit inference engine (.github/copilot-instructions.md)

**/*.py: Run ruff check and ruff format on all Python code before committing
Ensure Python code is formatted with ruff’s formatter

Files:

  • deepmd/entrypoints/test.py
🔇 Additional comments (7)
deepmd/entrypoints/test.py (7)

514-521: Units switch for Force logs looks good (Å).

A→Å change is correct. Please also run ruff format/check before merge.


524-526: Force atom logs updated to Å — OK.


546-547: Hessian units updated to eV/Å^2 — OK.


666-671: System‑avg Force logs: A→Å change looks correct.


672-675: System‑avg Force atom logs: A→Å change looks correct.


682-683: System‑avg Hessian logs: A→Å^2 change looks correct.


1100-1100: System‑avg WFC log: A→Å change looks correct.

Copy link

codecov bot commented Sep 16, 2025

Codecov Report

❌ Patch coverage is 70.00000% with 6 lines in your changes missing coverage. Please review.
✅ Project coverage is 84.20%. Comparing base (34df2b4) to head (723d9cf).
⚠️ Report is 3 commits behind head on devel.

Files with missing lines Patch % Lines
deepmd/entrypoints/test.py 70.00% 6 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##            devel    #4978      +/-   ##
==========================================
- Coverage   84.20%   84.20%   -0.01%     
==========================================
  Files         705      705              
  Lines       69229    69229              
  Branches     3576     3575       -1     
==========================================
- Hits        58293    58292       -1     
  Misses       9797     9797              
- Partials     1139     1140       +1     

☔ View full report in Codecov by Sentry.
📢 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.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@wanghan-iapcm wanghan-iapcm added this pull request to the merge queue Sep 17, 2025
Merged via the queue into deepmodeling:devel with commit 15c2b7d Sep 17, 2025
60 checks passed
@OutisLi OutisLi deleted the pr/fix_unit_disp branch September 17, 2025 08:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants