Skip to content

Feat: add moransi#304

Merged
mumichae merged 20 commits into
mainfrom
feat/add_moransi
Apr 24, 2026
Merged

Feat: add moransi#304
mumichae merged 20 commits into
mainfrom
feat/add_moransi

Conversation

@MxMstrmn

@MxMstrmn MxMstrmn commented May 2, 2022

Copy link
Copy Markdown
Contributor

Updated version of moran's I PR with pre-commits

A new approach to integrate #245

@MxMstrmn MxMstrmn requested a review from mumichae May 2, 2022 20:21
@MxMstrmn

MxMstrmn commented May 2, 2022

Copy link
Copy Markdown
Contributor Author

Hi @michalk8, do you have an idea why the checks fail here? The file locally has no syntax errors and also passes the pre-commits I added as part of this PR. Do not know how to handle this best / fix it.

@michalk8

michalk8 commented May 2, 2022

Copy link
Copy Markdown
Contributor

Done. Also, I'd seriously consider refactoring the CI to be more up-to-date.
Interestingly, AST checker pre-commit did not catch this.

@MxMstrmn

MxMstrmn commented May 2, 2022

Copy link
Copy Markdown
Contributor Author

Why does f"{variable=}" fail the parse, is that not normal python syntax?

@MxMstrmn

MxMstrmn commented May 2, 2022

Copy link
Copy Markdown
Contributor Author

I did not set the CI up, I guess @mumichae and I would be very glad for your input to improve this :)

@michalk8

michalk8 commented May 2, 2022

Copy link
Copy Markdown
Contributor

Why does f"{variable=}" fail the parse, is that not normal python syntax?

It is, just from Python 3.8 (would deprecate 3.7 since numpy support ended last December), hence the refactoring.

@MxMstrmn

MxMstrmn commented May 2, 2022

Copy link
Copy Markdown
Contributor Author

Thanks so much, @michalk8!

@mumichae

mumichae commented May 2, 2022

Copy link
Copy Markdown
Collaborator

Done. Also, I'd seriously consider refactoring the CI to be more up-to-date.
Interestingly, AST checker pre-commit did not catch this.

Are you referring to the .github/workflow content to be updated based on a newer configuration template? I wasn't aware there was an update, what consequences would the current code have of not updated?

Would be happy to update, however that would be in a separate PR.

@michalk8

michalk8 commented May 3, 2022

Copy link
Copy Markdown
Contributor

Are you referring to the .github/workflow content to be updated based on a newer configuration template? I wasn't aware there was an update, what consequences would the current code have of not updated?

Would do the following:

  • remove 3.7 CI, add 3.9 (unless you need to support it)
  • use pre-commits (add e.g. black) instead of running raw flake8 (this PR was)
  • add tests coverage
  • not sure how much work, but macOS test CI would be nice to have

The first 2 points I'd say are the one to focus on.

@mumichae

mumichae commented May 3, 2022

Copy link
Copy Markdown
Collaborator

Thanks a lot for the suggestions @michalk8 !

I think we should definitely make things more consistent, if we start using pre-commit (which we hadn't before). But I think this should be separated from Moran's I. I'll open a new issue with a description of what we'd need for pre-commit integration and would suggest we get that merged before the new metric.

@MxMstrmn

MxMstrmn commented May 3, 2022

Copy link
Copy Markdown
Contributor Author

Updated version of #303

@MxMstrmn MxMstrmn mentioned this pull request May 3, 2022
MxMstrmn added 2 commits May 3, 2022 14:27
Move helper functions outside, only consider scores > 0, refactor code, reduce default n_hvg
@MxMstrmn MxMstrmn requested a review from LuckyMD May 3, 2022 12:50
@codecov

codecov Bot commented May 10, 2022

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 95.94595% with 3 lines in your changes missing coverage. Please review.
✅ Project coverage is 58.16%. Comparing base (b6bb778) to head (64bb73c).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
scib/metrics/morans_i.py 96.96% 2 Missing ⚠️
scib/preprocessing.py 50.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #304      +/-   ##
==========================================
+ Coverage   52.15%   58.16%   +6.01%     
==========================================
  Files          22       23       +1     
  Lines        1762     1836      +74     
==========================================
+ Hits          919     1068     +149     
+ Misses        843      768      -75     
Flag Coverage Δ
unittests 58.16% <95.94%> (+6.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
scib/metrics/__init__.py 100.00% <100.00%> (ø)
scib/metrics/metrics.py 82.29% <100.00%> (+0.97%) ⬆️
scib/preprocessing.py 30.80% <50.00%> (+7.44%) ⬆️
scib/metrics/morans_i.py 96.96% <96.96%> (ø)

... and 2 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@mumichae mumichae changed the title Feat/add moransi Feat: add moransi Apr 24, 2026
@mumichae mumichae merged commit ce78467 into main Apr 24, 2026
10 of 11 checks passed
@mumichae mumichae deleted the feat/add_moransi branch April 27, 2026 20:13
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.

3 participants