Conversation
Codecov Report✅ All modified and coverable lines are covered by tests.
🚀 New features to boost your workflow:
|
Code reviewNo issues found. Checked for bugs and CLAUDE.md compliance. |
…o broke the tests somehow, there is possibly a problem with `is_quadratic_form`
…ude gramian, they are not about Gramians but about PSD(Generalized)Matrices
… in _linalg take a GeneralizedMatrix. Update test accordingly.
PSDQuadraticForm and GeneralizedMatrix.PSDQuadraticForm and GeneralizedMatrix.
… the one in _linalg take a GeneralizedMatrix. Update test accordingly." This reverts commit bda0a5f.
There was a problem hiding this comment.
Looks very good. I really like all of those changes. I made many minor comments that should be super easy to fix.
Suggested commit description:
- Add PSDTensor
- Remove GeneralizedMatrix
- Use classes for Matrix, PSDMatrix and PSDTensor instead of type annotations
- Use casting in compute_gramian, normalize and regularize
- Add typeguard functions is_matrix, is_psd_tensor and is_psd_matrix
- Move normalize and regularize to _linalg
- Move _check_is_matrix to
Aggregator.__call__ - Improve internal type hints
- Rename reshape_gramian to reshape and movedim_gramian to movedim
- Add _gramian_utils.flatten
- Rename a few tests
- Add some parametrizations to test_gramian_is_psd
- Add test_reshape_yields_psd, test_flatten_yields_matrix, test_flatten_yields_psd, test_movedim_yields_psd, test_normalize_yields_psd and test_regularize_yields_psd
- Add assert_is_psd_tensor
|
@claude Could you double-check that we didn't forget to change some internal type hints? Also, did I miss something in my review? |
|
Claude finished @ValerianRey's task in 3m 14s —— View job Type Hints Review CompleteI've performed a comprehensive review of the internal type hints across the PR. Here are my findings: ✅ Internal Type Hints Look GoodThe type hint migration from Core type system:
Production code:
No remaining old references:
📝 About ValerianRey's ReviewValerianRey's review is excellent and thorough. I didn't find anything missing. The review covers:
The only suggestion in the review related to type hints is about test utility functions ( ✨ ConclusionNo internal type hints were forgotten. The migration from type aliases to classes was done comprehensively and correctly. All the suggestions in ValerianRey's review are valid improvements to make the code even better. |
Co-authored-by: Valérian Rey <31951177+ValerianRey@users.noreply.github.com>
Code reviewNo issues found. Checked for bugs and CLAUDE.md compliance. |
PSDQuadraticForm and GeneralizedMatrix.
Aggregator.__call__Also fixed some
typingproblems on the rest of the lib (sorry).I'm still not sure about having classes, but as far as I understand this is the only way of having intersections. The main counter argument is that it makes the MRO heavier to compute.
TODO:
PSDQuadraticFormorPSDMatrix.is_*tocast(*, *)