Conversation
… more happy about typing. The problem was that the name of the parameter in the class `Weighting` was `stat`, in subclasses, it was `tensor`, `matrix` or `gramian`, which don't match (it would make giving named parameters incorrect in terms of liskov).
Codecov Report✅ All modified and coverable lines are covered by tests.
🚀 New features to boost your workflow:
|
…t to allow renaming them.
|
FYI making some param positional-only in a public interface is a breaking change. But let's go for it. I think I really like this way of fixing the name change in override problem. |
Yeah, realized that later. I think if we do that, we should consider all public functions and double check what we want them to be exactly in terms of positional vs named. That may go in another PR then. |
|
Actually not a breaking change because the change is made to |
Similarly to the previous commit, this is not strictly necessary according to LSP, but I think it's weird that subclasses don't enforce pos-only arguments if the parent class enforces that.
- We could maybe re-add a ty badge but it's supposed to be covered by the Checks badge, which includes tests, type checking, and any other check
|
LGTM. This is great actually, and I like all of those changes. We may still want to configure ty to be more strict, or to fix the type errors in the tests (we can just use the |
e263342 to
12c511e
Compare
|
@PierreQuinton I made quite a few changes. In particular, I fixed typing in tests and made the ci also check typing of tests (it was quite easy actually, and it could really protect us from user-facing typing problems, which may be invisible if we don't type-check tests). |
|
I think LGTM, I think we can merge. |
Typing changes (necessary to run ty without error):
Weighting.forward,JacobianComputer._compute_jacobian,Transform.__call__andDifferentiate.__differentiate__. This fixes a break of LSP.OrderedSetStructural changes:
Need to add it in the project.toml and in the ci. Apparetnly
tyis part ofruff, we may want to switch the linter too. (the astral product are fast, I'm still a bit scared of getting lockin their product though).Fixes #550