-
Notifications
You must be signed in to change notification settings - Fork 584
fix(pd): fix unitest #5113
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(pd): fix unitest #5113
Conversation
|
Note Other AI code review bot(s) detectedCodeRabbit has detected other AI code review bot(s) in this pull request and will avoid duplicating their findings in the review comments. This may lead to a less comprehensive review. 📝 WalkthroughWalkthroughThe changes relocate the import of Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes
Suggested labels
Suggested reviewers
Pre-merge checks and finishing touches❌ Failed checks (1 warning, 1 inconclusive)
✅ Passed checks (1 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR refactors test files to migrate import paths from the legacy deepmd.tf namespace to the common deepmd.common and deepmd.utils namespaces. It also includes test maintenance improvements, including a temporary test skip for numpy 2.4 compatibility and enhanced file cleanup logic.
Key changes:
- Updated
expand_sys_strimports fromdeepmd.tf.commontodeepmd.commonacross 6 test files - Updated
DeepmdDataSystemimport fromdeepmd.tf.utils.data_systemtodeepmd.utils.data_system - Added existence checks before file removal operations in test teardown to prevent potential errors
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| source/tests/pd/test_training.py | Enhanced tearDown method with existence checks before removing files/directories |
| source/tests/pd/test_sampler.py | Updated imports to use common namespace and temporarily skipped test for numpy 2.4 compatibility |
| source/tests/pd/model/test_saveload_se_e2_a.py | Migrated expand_sys_str import from deepmd.tf.common to deepmd.common |
| source/tests/pd/model/test_saveload_dpa1.py | Migrated expand_sys_str import from deepmd.tf.common to deepmd.common |
| source/tests/pd/model/test_model.py | Migrated expand_sys_str import from deepmd.tf.common to deepmd.common |
| source/tests/pd/model/test_embedding_net.py | Migrated expand_sys_str import from deepmd.tf.common to deepmd.common |
| source/tests/pd/model/test_descriptor.py | Migrated expand_sys_str import from deepmd.tf.common to deepmd.common |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## devel #5113 +/- ##
=======================================
Coverage 82.15% 82.15%
=======================================
Files 709 709
Lines 72470 72469 -1
Branches 3615 3616 +1
=======================================
Hits 59536 59536
+ Misses 11771 11770 -1
Partials 1163 1163 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
This pull request refactors several test files to update import paths for the
expand_sys_strutility and related modules, reflecting a migration away from thedeepmd.tfnamespace. Additionally, it temporarily skips a test due to compatibility issues with numpy 2.4 and improves file cleanup logic in one test. The main themes are import path updates and test maintenance.Import path updates:
expand_sys_strin multiple test files (test_descriptor.py,test_embedding_net.py,test_model.py,test_saveload_dpa1.py,test_saveload_se_e2_a.py,test_sampler.py) to usedeepmd.commoninstead ofdeepmd.tf.common. [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11]DeepmdDataSystemintest_sampler.pyfromdeepmd.tf.utils.data_systemtodeepmd.utils.data_system.Test maintenance and compatibility:
test_sampler_debug_infotest intest_sampler.pydue to issues with numpy 2.4.test_training.pyby checking for file existence before attempting to remove files or directories.Summary by CodeRabbit
Tests
Chores
✏️ Tip: You can customize this high-level summary in your review settings.
Related PR: PaddlePaddle/Paddle#77013