Enforce ruff/refurb rules (FURB)#12144
Conversation
| @make_array_nonempty.register(DecimalDtype) | ||
| def _(dtype): | ||
| return DecimalArray._from_sequence([Decimal("0"), Decimal("NaN")], dtype=dtype) | ||
| return DecimalArray._from_sequence([Decimal(0), Decimal("NaN")], dtype=dtype) |
There was a problem hiding this comment.
Not sure about this rule. Perhaps consistency between integers and floats is more important.
28d0b39 to
f49a804
Compare
Unit Test ResultsSee test report for an extended history of previous test failures. This is useful for diagnosing flaky tests. 9 files ±0 9 suites ±0 3h 6m 20s ⏱️ - 10m 13s For more details on these failures, see this check. Results for commit 7dc6abd. ± Comparison against base commit cd5e429. ♻️ This comment has been updated with latest results. |
jacobtomlinson
left a comment
There was a problem hiding this comment.
I'm not sure this rule is adding value. I would argue in some cases it is making code less readable. I think we should skip this one.
f49a804 to
5e8efd5
Compare
|
Agreed, now ignoring rule verbose-decimal-constructor (FURB157). |
|
Sorry I mean this whole ruleset. I find many of the changes in this PR subjectively worse. We like simple code here and I don't think having extra linter rules that push us towards these patterns aligns with that. |
|
While I agree
Not 100% certain about this one:
|
5e8efd5 to
030edcb
Compare
|
I think |
030edcb to
65a3dba
Compare
|
65a3dba to
17b768b
Compare
|
@jacobtomlinson I have further simplified the |
jacobtomlinson
left a comment
There was a problem hiding this comment.
I don't think using writelines makes the code any better or worse. There is no perf gain, no real readability gain and it has cost both our time to write and review. As I've said in other PRs I'm happy to merge it because you've already done it, but would caution that these changes aren't really worth the effort.
FURB116 Replace `hex` call with f-string
FURB122 Use of `f.write` in a for loop
FURB136 Replace `x if x > y else y` with `max(y, x)`
FURB163 Prefer `math.log2(N / group_size)` over `math.log` with a redundant base
FURB187 Use of assignment of `reversed` on list
17b768b to
7dc6abd
Compare
|
My understanding is that
I must admit the documentation of
|
pre-commit run --all-files