You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The codebase currently lacks type hints. Adding type hints would greatly increase the ability for static type checkers like mypy to enforce type-safety and catch bugs at type-checking time.
Adding mypy or an equivalent type checker to pre-commit would help maintain type-safety during the development process.
Operationally, I would suggest adding a type checker like mypy to the pre-commit configuration, but exempting all modules from type checking (because they would all fail).
One by one, modules would be added to mypy's scope, and that module would receive complete type annotations. This should be a safe way to gradually type the entire codebase.
Added type annotations and enabled strict mypy checking for 2 additional modules:
Newly Strict
errors.py - Added type annotation to suggest() method
hash.py - Added type annotations to key_hash() and uuid_from_buffer()
Current Status
3 modules now under strict mypy checking:
content_registry ✓
errors ✓ (new)
hash ✓ (new)
26 modules remain in gradual adoption queue
Next Steps
Following the gradual adoption strategy, additional modules can be promoted to strict checking as they receive complete type annotations. The infrastructure is in place - modules can be moved from the excluded list to the strict list as they're typed.
Commit: feat: add type annotations to errors and hash modules
Activity
github-actions commentedon Oct 13, 2025
This issue is stale because it has been open for 45 days with no activity.
feat: add mypy type checking to pre-commit
dimitri-yatsenko commentedon Jan 8, 2026
Implemented in DataJoint 2.0
Added mypy type checking with gradual adoption strategy as suggested.
Changes (commit 27391c7)
pyproject.toml - mypy configuration:
.pre-commit-config.yaml - mypy hook:
Gradual Adoption Strategy
content_registry.pyhas strict type checking (100% typed)ignore_errors = trueto strict as they're fully typedCurrent Type Coverage
from __future__ import annotationsDevelopers can now gradually type modules and move them to strict checking.
dimitri-yatsenko commentedon Jan 8, 2026
@d-v-b Take a look and I will close as completed (as a gradual policy)
feat: add type annotations to errors and hash modules
dimitri-yatsenko commentedon Jan 8, 2026
Type Annotation Coverage Increased
Added type annotations and enabled strict mypy checking for 2 additional modules:
Newly Strict
suggest()methodkey_hash()anduuid_from_buffer()Current Status
3 modules now under strict mypy checking:
content_registry✓errors✓ (new)hash✓ (new)26 modules remain in gradual adoption queue
Next Steps
Following the gradual adoption strategy, additional modules can be promoted to strict checking as they receive complete type annotations. The infrastructure is in place - modules can be moved from the excluded list to the strict list as they're typed.
Commit:
feat: add type annotations to errors and hash modules