Skip to content

Enforce ruff/flake8-simplify rules (SIM) - #10480

Merged
max-sixty merged 10 commits into
pydata:mainfrom
DimitriPapadopoulos:SIM
Jul 4, 2025
Merged

Enforce ruff/flake8-simplify rules (SIM)#10480
max-sixty merged 10 commits into
pydata:mainfrom
DimitriPapadopoulos:SIM

Conversation

@DimitriPapadopoulos

@DimitriPapadopoulosDimitriPapadopoulos commented Jul 1, 2025

Copy link
Copy Markdown
Contributor

Resubmitting #10462, this time ignoring ruff rule SIM118.

Please review carefully each commit/rule, I am happy to ignore any rule you don't find useful. For example, I'm not certain whether SIM102 results in more readable or more efficient code (9643fdd).

  • Closes #xxxx
  • Tests added
  • User visible changes (including notable bug fixes) are documented in whats-new.rst
  • New functions/methods are listed in api.rst

@max-sixtymax-sixty left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! (though the previous one lgtm too...)

any feedback from others?

@max-sixtymax-sixty added the plan to merge Final call for comments label Jul 1, 2025
Comment threadxarray/core/resample_cftime.py Outdated
SIM102 Use a single `if` statement instead of nested `if` statements
SIM113 Use `enumerate()` for index variable in `for` loop
SIM114 Combine `if` branches using logical `or` operator
DimitriPapadopoulosand others added 6 commits July 4, 2025 08:22
SIM201 Use `... != ...` instead of `not ... == ..."`
SIM905 Consider using a list literal instead of `str.split`
SIM910 Use `.get(...)` instead of `.get(..., None)`
Co-authored-by: Illviljan <14371165+Illviljan@users.noreply.github.com>
SIM102 Use a single `if` statement instead of nested `if` statements
@max-sixty
max-sixty merged commit a8de733 into pydata:mainJul 4, 2025
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

@DimitriPapadopoulos@max-sixty@Illviljan