fix: handle empty iter_data_new_exp in auto_prob generation#368
fix: handle empty iter_data_new_exp in auto_prob generation#368SchrodingersCattt wants to merge 3 commits into
Conversation
When FP labeling fails on all conformations and continue_on_success_ratio allows the workflow to proceed, iter_data contains directory entries that expand to zero systems. This caused auto_prob to generate an empty range like "prob_sys_size; 0:2:0.6; 2:2:0.4" which crashes dp train with "ValueError: probabilities do not sum to 1". Fix: guard with `if numb_new > numb_old` before generating the two-group auto_prob string. When there is no new data, fall back to plain "prob_sys_size" and log a warning. Fixes the scenario: extreme systems (e.g., energetic materials at high temperature) where teacher model cannot label any conformations from the first exploration iteration.
for more information, see https://pre-commit.ci
|
Warning Review limit reached
Next review available in: 39 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthrough
ChangesAuto probability fallback
Estimated code review effort: 2 (Simple) | ~10 minutes 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
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. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@tests/op/test_run_dp_train.py`:
- Around line 349-355: Update the test around RunDPTrain.execute to exercise the
production fallback rather than recomputing auto_prob locally. Mock run_command,
invoke execute with iter_data=[empty_iter], then inspect the generated training
script and assert its auto_prob value is "prob_sys_size"; remove the duplicate
numb_new/numb_old conditional and assertion based on it.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 0e6873f7-f44c-48b1-a2b0-d1a2d779e58a
📒 Files selected for processing (2)
dpgen2/op/run_dp_train.pytests/op/test_run_dp_train.py
Address review: replace local logic re-computation with an actual call to RunDPTrain.execute() using mocked run_command, then inspect the generated training script's auto_prob value. This ensures the test fails if the production guard is removed.
Problem
When FP labeling fails on all conformations and
continue_on_success_ratioallows the workflow to proceed,iter_datacontains directory entries that expand to zero systems.This causes
auto_probto generateprob_sys_size; 0:2:0.6; 2:2:0.4(empty range2:2) which crashes withValueError: probabilities do not sum to 1.Fix
Guard with
if numb_new > numb_old+ fallback to plainprob_sys_size+ warning log.Test
Added
test_auto_prob_empty_new_iter_data.Summary by CodeRabbit
Bug Fixes
Tests