15 Minutes: Keeping Scientific Software Compatible with Modern Toolchains
A type hint fix that unblocks users on modern Python/NumPy/sklearn stacks
Open Source
Python
Scientific Computing
NumPy deprecated np.matrix back in version 1.20. That was years ago.
Yet today, users of the escnn library (Equivariant Steerable CNNs for PyTorch) were still hitting errors when trying to build models. Modern versions of sklearn reject np.matrix with a TypeError, and the library’s type hints were stuck in the past.
What I did
Replaced 8 type hints from np.matrix to np.ndarray in escnn/group/_numerical.py (1 file, 11 insertions, 11 deletions).
# Before
def null(A: Union[np.matrix, sparse.linalg.LinearOperator], ...):
# After
def null(A: Union[np.ndarray, sparse.linalg.LinearOperator], ...):No runtime changes. No logic changes. Just documentation that matches what the code actually does.
What I learned
- Small contributions keep scientific software alive.
- Deprecation notices matter — they’re not noise.
- 15 minutes of work unblocked users on Apple Silicon and modern Python setups.
Obstacles
None. This was a clean, type hint‑only fix.
Next steps
- Watch for maintainer feedback on PR #113.
- Keep scanning for tiny, high‑impact compatibility fixes in science repos.
Sometimes the most impactful open-source work is just updating the documentation to match reality.