theislab / scib

Benchmarking analysis of data integration tools
MIT License
294 stars 63 forks source link

Only pass max_epochs to SCVI.train if set #345

Closed scottgigante-immunai closed 1 year ago

scottgigante-immunai commented 1 year ago

Passing max_epochs=None to SCVI.train throws an error.

    File "/usr/local/lib/python3.8/site-packages/scib/integration.py", line 280, in scanvi
      vae = scvi(adata, batch, hvg, return_model=True, max_epochs=n_epochs_scVI)
    File "/usr/local/lib/python3.8/site-packages/scib/integration.py", line 242, in scvi
      vae.train(train_size=1.0, max_epochs=max_epochs)
    File "/usr/local/lib/python3.8/site-packages/scvi/model/base/_training_mixin.py", line 142, in train
      return runner()
    File "/usr/local/lib/python3.8/site-packages/scvi/train/_trainrunner.py", line 82, in __call__
      self.trainer.fit(self.training_plan, self.data_splitter)
    File "/usr/local/lib/python3.8/site-packages/scvi/train/_trainer.py", line 188, in fit
      super().fit(*args, **kwargs)
    File "/usr/local/lib/python3.8/site-packages/pytorch_lightning/trainer/trainer.py", line 696, in fit
      self._call_and_handle_interrupt(
    File "/usr/local/lib/python3.8/site-packages/pytorch_lightning/trainer/trainer.py", line 650, in _call_and_handle_interrupt
      return trainer_fn(*args, **kwargs)
    File "/usr/local/lib/python3.8/site-packages/pytorch_lightning/trainer/trainer.py", line 735, in _fit_impl
      results = self._run(model, ckpt_path=self.ckpt_path)
    File "/usr/local/lib/python3.8/site-packages/pytorch_lightning/trainer/trainer.py", line 1166, in _run
      results = self._run_stage()
    File "/usr/local/lib/python3.8/site-packages/pytorch_lightning/trainer/trainer.py", line 1252, in _run_stage
      return self._run_train()
    File "/usr/local/lib/python3.8/site-packages/pytorch_lightning/trainer/trainer.py", line 1283, in _run_train
      self.fit_loop.run()
    File "/usr/local/lib/python3.8/site-packages/pytorch_lightning/loops/loop.py", line 190, in run
      if self.skip:
    File "/usr/local/lib/python3.8/site-packages/pytorch_lightning/loops/fit_loop.py", line 194, in skip
      return self.done or self.trainer.limit_train_batches == 0
    File "/usr/local/lib/python3.8/site-packages/pytorch_lightning/loops/fit_loop.py", line 165, in done
      assert isinstance(self.max_epochs, int)
  AssertionError
codecov[bot] commented 1 year ago

Codecov Report

Merging #345 (49dbfdb) into main (162fe99) will decrease coverage by 31.76%. The diff coverage is 100.00%.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #345 +/- ## =========================================== - Coverage 56.04% 24.27% -31.77% =========================================== Files 38 38 Lines 2102 2105 +3 =========================================== - Hits 1178 511 -667 - Misses 924 1594 +670 ``` | Flag | Coverage Δ | | |---|---|---| | unittest | `24.27% <100.00%> (-31.77%)` | :arrow_down: | Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=theislab#carryforward-flags-in-the-pull-request-comment) to find out more. | [Impacted Files](https://codecov.io/gh/theislab/scib/pull/345?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=theislab) | Coverage Δ | | |---|---|---| | [scib/integration.py](https://codecov.io/gh/theislab/scib/pull/345/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=theislab#diff-c2NpYi9pbnRlZ3JhdGlvbi5weQ==) | `33.93% <100.00%> (+1.22%)` | :arrow_up: | | [scib/metrics/isolated\_labels.py](https://codecov.io/gh/theislab/scib/pull/345/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=theislab#diff-c2NpYi9tZXRyaWNzL2lzb2xhdGVkX2xhYmVscy5weQ==) | `14.00% <0.00%> (-80.00%)` | :arrow_down: | | [scib/metrics/highly\_variable\_genes.py](https://codecov.io/gh/theislab/scib/pull/345/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=theislab#diff-c2NpYi9tZXRyaWNzL2hpZ2hseV92YXJpYWJsZV9nZW5lcy5weQ==) | `14.70% <0.00%> (-79.42%)` | :arrow_down: | | [scib/metrics/trajectory.py](https://codecov.io/gh/theislab/scib/pull/345/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=theislab#diff-c2NpYi9tZXRyaWNzL3RyYWplY3RvcnkucHk=) | `14.28% <0.00%> (-76.79%)` | :arrow_down: | | [scib/metrics/cell\_cycle.py](https://codecov.io/gh/theislab/scib/pull/345/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=theislab#diff-c2NpYi9tZXRyaWNzL2NlbGxfY3ljbGUucHk=) | `14.89% <0.00%> (-74.47%)` | :arrow_down: | | [tests/metrics/test\_trajectory.py](https://codecov.io/gh/theislab/scib/pull/345/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=theislab#diff-dGVzdHMvbWV0cmljcy90ZXN0X3RyYWplY3RvcnkucHk=) | `26.31% <0.00%> (-73.69%)` | :arrow_down: | | [tests/metrics/test\_beyond\_label\_metrics.py](https://codecov.io/gh/theislab/scib/pull/345/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=theislab#diff-dGVzdHMvbWV0cmljcy90ZXN0X2JleW9uZF9sYWJlbF9tZXRyaWNzLnB5) | `27.27% <0.00%> (-72.73%)` | :arrow_down: | | [tests/metrics/test\_clisi.py](https://codecov.io/gh/theislab/scib/pull/345/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=theislab#diff-dGVzdHMvbWV0cmljcy90ZXN0X2NsaXNpLnB5) | `28.57% <0.00%> (-71.43%)` | :arrow_down: | | [tests/metrics/test\_ilisi.py](https://codecov.io/gh/theislab/scib/pull/345/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=theislab#diff-dGVzdHMvbWV0cmljcy90ZXN0X2lsaXNpLnB5) | `28.57% <0.00%> (-71.43%)` | :arrow_down: | | [scib/metrics/silhouette.py](https://codecov.io/gh/theislab/scib/pull/345/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=theislab#diff-c2NpYi9tZXRyaWNzL3NpbGhvdWV0dGUucHk=) | `13.51% <0.00%> (-70.28%)` | :arrow_down: | | ... and [18 more](https://codecov.io/gh/theislab/scib/pull/345/diff?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=theislab) | |