-
Notifications
You must be signed in to change notification settings - Fork 525
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add unittest for virial and pe/atom #4013
Conversation
WalkthroughWalkthroughThe changes enhance the Changes
Sequence Diagram(s)sequenceDiagram
participant Test as Test Script
participant LAMMPS as LAMMPS Simulation
participant NumPy as NumPy Library
Test->>LAMMPS: Compute virial
Test->>LAMMPS: Compute pressure
LAMMPS-->>Test: Return virial values
LAMMPS-->>Test: Return pressure values
Test->>NumPy: Validate virial values
Test->>NumPy: Validate pressure values
NumPy-->>Test: Return validation results
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
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 as PR comments)
Additionally, you can add CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
Outside diff range, codebase verification and nitpick comments (1)
source/lmp/tests/test_lammps.py (1)
326-328
: Define pressure variables using a loop.The loop correctly defines pressure variables based on the computed values. However, consider adding comments for better readability.
+ # Define pressure variables from computed values for ii in range(9): jj = [0, 4, 8, 3, 6, 7, 1, 2, 5][ii] lammps.variable(f"pressure{jj} c_pressure[{ii+1}]")
for more information, see https://pre-commit.ci
for more information, see https://pre-commit.ci
for more information, see https://pre-commit.ci
for more information, see https://pre-commit.ci
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## devel #4013 +/- ##
==========================================
+ Coverage 82.92% 82.93% +0.01%
==========================================
Files 522 522
Lines 51005 51005
Branches 3022 3022
==========================================
+ Hits 42294 42300 +6
+ Misses 7767 7763 -4
+ Partials 944 942 -2 ☔ View full report in Codecov by Sentry. |
Addresses deepmodeling#3943 <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **New Features** - Enhanced testing functionality for pressure calculations alongside virial computations in the simulation framework. - **Bug Fixes** - Improved reliability and accuracy of test assertions for pressure values, ensuring better validation of simulation results. <!-- end of auto-generated comment: release notes by coderabbit.ai --> --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Addresses #3943
Summary by CodeRabbit
New Features
Bug Fixes