From dd8d2f8f9c85571076936c585b04fe0027e0cf2c Mon Sep 17 00:00:00 2001 From: Steffen Schneider Date: Mon, 22 Jun 2026 23:38:20 +0200 Subject: [PATCH 1/2] bump pre-commit versions --- .pre-commit-config.yaml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index fbd45842..3e59e0d1 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,6 +1,6 @@ repos: - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v4.4.0 + rev: v6.0.0 hooks: - id: end-of-file-fixer - id: trailing-whitespace @@ -9,18 +9,18 @@ repos: - id: check-executables-have-shebangs - id: check-toml - repo: https://github.com/google/yapf - rev: v0.33.0 + rev: v0.43.0 hooks: - id: yapf additional_dependencies: - pyproject.toml - repo: https://github.com/PyCQA/isort - rev: 5.12.0 + rev: 8.0.1 hooks: - id: isort additional_dependencies: - pyproject.toml - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.0.280 + rev: v0.15.18 hooks: - id: ruff From 95c6a31396a6b8fc19114db565f97de8e8e5c609 Mon Sep 17 00:00:00 2001 From: Steffen Schneider Date: Mon, 22 Jun 2026 23:39:47 +0200 Subject: [PATCH 2/2] re-format the repository --- README.md | 4 ++-- cebra/helper.py | 3 +-- cebra/integrations/plotly.py | 3 ++- docs/source/api/integrations/data.rst | 2 +- docs/source/api/integrations/deeplabcut.rst | 2 -- docs/source/api/integrations/matplotlib.rst | 1 - docs/source/api/integrations/plotly.rst | 1 - tests/test_datasets.py | 5 ++--- tests/test_solver.py | 4 +++- 9 files changed, 11 insertions(+), 14 deletions(-) diff --git a/README.md b/README.md index d75fd99b..e6849b2f 100644 --- a/README.md +++ b/README.md @@ -50,9 +50,9 @@ Steffen Schneider, Rodrigo González Laiz, Anastasiia Filipova, Markus Frey, Mac [Learnable latent embeddings for joint behavioral and neural analysis.](https://arxiv.org/abs/2204.00673) Steffen Schneider*, Jin Hwa Lee* and Mackenzie Weygandt Mathis -# Patent Information +# Patent Information -- [Dimensionality reduction of time-series data, and systems and devices that use the resultant embeddings](https://patents.google.com/patent/US12499131B2/en). Steffen Schneider* & Mackenzie Weygandt Mathis*. Awarded Dec 2025. Please contact the [TTO office](adam.swetloff@epfl.ch) at EPFL for licensing. +- [Dimensionality reduction of time-series data, and systems and devices that use the resultant embeddings](https://patents.google.com/patent/US12499131B2/en). Steffen Schneider* & Mackenzie Weygandt Mathis*. Awarded Dec 2025. Please contact the [TTO office](adam.swetloff@epfl.ch) at EPFL for licensing. # License diff --git a/cebra/helper.py b/cebra/helper.py index b956d7f0..00d95edb 100644 --- a/cebra/helper.py +++ b/cebra/helper.py @@ -169,8 +169,7 @@ def wrapper(*args, patched_version=None, **kwargs): installed_version = packaging.version.parse( patched_version) # Use the patched version if provided else: - installed_version = packaging.version.parse( - module.__version__) + installed_version = packaging.version.parse(module.__version__) if installed_version < required_version: raise ImportError( diff --git a/cebra/integrations/plotly.py b/cebra/integrations/plotly.py index af8719fd..9b3fcf91 100644 --- a/cebra/integrations/plotly.py +++ b/cebra/integrations/plotly.py @@ -87,7 +87,8 @@ def _define_colorscale(self, cmap: str): Returns: colorscale: List of scaled colors to plot the embeddings """ - colorscale = _convert_cmap2colorscale(matplotlib.colormaps.get_cmap(cmap)) + colorscale = _convert_cmap2colorscale( + matplotlib.colormaps.get_cmap(cmap)) return colorscale diff --git a/docs/source/api/integrations/data.rst b/docs/source/api/integrations/data.rst index 88c0f3eb..8bfa322e 100644 --- a/docs/source/api/integrations/data.rst +++ b/docs/source/api/integrations/data.rst @@ -3,4 +3,4 @@ Data Loading .. automodule:: cebra.data.load :show-inheritance: - :members: \ No newline at end of file + :members: diff --git a/docs/source/api/integrations/deeplabcut.rst b/docs/source/api/integrations/deeplabcut.rst index 44ebd4f6..8b41e438 100644 --- a/docs/source/api/integrations/deeplabcut.rst +++ b/docs/source/api/integrations/deeplabcut.rst @@ -4,5 +4,3 @@ DeepLabCut .. automodule:: cebra.integrations.deeplabcut :show-inheritance: :members: - - diff --git a/docs/source/api/integrations/matplotlib.rst b/docs/source/api/integrations/matplotlib.rst index 45ed20f7..e9d24e88 100644 --- a/docs/source/api/integrations/matplotlib.rst +++ b/docs/source/api/integrations/matplotlib.rst @@ -4,4 +4,3 @@ Plotting with ``matplotlib`` .. automodule:: cebra.integrations.matplotlib :show-inheritance: :members: - diff --git a/docs/source/api/integrations/plotly.rst b/docs/source/api/integrations/plotly.rst index e12f6123..fcad2249 100644 --- a/docs/source/api/integrations/plotly.rst +++ b/docs/source/api/integrations/plotly.rst @@ -4,4 +4,3 @@ Plotting with ``plotly`` .. automodule:: cebra.integrations.plotly :show-inheritance: :members: - diff --git a/tests/test_datasets.py b/tests/test_datasets.py index 88af686c..3b63a43c 100644 --- a/tests/test_datasets.py +++ b/tests/test_datasets.py @@ -148,9 +148,8 @@ def test_allen(): @pytest.mark.requires_dataset -@pytest.mark.parametrize("options", - cebra.datasets.get_options("*", - expand_parametrized=False)) +@pytest.mark.parametrize( + "options", cebra.datasets.get_options("*", expand_parametrized=False)) def test_options(options): assert len(options) > 0 assert len(multisubject_options) > 0 diff --git a/tests/test_solver.py b/tests/test_solver.py index 8a54aaa9..cf2c62ad 100644 --- a/tests/test_solver.py +++ b/tests/test_solver.py @@ -41,8 +41,10 @@ def _get_loader(data_name, loader_initfunc): loader = loader_initfunc(data, **kwargs) return loader, data + OUTPUT_DIMENSION = 3 + def _make_model(dataset, model_architecture="offset10-model"): # TODO flexible input dimension # return nn.Sequential( @@ -398,4 +400,4 @@ def test_unified_session(data_name, model_architecture, loader_initfunc, assert emb.shape == (loader.dataset.num_timepoints, 3) emb = solver.transform(data, labels, session_id=i, batch_size=300) - assert emb.shape == (loader.dataset.num_timepoints, 3) \ No newline at end of file + assert emb.shape == (loader.dataset.num_timepoints, 3)