-
Notifications
You must be signed in to change notification settings - Fork 520
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
chore: rename j_must_have to j_deprecated and only warn about deprecated keys #3816
Conversation
…ted keys Fix deepmodeling#3523. Signed-off-by: Jinzhe Zeng <jinzhe.zeng@rutgers.edu>
Warning Rate Limit Exceeded@njzjz has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 13 minutes and 16 seconds before requesting another review. How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. WalkthroughThe changes involve the removal of the Changes
Assessment against linked issues
The changes meet the primary objectives of renaming the 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 Configration 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.
CodeQL found more than 20 potential problems in the proposed changes. Check the Files changed tab for more details.
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## devel #3816 +/- ##
==========================================
- Coverage 82.48% 82.48% -0.01%
==========================================
Files 516 516
Lines 49057 49057
Branches 2987 2986 -1
==========================================
- Hits 40466 40465 -1
- Misses 7680 7681 +1
Partials 911 911 ☔ View full report in Codecov by Sentry. |
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: 28
Outside diff range and nitpick comments (4)
deepmd/utils/data_system.py (1)
794-797
: Add detailed documentation for theget_batch
method to clarify its behavior and parameters.deepmd/tf/train/trainer.py (3)
Line range hint
93-125
: Consider adding error handling for missing keys injdata
.Using direct dictionary access (
jdata["key"]
) can lead toKeyError
if the key is missing. Consider usingjdata.get("key", default_value)
to provide default values or handle missing keys gracefully.
Line range hint
184-186
: Refine the assertion error message inbuild
method.The assertion
assert isinstance(self.fitting, EnerFitting)
could be more informative. Consider raising a specific exception with a clear error message if the condition is not met.- assert isinstance(self.fitting, EnerFitting), "Data in mixed_type format must use ener fitting!" + if not isinstance(self.fitting, EnerFitting): + raise TypeError("Data in mixed_type format must use EnerFitting. Current fitting type: {}".format(type(self.fitting).__name__))
Line range hint
1015-1017
: Consider replacingtf.py_func
withtf.data
API for better performance and compatibility.
tf.py_func
is not recommended as it does not support graph optimizations and may not be compatible with TensorFlow 2.x. Consider usingtf.data
API for building data loading operations, which is more efficient and compatible with newer TensorFlow versions.
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: 4
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> Signed-off-by: Jinzhe Zeng <jinzhe.zeng@rutgers.edu>
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> Signed-off-by: Jinzhe Zeng <jinzhe.zeng@rutgers.edu>
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> Signed-off-by: Jinzhe Zeng <jinzhe.zeng@rutgers.edu>
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: 27
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> Signed-off-by: Jinzhe Zeng <jinzhe.zeng@rutgers.edu>
@coderabbitai resolve |
Actions PerformedComments resolved. |
…ted keys (deepmodeling#3816) Fix deepmodeling#3523. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **Refactor** - Simplified code by removing the `j_must_have` function and directly accessing dictionary keys in various test files. - Replaced `j_must_have` with direct dictionary access for improved code readability and maintenance. - **Chores** - Updated test files to directly access dictionary values, enhancing code readability and maintainability. <!-- end of auto-generated comment: release notes by coderabbit.ai --> --------- Signed-off-by: Jinzhe Zeng <jinzhe.zeng@rutgers.edu> Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Fix #3523.
Summary by CodeRabbit
Refactor
j_must_have
function and directly accessing dictionary keys in various test files.j_must_have
with direct dictionary access for improved code readability and maintenance.Chores