Skip to content

Commit e4757d4

Browse files
authored
feat: documentation (#64)
* Update README with install and badges * Bootstrap documentation * Usage documentation * Source Code documentation * Index grids * GitHub Action * chore: Build Models * chore: Autoformat code --------- Co-authored-by: kjy5 <[email protected]>
1 parent 3c3d27f commit e4757d4

Some content is hidden

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

63 files changed

+500
-106
lines changed

.github/workflows/build-docs.yml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: Build Documentation
2+
3+
on:
4+
pull_request:
5+
branches: [ "main" ]
6+
workflow_dispatch:
7+
workflow_call:
8+
9+
jobs:
10+
build:
11+
name: Build
12+
13+
runs-on: ubuntu-latest
14+
15+
steps:
16+
- name: 🛎 Checkout
17+
uses: actions/checkout@v4
18+
with:
19+
ref: ${{ github.head_ref }}
20+
21+
- name: 🐍 Setup Python
22+
uses: actions/setup-python@v5
23+
with:
24+
python-version: "3.13"
25+
cache: "pip"
26+
27+
- name: 📦 Install Hatch
28+
uses: pypa/hatch@install
29+
30+
- name: 🔨 Build Documentation
31+
run: hatch -e docs run build
32+
33+
- name: ⬆️ Upload Artifacts
34+
uses: actions/upload-pages-artifact@v3
35+
with:
36+
path: "site"

.github/workflows/deploy-docs.yml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: Deploy Documentation
2+
3+
on:
4+
push:
5+
branches: [ "main" ]
6+
workflow_dispatch:
7+
8+
permissions:
9+
contents: read
10+
pages: write
11+
id-token: write
12+
13+
concurrency:
14+
group: "deploy-docs"
15+
cancel-in-progress: true
16+
17+
jobs:
18+
19+
build:
20+
name: Build
21+
uses: ./.github/workflows/build-docs.yml
22+
23+
deploy:
24+
name: Deploy Documentation
25+
26+
needs: build
27+
28+
environment:
29+
name: github-pages
30+
url: ${{ steps.deployment.outputs.page_url }}
31+
32+
runs-on: ubuntu-latest
33+
34+
steps:
35+
36+
- name: 🎛 Setup Pages
37+
uses: actions/configure-pages@v5
38+
39+
- name: 🚀 Deploy to GitHub Pages
40+
id: deployment
41+
uses: actions/deploy-pages@v4

README.md

Lines changed: 38 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,40 @@
1-
# VBL Aquarium
1+
# Virtual Brain Lab Aquarium
22

3-
Collection of Pydantic models describing data objects passed between Virtual Brain Lab projects.
3+
![PyPI - Version](https://img.shields.io/pypi/v/vbl-aquarium)
4+
[![Build Models](https://github.com/VirtualBrainLab/vbl-aquarium/actions/workflows/build-models.yml/badge.svg)](https://github.com/VirtualBrainLab/vbl-aquarium/actions/workflows/build-models.yml)
5+
[![Static Analysis](https://github.com/VirtualBrainLab/vbl-aquarium/actions/workflows/static-analysis.yml/badge.svg)](https://github.com/VirtualBrainLab/vbl-aquarium/actions/workflows/static-analysis.yml)
6+
[![Pydantic v2](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/pydantic/pydantic/main/docs/badge/v2.json)](https://pydantic.dev)
7+
[![Hatch project](https://img.shields.io/badge/%F0%9F%A5%9A-Hatch-4051b5.svg)](https://github.com/pypa/hatch)
8+
[![Ruff](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json)](https://github.com/astral-sh/ruff)
9+
[![Checked with pyright](https://microsoft.github.io/pyright/img/pyright_badge.svg)](https://microsoft.github.io/pyright/)
410

5-
Corresponding JSON schema and C# .cs struct files are generated automatically with the command `python build.py`
11+
Collection of Pydantic models describing data objects passed between Virtual
12+
Brain Lab projects.
13+
14+
Corresponding JSON schema and C# files are generated automatically and are
15+
located in the `models` directory.
16+
17+
## Usage
18+
19+
For C# structs or JSON schemas, copy or reference whatever models you need from
20+
the `models` directory.
21+
22+
To use the Pydantic models directly in Python, install the package with
23+
24+
```bash
25+
pip install vbl-aquarium
26+
```
27+
28+
Then import the models with
29+
30+
```python
31+
from vbl_aquarium.models.module_name import ModelName
32+
```
33+
34+
replacing `.module_name` and `ModelName` with the desired model.
35+
36+
## Further Documentation
37+
38+
For more information regarding updating models and each model's specification,
39+
see the VBL
40+
Aquarium [documentation](https://virtualbrainlab.github.io/vbl-aquarium/).

docs/api/ephys_link.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
::: vbl_aquarium.models.ephys_link

docs/api/index.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# Model API
2+
3+
This section documents each model's API. These are autogenerated using the
4+
model's docstrings.
5+
6+
!!! warning
7+
8+
Not all models have complete docstring documentation yet. Please come back later for updates!

docs/api/unity_models.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
::: vbl_aquarium.utils.unity_models

docs/api/vbl_base_model.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
::: vbl_aquarium.utils.vbl_base_model

docs/assets/favicon.ico

66.1 KB
Binary file not shown.

docs/assets/icon.png

8.07 KB
Loading

docs/development/index.md

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# Developing VBL Aquarium
2+
3+
[GitHub Actions](https://github.com/VirtualBrainLab/vbl-aquarium/actions/workflows/build-models.yml)
4+
are used to automatically build models to the `models` directory.
5+
To update the models, simply push changes to the underlying pydantic models in
6+
the `vbl_aquarium/models` directory.
7+
8+
## Local Development Setup
9+
10+
1. Install [Hatch](https://hatch.pypa.io/latest/)
11+
2. Clone the repository
12+
3. Run `hatch shell` in the repository root directory
13+
14+
Use
15+
16+
```bash
17+
python src/vbl_aquarium/build.py
18+
```
19+
20+
to build the models locally.
21+
22+
Use
23+
24+
```bash
25+
hatch run check
26+
```
27+
28+
to run pyright type checking.

0 commit comments

Comments
 (0)