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

Custom dataloader registry support #2932

Open
wants to merge 96 commits into
base: main
Choose a base branch
from

Conversation

ori-kron-wis
Copy link
Collaborator

No description provided.

@ori-kron-wis ori-kron-wis added this to the scvi-tools 1.2 milestone Aug 7, 2024
@ori-kron-wis ori-kron-wis self-assigned this Aug 7, 2024
@ori-kron-wis ori-kron-wis linked an issue Aug 7, 2024 that may be closed by this pull request
Copy link

codecov bot commented Aug 11, 2024

Codecov Report

Attention: Patch coverage is 50.60241% with 164 lines in your changes missing coverage. Please review.

Project coverage is 81.96%. Comparing base (2f1611c) to head (2485bb6).

Files with missing lines Patch % Lines
src/scvi/model/base/_base_model.py 37.28% 74 Missing ⚠️
src/scvi/dataloaders/_custom_dataloders.py 43.52% 48 Missing ⚠️
src/scvi/model/_scanvi.py 62.96% 20 Missing ⚠️
src/scvi/model/_scvi.py 52.00% 12 Missing ⚠️
src/scvi/model/base/_archesmixin.py 75.75% 8 Missing ⚠️
src/scvi/model/base/_save_load.py 85.71% 1 Missing ⚠️
src/scvi/model/base/_training_mixin.py 50.00% 1 Missing ⚠️

❌ Your project check has failed because the head coverage (81.96%) is below the target coverage (83.00%). You can increase the head coverage or adjust the target coverage.

❗ There is a different number of reports uploaded between BASE (2f1611c) and HEAD (2485bb6). Click for more details.

HEAD has 62 uploads less than BASE
Flag BASE (2f1611c) HEAD (2485bb6)
65 3
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2932      +/-   ##
==========================================
- Coverage   89.43%   81.96%   -7.48%     
==========================================
  Files         185      186       +1     
  Lines       16182    16439     +257     
==========================================
- Hits        14473    13474     -999     
- Misses       1709     2965    +1256     
Files with missing lines Coverage Δ
src/scvi/data/_utils.py 87.57% <100.00%> (+0.53%) ⬆️
src/scvi/dataloaders/__init__.py 100.00% <100.00%> (ø)
src/scvi/dataloaders/_data_splitting.py 95.47% <ø> (ø)
src/scvi/external/resolvi/_model.py 92.72% <ø> (ø)
src/scvi/external/stereoscope/_model.py 92.40% <ø> (ø)
src/scvi/external/stereoscope/_module.py 96.33% <ø> (ø)
src/scvi/model/_amortizedlda.py 94.11% <ø> (ø)
src/scvi/model/_autozi.py 95.40% <ø> (ø)
src/scvi/model/_condscvi.py 95.74% <ø> (ø)
src/scvi/model/_jaxscvi.py 92.30% <ø> (ø)
... and 12 more

... and 26 files with indirect coverage changes

@ori-kron-wis ori-kron-wis removed the custom_dataloader PR 2932 label Feb 9, 2025
@ori-kron-wis ori-kron-wis added the on-merge: backport to 1.2.x on-merge: backport to 1.2.x label Feb 10, 2025
import scvi

if TYPE_CHECKING:
import lamindb as ln
Copy link
Member

Choose a reason for hiding this comment

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

does this create a requirement for lamindb? Can we make MappedCollectionDataModule a lazy load?

"state_registry": {
"categorical_mapping": self.label_keys,
"original_key": self._label_key,
"unlabeled_category": "unlabeled",
Copy link
Member

Choose a reason for hiding this comment

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

expose "unlabeled"?

**datasplitter_kwargs,
)
else:
# TODO fix in external dataloader?
Copy link
Member

Choose a reason for hiding this comment

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

print warning.

@@ -134,6 +148,7 @@ def __init__(
f"dropout_rate: {dropout_rate}, dispersion: {dispersion}, "
f"gene_likelihood: {gene_likelihood}, latent_distribution: {latent_distribution}."
)
self._module_init_on_train = False

if self._module_init_on_train:
Copy link
Member

Choose a reason for hiding this comment

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

remove module_init_on_train. This is deprecated code with the new dataloader implementation.

)
else:
# custom datamodule
n_cats_per_cov = self.summary_stats[f"n_{REGISTRY_KEYS.CAT_COVS_KEY}"]
Copy link
Member

Choose a reason for hiding this comment

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

does this work for AnnData? Can we remove the if statement here?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
custom_dataloader PR 2932 on-merge: backport to 1.2.x on-merge: backport to 1.2.x
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Fix custom dataloader registry
2 participants