Skip to content

Commit 0c13a97

Browse files
authored
Release v0.3.0rc2 (#67)
* Bump to 0.3.0rc2 Adding another RC as additionals PRs were merged * Apply pre-commit to all files * Apply pre-commit * Add docker container * Fix synthetic dataset * run full test suite
1 parent 9576a5a commit 0c13a97

File tree

18 files changed

+144
-29
lines changed

18 files changed

+144
-29
lines changed

.dockerignore

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
conda/
2+
docs/
3+
__pycache__/
4+
tests/
5+
third_party/
6+
tools/
7+
PKGBUILD

.github/workflows/doc-coverage.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,12 @@ name: PR Status
1010
on:
1111
pull_request:
1212
branches:
13-
- main
13+
- main
1414
- public
1515
- dev
1616

17-
permissions:
18-
pull-requests: write
17+
permissions:
18+
pull-requests: write
1919

2020
jobs:
2121
documentation-status:
@@ -26,7 +26,7 @@ jobs:
2626

2727
steps:
2828
# NOTE(stes) currently not used, we check
29-
# the entire codebase now by default.
29+
# the entire codebase now by default.
3030
#- uses: actions/checkout@v3
3131
# with:
3232
# ref: main
@@ -41,7 +41,7 @@ jobs:
4141
uses: actions/setup-python@v1
4242
with:
4343
python-version: ${{ matrix.python-version }}
44-
- name: Install package
44+
- name: Install package
4545
run: |
4646
python -m pip install --upgrade pip setuptools wheel
4747
pip install interrogate==1.5.0

Dockerfile

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
## EXPERIMENT BASE CONTAINER
2+
FROM nvidia/cuda:11.7.1-cudnn8-runtime-ubuntu20.04 AS cebra-base
3+
4+
ENV DEBIAN_FRONTEND=noninteractive
5+
RUN apt-get update -y \
6+
&& apt-get install --no-install-recommends -yy git python3 python3-pip python-is-python3 \
7+
&& rm -rf /var/lib/apt/lists/*
8+
9+
RUN pip install --no-cache-dir torch==2.0.0+cu117 \
10+
--index-url https://download.pytorch.org/whl/cu117
11+
RUN pip install --no-cache-dir --pre 'cebra[dev,datasets,integrations]' \
12+
&& pip uninstall -y cebra
13+
14+
15+
## GIT repository
16+
FROM ubuntu AS repo
17+
18+
ENV DEBIAN_FRONTEND=noninteractive
19+
RUN apt-get update -y \
20+
&& apt-get install --no-install-recommends -yy git python3 python3-pip python-is-python3 \
21+
&& rm -rf /var/lib/apt/lists/*
22+
23+
WORKDIR /repo
24+
COPY . /repo
25+
RUN git status --porcelain
26+
27+
WORKDIR /target
28+
RUN git clone --filter=tree:0 --depth=1 file:///repo/.git /target
29+
RUN git log
30+
31+
## CEBRA WHEEL
32+
FROM python:3.9 AS wheel
33+
34+
RUN pip install --upgrade --no-cache-dir pip
35+
RUN pip install --upgrade --no-cache-dir build virtualenv
36+
37+
WORKDIR /build
38+
COPY --from=repo /target .
39+
RUN make dist
40+
41+
## CEBRA CONTAINER
42+
FROM cebra-base
43+
44+
# install the cebra wheel
45+
ENV WHEEL=cebra-0.3.0rc2-py2.py3-none-any.whl
46+
WORKDIR /build
47+
COPY --from=wheel /build/dist/${WHEEL} .
48+
RUN pip install --no-cache-dir ${WHEEL}'[dev,integrations,datasets]'
49+
RUN rm -rf /build
50+
51+
# add the repository
52+
WORKDIR /app
53+
COPY --from=repo /target .
54+
55+
ENV PYTHONPATH=/app
56+
57+
ARG UID
58+
ARG GID
59+
RUN groupadd -g $GID appgroup
60+
RUN useradd -u $UID -g $GID -ms "/bin/bash" appuser
61+
RUN chown -R appuser:appgroup /app
62+
USER appuser
63+
64+
ARG GIT_HASH
65+
RUN if [ "$(git rev-parse HEAD)" != "${GIT_HASH}" ]; then \
66+
git rev-parse HEAD; \
67+
echo ${GIT_HASH}; \
68+
exit 1; \
69+
fi
70+
RUN git status --porcelain || exit 1

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ build: dist
1010
archlinux:
1111
mkdir -p dist/arch
1212
cp PKGBUILD dist/arch
13-
cp dist/cebra-0.3.0rc1.tar.gz dist/arch
13+
cp dist/cebra-0.3.0rc2.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 <[email protected]>
22
pkgname=python-cebra
33
_pkgname=cebra
4-
pkgver=0.3.0rc1
4+
pkgver=0.3.0rc2
55
pkgrel=1
66
pkgdesc="Consistent Embeddings of high-dimensional Recordings using Auxiliary variables"
77
url="https://cebra.ai"

cebra/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@
4747

4848
import cebra.integrations.sklearn as sklearn
4949

50-
__version__ = "0.3.0rc1"
50+
__version__ = "0.3.0rc2"
5151
__all__ = ["CEBRA"]
5252
__allow_lazy_imports = False
5353
__lazy_imports = {}

cebra/data/assets.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ def download_file_with_progress_bar(url: str,
2828
file_name: str,
2929
retry_count: int = 0) -> Optional[str]:
3030
"""Download a file from the given URL.
31-
31+
3232
During download, progress is reported using a progress bar. The downloaded
3333
file's checksum is compared to the provided ``expected_checksum``.
3434

cebra/datasets/synthetic_data.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -97,9 +97,9 @@ def __init__(self, name, root=_DEFAULT_DATADIR, download=True):
9797
data = joblib.load(file_path)
9898
self.data = data #NOTE: making it backwards compatible with synth notebook.
9999
self.name = name
100-
self.neural = self.data['z']
101-
self.latents = self.data['x']
102-
self.u = self.data['u']
100+
self.neural = self.data['x']
101+
self.latents = self.data['z']
102+
self.index = self.data['u']
103103
self.lam = self.data['lam']
104104

105105
@property

cebra/integrations/sklearn/cebra.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1417,8 +1417,9 @@ def load(cls,
14171417
f"Cannot use 'torch' backend with a dictionary-based checkpoint. "
14181418
f"Please try a different backend.")
14191419
if not isinstance(checkpoint, dict) and backend == "sklearn":
1420-
raise RuntimeError(f"Cannot use 'sklearn' backend a non dictionary-based checkpoint. "
1421-
f"Please try a different backend.")
1420+
raise RuntimeError(
1421+
f"Cannot use 'sklearn' backend a non dictionary-based checkpoint. "
1422+
f"Please try a different backend.")
14221423

14231424
if backend == "sklearn":
14241425
cebra_ = _load_cebra_with_sklearn_backend(checkpoint)

docs/source/api/sklearn/helpers.rst

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,3 @@ Helper functions
44
.. automodule:: cebra.integrations.sklearn.helpers
55
:show-inheritance:
66
:members:
7-

0 commit comments

Comments
 (0)