-
Notifications
You must be signed in to change notification settings - Fork 584
chore(tf): throw an error if type map is missing in change_energy_bias #4636
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(tf): throw an error if type map is missing in change_energy_bias #4636
Conversation
Fix deepmodeling#4608. Signed-off-by: Jinzhe Zeng <jinzhe.zeng@ustc.edu.cn>
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.
PR Overview
This PR adds error handling for a missing type map in the change_energy_bias function.
- Adds a check that raises a ValueError when the type map provided by the data is empty.
Reviewed Changes
| File | Description |
|---|---|
| deepmd/tf/train/trainer.py | Adds a conditional check to raise an error for a missing type map |
Copilot reviewed 1 out of 1 changed files in this pull request and generated no comments.
📝 WalkthroughWalkthroughThe changes introduce an error handling mechanism within the Changes
Sequence Diagram(s)sequenceDiagram
participant T as DPTrainer
participant D as Data
participant M as Model
T->>D: get_type_map()
alt Type map is empty
D-->>T: Empty type map
T->>T: Raise ValueError("type_map.raw file must be provided")
else Type map is valid
D-->>T: Valid type map
T->>M: change_energy_bias(..., bias_adjust_mode)
M-->>T: Acknowledge update
end
Suggested labels
Suggested reviewers
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (1)
⏰ Context from checks skipped due to timeout of 90000ms (20)
🔇 Additional comments (1)
✨ Finishing Touches
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. 🪧 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 ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## devel #4636 +/- ##
==========================================
- Coverage 84.78% 84.77% -0.01%
==========================================
Files 688 688
Lines 66091 66092 +1
Branches 3539 3539
==========================================
- Hits 56033 56032 -1
Misses 8918 8918
- Partials 1140 1142 +2 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Fix #4608.
Summary by CodeRabbit