Hi all,
For the past few weeks, I have been busy working on the type annotations of the DomainMatrix layer. During my process, I found that many type annotations are not specific to the DomainMatrix class and are rather related to the inconsistencies between DomainMatrix and the low-level dup_/dmp_ polynomial helper functions and the higher-level interfaces.
The generic type parameter (Er) that was introduced in the DomainMatrix class does not always align well with the generic types in the low-level polynomial arithmetic helper functions. This has been causing many mypy conflicts and operator type conflicts. This has also been causing many casts to appear in the code, which should rather have explicit type information.
I was thinking of extending the current work to include:
1. Stabilizing and finalizing the current generic work on the DomainMatrix generic layer.
2. Synchronizing type variables between DomainMatrix and the low-level dup_/dmp_ polynomial helper functions.
3. Reducing generic duplication and eliminating unsafe casts.
4. Improving return type consistency in selected high-level polynomial interfaces.
The aim of the extension would not include annotating the entire polys subsystem but rather make the DomainMatrix-based polynomial matrix pipeline generically consistent.
Before expanding further in this direction, I would appreciate feedback on whether this scope sounds useful and aligned with SymPy’s current priorities
Thanks,
Vedant