Skip to content

Commit f3c4f0a

Browse files
authored
Add pre-commit config to standardize files (#42)
* Add pre-commit config * add formatted file * Adapt pre-commit config * Move PR template * update ignore list for isort * Ignore third_party for yapf * Add yapfignore * add yapf exclude rules * update * update pre commit * Update pre commit config * Standardize files with current pre-commit config
1 parent d37e7f9 commit f3c4f0a

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

56 files changed

+395
-365
lines changed
File renamed without changes.

.github/workflows/docs.yml

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@ name: Build docs
33
on:
44
push:
55
branches:
6-
- main
6+
- main
77
pull_request:
88
branches:
9-
- main
9+
- main
1010
- public
1111
- dev
1212

@@ -25,7 +25,7 @@ jobs:
2525
- name: Checkout code
2626
uses: actions/checkout@v3
2727

28-
- name: Checkout cebra figures
28+
- name: Checkout cebra figures
2929
uses: actions/checkout@v3
3030
with:
3131
repository: AdaptiveMotorControlLab/cebra-figures
@@ -44,7 +44,7 @@ jobs:
4444
cp -r assets/* .
4545
rm -r assets
4646
47-
- name: Checkout cebra demos
47+
- name: Checkout cebra demos
4848
uses: actions/checkout@v3
4949
with:
5050
repository: AdaptiveMotorControlLab/cebra-demos
@@ -70,12 +70,12 @@ jobs:
7070
export SPHINXOPTS="-W --keep-going -n"
7171
make docs
7272
73-
# NOTE(stes): To avoid issues as observed in
73+
# NOTE(stes): To avoid issues as observed in
7474
# https://github.com/AdaptiveMotorControlLab/CEBRA/pull/20, we modified
7575
# this workflow to not rely on PATs. All repos except for the website
7676
# repo are public and only read access is required, so we simply removed
7777
# the tokens from the checkout actions.
78-
#
78+
#
7979
# For pushing the docs, I temporarily disabled the staging repo, which
8080
# does not add anything informative to the contributor anyways, as it just
8181
# tests whether or not docs can be pushed (the staging branch is not deployed).
@@ -108,5 +108,4 @@ jobs:
108108
destination-repository-name: 'cebra-ai'
109109
user-name: stes
110110
user-email: [email protected]
111-
target-branch: main
112-
111+
target-branch: main

.pre-commit-config.yaml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
repos:
2+
- repo: https://github.com/pre-commit/pre-commit-hooks
3+
rev: v4.4.0
4+
hooks:
5+
- id: end-of-file-fixer
6+
- id: trailing-whitespace
7+
- id: check-yaml
8+
- id: check-added-large-files
9+
- id: check-executables-have-shebangs
10+
- id: check-toml
11+
- repo: https://github.com/google/yapf
12+
rev: v0.33.0
13+
hooks:
14+
- id: yapf
15+
additional_dependencies:
16+
- pyproject.toml
17+
- repo: https://github.com/PyCQA/isort
18+
rev: 5.12.0
19+
hooks:
20+
- id: isort
21+
additional_dependencies:
22+
- pyproject.toml

.yapfignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
third_party/

CHANGELOG.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Changelog
22

3-
When contributing a PR, please add the title, link and a short 1-2 line description of the
3+
When contributing a PR, please add the title, link and a short 1-2 line description of the
44
PR to this document. If you are an external contributor, please also add your github handle.
55
You can use markdown formatting in this document.
66

@@ -19,8 +19,8 @@ in this file to the released code version using the name of the github tag (e.g.
1919
Add ``ensemble_embeddings`` that aligns multiple embeddings and combine them into an averaged one.
2020

2121
- **Move `max_validation_iterations` from `cebra.CEBRA` to `cebra.metrics.infonce_loss` [#527](https://github.com/AdaptiveMotorControlLab/CEBRA-dev/pull/527)**:
22-
Move `max_validation_iterations` from `cebra.CEBRA` to `cebra.metrics.infonce_loss` and
23-
rename the variable to `num_batches`.
22+
Move `max_validation_iterations` from `cebra.CEBRA` to `cebra.metrics.infonce_loss` and
23+
rename the variable to `num_batches`.
2424

2525
- **Add `plot_consistency` and demo notebook [#502](https://github.com/AdaptiveMotorControlLab/CEBRA-dev/pull/502)**:
2626
Add `plot_consistency` helper function and complete the corresponding notebook.
@@ -50,7 +50,7 @@ It is the official first release distributed along with the publication of the C
5050
- **Add cebra.plot package [#385](https://github.com/stes/neural_cl/pull/385)**:
5151
Simplify post-hoc analysis of model performance and embeddings by collecting plotting functions for the most common usecases.
5252
- **Multisession API integration [#333](https://github.com/stes/neural_cl/pull/333)**:
53-
Add multisession implementation compatibility to the sklearn API.
53+
Add multisession implementation compatibility to the sklearn API.
5454
- v0.0.2rc1
5555
- **Implementation for general dataloading [#305](https://github.com/stes/neural_cl/pull/305)**:
5656
Implement `load`, a general function to convert any supported data file types to ``numpy.array``.
@@ -59,7 +59,7 @@ It is the official first release distributed along with the publication of the C
5959
- **Add quick testing option [#318](https://github.com/stes/neural_cl/pull/318)**:
6060
Add slow marker for longer tests and a quick testing option for pytest and in github workflow.
6161
- **Add CITATION.cff file [#339](https://github.com/stes/neural_cl/pull/339)**:
62-
Add CITATION.cff file for easy-to-use citation of the pre-print paper.
62+
Add CITATION.cff file for easy-to-use citation of the pre-print paper.
6363
- **Update sklearn dependency [#317](https://github.com/stes/neural_cl/pull/317)**:
6464
The sklearn dependency was updated to `scikit-learn` as discussed
6565
[in the scikit-learn docs](https://github.com/scikit-learn/sklearn-pypi-package)

CITATION.cff

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,4 +37,4 @@ preferred-citation:
3737
month: 05
3838
doi: 10.1038/s41586-023-06031-6
3939
issn: 1476-4687
40-
url: https://doi.org/10.1038/s41586-023-06031-6
40+
url: https://doi.org/10.1038/s41586-023-06031-6

CLA.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ For reference, or for printing and emailing or mailing the form it is reproduced
99

1010
CLA Version as of March 17th, 2023.
1111

12-
Thank you for your interest in software from The Mathis Laboratory of
12+
Thank you for your interest in software from The Mathis Laboratory of
1313
Adaptive Motor Control, UPMWMATHIS ("Lab").
1414
In order to clarify the intellectual property license
1515
granted with Contributions from any person or entity, the Lab

CODE_OF_CONDUCT.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ further defined and clarified by project maintainers.
5555
## Enforcement
5656

5757
Instances of abusive, harassing, or otherwise unacceptable behavior may be
58-
reported by contacting the project team at [email protected] or [email protected].
58+
reported by contacting the project team at [email protected] or [email protected].
5959
All complaints will be reviewed and investigated and will result in a response that
6060
is deemed necessary and appropriate to the circumstances. The project team is
6161
obligated to maintain confidentiality with regard to the reporter of an incident.

LICENSE.md

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -7,60 +7,60 @@ Steffen Schneider, Jin H Lee, Mackenzie W Mathis. 2023.
77
**Introduction**
88

99
- This license agreement sets forth the terms and conditions under which ECOLE POLYTECHNIQUE FEDERALE DE LAUSANNE ( EPFL),
10-
CH-1015 Lausanne, Switzerland and Prof. Mackenzie W. Mathis and code authors (hereafter "LICENSOR") will grant you
10+
CH-1015 Lausanne, Switzerland and Prof. Mackenzie W. Mathis and code authors (hereafter "LICENSOR") will grant you
1111
(hereafter "LICENSEE") a fully-paid, non-exclusive, and non-transferable license for academic, non-commercial purposes only
1212
(hereafter “LICENSE”) to use the "CEBRA" computer software program (hereafter "PROGRAM").
1313

1414
- LICENSEE acknowledges that the PROGRAM is a research tool that is being supplied "as is", without any related services,
1515
improvements or warranties from LICENSOR and that this license is entered into in order to enable others to utilize the
16-
PROGRAM in their academic activities.
16+
PROGRAM in their academic activities.
1717

18-
- The ideas covered in this work is also patent pending (as of Jan 2023): US 63/302,670 “DIMENSIONALITY REDUCTION OF TIME-SERIES DATA,
18+
- The ideas covered in this work is also patent pending (as of Jan 2023): US 63/302,670 “DIMENSIONALITY REDUCTION OF TIME-SERIES DATA,
1919
AND SYSTEMS AND DEVICES THAT USE THE RESULTANT EMBEDDINGS”
2020

2121
- If this license is not appropriate for your application, please contact Prof. Mackenzie W. Mathis ([email protected])
2222
and/or the TTO office at EPFL ([email protected]) for a commercial use license.
2323

2424
**Terms and Conditions of the LICENSE**
2525
1. LICENSOR grants to LICENSEE a fully-paid up, non-exclusive, and non-transferable license to use the PROGRAM for academic,
26-
non-commercial purposes, upon the terms and conditions hereinafter set out and until termination of this license as set
26+
non-commercial purposes, upon the terms and conditions hereinafter set out and until termination of this license as set
2727
forth below.
2828

29-
2. LICENSEE acknowledges the PROGRAM is provided "as is", without any related services or improvements from LICENSOR and
29+
2. LICENSEE acknowledges the PROGRAM is provided "as is", without any related services or improvements from LICENSOR and
3030
that the LICENSE is entered into in order to enable others to utilize the PROGRAM in their academic activities.
3131

3232
3. LICENSOR MAKES NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY REPRESENTATIONS OR
33-
WARRANTIES OF MERCHANTABILITY OR FITNESS FOR PARTICULAR PURPOSE OR THAT THE USE OF THE PROGRAM WILL NOT INFRINGE ANY
33+
WARRANTIES OF MERCHANTABILITY OR FITNESS FOR PARTICULAR PURPOSE OR THAT THE USE OF THE PROGRAM WILL NOT INFRINGE ANY
3434
PATENTS, COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS. LICENSOR shall not be liable for any direct, indirect or consequential
3535
damages with respect to any claim by LICENSEE or any third party arising from this Agreement or use of the PROGRAM.
36-
37-
4. LICENSEE agrees that it will use the PROGRAM, and any modifications, improvements, or derivatives to PROGRAM that
38-
LICENSEE may create (collectively, "IMPROVEMENTS") solely for academic, non-commercial purposes and shall not
36+
37+
4. LICENSEE agrees that it will use the PROGRAM, and any modifications, improvements, or derivatives to PROGRAM that
38+
LICENSEE may create (collectively, "IMPROVEMENTS") solely for academic, non-commercial purposes and shall not
3939
distribute or transfer the PROGRAM or any IMPROVEMENTS to any person without prior written permission from LICENSOR.
4040
Any IMPROVEMENTS must remain open source with a copy of this license. The terms "academic, non-commercial", as used
41-
in this Agreement, mean academic or other scholarly research which (a) is not undertaken for profit, or (b) is not
41+
in this Agreement, mean academic or other scholarly research which (a) is not undertaken for profit, or (b) is not
4242
intended to produce works, services, or data for commercial use, or (c) is neither conducted, nor funded, by a person
4343
or an entity engaged in the commercial use, application or exploitation of works similar to the PROGRAM.
4444

45-
5. LICENSEE agrees that they shall credit the use of CEBRA with an appropriate citation:
46-
Steffen Schneider, Jin H. Lee, Mackenzie Weygandt Mathis. Learnable latent embeddings for joint behavioral
45+
5. LICENSEE agrees that they shall credit the use of CEBRA with an appropriate citation:
46+
Steffen Schneider, Jin H. Lee, Mackenzie Weygandt Mathis. Learnable latent embeddings for joint behavioral
4747
and neural analysis. Nature 2023 doi: https://doi.org/10.1038/s41586-023-06031-6.
4848

4949
6. Ownership of all rights, including copyright in the PROGRAM and in any material associated therewith, shall at all times
50-
remain with LICENSOR and LICENSEE agrees to preserve the same. LICENSEE agrees not to use any portion of the PROGRAM or
51-
of any IMPROVEMENTS in any machine-readable form outside the PROGRAM, nor to make any copies except for its internal use,
50+
remain with LICENSOR and LICENSEE agrees to preserve the same. LICENSEE agrees not to use any portion of the PROGRAM or
51+
of any IMPROVEMENTS in any machine-readable form outside the PROGRAM, nor to make any copies except for its internal use,
5252
without prior written consent of LICENSOR. LICENSEE agrees to maintain this license file with the source code and place the
53-
following copyright notice on any such copies:
53+
following copyright notice on any such copies:
5454

5555
© All rights reserved. ECOLE POLYTECHNIQUE FÉDÉRALE DE LAUSANNE, Switzerland, Laboratory of Prof. Mackenzie W. Mathis
5656
(UPMWMATHIS) and original authors: Steffen Schneider, Jin H Lee, Mackenzie W Mathis. 2023.
5757

5858
7. The LICENSE shall not be construed to confer any rights upon LICENSEE by implication or otherwise except as specifically
5959
set forth herein.
6060

61-
8. This Agreement shall be governed by the material laws of Switzerland and any dispute arising out of this Agreement or
62-
use of the PROGRAM shall be brought before the courts of Lausanne, Switzerland.
61+
8. This Agreement shall be governed by the material laws of Switzerland and any dispute arising out of this Agreement or
62+
use of the PROGRAM shall be brought before the courts of Lausanne, Switzerland.
6363

64-
9. This Agreement and the LICENSE shall remain effective until expiration of the copyrights of the PROGRAM except that,
64+
9. This Agreement and the LICENSE shall remain effective until expiration of the copyrights of the PROGRAM except that,
6565
upon any breach of this Agreement by LICENSEE, LICENSOR shall have the right to terminate the LICENSE immediately upon
6666
notice to LICENSEE.

Makefile

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ build: dist
99

1010
archlinux:
1111
mkdir -p dist/arch
12-
cp PKGBUILD dist/arch
13-
cp dist/cebra-0.2.0.tar.gz dist/arch
12+
cp PKGBUILD dist/arch
13+
cp dist/cebra-0.2.0.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
@@ -83,7 +83,7 @@ format:
8383
# https://github.com/PyCQA/docformatter/issues/119
8484
# is resolved.
8585
# docformatter --config pyproject.toml -i cebra
86-
# docformatter --config pyproject.toml -i tests
86+
# docformatter --config pyproject.toml -i tests
8787
isort cebra/
8888
isort tests/
8989

@@ -99,4 +99,3 @@ report: check_docker format .coverage .pylint
9999
coverage report
100100

101101
.PHONY: dist build archlinux clean_test test doctest test_parallel test_parallel_debug test_all test_fast test_debug test_benchmark interrogate docs docs-touch docs-strict serve_docs serve_page format codespell check_for_binary
102-

0 commit comments

Comments
 (0)