theislab / moscot

Multi-omic single-cell optimal transport tools
https://moscot-tools.org
BSD 3-Clause "New" or "Revised" License
101 stars 9 forks source link

Refactor: Handling Unrecognized Arguments for Prepare #696

Closed selmanozleyen closed 1 day ago

selmanozleyen commented 1 month ago

These are the things I want to do first. related: #596

From reading through ottjax only the __call__ functions on solvers absorb kwargs that aren't recognized. And they are because either they are given to create_geometry methods or create_initializer methods:

So this is kind of good news because from what I read from moscot, call_fn arguments are filtered before here: https://github.com/theislab/moscot/blob/e21677e6fbf1e5484b1c69a8ba55587dbf40f009/src/moscot/base/solver.py#L145-L164

Overall this means:

Related issues (will be closed after merge):

I separated some issues from this PR so that we can work on them later:

Now that the tests pass these are the things to do:

codecov[bot] commented 3 weeks ago

Codecov Report

Attention: Patch coverage is 85.81560% with 20 lines in your changes missing coverage. Please review.

Project coverage is 78.13%. Comparing base (3151da7) to head (7535065). Report is 46 commits behind head on main.

:exclamation: Current head 7535065 differs from pull request most recent head b11efac

Please upload reports for the commit b11efac to get more accurate results.

Additional details and impacted files [![Impacted file tree graph](https://app.codecov.io/gh/theislab/moscot/pull/696/graphs/tree.svg?width=650&height=150&src=pr&token=Rgtm5Tsblo&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=theislab)](https://app.codecov.io/gh/theislab/moscot/pull/696?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=theislab) ```diff @@ Coverage Diff @@ ## main #696 +/- ## ========================================== - Coverage 78.19% 78.13% -0.06% ========================================== Files 36 36 Lines 3806 3865 +59 Branches 706 727 +21 ========================================== + Hits 2976 3020 +44 - Misses 524 530 +6 - Partials 306 315 +9 ``` | [Files](https://app.codecov.io/gh/theislab/moscot/pull/696?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=theislab) | Coverage Δ | | |---|---|---| | [src/moscot/base/problems/birth\_death.py](https://app.codecov.io/gh/theislab/moscot/pull/696?src=pr&el=tree&filepath=src%2Fmoscot%2Fbase%2Fproblems%2Fbirth_death.py&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=theislab#diff-c3JjL21vc2NvdC9iYXNlL3Byb2JsZW1zL2JpcnRoX2RlYXRoLnB5) | `90.76% <100.00%> (+0.93%)` | :arrow_up: | | [src/moscot/base/problems/compound\_problem.py](https://app.codecov.io/gh/theislab/moscot/pull/696?src=pr&el=tree&filepath=src%2Fmoscot%2Fbase%2Fproblems%2Fcompound_problem.py&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=theislab#diff-c3JjL21vc2NvdC9iYXNlL3Byb2JsZW1zL2NvbXBvdW5kX3Byb2JsZW0ucHk=) | `75.67% <100.00%> (ø)` | | | [src/moscot/problems/cross\_modality/\_translation.py](https://app.codecov.io/gh/theislab/moscot/pull/696?src=pr&el=tree&filepath=src%2Fmoscot%2Fproblems%2Fcross_modality%2F_translation.py&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=theislab#diff-c3JjL21vc2NvdC9wcm9ibGVtcy9jcm9zc19tb2RhbGl0eS9fdHJhbnNsYXRpb24ucHk=) | `96.07% <100.00%> (-0.08%)` | :arrow_down: | | [src/moscot/problems/generic/\_generic.py](https://app.codecov.io/gh/theislab/moscot/pull/696?src=pr&el=tree&filepath=src%2Fmoscot%2Fproblems%2Fgeneric%2F_generic.py&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=theislab#diff-c3JjL21vc2NvdC9wcm9ibGVtcy9nZW5lcmljL19nZW5lcmljLnB5) | `93.44% <100.00%> (-3.17%)` | :arrow_down: | | [...moscot/problems/spatiotemporal/\_spatio\_temporal.py](https://app.codecov.io/gh/theislab/moscot/pull/696?src=pr&el=tree&filepath=src%2Fmoscot%2Fproblems%2Fspatiotemporal%2F_spatio_temporal.py&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=theislab#diff-c3JjL21vc2NvdC9wcm9ibGVtcy9zcGF0aW90ZW1wb3JhbC9fc3BhdGlvX3RlbXBvcmFsLnB5) | `100.00% <100.00%> (ø)` | | | [src/moscot/problems/time/\_lineage.py](https://app.codecov.io/gh/theislab/moscot/pull/696?src=pr&el=tree&filepath=src%2Fmoscot%2Fproblems%2Ftime%2F_lineage.py&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=theislab#diff-c3JjL21vc2NvdC9wcm9ibGVtcy90aW1lL19saW5lYWdlLnB5) | `96.15% <100.00%> (+0.32%)` | :arrow_up: | | [src/moscot/base/problems/problem.py](https://app.codecov.io/gh/theislab/moscot/pull/696?src=pr&el=tree&filepath=src%2Fmoscot%2Fbase%2Fproblems%2Fproblem.py&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=theislab#diff-c3JjL21vc2NvdC9iYXNlL3Byb2JsZW1zL3Byb2JsZW0ucHk=) | `77.80% <90.00%> (+0.30%)` | :arrow_up: | | [src/moscot/problems/space/\_mapping.py](https://app.codecov.io/gh/theislab/moscot/pull/696?src=pr&el=tree&filepath=src%2Fmoscot%2Fproblems%2Fspace%2F_mapping.py&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=theislab#diff-c3JjL21vc2NvdC9wcm9ibGVtcy9zcGFjZS9fbWFwcGluZy5weQ==) | `98.33% <87.50%> (-1.67%)` | :arrow_down: | | [src/moscot/problems/space/\_alignment.py](https://app.codecov.io/gh/theislab/moscot/pull/696?src=pr&el=tree&filepath=src%2Fmoscot%2Fproblems%2Fspace%2F_alignment.py&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=theislab#diff-c3JjL21vc2NvdC9wcm9ibGVtcy9zcGFjZS9fYWxpZ25tZW50LnB5) | `83.33% <61.11%> (-16.67%)` | :arrow_down: | | [src/moscot/problems/\_utils.py](https://app.codecov.io/gh/theislab/moscot/pull/696?src=pr&el=tree&filepath=src%2Fmoscot%2Fproblems%2F_utils.py&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=theislab#diff-c3JjL21vc2NvdC9wcm9ibGVtcy9fdXRpbHMucHk=) | `75.75% <80.35%> (+2.07%)` | :arrow_up: | ... and [1 file with indirect coverage changes](https://app.codecov.io/gh/theislab/moscot/pull/696/indirect-changes?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=theislab)
selmanozleyen commented 2 days ago

@MUCDK the problem is even though 3.10 passes 3.9 now fails. The results change between these versions

MUCDK commented 2 days ago

Ok can we skip the test for python 3.9?

selmanozleyen commented 2 days ago

Sure will update the tests in a new PR then