Skip to content

MNT: Apply refurb suggestions #1153

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 9 commits into from
Dec 13, 2022
Merged

Conversation

DimitriPapadopoulos
Copy link
Contributor

  • [FURB108]: Use x in (y, z) instead of x == y or x == z
  • [FURB110]: Use x or y instead of x if x else y
  • [FURB113]: Use x.extend(...) instead of repeatedly calling x.append()
  • [FURB115]: Replace len(x) > 0 with x
  • [FURB118]: Replace lambda with operator.eq
  • [FURB123]: Replace int(x) with x
  • [FURB125]: Return is redundant here

@DimitriPapadopoulos DimitriPapadopoulos changed the title Apply refurb suggestions MNT: Apply refurb suggestions Dec 12, 2022
[FURB125]: Return is redundant here
[FURB115]: Replace `len(x) > 0` with `x`
[FURB113]: Use `x.extend(...)` instead of repeatedly calling `x.append()`
[FURB110]: Use `x or y` instead of `x if x else y`
[FURB123]: Replace `int(x)` with `x`
[FURB108]: Use `x in (y, z)` instead of `x == y or x == z`
[FURB118]: Replace lambda with `operator.eq`
Copy link
Member

@effigies effigies left a comment

Choose a reason for hiding this comment

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

Overall looks reasonable. Thanks! Two suggestions.

@codecov
Copy link

codecov bot commented Dec 12, 2022

Codecov Report

Base: 91.81% // Head: 91.84% // Increases project coverage by +0.02% 🎉

Coverage data is based on head (fe78b60) compared to base (d33a05a).
Patch coverage: 75.00% of modified lines in pull request are covered.

❗ Current head fe78b60 differs from pull request most recent head ad30f0e. Consider uploading reports for the commit ad30f0e to get more accurate results

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1153      +/-   ##
==========================================
+ Coverage   91.81%   91.84%   +0.02%     
==========================================
  Files         101      101              
  Lines       12463    12447      -16     
  Branches     2238     2237       -1     
==========================================
- Hits        11443    11432      -11     
+ Misses        693      688       -5     
  Partials      327      327              
Impacted Files Coverage Δ
nibabel/cmdline/dicomfs.py 19.41% <0.00%> (+0.44%) ⬆️
nibabel/cmdline/utils.py 80.64% <0.00%> (ø)
nibabel/dft.py 81.13% <ø> (-0.22%) ⬇️
nibabel/wrapstruct.py 96.99% <ø> (-0.03%) ⬇️
nibabel/deprecator.py 100.00% <100.00%> (ø)
nibabel/nicom/dicomwrappers.py 90.66% <100.00%> (ø)
nibabel/streamlines/__init__.py 100.00% <100.00%> (ø)
nibabel/streamlines/tck.py 99.48% <100.00%> (-0.01%) ⬇️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@effigies effigies merged commit fbdfae8 into nipy:master Dec 13, 2022
@DimitriPapadopoulos DimitriPapadopoulos deleted the linter branch December 13, 2022 14:53
@effigies effigies added this to the 5.0.0 milestone Jan 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants