datapipe-neuro 0.1.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- datapipe_neuro-0.1.0/.forgejo/workflows/ci.yml +77 -0
- datapipe_neuro-0.1.0/.github/workflows/ci.yml +77 -0
- datapipe_neuro-0.1.0/.github/workflows/docs.yml +34 -0
- datapipe_neuro-0.1.0/.github/workflows/release.yml +60 -0
- datapipe_neuro-0.1.0/.gitignore +36 -0
- datapipe_neuro-0.1.0/CITATION.cff +14 -0
- datapipe_neuro-0.1.0/CODE_OF_CONDUCT.md +31 -0
- datapipe_neuro-0.1.0/CONTRIBUTING.md +56 -0
- datapipe_neuro-0.1.0/LICENSE +32 -0
- datapipe_neuro-0.1.0/PKG-INFO +105 -0
- datapipe_neuro-0.1.0/README.md +55 -0
- datapipe_neuro-0.1.0/VERSION +1 -0
- datapipe_neuro-0.1.0/docs/index.md +11 -0
- datapipe_neuro-0.1.0/mkdocs.yml +20 -0
- datapipe_neuro-0.1.0/pyproject.toml +56 -0
- datapipe_neuro-0.1.0/src/datapipe/__init__.py +38 -0
- datapipe_neuro-0.1.0/src/datapipe/cli.py +459 -0
- datapipe_neuro-0.1.0/src/datapipe/compress.py +75 -0
- datapipe_neuro-0.1.0/src/datapipe/models/__init__.py +19 -0
- datapipe_neuro-0.1.0/src/datapipe/models/serialsection.py +164 -0
- datapipe_neuro-0.1.0/src/datapipe/place.py +331 -0
- datapipe_neuro-0.1.0/src/datapipe/place_session.py +217 -0
- datapipe_neuro-0.1.0/src/datapipe/register.py +225 -0
- datapipe_neuro-0.1.0/src/datapipe/segment.py +126 -0
- datapipe_neuro-0.1.0/src/datapipe/splits.py +296 -0
- datapipe_neuro-0.1.0/tests/test_place_identity.py +142 -0
- datapipe_neuro-0.1.0/tests/test_place_session.py +109 -0
- datapipe_neuro-0.1.0/tests/test_splits.py +136 -0
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
name: CI
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches: [main]
|
|
6
|
+
tags-ignore: ["v*"]
|
|
7
|
+
pull_request:
|
|
8
|
+
branches: [main]
|
|
9
|
+
|
|
10
|
+
permissions:
|
|
11
|
+
contents: read
|
|
12
|
+
|
|
13
|
+
jobs:
|
|
14
|
+
lint:
|
|
15
|
+
name: Lint
|
|
16
|
+
runs-on: ubuntu-latest
|
|
17
|
+
if: ${{ github.server_url != 'https://github.com' && (!startsWith(github.event.head_commit.message, 'bump:')) }}
|
|
18
|
+
steps:
|
|
19
|
+
- uses: actions/checkout@v4
|
|
20
|
+
with:
|
|
21
|
+
fetch-depth: 0
|
|
22
|
+
|
|
23
|
+
- uses: astral-sh/setup-uv@v7
|
|
24
|
+
with:
|
|
25
|
+
python-version: "3.12"
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
- name: Install dependencies
|
|
29
|
+
run: uv sync --extra dev
|
|
30
|
+
|
|
31
|
+
- name: Run pre-commit (ruff + mypy + commitizen + gitleaks)
|
|
32
|
+
run: uv run pre-commit run --all-files --show-diff-on-failure
|
|
33
|
+
|
|
34
|
+
test:
|
|
35
|
+
name: Test (Python ${{ matrix.python-version }})
|
|
36
|
+
runs-on: ubuntu-latest
|
|
37
|
+
if: ${{ github.server_url != 'https://github.com' && (github.event_name == 'pull_request') }}
|
|
38
|
+
strategy:
|
|
39
|
+
fail-fast: false
|
|
40
|
+
matrix:
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
python-version: ["3.12", "3.13"]
|
|
44
|
+
|
|
45
|
+
steps:
|
|
46
|
+
- uses: actions/checkout@v4
|
|
47
|
+
with:
|
|
48
|
+
fetch-depth: 0
|
|
49
|
+
|
|
50
|
+
- uses: astral-sh/setup-uv@v7
|
|
51
|
+
with:
|
|
52
|
+
python-version: ${{ matrix.python-version }}
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
- name: Install dependencies
|
|
56
|
+
run: uv sync --extra dev
|
|
57
|
+
|
|
58
|
+
- name: Run tests
|
|
59
|
+
run: uv run pytest
|
|
60
|
+
|
|
61
|
+
# Aggregate gate — add as required status check in branch protection
|
|
62
|
+
ci:
|
|
63
|
+
name: CI
|
|
64
|
+
runs-on: ubuntu-latest
|
|
65
|
+
needs: [lint, test]
|
|
66
|
+
if: ${{ always() && github.server_url != 'https://github.com' }}
|
|
67
|
+
steps:
|
|
68
|
+
- name: Check required jobs
|
|
69
|
+
run: |
|
|
70
|
+
|
|
71
|
+
if [[ "${{ needs.lint.result }}" != "success" && "${{ needs.lint.result }}" != "skipped" ]]; then
|
|
72
|
+
echo "lint failed" && exit 1
|
|
73
|
+
fi
|
|
74
|
+
if [[ "${{ needs.test.result }}" != "success" && "${{ needs.test.result }}" != "skipped" ]]; then
|
|
75
|
+
echo "test failed" && exit 1
|
|
76
|
+
fi
|
|
77
|
+
echo "All required checks passed."
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
name: CI
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches: [main]
|
|
6
|
+
tags-ignore: ["v*"] # tag pushes are handled by release.yml
|
|
7
|
+
pull_request:
|
|
8
|
+
branches: [main]
|
|
9
|
+
|
|
10
|
+
permissions:
|
|
11
|
+
contents: read
|
|
12
|
+
|
|
13
|
+
jobs:
|
|
14
|
+
lint:
|
|
15
|
+
name: Lint
|
|
16
|
+
runs-on: ubuntu-26.04
|
|
17
|
+
if: ${{ github.server_url == 'https://github.com' && (!startsWith(github.event.head_commit.message, 'bump:')) }}
|
|
18
|
+
steps:
|
|
19
|
+
- uses: actions/checkout@v6
|
|
20
|
+
with:
|
|
21
|
+
fetch-depth: 0
|
|
22
|
+
|
|
23
|
+
- uses: astral-sh/setup-uv@v7
|
|
24
|
+
with:
|
|
25
|
+
python-version: "3.12"
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
- name: Install dependencies
|
|
29
|
+
run: uv sync --extra dev
|
|
30
|
+
|
|
31
|
+
- name: Run pre-commit (ruff + mypy + commitizen + gitleaks)
|
|
32
|
+
run: uv run pre-commit run --all-files --show-diff-on-failure
|
|
33
|
+
|
|
34
|
+
test:
|
|
35
|
+
name: Test (Python ${{ matrix.python-version }})
|
|
36
|
+
runs-on: ubuntu-26.04
|
|
37
|
+
if: ${{ github.server_url == 'https://github.com' && (github.event_name == 'pull_request') }}
|
|
38
|
+
strategy:
|
|
39
|
+
fail-fast: false
|
|
40
|
+
matrix:
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
python-version: ["3.12", "3.13"]
|
|
44
|
+
|
|
45
|
+
steps:
|
|
46
|
+
- uses: actions/checkout@v6
|
|
47
|
+
with:
|
|
48
|
+
fetch-depth: 0
|
|
49
|
+
|
|
50
|
+
- uses: astral-sh/setup-uv@v7
|
|
51
|
+
with:
|
|
52
|
+
python-version: ${{ matrix.python-version }}
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
- name: Install dependencies
|
|
56
|
+
run: uv sync --extra dev
|
|
57
|
+
|
|
58
|
+
- name: Run tests
|
|
59
|
+
run: uv run pytest
|
|
60
|
+
|
|
61
|
+
# Aggregate gate — add as required status check in branch protection
|
|
62
|
+
ci:
|
|
63
|
+
name: CI
|
|
64
|
+
runs-on: ubuntu-26.04
|
|
65
|
+
needs: [lint, test]
|
|
66
|
+
if: ${{ always() && github.server_url == 'https://github.com' }}
|
|
67
|
+
steps:
|
|
68
|
+
- name: Check required jobs
|
|
69
|
+
run: |
|
|
70
|
+
|
|
71
|
+
if [[ "${{ needs.lint.result }}" != "success" && "${{ needs.lint.result }}" != "skipped" ]]; then
|
|
72
|
+
echo "lint failed" && exit 1
|
|
73
|
+
fi
|
|
74
|
+
if [[ "${{ needs.test.result }}" != "success" && "${{ needs.test.result }}" != "skipped" ]]; then
|
|
75
|
+
echo "test failed" && exit 1
|
|
76
|
+
fi
|
|
77
|
+
echo "All required checks passed."
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
name: Docs
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches: [main]
|
|
6
|
+
paths:
|
|
7
|
+
- "docs/**"
|
|
8
|
+
- "mkdocs.yml"
|
|
9
|
+
- ".github/workflows/docs.yml"
|
|
10
|
+
- "src/**/*.py"
|
|
11
|
+
workflow_dispatch:
|
|
12
|
+
|
|
13
|
+
permissions:
|
|
14
|
+
contents: write
|
|
15
|
+
|
|
16
|
+
jobs:
|
|
17
|
+
deploy:
|
|
18
|
+
name: Deploy docs to GitHub Pages
|
|
19
|
+
runs-on: ubuntu-26.04
|
|
20
|
+
if: ${{ github.server_url == 'https://github.com' }}
|
|
21
|
+
steps:
|
|
22
|
+
- uses: actions/checkout@v6
|
|
23
|
+
with:
|
|
24
|
+
fetch-depth: 0
|
|
25
|
+
|
|
26
|
+
- uses: astral-sh/setup-uv@v7
|
|
27
|
+
with:
|
|
28
|
+
python-version: "3.12"
|
|
29
|
+
|
|
30
|
+
- name: Install dependencies
|
|
31
|
+
run: uv sync --extra docs
|
|
32
|
+
|
|
33
|
+
- name: Deploy
|
|
34
|
+
run: uv run mkdocs gh-deploy --force
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
name: Release
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches: [main]
|
|
6
|
+
workflow_dispatch:
|
|
7
|
+
|
|
8
|
+
permissions:
|
|
9
|
+
contents: write
|
|
10
|
+
id-token: write
|
|
11
|
+
|
|
12
|
+
jobs:
|
|
13
|
+
release:
|
|
14
|
+
name: Bump, build, publish
|
|
15
|
+
runs-on: ubuntu-26.04
|
|
16
|
+
if: ${{ github.server_url == 'https://github.com' && (!startsWith(github.event.head_commit.message, 'bump:')) }}
|
|
17
|
+
steps:
|
|
18
|
+
- uses: actions/checkout@v6
|
|
19
|
+
with:
|
|
20
|
+
fetch-depth: 0
|
|
21
|
+
|
|
22
|
+
- name: Configure git identity
|
|
23
|
+
run: |
|
|
24
|
+
git config user.name "github-actions[bot]"
|
|
25
|
+
git config user.email "github-actions[bot]@users.noreply.github.com"
|
|
26
|
+
|
|
27
|
+
- uses: astral-sh/setup-uv@v7
|
|
28
|
+
with:
|
|
29
|
+
python-version: "3.12"
|
|
30
|
+
|
|
31
|
+
- name: Bump version
|
|
32
|
+
id: bump
|
|
33
|
+
run: |
|
|
34
|
+
uvx --from commitizen cz bump --yes || EXIT=$?
|
|
35
|
+
if [ "${EXIT:-0}" -eq 21 ] || [ "${EXIT:-0}" -eq 6 ]; then
|
|
36
|
+
echo "No bumpable commits since last tag — skipping."
|
|
37
|
+
echo "skipped=true" >> "$GITHUB_OUTPUT"
|
|
38
|
+
exit 0
|
|
39
|
+
fi
|
|
40
|
+
[ "${EXIT:-0}" -eq 0 ] || exit $EXIT
|
|
41
|
+
VERSION=$(cat VERSION)
|
|
42
|
+
git push origin HEAD:main
|
|
43
|
+
git push origin "v${VERSION}"
|
|
44
|
+
echo "version=${VERSION}" >> "$GITHUB_OUTPUT"
|
|
45
|
+
|
|
46
|
+
- name: Build
|
|
47
|
+
if: steps.bump.outputs.skipped != 'true'
|
|
48
|
+
run: uv build
|
|
49
|
+
|
|
50
|
+
- name: Create GitHub release
|
|
51
|
+
if: steps.bump.outputs.skipped != 'true'
|
|
52
|
+
uses: softprops/action-gh-release@v3
|
|
53
|
+
with:
|
|
54
|
+
tag_name: "v${{ steps.bump.outputs.version }}"
|
|
55
|
+
files: dist/*
|
|
56
|
+
generate_release_notes: false
|
|
57
|
+
|
|
58
|
+
- name: Publish to PyPI
|
|
59
|
+
if: steps.bump.outputs.skipped != 'true'
|
|
60
|
+
run: uv publish --trusted-publishing automatic
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
# Virtual environments
|
|
2
|
+
.venv/
|
|
3
|
+
venv/
|
|
4
|
+
env/
|
|
5
|
+
ENV/
|
|
6
|
+
|
|
7
|
+
# Python
|
|
8
|
+
__pycache__/
|
|
9
|
+
*.py[cod]
|
|
10
|
+
*.pyo
|
|
11
|
+
*.so
|
|
12
|
+
*.egg
|
|
13
|
+
*.egg-info/
|
|
14
|
+
dist/
|
|
15
|
+
build/
|
|
16
|
+
|
|
17
|
+
# uv
|
|
18
|
+
uv.lock
|
|
19
|
+
|
|
20
|
+
# Caches / tooling
|
|
21
|
+
.mypy_cache/
|
|
22
|
+
.ruff_cache/
|
|
23
|
+
.pytest_cache/
|
|
24
|
+
.runlogs/
|
|
25
|
+
.coverage
|
|
26
|
+
.coverage.*
|
|
27
|
+
htmlcov/
|
|
28
|
+
|
|
29
|
+
# hatch-vcs generated
|
|
30
|
+
src/*/_version.py
|
|
31
|
+
|
|
32
|
+
# OS / IDE
|
|
33
|
+
.DS_Store
|
|
34
|
+
.idea/
|
|
35
|
+
.vscode/
|
|
36
|
+
*.swp
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
cff-version: 1.2.0
|
|
2
|
+
message: "If you use this software, please cite it as below."
|
|
3
|
+
type: software
|
|
4
|
+
title: "datapipe"
|
|
5
|
+
version: "0.1.0"
|
|
6
|
+
repository-code: https://github.com/larsrollik/datapipe
|
|
7
|
+
url: https://github.com/larsrollik/datapipe
|
|
8
|
+
# Not an SPDX identifier: the terms are custom (non-commercial research use only),
|
|
9
|
+
# so CFF takes a URL rather than an id.
|
|
10
|
+
license-url: https://github.com/larsrollik/datapipe/blob/main/LICENSE
|
|
11
|
+
authors:
|
|
12
|
+
- family-names: Rollik
|
|
13
|
+
given-names: Lars
|
|
14
|
+
# orcid: add before the first tagged release; a placeholder id must not ship
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
# Contributor Covenant Code of Conduct
|
|
2
|
+
|
|
3
|
+
## Our Pledge
|
|
4
|
+
|
|
5
|
+
We as members, contributors, and leaders pledge to make participation in our community a harassment-free experience for everyone, regardless of age, body size, visible or invisible disability, ethnicity, sex characteristics, gender identity and expression, level of experience, education, socio-economic status, nationality, personal appearance, race, caste, color, religion, or sexual identity and orientation.
|
|
6
|
+
|
|
7
|
+
## Our Standards
|
|
8
|
+
|
|
9
|
+
Examples of behavior that contributes to a positive environment:
|
|
10
|
+
|
|
11
|
+
- Demonstrating empathy and kindness toward other people
|
|
12
|
+
- Being respectful of differing opinions, viewpoints, and experiences
|
|
13
|
+
- Giving and gracefully accepting constructive feedback
|
|
14
|
+
- Accepting responsibility and apologizing to those affected by our mistakes
|
|
15
|
+
- Focusing on what is best not just for us as individuals, but for the overall community
|
|
16
|
+
|
|
17
|
+
Examples of unacceptable behavior:
|
|
18
|
+
|
|
19
|
+
- The use of sexualized language or imagery, and sexual attention or advances of any kind
|
|
20
|
+
- Trolling, insulting or derogatory comments, and personal or political attacks
|
|
21
|
+
- Public or private harassment
|
|
22
|
+
- Publishing others' private information without explicit permission
|
|
23
|
+
- Other conduct which could reasonably be considered inappropriate in a professional setting
|
|
24
|
+
|
|
25
|
+
## Enforcement
|
|
26
|
+
|
|
27
|
+
Instances of abusive, harassing, or otherwise unacceptable behavior may be reported to lars@rollik.me. All complaints will be reviewed and investigated promptly and fairly.
|
|
28
|
+
|
|
29
|
+
## Attribution
|
|
30
|
+
|
|
31
|
+
This Code of Conduct is adapted from the [Contributor Covenant](https://www.contributor-covenant.org), version 2.1.
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
# Contributing
|
|
2
|
+
|
|
3
|
+
Contributions are welcome — bug fixes, features, and documentation improvements.
|
|
4
|
+
|
|
5
|
+
## Getting started
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
uv sync --extra dev
|
|
9
|
+
uv run pre-commit install --hook-type pre-commit --hook-type commit-msg
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
The second command installs two hook types:
|
|
13
|
+
- `pre-commit` — runs ruff, mypy, gitleaks on staged files
|
|
14
|
+
- `commit-msg` — auto-fixes commit message formatting, then lints with gitlint and commitizen
|
|
15
|
+
|
|
16
|
+
## Commit format
|
|
17
|
+
|
|
18
|
+
This project uses [Conventional Commits](https://www.conventionalcommits.org/).
|
|
19
|
+
Commitizen enforces the format; use `cz commit` for an interactive prompt.
|
|
20
|
+
|
|
21
|
+
```
|
|
22
|
+
feat: add new feature
|
|
23
|
+
fix: correct a bug
|
|
24
|
+
docs: update README
|
|
25
|
+
chore: update dependencies
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
Breaking changes: add `!` after the type or a `BREAKING CHANGE:` footer.
|
|
29
|
+
|
|
30
|
+
Multi-line messages with indented body text must use a heredoc to prevent
|
|
31
|
+
the shell from stripping leading whitespace:
|
|
32
|
+
|
|
33
|
+
```bash
|
|
34
|
+
git commit -m "$(cat <<'EOF'
|
|
35
|
+
feat: add new feature
|
|
36
|
+
|
|
37
|
+
- first change
|
|
38
|
+
- second change
|
|
39
|
+
EOF
|
|
40
|
+
)"
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
Passing the message directly with `-m "..."` and newlines works for single-line
|
|
44
|
+
subjects but can strip indentation in the body on some shells.
|
|
45
|
+
|
|
46
|
+
## Commit message hooks
|
|
47
|
+
|
|
48
|
+
The `commit-msg` hooks run automatically on every commit:
|
|
49
|
+
|
|
50
|
+
1. **fix-commit-msg** — auto-fixes leading/trailing whitespace, hard tabs, missing blank line between subject and body
|
|
51
|
+
2. **gitlint** — flags remaining issues (subject too long, etc.) that need manual correction
|
|
52
|
+
3. **commitizen** — rejects messages that don't follow Conventional Commits
|
|
53
|
+
|
|
54
|
+
## Questions
|
|
55
|
+
|
|
56
|
+
Open an issue or email lars@rollik.me.
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
|
|
2
|
+
Copyright (c) 2026-present Lars B. Rollik. All rights reserved.
|
|
3
|
+
|
|
4
|
+
Permission is granted, free of charge, to use, copy, modify, and distribute
|
|
5
|
+
this software and associated documentation files (the "Software") for
|
|
6
|
+
non-commercial research or academic purposes only, subject to the following
|
|
7
|
+
conditions:
|
|
8
|
+
|
|
9
|
+
1. This copyright notice and permission notice must be included in all copies
|
|
10
|
+
or substantial portions of the Software.
|
|
11
|
+
|
|
12
|
+
2. Any publication, presentation, or product that uses or builds upon the
|
|
13
|
+
Software must give clear attribution to the original work and its authors.
|
|
14
|
+
|
|
15
|
+
3. Commercial use is prohibited without a separate written commercial licence
|
|
16
|
+
agreement with the copyright holder. Commercial use means incorporation of
|
|
17
|
+
the Software into anything for which fees or other compensation are charged
|
|
18
|
+
or received, including commercial products and commercial services.
|
|
19
|
+
|
|
20
|
+
4. No patent licence, express or implied, is granted under these terms. Any
|
|
21
|
+
use that would require a patent licence from the copyright holder requires
|
|
22
|
+
a separate written agreement.
|
|
23
|
+
|
|
24
|
+
5. Redistribution, in source or binary form, is permitted only for
|
|
25
|
+
non-commercial purposes and must retain this notice unmodified.
|
|
26
|
+
|
|
27
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
28
|
+
IMPLIED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM,
|
|
29
|
+
DAMAGES, OR OTHER LIABILITY ARISING FROM, OUT OF, OR IN CONNECTION WITH THE
|
|
30
|
+
SOFTWARE OR THE USE OR DEALINGS IN THE SOFTWARE.
|
|
31
|
+
|
|
32
|
+
For commercial or patent licensing enquiries contact: lars@rollik.me
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
Metadata-Version: 2.5
|
|
2
|
+
Name: datapipe-neuro
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: Dataset-aware pipeline for filing, registering, segmenting and compressing acquisition data.
|
|
5
|
+
Project-URL: Homepage, https://github.com/larsrollik/datapipe
|
|
6
|
+
Project-URL: Documentation, https://larsrollik.github.io/datapipe/
|
|
7
|
+
Project-URL: Issue Tracker, https://github.com/larsrollik/datapipe/issues
|
|
8
|
+
Author-email: "Lars B. Rollik" <lars@rollik.me>
|
|
9
|
+
License:
|
|
10
|
+
Copyright (c) 2026-present Lars B. Rollik. All rights reserved.
|
|
11
|
+
|
|
12
|
+
Permission is granted, free of charge, to use, copy, modify, and distribute
|
|
13
|
+
this software and associated documentation files (the "Software") for
|
|
14
|
+
non-commercial research or academic purposes only, subject to the following
|
|
15
|
+
conditions:
|
|
16
|
+
|
|
17
|
+
1. This copyright notice and permission notice must be included in all copies
|
|
18
|
+
or substantial portions of the Software.
|
|
19
|
+
|
|
20
|
+
2. Any publication, presentation, or product that uses or builds upon the
|
|
21
|
+
Software must give clear attribution to the original work and its authors.
|
|
22
|
+
|
|
23
|
+
3. Commercial use is prohibited without a separate written commercial licence
|
|
24
|
+
agreement with the copyright holder. Commercial use means incorporation of
|
|
25
|
+
the Software into anything for which fees or other compensation are charged
|
|
26
|
+
or received, including commercial products and commercial services.
|
|
27
|
+
|
|
28
|
+
4. No patent licence, express or implied, is granted under these terms. Any
|
|
29
|
+
use that would require a patent licence from the copyright holder requires
|
|
30
|
+
a separate written agreement.
|
|
31
|
+
|
|
32
|
+
5. Redistribution, in source or binary form, is permitted only for
|
|
33
|
+
non-commercial purposes and must retain this notice unmodified.
|
|
34
|
+
|
|
35
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
36
|
+
IMPLIED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM,
|
|
37
|
+
DAMAGES, OR OTHER LIABILITY ARISING FROM, OUT OF, OR IN CONNECTION WITH THE
|
|
38
|
+
SOFTWARE OR THE USE OR DEALINGS IN THE SOFTWARE.
|
|
39
|
+
|
|
40
|
+
For commercial or patent licensing enquiries contact: lars@rollik.me
|
|
41
|
+
License-File: LICENSE
|
|
42
|
+
Requires-Python: >=3.12
|
|
43
|
+
Requires-Dist: numpy>=1.24
|
|
44
|
+
Requires-Dist: pyyaml>=6
|
|
45
|
+
Provides-Extra: dev
|
|
46
|
+
Requires-Dist: mypy; extra == 'dev'
|
|
47
|
+
Requires-Dist: pytest>=8; extra == 'dev'
|
|
48
|
+
Requires-Dist: ruff; extra == 'dev'
|
|
49
|
+
Description-Content-Type: text/markdown
|
|
50
|
+
|
|
51
|
+
# datapipe
|
|
52
|
+
|
|
53
|
+
Dataset-aware pipeline for filing, registering, segmenting and compressing acquisition data.
|
|
54
|
+
|
|
55
|
+
Each stage operates on **one sample or session per invocation**, so the unit of work is also the
|
|
56
|
+
unit of failure: a stage that cannot establish what it is looking at refuses rather than guessing,
|
|
57
|
+
and nothing is moved until its identity has been confirmed.
|
|
58
|
+
|
|
59
|
+
## Installation
|
|
60
|
+
|
|
61
|
+
```sh
|
|
62
|
+
pip install datapipe-neuro
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
The distribution is `datapipe-neuro`; the import name and the CLI are both `datapipe`. An unrelated
|
|
66
|
+
`datapipe` project already holds that name on PyPI.
|
|
67
|
+
|
|
68
|
+
Individual stages need tools that are deliberately **not** install-time dependencies, because most
|
|
69
|
+
runs use only one stage: `register` and `segment` need `brainreg` and
|
|
70
|
+
`brainglobe-segmentation`, and `compress` shells out to the [`datapack`](https://github.com/larsrollik/datapack)
|
|
71
|
+
CLI (`datapack-neuro`) rather than importing it.
|
|
72
|
+
|
|
73
|
+
## Stages
|
|
74
|
+
|
|
75
|
+
| Command | What it does |
|
|
76
|
+
|---|---|
|
|
77
|
+
| `datapipe register <sample>` | brainreg-registers one serial-section sample, writing output beside the stitched directories |
|
|
78
|
+
| `datapipe segment <sample>` | opens napari and brainglobe-segmentation preloaded on that sample's registration |
|
|
79
|
+
| `datapipe compress <sample> <dest>` | compresses one sample's raw and analysis trees via datapack into `dest/<sample>` |
|
|
80
|
+
| `datapipe place <path>` | files one scan or session into a data tree, refusing on identity mismatch |
|
|
81
|
+
| `datapipe splits <root>` | finds acquisitions the recorder broke in two, and tells them from false starts |
|
|
82
|
+
|
|
83
|
+
### place
|
|
84
|
+
|
|
85
|
+
`place` routes on what the directory *is*, not on a flag you have to remember: a serial-section
|
|
86
|
+
scan is repacked into the tree, while an acquisition session is moved, because compression is an
|
|
87
|
+
earlier stage and has already run by the time anything is placed.
|
|
88
|
+
|
|
89
|
+
The subject is checked against the directory's own record and a **mismatch is refused, not
|
|
90
|
+
warned about**. For an acquisition session that record is the full directory prefix, not its middle
|
|
91
|
+
field. A histology run that holds more than one brain carries every id in its name, and is split
|
|
92
|
+
per animal afterwards.
|
|
93
|
+
|
|
94
|
+
### splits
|
|
95
|
+
|
|
96
|
+
A recording broken in two by a crash and a false start followed by a real recording look alike on
|
|
97
|
+
disk: two acquisitions, minutes apart, same subject. `splits` separates them on the gap between
|
|
98
|
+
them and on how much each half contains, reporting its reasoning per candidate rather than only a
|
|
99
|
+
verdict. Durations come from the sample counts in the `.npy` sidecars — the array shape is read,
|
|
100
|
+
never the array — so a 400 GB recording is classified without being loaded.
|
|
101
|
+
|
|
102
|
+
## Licence
|
|
103
|
+
|
|
104
|
+
Non-commercial research and academic use. See [LICENSE](LICENSE); commercial use requires a separate
|
|
105
|
+
written agreement.
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
# datapipe
|
|
2
|
+
|
|
3
|
+
Dataset-aware pipeline for filing, registering, segmenting and compressing acquisition data.
|
|
4
|
+
|
|
5
|
+
Each stage operates on **one sample or session per invocation**, so the unit of work is also the
|
|
6
|
+
unit of failure: a stage that cannot establish what it is looking at refuses rather than guessing,
|
|
7
|
+
and nothing is moved until its identity has been confirmed.
|
|
8
|
+
|
|
9
|
+
## Installation
|
|
10
|
+
|
|
11
|
+
```sh
|
|
12
|
+
pip install datapipe-neuro
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
The distribution is `datapipe-neuro`; the import name and the CLI are both `datapipe`. An unrelated
|
|
16
|
+
`datapipe` project already holds that name on PyPI.
|
|
17
|
+
|
|
18
|
+
Individual stages need tools that are deliberately **not** install-time dependencies, because most
|
|
19
|
+
runs use only one stage: `register` and `segment` need `brainreg` and
|
|
20
|
+
`brainglobe-segmentation`, and `compress` shells out to the [`datapack`](https://github.com/larsrollik/datapack)
|
|
21
|
+
CLI (`datapack-neuro`) rather than importing it.
|
|
22
|
+
|
|
23
|
+
## Stages
|
|
24
|
+
|
|
25
|
+
| Command | What it does |
|
|
26
|
+
|---|---|
|
|
27
|
+
| `datapipe register <sample>` | brainreg-registers one serial-section sample, writing output beside the stitched directories |
|
|
28
|
+
| `datapipe segment <sample>` | opens napari and brainglobe-segmentation preloaded on that sample's registration |
|
|
29
|
+
| `datapipe compress <sample> <dest>` | compresses one sample's raw and analysis trees via datapack into `dest/<sample>` |
|
|
30
|
+
| `datapipe place <path>` | files one scan or session into a data tree, refusing on identity mismatch |
|
|
31
|
+
| `datapipe splits <root>` | finds acquisitions the recorder broke in two, and tells them from false starts |
|
|
32
|
+
|
|
33
|
+
### place
|
|
34
|
+
|
|
35
|
+
`place` routes on what the directory *is*, not on a flag you have to remember: a serial-section
|
|
36
|
+
scan is repacked into the tree, while an acquisition session is moved, because compression is an
|
|
37
|
+
earlier stage and has already run by the time anything is placed.
|
|
38
|
+
|
|
39
|
+
The subject is checked against the directory's own record and a **mismatch is refused, not
|
|
40
|
+
warned about**. For an acquisition session that record is the full directory prefix, not its middle
|
|
41
|
+
field. A histology run that holds more than one brain carries every id in its name, and is split
|
|
42
|
+
per animal afterwards.
|
|
43
|
+
|
|
44
|
+
### splits
|
|
45
|
+
|
|
46
|
+
A recording broken in two by a crash and a false start followed by a real recording look alike on
|
|
47
|
+
disk: two acquisitions, minutes apart, same subject. `splits` separates them on the gap between
|
|
48
|
+
them and on how much each half contains, reporting its reasoning per candidate rather than only a
|
|
49
|
+
verdict. Durations come from the sample counts in the `.npy` sidecars — the array shape is read,
|
|
50
|
+
never the array — so a 400 GB recording is classified without being loaded.
|
|
51
|
+
|
|
52
|
+
## Licence
|
|
53
|
+
|
|
54
|
+
Non-commercial research and academic use. See [LICENSE](LICENSE); commercial use requires a separate
|
|
55
|
+
written agreement.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
0.2.0
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
# datapipe
|
|
2
|
+
|
|
3
|
+
Dataset-aware pipeline for filing, registering, segmenting and compressing acquisition data.
|
|
4
|
+
|
|
5
|
+
```sh
|
|
6
|
+
pip install datapipe-neuro
|
|
7
|
+
```
|
|
8
|
+
|
|
9
|
+
The distribution is `datapipe-neuro`; the import name and the CLI are both `datapipe`.
|
|
10
|
+
|
|
11
|
+
See the [README](https://github.com/larsrollik/datapipe#readme) for the stage reference.
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
site_name: datapipe
|
|
2
|
+
site_description: Dataset-aware pipeline for filing, registering, segmenting and compressing acquisition data.
|
|
3
|
+
site_url: https://larsrollik.github.io/datapipe/
|
|
4
|
+
repo_url: https://github.com/larsrollik/datapipe
|
|
5
|
+
repo_name: larsrollik/datapipe
|
|
6
|
+
edit_uri: edit/main/docs/
|
|
7
|
+
|
|
8
|
+
theme:
|
|
9
|
+
name: material
|
|
10
|
+
palette:
|
|
11
|
+
scheme: slate
|
|
12
|
+
primary: teal
|
|
13
|
+
accent: teal
|
|
14
|
+
features:
|
|
15
|
+
- navigation.sections
|
|
16
|
+
- navigation.top
|
|
17
|
+
- content.code.copy
|
|
18
|
+
|
|
19
|
+
nav:
|
|
20
|
+
- Home: index.md
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["hatchling"]
|
|
3
|
+
build-backend = "hatchling.build"
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
name = "datapipe-neuro"
|
|
7
|
+
version = "0.1.0"
|
|
8
|
+
description = "Dataset-aware pipeline for filing, registering, segmenting and compressing acquisition data."
|
|
9
|
+
requires-python = ">=3.12"
|
|
10
|
+
readme = "README.md"
|
|
11
|
+
license = { file = "LICENSE" }
|
|
12
|
+
authors = [
|
|
13
|
+
{ name = "Lars B. Rollik", email = "lars@rollik.me" },
|
|
14
|
+
]
|
|
15
|
+
dependencies = [
|
|
16
|
+
"pyyaml>=6", # parse StitchIt recipe_*.yml
|
|
17
|
+
"numpy>=1.24", # read sample counts from .npy sidecars (splits); shape only, never loaded
|
|
18
|
+
]
|
|
19
|
+
|
|
20
|
+
[project.scripts]
|
|
21
|
+
datapipe = "datapipe.cli:main"
|
|
22
|
+
|
|
23
|
+
[project.optional-dependencies]
|
|
24
|
+
dev = ["pytest>=8", "mypy", "ruff"]
|
|
25
|
+
|
|
26
|
+
# The `compress` stage shells out to the datapack CLI rather than importing it, so
|
|
27
|
+
# datapack-neuro is not a dependency here: a run that never compresses must not have
|
|
28
|
+
# to install it. Stages needing brainreg and brainglobe-segmentation are the same way.
|
|
29
|
+
|
|
30
|
+
[project.urls]
|
|
31
|
+
Homepage = "https://github.com/larsrollik/datapipe"
|
|
32
|
+
Documentation = "https://larsrollik.github.io/datapipe/"
|
|
33
|
+
"Issue Tracker" = "https://github.com/larsrollik/datapipe/issues"
|
|
34
|
+
|
|
35
|
+
[tool.hatch.build.targets.wheel]
|
|
36
|
+
packages = ["src/datapipe"]
|
|
37
|
+
|
|
38
|
+
# ---------------------------------------------------------------------------
|
|
39
|
+
# Versioning. release.yml runs `cz bump`, which needs this section: without it the
|
|
40
|
+
# workflow fails on its first run, having been copied from a repo that had one.
|
|
41
|
+
# ---------------------------------------------------------------------------
|
|
42
|
+
[tool.commitizen]
|
|
43
|
+
name = "cz_conventional_commits"
|
|
44
|
+
version_provider = "commitizen"
|
|
45
|
+
version = "0.2.0"
|
|
46
|
+
version_files = ["VERSION"]
|
|
47
|
+
tag_format = "v$version"
|
|
48
|
+
update_changelog_on_bump = false
|
|
49
|
+
|
|
50
|
+
[tool.ruff]
|
|
51
|
+
line-length = 88
|
|
52
|
+
src = ["src"]
|
|
53
|
+
|
|
54
|
+
[tool.mypy]
|
|
55
|
+
python_version = "3.12"
|
|
56
|
+
ignore_missing_imports = true
|