Skip to content

Commit 1dfee85

Browse files
authored
Merge pull request #125 from geometric-intelligence/ninamiolane-ci
Add CI
2 parents d70ee30 + dae0db0 commit 1dfee85

21 files changed

+551
-30
lines changed

.github/workflows/docs.yml

+70
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
name: "Docs: Check and Deploy"
2+
3+
on:
4+
push:
5+
branches: [main, github-actions-test]
6+
pull_request:
7+
branches: [main]
8+
permissions:
9+
contents: write
10+
11+
jobs:
12+
build:
13+
runs-on: ${{matrix.os}}
14+
strategy:
15+
matrix:
16+
os: [ubuntu-latest]
17+
python-version: [3.11.3]
18+
19+
steps:
20+
- uses: actions/checkout@v3
21+
- name: Build using Python ${{matrix.python-version}}
22+
uses: actions/setup-python@v4
23+
with:
24+
python-version: ${{matrix.python-version}}
25+
cache: "pip"
26+
cache-dependency-path: "pyproject.toml"
27+
- name: Install dependencies [pip]
28+
run: |
29+
pip install --upgrade pip setuptools wheel
30+
pip install -e .[doc]
31+
- name: Install Pandoc [apt-get]
32+
run: |
33+
sudo apt-get -y install pandoc
34+
- name: Generate Docs [Sphinx]
35+
run: |
36+
sphinx-build -b html -D version=latest -D release=latest docs docs/_build
37+
- name: Deploy Docs
38+
uses: JamesIves/github-pages-deploy-action@v4
39+
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' && github.repository == 'geometric-intelligence/neurometry' }}
40+
with:
41+
branch: main
42+
folder: docs/_build
43+
token: ${{ secrets.DOCUMENTATION_KEY }}
44+
repository-name: geometric-intelligence/geometric-intelligence.github.io
45+
target-folder: neurometry
46+
clean: true
47+
numpydoc-validation:
48+
runs-on: ${{matrix.os}}
49+
strategy:
50+
matrix:
51+
os: [ubuntu-latest]
52+
python-version: [3.11.3]
53+
54+
steps:
55+
- uses: actions/checkout@v3
56+
- name: Build using Python ${{matrix.python-version}}
57+
uses: actions/setup-python@v4
58+
with:
59+
python-version: ${{matrix.python-version}}
60+
cache: "pip"
61+
cache-dependency-path: "pyproject.toml"
62+
- name: Install dependencies [pip]
63+
run: |
64+
pip install --upgrade pip setuptools wheel
65+
pip install -e .[doc]
66+
- name: Checking NumpyDoc Validation for files
67+
run: |
68+
pip install pre-commit
69+
pre-commit install
70+
pre-commit run --all-files numpydoc-validation

.github/workflows/lint.yml

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
name: Lint
2+
3+
on:
4+
push:
5+
branches: [ main,github-actions-test ]
6+
pull_request:
7+
branches: [ main ]
8+
9+
jobs:
10+
ruff:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@v3
14+
- uses: chartboost/ruff-action@v1

.github/workflows/test.yml

+62
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
name: Test
2+
3+
on:
4+
push:
5+
branches: [main,github-actions-test]
6+
paths-ignore:
7+
- 'docs/**'
8+
- 'README.md'
9+
- 'LICENSE.txt'
10+
- '.gitignore'
11+
12+
pull_request:
13+
branches: [main]
14+
paths-ignore:
15+
- 'docs/**'
16+
- 'README.md'
17+
- 'LICENSE.txt'
18+
- '.gitignore'
19+
20+
21+
jobs:
22+
23+
build:
24+
runs-on: ${{ matrix.os }}
25+
26+
strategy:
27+
fail-fast: false
28+
matrix:
29+
os: [ubuntu-latest]
30+
python-version: ["3.11.3"]
31+
flavor: ["dev", "all"]
32+
33+
steps:
34+
- uses: actions/checkout@v3
35+
36+
- name: Set up Python ${{ matrix.python-version }}
37+
uses: actions/setup-python@v4
38+
with:
39+
python-version: ${{ matrix.python-version }}
40+
cache: "pip"
41+
cache-dependency-path: "pyproject.toml"
42+
43+
- name: Install Package [${{ matrix.flavor }}]
44+
run: |
45+
pip install -e .[${{ matrix.flavor }}]
46+
47+
- name: Typecheck [mypy]
48+
run: |
49+
mypy -p neurometry
50+
continue-on-error: true
51+
52+
- name: Run tests [pytest]
53+
run: |
54+
pytest --cov --cov-report=xml:coverage.xml
55+
56+
- name: Upload coverage reports to Codecov
57+
uses: codecov/[email protected]
58+
with:
59+
token: ${{ secrets.CODECOV_TOKEN }}
60+
slug: geometric-intelligence/neurometry
61+
file: coverage.xml
62+
fail_ci_if_error: false

.gitignore

-5
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,6 @@ neurometry/rep_metrics/benchmarks/stimulus/*
2222
neurometry/datasets/rnn_grid_cells/Dual agent path integration disjoint PCs/*
2323
neurometry/datasets/rnn_grid_cells/Single agent path integration/*
2424

25-
26-
27-
28-
29-
3025
# Wandb files
3126
wandb/*
3227

.pre-commit-config.yaml

+16-18
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,33 @@
1-
default_language_version :
2-
python : python3
1+
default_language_version:
2+
python: python3
3+
34
repos:
45
- repo: https://github.com/pre-commit/pre-commit-hooks
56
rev: v4.0.1
67
hooks:
7-
- id: check-byte-order-marker
8+
- id: fix-byte-order-marker
89
- id: check-case-conflict
910
- id: check-merge-conflict
1011
- id: check-yaml
1112
- id: mixed-line-ending
1213
args:
1314
- --fix=no
14-
- id: no-commit-to-branch
15-
args:
16-
- --branch=master
1715
- id: check-added-large-files
1816
args:
1917
- --maxkb=2048
2018
- id: trailing-whitespace
2119
- id: requirements-txt-fixer
22-
- repo: https://github.com/psf/black
23-
rev: 22.3.0
24-
hooks:
25-
- id: black
26-
- repo: https://github.com/pycqa/isort
27-
rev: 5.10.1
20+
21+
- repo: https://github.com/astral-sh/ruff-pre-commit
22+
rev: v0.1.14
2823
hooks:
29-
- id : isort
30-
args : ["--profile", "black", "--filter-files"]
31-
- repo: https://github.com/asottile/blacken-docs
32-
rev: v1.12.0
24+
- id: ruff
25+
types_or: [ python, pyi, jupyter ]
26+
args: [ --fix ]
27+
- id: ruff-format
28+
types_or: [ python, pyi, jupyter ]
29+
30+
- repo: https://github.com/numpy/numpydoc
31+
rev: v1.6.0
3332
hooks:
34-
- id: blacken-docs
35-
additional_dependencies: [black==20.8b0]
33+
- id: numpydoc-validation

codecov.yml

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# see https://docs.codecov.io/docs/codecov-yaml
2+
coverage:
3+
range: 50..100
4+
round: down
5+
precision: 2
6+
ignore:
7+
- "test/"

docs/Makefile

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# Minimal makefile for Sphinx documentation
2+
#
3+
4+
# You can set these variables from the command line.
5+
SPHINXOPTS =
6+
SPHINXBUILD = sphinx-build
7+
SOURCEDIR = .
8+
BUILDDIR = _build
9+
10+
# Put it first so that "make" without argument is like "make help".
11+
help:
12+
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
13+
14+
.PHONY: help Makefile
15+
16+
# Catch-all target: route all unknown targets to Sphinx using the new
17+
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
18+
%: Makefile
19+
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

docs/api/curvature.rst

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
*********
2+
Curvature
3+
*********
4+
5+
.. automodule:: neurometry.curvature
6+
:members:

docs/api/datasets.rst

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
********
2+
Datasets
3+
********
4+
5+
.. automodule:: neurometry.datasets
6+
:members:

docs/api/dimension.rst

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
*********
2+
Dimension
3+
*********
4+
5+
.. automodule:: neurometry.dimension
6+
:members:

docs/api/index.rst

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
=============
2+
API Reference
3+
=============
4+
5+
The API reference gives an overview of `Neurometry`, which consists of several modules:
6+
7+
- `datasets` implements utilities to load synthetic and real datasets.
8+
- `dimension` implements extrinsic and intrinsic dimension estimation.
9+
- `topology` implements topology estimation.
10+
- `curvature` implements geometry estimation, e.g., curvature computations.
11+
- `warping` implements warping functions.
12+
13+
.. toctree::
14+
:maxdepth: 2
15+
:caption: Packages & Modules
16+
17+
datasets
18+
dimension
19+
topology
20+
curvature
21+
warping

docs/api/topology.rst

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
********
2+
Topology
3+
********
4+
5+
6+
.. automodule:: neurometry.topology
7+
:members:

docs/api/warping.rst

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
*******
2+
Warping
3+
*******
4+
5+
.. automodule:: neurometry.warping
6+
:members:

0 commit comments

Comments
 (0)