Skip to content
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

Add all ruff checks we use in anndata #2761

Merged
merged 7 commits into from
Nov 23, 2023
Merged

Add all ruff checks we use in anndata #2761

merged 7 commits into from
Nov 23, 2023

Conversation

flying-sheep
Copy link
Member

@flying-sheep flying-sheep commented Nov 23, 2023

  • Release notes not necessary because: dev process change

All changes were automatic, except for:

  • removing unused imports or replacing them with __all__. Much more uncontroversial than AnnData as scanpy’s public modules were more well defined from the start. There were no ambiguous cases except for sc.get re-exporting "_check_mask", "_get_obs_rep", and "_set_obs_rep". But since those aren’t documented, we can decide over their fate at a later date.
  • Fixing circular imports like sc.{pp,tl}.pca. I only needed to create a neighbors/_doc.py file for shared neighbors/tools doc parts, and put the pca import in tools in __getattr__ (supported since 3.7)
  • replacing some with open(p) as f: x = json.loads(f.read())s with x = json.loads(Path(p).read_text())

All in all surprisingly easy

Copy link

codecov bot commented Nov 23, 2023

Codecov Report

Merging #2761 (1874966) into master (75cb4e7) will decrease coverage by 0.75%.
The diff coverage is 77.43%.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #2761      +/-   ##
==========================================
- Coverage   73.21%   72.46%   -0.75%     
==========================================
  Files         111      111              
  Lines       12246    12418     +172     
==========================================
+ Hits         8966     8999      +33     
- Misses       3280     3419     +139     
Files Coverage Δ
scanpy/__init__.py 82.14% <100.00%> (+0.66%) ⬆️
scanpy/_compat.py 40.47% <ø> (ø)
scanpy/datasets/__init__.py 100.00% <100.00%> (ø)
scanpy/datasets/_ebi_expression_atlas.py 90.36% <100.00%> (+0.11%) ⬆️
scanpy/datasets/_utils.py 100.00% <100.00%> (ø)
scanpy/experimental/__init__.py 100.00% <100.00%> (ø)
scanpy/experimental/_docs.py 100.00% <100.00%> (ø)
scanpy/experimental/pp/__init__.py 100.00% <100.00%> (ø)
scanpy/external/__init__.py 100.00% <100.00%> (ø)
scanpy/external/pp/__init__.py 100.00% <100.00%> (ø)
... and 101 more

@flying-sheep flying-sheep added this to the 1.10.0 milestone Nov 23, 2023
tl.pca
pp.pca
Copy link
Member Author

@flying-sheep flying-sheep Nov 23, 2023

Choose a reason for hiding this comment

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

I took the liberty to make this more Zen.

It’s the same function, it should be only in one place. (It’s still importable from the other, we can add a deprecation if we want, or just leave it.)

The only places that used to use it from tl are externals, I harmonized all that.

@flying-sheep flying-sheep merged commit bc349b9 into master Nov 23, 2023
17 checks passed
@flying-sheep flying-sheep deleted the more-checks branch November 23, 2023 16:58
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.

Add lints and import sorting
1 participant