Conversation
…check_keys` have a positional only list of argument and remove `jacobians` from _disunite.
ef0516f to
6f594aa
Compare
Codecov Report✅ All modified and coverable lines are covered by tests.
🚀 New features to boost your workflow:
|
ValerianRey
left a comment
There was a problem hiding this comment.
I really like most of those new rules. Here is what I don't like:
There are some issues with RUF, especially in all ordering. It's cool if we can configure it better, but otherwise it's fine to just keep it that way. See comments I made in the code.
I don't like ARG so much. It decreases readability because it hides the name of the variables we don't use in a given function. I would revert this.
I really don't like RET, because when we name something before returning it, it's always a voluntary decision we made in order to improve readability. The best example of this is in some aggregator where something is named B or alpha in another one. I think it either relates to the variable name in the original implementation, or to the symbol they used in their maths. In any case, it's has a very large impact on readability to remove this B or alpha variable. I would revert this too.
I'm not a fan of COM, because it increases the number of lines (by about 70 in total). But it's probably still positive, because it goes in the way of automating code formating a bit more. So we can keep it.
I really like some of the changes induced by FBT (namely making some parameter keyword only). But I don't like enforcing FBT on our whole codebase. I'd rather use this technique at our own discretion. Examples where it doesn't make sense:
- foo.requires_grad(requires_grad=True)
- set_deterministic_mode(mode=True)
- everywhere in tests
- for the value param of BoolRef
- in internal code it mostly just increases verbosity without a lot of added value.
So I think we should keep some of the changes coming from this commit (probably only those affecting the interface, like retain_grad, retain_jac, create_graph, chunk_size), and also make a changelog entry for that (because it's a breaking change). I would revert the rest, and not add the FBT rule.
|
Most of the things you mention can be excepted, we just need to pick the right rule and remove it in the |
Yes I agree. For example, what I really don't like in RET is actually RET504 (see https://docs.astral.sh/ruff/rules/#flake8-return-ret). |
|
Closing in favor of #561 |
No description provided.