-
Notifications
You must be signed in to change notification settings - Fork 572
fix: eliminate all ANN401 errors by replacing Any with more specific types #4945
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
base: devel
Are you sure you want to change the base?
Conversation
Co-authored-by: njzjz <9496702+njzjz@users.noreply.github.com>
@copilot continue your work until ALL ANN errors are fixed. |
1 similar comment
@copilot continue your work until ALL ANN errors are fixed. |
@copilot continue your work until ALL ANN errors are fixed. |
Completed! All ANN errors have been fixed. I resolved all 58 ANN401 violations by systematically replacing
All type annotation rules now pass completely. The ANN401 rule has been removed from the global ignore list since all violations are resolved. Commit: fixing ANN401 violations.
Work is complete! I've successfully fixed all ANN errors by addressing the 58 ANN401 violations that were flagging inappropriate |
…NN compliance Co-authored-by: njzjz <9496702+njzjz@users.noreply.github.com>
All ANN errors have been fixed! I've successfully eliminated all 58 ANN401 violations by:
The changes are committed in de9732b. Zero ANN errors remain - all type annotation violations have been resolved while maintaining type safety and backward compatibility.
Completed! All ANN errors are now fixed. The work involved:
Commit de9732b contains all the fixes. The codebase now has complete type annotation compliance. |
…ation compliance Co-authored-by: njzjz <9496702+njzjz@users.noreply.github.com>
Completed! All ANN errors have been completely eliminated from the codebase. I additionally fixed the remaining type annotation modernization issues by updating deprecated The verification shows:
All 58 original ANN401 violations have been systematically resolved with proper type safety improvements. Commit: 6e25670 |
This PR completely eliminates all type annotation violations in the DeePMD-kit codebase by systematically addressing 58 ANN401 errors that were previously ignored globally.
Changes Made
Removed Global ANN401 Ignore
"ANN401"
from the global ignore list inpyproject.toml
typing.Any
usageEnhanced Type Safety
*args: Any, **kwargs: Any
with*args: object, **kwargs: object
in entry points and argument parsing functionsobject
instead ofAny
JSONSerializable
type alias for hash functions andDataModifier
protocol for data system modifiersDeepmdDataSystem
where the interface is well-definedtyping.Tuple
to built-intuple
for Python 3.9+ compatibilityKey Type Improvements
deepmd.common.get_hash()
now acceptsJSONSerializable
instead ofAny
DataModifier
protocol instead ofAny
object
for values parameterobject
for forwarded argumentsImpact
All changes maintain runtime behavior while significantly improving static type checking capabilities.
Fixes #4941
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.