Skip to content

Commit 5227107

Browse files
authored
Merge branch 'main' into add_options_mixed
2 parents f1894a1 + f45e69d commit 5227107

20 files changed

Lines changed: 121 additions & 35 deletions

File tree

.github/workflows/docs.yml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,13 @@ jobs:
5959
- name: Install package
6060
run: |
6161
python -m pip install --upgrade pip setuptools wheel
62-
sudo apt-get install -y pandoc
62+
# NOTE(stes) Pandoc version must be at least (2.14.2) but less than (4.0.0).
63+
# as of 29/10/23. Ubuntu 22.04 which is used for ubuntu-latest only has an
64+
# old pandoc version (2.9.). We will hence install the latest version manually.
65+
# previou: sudo apt-get install -y pandoc
66+
wget https://github.com/jgm/pandoc/releases/download/3.1.9/pandoc-3.1.9-1-amd64.deb
67+
sudo dpkg -i pandoc-3.1.9-1-amd64.deb
68+
rm pandoc-3.1.9-1-amd64.deb
6369
pip install torch --extra-index-url https://download.pytorch.org/whl/cpu
6470
pip install '.[docs]'
6571

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ RUN make dist
4242
FROM cebra-base
4343

4444
# install the cebra wheel
45-
ENV WHEEL=cebra-0.3.0-py2.py3-none-any.whl
45+
ENV WHEEL=cebra-0.3.1rc1-py2.py3-none-any.whl
4646
WORKDIR /build
4747
COPY --from=wheel /build/dist/${WHEEL} .
4848
RUN pip install --no-cache-dir ${WHEEL}'[dev,integrations,datasets]'

Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
CEBRA_VERSION=$(shell python3 -c "import cebra; print(cebra.__version__)")
1+
CEBRA_VERSION := 0.3.1rc1
22

33
dist:
44
python3 -m pip install virtualenv
@@ -10,7 +10,7 @@ build: dist
1010
archlinux:
1111
mkdir -p dist/arch
1212
cp PKGBUILD dist/arch
13-
cp dist/cebra-0.3.0.tar.gz dist/arch
13+
cp dist/cebra-${CEBRA_VERSION}.tar.gz dist/arch
1414
(cd dist/arch; makepkg --skipchecksums -f)
1515

1616
# NOTE(stes): Ensure that no old tempfiles are present. Ideally, move this into

PKGBUILD

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Maintainer: Steffen Schneider <stes@hey.com>
22
pkgname=python-cebra
33
_pkgname=cebra
4-
pkgver=0.3.0
4+
pkgver=0.3.1rc1
55
pkgrel=1
66
pkgdesc="Consistent Embeddings of high-dimensional Recordings using Auxiliary variables"
77
url="https://cebra.ai"

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,5 +45,6 @@ It can jointly use behavioral and neural data in a hypothesis- or discovery-driv
4545
[Learnable latent embeddings for joint behavioral and neural analysis.](https://arxiv.org/abs/2204.00673)
4646
Steffen Schneider*, Jin Hwa Lee* and Mackenzie Weygandt Mathis
4747

48-
# License
48+
# License
49+
4950
- CEBRA is released for academic use only (please read the license file). If this license is not appropriate for your application, please contact Prof. Mackenzie W. Mathis (mackenzie@post.harvard.edu) for a commercial use license.

cebra/__init__.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,15 @@
3636
# silently fail for now
3737
pass
3838

39+
is_plotly_available = False
40+
try:
41+
from cebra.integrations.plotly import *
42+
43+
is_plotly_available = True
44+
except ImportError as e:
45+
# silently fail for now
46+
pass
47+
3948
from cebra.data.load import load as load_data
4049

4150
is_load_deeplabcut_available = False
@@ -47,7 +56,7 @@
4756

4857
import cebra.integrations.sklearn as sklearn
4958

50-
__version__ = "0.3.0"
59+
__version__ = "0.3.1rc1"
5160
__all__ = ["CEBRA"]
5261
__allow_lazy_imports = False
5362
__lazy_imports = {}

cebra/data/load.py

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,22 @@
99
# Please see LICENSE.md for the full license document:
1010
# https://github.com/AdaptiveMotorControlLab/CEBRA/LICENSE.md
1111
#
12-
"""A simple API for loading various data formats used with CEBRA."""
12+
"""A simple API for loading various data formats used with CEBRA.
13+
14+
Availability of different data formats depends on the installed
15+
dependencies. If a dependency is not installed, an attempt to load
16+
a file of that format will throw an error with further installation
17+
instructions.
18+
19+
Currently available formats:
20+
21+
- HDF5 via ``h5py``
22+
- Pickle files via ``pickle``
23+
- Joblib files via ``joblib``
24+
- Various dataframe formats via ``pandas``.
25+
- Matlab files via ``scipy.io.loadmat``
26+
- DeepLabCut (single animal) files via ``deeplabcut``
27+
"""
1328

1429
import abc
1530
import pathlib

cebra/integrations/__init__.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,17 +9,15 @@
99
# Please see LICENSE.md for the full license document:
1010
# https://github.com/AdaptiveMotorControlLab/CEBRA/LICENSE.md
1111
#
12-
"""Integration of CEBRA into common machine learning libraries.
12+
"""Integration of CEBRA with common machine learning and visualization libraries.
1313
1414
This package contains a growing collection of interfaces to other Python packages.
1515
There is no clear limit (yet) of what can go into it. The current examples include
1616
interfaces (implemented or planned) to `scikit-learn <https://scikit-learn.org/stable/>`_,
1717
`streamlit <https://streamlit.io/>`_, `deeplabcut <http://www.mackenziemathislab.org/deeplabcut>`_,
18-
`matplotlib <https://matplotlib.org/>`_ and `threejs <https://threejs.org/>`_.
18+
`matplotlib <https://matplotlib.org/>`_ and `threejs <https://threejs.org/>`_ and `plotly <https://plotly.com/>`_.
1919
2020
Integrations can be used for data visualization, for providing easier interfaces to using CEBRA
2121
for a particular userbase, or any other helpful function that requires a dependency to a larger
2222
third-party package.
23-
24-
See our CEBRA `live demo <https://stes.io/c>`_.
2523
"""

cebra/integrations/plotly.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ def plot_embedding_interactive(
135135
This is supposing that the dimensions provided to ``idx_order`` are in the range of the number of
136136
dimensions of the embedding (i.e., between 0 and :py:attr:`cebra.CEBRA.output_dimension` -1).
137137
138-
The function makes use of :py:func:`plotly.graph_objs._scatter.Scatter` and parameters from that function can be provided
138+
The function makes use of :py:class:`plotly.graph_objects.Scatter` and parameters from that function can be provided
139139
as part of ``kwargs``.
140140
141141
@@ -156,7 +156,7 @@ def plot_embedding_interactive(
156156
title: The title on top of the embedding.
157157
figsize: Figure width and height in inches.
158158
dpi: Figure resolution.
159-
kwargs: Optional arguments to customize the plots. See :py:func:`plotly.graph_objs._scatter.Scatter` documentation for more
159+
kwargs: Optional arguments to customize the plots. See :py:class:`plotly.graph_objects.Scatter` documentation for more
160160
details on which arguments to use.
161161
162162
Returns:
@@ -174,7 +174,7 @@ def plot_embedding_interactive(
174174
CEBRA(max_iterations=10)
175175
>>> embedding = cebra_model.transform(X)
176176
>>> cebra_time = np.arange(X.shape[0])
177-
>>> fig = cebra.integrations.plotly.plot_embedding_interactive(embedding, embedding_labels=cebra_time)
177+
>>> fig = cebra.plot_embedding_interactive(embedding, embedding_labels=cebra_time)
178178
179179
"""
180180
return _EmbeddingInteractivePlot(

docs/source/api.rst

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,16 @@ these components in other contexts and research code bases.
3737
api/pytorch/datasets
3838
api/pytorch/distributions
3939
api/pytorch/models
40-
api/pytorch/integrations
4140
api/pytorch/helpers
4241

42+
.. toctree::
43+
:hidden:
44+
:caption: Integrations
45+
46+
api/integrations/data
47+
api/integrations/matplotlib
48+
api/integrations/plotly
49+
api/integrations/deeplabcut
50+
4351

4452
.. _Scikit-learn estimators: https://scikit-learn.org/stable/developers/develop.html

0 commit comments

Comments
 (0)