-
Notifications
You must be signed in to change notification settings - Fork 130
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
fix: only apply comp_prec for floating dtypes #711
Conversation
Fix deepmodeling#703. Signed-off-by: Jinzhe Zeng <jinzhe.zeng@rutgers.edu>
WalkthroughWalkthroughThe changes made to the Changes
Assessment against linked issues
Recent review detailsConfiguration used: CodeRabbit UI Files selected for processing (2)
Additional comments not posted (2)
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 using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## devel #711 +/- ##
==========================================
+ Coverage 84.58% 84.59% +0.01%
==========================================
Files 81 81
Lines 7052 7057 +5
==========================================
+ Hits 5965 5970 +5
Misses 1087 1087 ☔ View full report in Codecov by Sentry. |
CodSpeed Performance ReportMerging #711 will not alter performanceComparing Summary
|
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)
dpdata/deepmd/hdf5.py (1)
255-258
: Approve changes with a minor suggestion for improvement.The changes correctly address the issue of applying
comp_prec
only to floating-point data types. This fix aligns with the PR objectives and resolves the problem described in the linked issue #703.Consider adding a brief comment explaining why we're only converting floating-point data. This would improve code readability and maintainability. Here's a suggested implementation:
ddata = np.reshape(data[dt], prop["shape"]) +# Only apply precision conversion to floating-point data types if np.issubdtype(ddata.dtype, np.floating): ddata = ddata.astype(comp_prec) reshaped_data[dt] = ddata
Fix #703.
Summary by CodeRabbit
New Features
Bug Fixes