Skip to content

Add PIE and B lints - #3573

Merged
flying-sheep merged 2 commits into
mainfrom
pa/bugbear
Apr 10, 2025
Merged

Add PIE and B lints#3573
flying-sheep merged 2 commits into
mainfrom
pa/bugbear

Conversation

@flying-sheep

@flying-sheep flying-sheep commented Apr 10, 2025

Copy link
Copy Markdown
Member

Also sort lints. learnings:

  • B028 no-explicit-stacklevel: the suggested “2” is for user-facing functions, one has to add 1 depending how deep in the stack one is
  • B905 zip-without-explicit-strict: should almost always be strict=True, not as autofixed False (except for cyclers)
  • B904 raise-without-from-inside-except: should almost always be raise … from e, except when using an exception instead of a check (i.e. the caught exception isn’t an error, but an expected branching)

@codecov

codecov Bot commented Apr 10, 2025

Copy link
Copy Markdown

Codecov Report

Attention: Patch coverage is 59.34066% with 74 lines in your changes missing coverage. Please review.

Project coverage is 75.48%. Comparing base (f11789e) to head (413cc48).
Report is 45 commits behind head on main.

✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
src/scanpy/readwrite.py 90.16% 6 Missing ⚠️
src/scanpy/_utils/__init__.py 60.00% 4 Missing ⚠️
src/scanpy/external/tl/_phenograph.py 0.00% 4 Missing ⚠️
src/scanpy/queries/_queries.py 0.00% 4 Missing ⚠️
src/scanpy/external/pp/_magic.py 0.00% 3 Missing ⚠️
src/scanpy/tools/_sim.py 50.00% 3 Missing ⚠️
src/scanpy/external/exporting.py 0.00% 2 Missing ⚠️
src/scanpy/external/pl.py 0.00% 2 Missing ⚠️
src/scanpy/external/pp/_bbknn.py 0.00% 2 Missing ⚠️
src/scanpy/external/pp/_dca.py 0.00% 2 Missing ⚠️
... and 26 more
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3573      +/-   ##
==========================================
- Coverage   75.51%   75.48%   -0.04%     
==========================================
  Files         113      113              
  Lines       13178    13169       -9     
==========================================
- Hits         9952     9941      -11     
- Misses       3226     3228       +2     
Files with missing lines Coverage Δ
src/scanpy/_compat.py 76.99% <100.00%> (ø)
src/scanpy/_version.py 100.00% <ø> (ø)
src/scanpy/cli.py 89.87% <100.00%> (-3.88%) ⬇️
...c/scanpy/experimental/pp/_highly_variable_genes.py 62.73% <ø> (ø)
src/scanpy/experimental/pp/_normalization.py 94.04% <ø> (ø)
src/scanpy/experimental/pp/_recipes.py 100.00% <100.00%> (ø)
src/scanpy/metrics/_common.py 91.25% <ø> (ø)
src/scanpy/plotting/_baseplot_class.py 88.92% <ø> (ø)
src/scanpy/plotting/_preprocessing.py 87.71% <ø> (ø)
src/scanpy/plotting/_tools/scatterplots.py 84.25% <100.00%> (ø)
... and 46 more

Sign up for free to 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.

1 participant