feat(pt_expt): add dos, dipole, polar and property fittings#5254
feat(pt_expt): add dos, dipole, polar and property fittings#5254njzjz merged 3 commits intodeepmodeling:masterfrom
Conversation
|
No actionable comments were generated in the recent review. 🎉 📝 WalkthroughWalkthroughAdds PT-Expt fitting wrappers and exports for dipole, DOS, polarizability, and property models, updates dpmodel polarizability device allocation for the identity tensor, and adds corresponding conditional test wiring plus dedicated PT-Expt test suites. Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Suggested reviewers
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ 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.
🧹 Nitpick comments (4)
source/tests/pt_expt/fitting/test_polar_fitting.py (1)
37-37: Prefix unused unpacked variables with_Same RUF059 pattern as
test_property_fitting.py—nfandnneiare unused at lines 37, 94, and 131.♻️ Proposed fix
- nf, nloc, nnei = self.nlist.shape + _nf, nloc, _nnei = self.nlist.shapeApply at lines 37, 94, and 131.
Also applies to: 94-94, 131-131
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@source/tests/pt_expt/fitting/test_polar_fitting.py` at line 37, Replace the unused unpacked variables by prefixing them with underscores where self.nlist is unpacked (the assignment "nf, nloc, nnei = self.nlist.shape" in test_polar_fitting.py and the analogous unpackings later): change "nf" to "_nf" and "nnei" to "_nnei" (or simply "_") so only the used "nloc" remains as a normal variable; update each occurrence (the unpackings at the three locations) to avoid unused-variable warnings while keeping the same semantics.source/tests/consistent/fitting/test_dos.py (1)
202-209: Prefix unused unpacked variables with_ineval_pt_exptRuff (RUF059) flags
resnet_dt,precision,mixed_types, andnumb_dosas unused in this unpack. Onlynumb_fparamandnumb_aparamare used.♻️ Proposed fix
- ( - resnet_dt, - precision, - mixed_types, - numb_fparam, - numb_aparam, - numb_dos, - ) = self.param + ( + _resnet_dt, + _precision, + _mixed_types, + numb_fparam, + numb_aparam, + _numb_dos, + ) = self.param🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@source/tests/consistent/fitting/test_dos.py` around lines 202 - 209, In the eval_pt_expt unpack in test_dos.py, prefix unused variables to satisfy Ruff RUF059: change the tuple unpack so resnet_dt, precision, mixed_types, and numb_dos are renamed to _resnet_dt, _precision, _mixed_types, and _numb_dos while keeping numb_fparam and numb_aparam as-is; update the unpack expression near the eval_pt_expt function to use these underscored names so only the actually used symbols (numb_fparam, numb_aparam) remain referenced.source/tests/pt_expt/fitting/test_property_fitting.py (1)
37-37: Prefix unused unpacked variables with_
nfandnneiare unused in all three tuple unpackings. Ruff (RUF059) flags these across lines 37, 90, and 127.♻️ Proposed fix
- nf, nloc, nnei = self.nlist.shape + _nf, nloc, _nnei = self.nlist.shapeApply the same change at lines 37, 90, and 127.
Also applies to: 90-90, 127-127
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@source/tests/pt_expt/fitting/test_property_fitting.py` at line 37, Two variables from the tuple unpacking of self.nlist.shape are unused; change the unpacking to prefix unused names with an underscore (e.g., replace occurrences like "nf, nloc, nnei = self.nlist.shape" with "_nf, nloc, _nnei = self.nlist.shape") to satisfy Ruff RUF059; apply the same change to the other two unpackings of self.nlist.shape in the file.source/tests/consistent/fitting/test_property.py (1)
211-219: Prefix unused unpacked variables with_ineval_pt_exptRuff (RUF059) flags
resnet_dt,precision,mixed_types,task_dim, andintensiveas unused. Onlynumb_fparamandnumb_aparamare consumed.♻️ Proposed fix
- ( - resnet_dt, - precision, - mixed_types, - numb_fparam, - numb_aparam, - task_dim, - intensive, - ) = self.param + ( + _resnet_dt, + _precision, + _mixed_types, + numb_fparam, + numb_aparam, + _task_dim, + _intensive, + ) = self.param🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@source/tests/consistent/fitting/test_property.py` around lines 211 - 219, The tuple unpacking in eval_pt_expt assigns several variables that are never used; rename the unused ones by prefixing with an underscore so only numb_fparam and numb_aparam remain as used names (e.g., change resnet_dt, precision, mixed_types, task_dim, intensive to _resnet_dt, _precision, _mixed_types, _task_dim, _intensive in the tuple assignment inside eval_pt_expt) so the linter (RUF059) no longer flags them as unused.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In `@source/tests/consistent/fitting/test_dos.py`:
- Around line 202-209: In the eval_pt_expt unpack in test_dos.py, prefix unused
variables to satisfy Ruff RUF059: change the tuple unpack so resnet_dt,
precision, mixed_types, and numb_dos are renamed to _resnet_dt, _precision,
_mixed_types, and _numb_dos while keeping numb_fparam and numb_aparam as-is;
update the unpack expression near the eval_pt_expt function to use these
underscored names so only the actually used symbols (numb_fparam, numb_aparam)
remain referenced.
In `@source/tests/consistent/fitting/test_property.py`:
- Around line 211-219: The tuple unpacking in eval_pt_expt assigns several
variables that are never used; rename the unused ones by prefixing with an
underscore so only numb_fparam and numb_aparam remain as used names (e.g.,
change resnet_dt, precision, mixed_types, task_dim, intensive to _resnet_dt,
_precision, _mixed_types, _task_dim, _intensive in the tuple assignment inside
eval_pt_expt) so the linter (RUF059) no longer flags them as unused.
In `@source/tests/pt_expt/fitting/test_polar_fitting.py`:
- Line 37: Replace the unused unpacked variables by prefixing them with
underscores where self.nlist is unpacked (the assignment "nf, nloc, nnei =
self.nlist.shape" in test_polar_fitting.py and the analogous unpackings later):
change "nf" to "_nf" and "nnei" to "_nnei" (or simply "_") so only the used
"nloc" remains as a normal variable; update each occurrence (the unpackings at
the three locations) to avoid unused-variable warnings while keeping the same
semantics.
In `@source/tests/pt_expt/fitting/test_property_fitting.py`:
- Line 37: Two variables from the tuple unpacking of self.nlist.shape are
unused; change the unpacking to prefix unused names with an underscore (e.g.,
replace occurrences like "nf, nloc, nnei = self.nlist.shape" with "_nf, nloc,
_nnei = self.nlist.shape") to satisfy Ruff RUF059; apply the same change to the
other two unpackings of self.nlist.shape in the file.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #5254 +/- ##
=======================================
Coverage 82.10% 82.11%
=======================================
Files 745 749 +4
Lines 74875 74904 +29
Branches 3615 3615
=======================================
+ Hits 61478 61507 +29
+ Misses 12235 12233 -2
- Partials 1162 1164 +2 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Summary by CodeRabbit
New Features
Bug Fixes
Tests
Chores