fix(c): call C++ interface without atomic properties when they are not requested#4010
fix(c): call C++ interface without atomic properties when they are not requested#4010wanghan-iapcm merged 2 commits intodeepmodeling:develfrom
Conversation
…t requested This is an internal change and doesn't affect the API. Signed-off-by: Jinzhe Zeng <jinzhe.zeng@rutgers.edu>
WalkthroughWalkthroughThe recent changes introduce conditional logic in the computation functions of the Changes
Sequence Diagram(s)sequenceDiagram
participant Client
participant DP_DeepPot
participant DP_DeepTensor
participant ComputeMethod
Client->>DP_DeepPot: Request computation with flags
DP_DeepPot->>ComputeMethod: Check atomic_energy, atomic_virial
alt If flags are true
ComputeMethod->>DP_DeepPot: Compute with full parameters
else
ComputeMethod->>DP_DeepPot: Compute with reduced parameters
end
DP_DeepPot->>Client: Return 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 (
|
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## devel #4010 +/- ##
==========================================
- Coverage 82.84% 82.83% -0.01%
==========================================
Files 522 522
Lines 50920 50938 +18
Branches 3015 3022 +7
==========================================
+ Hits 42187 42197 +10
+ Misses 7798 7796 -2
- Partials 935 945 +10 ☔ View full report in Codecov by Sentry. |
wanghan-iapcm
left a comment
There was a problem hiding this comment.
The doc of the output variables atomic_virial and atomic_energy should be updated.
deepmd-kit/source/api_c/include/c_api.h Lines 181 to 182 in 5dd0062 The documentation is correct before this PR. |
…t requested (deepmodeling#4010) This is an internal change and doesn't affect the API. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **New Features** - Enhanced computation functions for better flexibility in processing parameters based on specific flags. - **Bug Fixes** - Improved performance and resource management by adapting the compute method's parameters dynamically. <!-- end of auto-generated comment: release notes by coderabbit.ai --> Signed-off-by: Jinzhe Zeng <jinzhe.zeng@rutgers.edu>
This is an internal change and doesn't affect the API.
Summary by CodeRabbit