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 27, 2025
1 parent 5dafcae commit 78f5e09
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 22 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@ and this project adheres to [Semantic Versioning][].

### Added

- Basic tool, preprocessing and plotting functions
- Basic tool, preprocessing and plotting functions
20 changes: 10 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,15 @@ TorchGMM models against scikit-learn models is available on the

## Features

- Support for GPU and multi-node training by implementing models in PyTorch and relying on
[PyTorch Lightning](https://lightning.ai/docs/pytorch/stable/)
- Mini-batch training for all models such that they can be used on huge datasets
- Well-structured implementation of models
- Support for GPU and multi-node training by implementing models in PyTorch and relying on
[PyTorch Lightning](https://lightning.ai/docs/pytorch/stable/)
- Mini-batch training for all models such that they can be used on huge datasets
- Well-structured implementation of models

- High-level `Estimator` API allows for easy usage such that models feel and behave like in
scikit-learn
- Medium-level `LightingModule` implements the training algorithm
- Low-level PyTorch `Module` manages the model parameters
- High-level `Estimator` API allows for easy usage such that models feel and behave like in
scikit-learn
- Medium-level `LightingModule` implements the training algorithm
- Low-level PyTorch `Module` manages the model parameters

## Getting started

Expand Down Expand Up @@ -110,8 +110,8 @@ In fact, **you do not need to change anything else in your code**.

Currently, TorchGMM implements two different models:

- [GaussianMixture](https://pycave.borchero.com/sites/generated/bayes/gmm/pycave.bayes.GaussianMixture.html)
- [K-Means](https://pycave.borchero.com/sites/generated/clustering/kmeans/pycave.clustering.KMeans.html)
- [GaussianMixture](https://pycave.borchero.com/sites/generated/bayes/gmm/pycave.bayes.GaussianMixture.html)
- [K-Means](https://pycave.borchero.com/sites/generated/clustering/kmeans/pycave.clustering.KMeans.html)

## Contribution

Expand Down
16 changes: 8 additions & 8 deletions docs/contributing.md
Original file line number Diff line number Diff line change
Expand Up @@ -99,10 +99,10 @@ 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
- 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

See the [scanpy developer docs](https://scanpy.readthedocs.io/en/latest/dev/documentation.html) for more information
on how to write documentation.
Expand All @@ -119,10 +119,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
2 changes: 1 addition & 1 deletion src/torchgmm/base/estimator/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ def save_parameters(self, path: Path) -> None:
f.write(data)
except TypeError:
warnings.warn(
f"Failed to serialize parameters of `{self.__class__.__name__}` to JSON. " "Falling back to `pickle`.",
f"Failed to serialize parameters of `{self.__class__.__name__}` to JSON. Falling back to `pickle`.",
stacklevel=2,
)
with (path / "params.pickle").open("wb+") as f:
Expand Down
2 changes: 1 addition & 1 deletion src/torchgmm/base/utils/generics.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,6 @@ def get_generic_type(cls: Type[Any], origin: Type[Any], index: int = 0) -> Type[
if get_origin(base) == origin:
args = get_args(base)
if not args:
raise ValueError(f"`{cls.__name__}` does not provide a generic parameter " f"for `{origin.__name__}`")
raise ValueError(f"`{cls.__name__}` does not provide a generic parameter for `{origin.__name__}`")
return get_args(base)[index]
raise ValueError(f"`{cls.__name__}` does not inherit from `{origin.__name__}`")

0 comments on commit 78f5e09

Please sign in to comment.