Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Jan 13, 2025
1 parent b31b4b5 commit d2e1c8f
Show file tree
Hide file tree
Showing 7 changed files with 23 additions and 27 deletions.
6 changes: 3 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@

## [0.1.2] - 2024-11-11

- No change in DRVI code
- Fix github workflow, tests, docs, and pypi publishing pipelines
- No change in DRVI code
- Fix github workflow, tests, docs, and pypi publishing pipelines

## [0.1.0] - 2024-08-21

- Moved all files from repo to scverse cookiecutter project template
- Moved all files from repo to scverse cookiecutter project template
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,12 @@ Unsupervised Deep Disentangled Representation of Single-Cell Omics

Please refer to the [documentation][link-docs]. In particular, the

- [Tutorials][link-tutorials], specially
- [A demo](https://drvi.readthedocs.io/latest/notebooks/general_pipeline.html) of how to train DRVI and interpret the latent dimensions.
- [API documentation][link-api], specially
- [DRVI Model](https://drvi.readthedocs.io/latest/api/generated/drvi.model.DRVI.html)
- [DRVI utility functions (tools)](https://drvi.readthedocs.io/latest/api/tools.html)
- [DRVI plotting functions](https://drvi.readthedocs.io/latest/api/plotting.html)
- [Tutorials][link-tutorials], specially
- [A demo](https://drvi.readthedocs.io/latest/notebooks/general_pipeline.html) of how to train DRVI and interpret the latent dimensions.
- [API documentation][link-api], specially
- [DRVI Model](https://drvi.readthedocs.io/latest/api/generated/drvi.model.DRVI.html)
- [DRVI utility functions (tools)](https://drvi.readthedocs.io/latest/api/tools.html)
- [DRVI plotting functions](https://drvi.readthedocs.io/latest/api/plotting.html)

## System requirements

Expand Down
18 changes: 9 additions & 9 deletions docs/contributing.md
Original file line number Diff line number Diff line change
Expand Up @@ -100,11 +100,11 @@ Specify `vX.X.X` as a tag name and create a release. For more information, see [

Please write documentation for new or changed features and use-cases. This project uses [sphinx][] with the following features:

- the [myst][] extension allows to write documentation in markdown/Markedly Structured Text
- [Numpy-style docstrings][numpydoc] (through the [napoloen][numpydoc-napoleon] extension).
- Jupyter notebooks as tutorials through [myst-nb][] (See [Tutorials with myst-nb](#tutorials-with-myst-nb-and-jupyter-notebooks))
- [Sphinx autodoc typehints][], to automatically reference annotated input and output types
- Citations (like {cite:p}`Virshup_2023`) can be included with [sphinxcontrib-bibtex](https://sphinxcontrib-bibtex.readthedocs.io/)
- the [myst][] extension allows to write documentation in markdown/Markedly Structured Text
- [Numpy-style docstrings][numpydoc] (through the [napoloen][numpydoc-napoleon] extension).
- Jupyter notebooks as tutorials through [myst-nb][] (See [Tutorials with myst-nb](#tutorials-with-myst-nb-and-jupyter-notebooks))
- [Sphinx autodoc typehints][], to automatically reference annotated input and output types
- Citations (like {cite:p}`Virshup_2023`) can be included with [sphinxcontrib-bibtex](https://sphinxcontrib-bibtex.readthedocs.io/)

See the [scanpy developer docs](https://scanpy.readthedocs.io/en/latest/dev/documentation.html) for more information
on how to write documentation.
Expand All @@ -121,10 +121,10 @@ repository.

#### Hints

- If you refer to objects from other packages, please add an entry to `intersphinx_mapping` in `docs/conf.py`. Only
if you do so can sphinx automatically create a link to the external documentation.
- If building the documentation fails because of a missing link that is outside your control, you can add an entry to
the `nitpick_ignore` list in `docs/conf.py`
- If you refer to objects from other packages, please add an entry to `intersphinx_mapping` in `docs/conf.py`. Only
if you do so can sphinx automatically create a link to the external documentation.
- If building the documentation fails because of a missing link that is outside your control, you can add an entry to
the `nitpick_ignore` list in `docs/conf.py`

#### Building the docs locally

Expand Down
2 changes: 1 addition & 1 deletion docs/extensions/typed_returns.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
def _process_return(lines: Iterable[str]) -> Generator[str, None, None]:
for line in lines:
if m := re.fullmatch(r"(?P<param>\w+)\s+:\s+(?P<type>[\w.]+)", line):
yield f'-{m["param"]} (:class:`~{m["type"]}`)'
yield f"-{m['param']} (:class:`~{m['type']}`)"
else:
yield line

Expand Down
6 changes: 2 additions & 4 deletions src/drvi/nn_modules/embedding.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,7 @@ def __repr__(self):
if self._freeze_hook is None:
return f"Emb({self.num_embeddings}, {self.embedding_dim})"
else:
return (
f"Emb({self.num_embeddings}, {self.embedding_dim} | " f"freeze: {self.n_freeze_x}, {self.n_freeze_y})"
)
return f"Emb({self.num_embeddings}, {self.embedding_dim} | freeze: {self.n_freeze_x}, {self.n_freeze_y})"


class MultiEmbedding(nn.Module):
Expand Down Expand Up @@ -103,7 +101,7 @@ def from_pretrained(cls, feature_embedding_instance):
def load_weights_from_trained_module(self, other, freeze_old=False):
assert len(self.emb_list) >= len(other.emb_list)
if len(self.emb_list) > len(other.emb_list):
logging.warning(f"Extending feature embedding {other} to {self} " f"with more feature categories.")
logging.warning(f"Extending feature embedding {other} to {self} with more feature categories.")
else:
logging.info(f"Extending feature embedding {other} to {self}")
for self_emb, other_emb in zip(self.emb_list, other.emb_list, strict=False):
Expand Down
4 changes: 1 addition & 3 deletions src/drvi/nn_modules/feature_interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,7 @@ def __init__(self, feature_info_str_list: list[str], axis="var", total_dim=None,
self.axis = axis
if any(fi.dim is None for fi in self.feature_info_list):
if total_dim is None and default_dim is None:
raise ValueError(
f"missing dim in {feature_info_str_list}\n" f"Please provide `total_dim` or `default_dim`"
)
raise ValueError(f"missing dim in {feature_info_str_list}\nPlease provide `total_dim` or `default_dim`")
if total_dim is not None:
self._fill_with_total_dim(total_dim)
if default_dim is not None:
Expand Down
2 changes: 1 addition & 1 deletion src/drvi/scvi_tools_based/model/base/_archesmixin.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ def load_query_data(
raise ValueError("It appears you are loading a model from a different class.")

if _SETUP_ARGS_KEY not in registry:
raise ValueError("Saved model does not contain original setup inputs. " "Cannot load the original setup.")
raise ValueError("Saved model does not contain original setup inputs. Cannot load the original setup.")

cls.setup_anndata(
adata,
Expand Down

0 comments on commit d2e1c8f

Please sign in to comment.