Skip to content

feat: scVI-X release - #3823

Open
canergen wants to merge 25 commits into
mainfrom
scvix_da_omer2_rebase_upstream
Open

feat: scVI-X release#3823
canergen wants to merge 25 commits into
mainfrom
scvix_da_omer2_rebase_upstream

Conversation

@canergen

Copy link
Copy Markdown
Member

Do not merge or review yet.

@canergen

Copy link
Copy Markdown
Member Author

@ori-kron-wis code can be checked.

assert params_latent[k].shape == params_orig[k].shape

for k in keys:
assert_approx_equal(params_latent[k], params_orig[k])

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Results are not equal (only tests failure now), I guess, because of resampling of the minified model, you will need to tweak rtol and atol (increase - but how much?)

Comment thread src/scvi/external/scvix/_model.py Outdated

return pair_penalty

def mmd(self, params, mask=None):

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

if mask is None (default), what are mod_1 and mod_2? it will break.
also seems that this is the case cause line 661 invokes mmd with mask==None
its probably not covered in tests

ArchesMixin,
BaseMinifiedModeModelClass,
):
"""single-cell Variational Inference :cite:p:`Lopez18`.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I guess you will want to put you pre-print title here

Comment thread src/scvi/external/scvix/_model.py
encode_assay_list = [n_assay]
else:
encode_assay_list = [0]
if not encode_covariates:

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

if encode_covaraites if False, what is self.batch_representation_encoder? might not be utilized later on, but still need a value for this model registry (later save/load etc)

Comment thread src/scvi/utils/_docstrings.py
pseudoinputs_data_indices = np.random.randint(
0, self.summary_stats.n_cells, n_prior_components
)
assert pseudoinputs_data_indices.shape[0] == n_prior_components

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

do we need to check assert in the runtime code? It will not tell anything.
I suggest otherwise to check if condition, and plot an Error message

if prior == "gaussian":
self.prior = GaussianPrior()
elif prior == "vamp":
assert pseudoinput_data is not None, (

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

again, better to add a runtime error/warning message

Comment thread src/scvi/nn/_base_components.py

@ori-kron-wis ori-kron-wis left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I think the api changes in core function (trainingplans and base_components) are not really needed and we can avoid most of it by changing it internally in scvix module, thus, without affect other models.

For the changes in adversarial_classifier - it affect other models for sure (totalvi, gimvi) - are we certain they are ok?

@@ -761,9 +805,7 @@ def configure_optimizers(self):

if self.adversarial_classifier is not False:

@ori-kron-wis ori-kron-wis May 24, 2026

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

did we validate TotalVI functionality? multivi? There are parameter changes here (perhaps we can encode for scviX but return to previous values otherwise)

n_input=self.module.n_latent,
n_hidden=32,
n_input=self.module.n_latent + getattr(self.module, "n_adversarial_group", 0),
n_hidden=128,

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

another parameter change, how di dit affect other adversarial models?

Comment thread src/scvi/external/sysvi/_module.py
Comment thread src/scvi/external/sysvi/_base_components.py
A list containing, for each category of interest,
the number of categories. Each category will be
included using a one-hot encoding.
n_cont

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

this is still here, but you changed the API (why?) - my suggestion is to revert to n_cont and update scvi_x and not vice versa

Comment thread src/scvi/nn/_base_components.py

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

a change made to cope with api changes. need to verify

Comment thread src/scvi/external/sysvi/_base_components.py
Comment thread src/scvi/module/_multivae.py
@ori-kron-wis ori-kron-wis added the on-merge: backport to 1.4.x on-merge: backport to 1.4.x label May 28, 2026
@codecov

codecov Bot commented Jun 30, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 84.86708% with 74 lines in your changes missing coverage. Please review.
✅ Project coverage is 88.71%. Comparing base (937568a) to head (927bffc).
⚠️ Report is 3 commits behind head on main.

Files with missing lines Patch % Lines
src/scvi/external/scvix/_module.py 76.34% 57 Missing ⚠️
src/scvi/module/base/_embedding_mixin.py 87.50% 5 Missing ⚠️
src/scvi/nn/_base_components.py 91.37% 5 Missing ⚠️
src/scvi/external/scvix/_model.py 95.65% 4 Missing ⚠️
src/scvi/train/_trainingplans.py 95.00% 2 Missing ⚠️
src/scvi/model/base/_embedding_mixin.py 66.66% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3823      +/-   ##
==========================================
+ Coverage   88.54%   88.71%   +0.16%     
==========================================
  Files         231      234       +3     
  Lines       23064    23514     +450     
==========================================
+ Hits        20423    20861     +438     
- Misses       2641     2653      +12     
Flag Coverage Δ
integration 74.69% <84.86%> (+0.44%) ⬆️

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

Files with missing lines Coverage Δ
src/scvi/_constants.py 100.00% <100.00%> (ø)
src/scvi/external/__init__.py 100.00% <100.00%> (ø)
src/scvi/external/gimvi/_task.py 96.15% <ø> (ø)
src/scvi/external/scvix/__init__.py 100.00% <100.00%> (ø)
src/scvi/external/sysvi/_base_components.py 90.38% <100.00%> (ø)
src/scvi/external/sysvi/_module.py 97.54% <100.00%> (ø)
src/scvi/module/_constants.py 100.00% <100.00%> (ø)
src/scvi/module/_multivae.py 83.60% <100.00%> (+0.04%) ⬆️
src/scvi/nn/_embedding.py 100.00% <ø> (ø)
src/scvi/utils/_docstrings.py 100.00% <100.00%> (ø)
... and 6 more

... and 1 file with indirect coverage changes

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

@ori-kron-wis ori-kron-wis added on-merge: backport to 1.5.x on-merge: backport to 1.5.x and removed on-merge: backport to 1.4.x on-merge: backport to 1.4.x labels Jul 7, 2026
@ori-kron-wis ori-kron-wis changed the title scVI-X release feat: scVI-X release Jul 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

on-merge: backport to 1.5.x on-merge: backport to 1.5.x

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants