aind-code-ocean-pipeline-utils 0.4.2__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.
Files changed (44) hide show
  1. aind_code_ocean_pipeline_utils-0.4.2/.copier-answers.yml +26 -0
  2. aind_code_ocean_pipeline_utils-0.4.2/.github/ISSUE_TEMPLATE/bug_report.md +38 -0
  3. aind_code_ocean_pipeline_utils-0.4.2/.github/ISSUE_TEMPLATE/feature_request.md +20 -0
  4. aind_code_ocean_pipeline_utils-0.4.2/.github/ISSUE_TEMPLATE/user-story.md +27 -0
  5. aind_code_ocean_pipeline_utils-0.4.2/.github/dependabot.yml +19 -0
  6. aind_code_ocean_pipeline_utils-0.4.2/.github/workflows/bump-call.yml +33 -0
  7. aind_code_ocean_pipeline_utils-0.4.2/.github/workflows/ci-call.yml +38 -0
  8. aind_code_ocean_pipeline_utils-0.4.2/.github/workflows/publish-call.yml +25 -0
  9. aind_code_ocean_pipeline_utils-0.4.2/.gitignore +153 -0
  10. aind_code_ocean_pipeline_utils-0.4.2/.python-version +1 -0
  11. aind_code_ocean_pipeline_utils-0.4.2/CHANGELOG.md +71 -0
  12. aind_code_ocean_pipeline_utils-0.4.2/CLAUDE.md +88 -0
  13. aind_code_ocean_pipeline_utils-0.4.2/LICENSE +22 -0
  14. aind_code_ocean_pipeline_utils-0.4.2/PKG-INFO +443 -0
  15. aind_code_ocean_pipeline_utils-0.4.2/README.md +424 -0
  16. aind_code_ocean_pipeline_utils-0.4.2/pyproject.toml +106 -0
  17. aind_code_ocean_pipeline_utils-0.4.2/scripts/run_linters_and_checks.sh +64 -0
  18. aind_code_ocean_pipeline_utils-0.4.2/src/aind_code_ocean_pipeline_utils/__init__.py +81 -0
  19. aind_code_ocean_pipeline_utils-0.4.2/src/aind_code_ocean_pipeline_utils/cache.py +108 -0
  20. aind_code_ocean_pipeline_utils-0.4.2/src/aind_code_ocean_pipeline_utils/cli.py +51 -0
  21. aind_code_ocean_pipeline_utils-0.4.2/src/aind_code_ocean_pipeline_utils/diagnostics.py +202 -0
  22. aind_code_ocean_pipeline_utils-0.4.2/src/aind_code_ocean_pipeline_utils/io.py +217 -0
  23. aind_code_ocean_pipeline_utils-0.4.2/src/aind_code_ocean_pipeline_utils/log.py +321 -0
  24. aind_code_ocean_pipeline_utils-0.4.2/src/aind_code_ocean_pipeline_utils/metadata.py +332 -0
  25. aind_code_ocean_pipeline_utils-0.4.2/src/aind_code_ocean_pipeline_utils/process.py +199 -0
  26. aind_code_ocean_pipeline_utils-0.4.2/src/aind_code_ocean_pipeline_utils/provenance.py +106 -0
  27. aind_code_ocean_pipeline_utils-0.4.2/src/aind_code_ocean_pipeline_utils/py.typed +1 -0
  28. aind_code_ocean_pipeline_utils-0.4.2/src/aind_code_ocean_pipeline_utils/role_dispatch.py +391 -0
  29. aind_code_ocean_pipeline_utils-0.4.2/src/aind_code_ocean_pipeline_utils/step.py +569 -0
  30. aind_code_ocean_pipeline_utils-0.4.2/src/aind_code_ocean_pipeline_utils/threading_utils.py +92 -0
  31. aind_code_ocean_pipeline_utils-0.4.2/tests/__init__.py +1 -0
  32. aind_code_ocean_pipeline_utils-0.4.2/tests/test_cache.py +125 -0
  33. aind_code_ocean_pipeline_utils-0.4.2/tests/test_cli.py +71 -0
  34. aind_code_ocean_pipeline_utils-0.4.2/tests/test_diagnostics.py +192 -0
  35. aind_code_ocean_pipeline_utils-0.4.2/tests/test_example.py +9 -0
  36. aind_code_ocean_pipeline_utils-0.4.2/tests/test_io.py +227 -0
  37. aind_code_ocean_pipeline_utils-0.4.2/tests/test_log.py +265 -0
  38. aind_code_ocean_pipeline_utils-0.4.2/tests/test_metadata.py +113 -0
  39. aind_code_ocean_pipeline_utils-0.4.2/tests/test_process.py +170 -0
  40. aind_code_ocean_pipeline_utils-0.4.2/tests/test_provenance.py +112 -0
  41. aind_code_ocean_pipeline_utils-0.4.2/tests/test_role_dispatch.py +319 -0
  42. aind_code_ocean_pipeline_utils-0.4.2/tests/test_step.py +249 -0
  43. aind_code_ocean_pipeline_utils-0.4.2/tests/test_threading_utils.py +110 -0
  44. aind_code_ocean_pipeline_utils-0.4.2/uv.lock +1704 -0
@@ -0,0 +1,26 @@
1
+ # Changes here will be overwritten by Copier; NEVER EDIT MANUALLY
2
+ _commit: 0.1.15
3
+ _src_path: /home/galen.lynch/Documents/Code/aind-python-copier-template
4
+ author_email: galen@galenlynch.com
5
+ author_fullname: Galen Lynch
6
+ auto_setup_repo: true
7
+ current_year: '2026'
8
+ github_org: AllenNeuralDynamics
9
+ github_url: https://github.com/AllenNeuralDynamics/aind-code-ocean-pipeline-utils
10
+ include_claude_md: true
11
+ include_cli: false
12
+ include_commitizen: true
13
+ include_docs: false
14
+ include_notebooks: false
15
+ include_type_hints: true
16
+ institute_name: Allen Institute for Neural Dynamics
17
+ license: MIT
18
+ project_description: Utilities for use in Code Ocean pipelines
19
+ project_name: AIND Code Ocean pipeline utils
20
+ project_slug: aind-code-ocean-pipeline-utils
21
+ publish_to_pypi: true
22
+ python_package_import_name: aind_code_ocean_pipeline_utils
23
+ python_version: '3.11'
24
+ target_python_version: '3.13'
25
+ workflow_source: AllenNeuralDynamics/galen-uv-workflows
26
+ workflow_version: v2
@@ -0,0 +1,38 @@
1
+ ---
2
+ name: Bug report
3
+ about: Create a report to help us improve
4
+ title: ''
5
+ labels: ''
6
+ assignees: ''
7
+
8
+ ---
9
+
10
+ **Describe the bug**
11
+ A clear and concise description of what the bug is.
12
+
13
+ **To Reproduce**
14
+ Steps to reproduce the behavior:
15
+ 1. Go to '...'
16
+ 2. Click on '....'
17
+ 3. Scroll down to '....'
18
+ 4. See error
19
+
20
+ **Expected behavior**
21
+ A clear and concise description of what you expected to happen.
22
+
23
+ **Screenshots**
24
+ If applicable, add screenshots to help explain your problem.
25
+
26
+ **Desktop (please complete the following information):**
27
+ - OS: [e.g. iOS]
28
+ - Browser [e.g. chrome, safari]
29
+ - Version [e.g. 22]
30
+
31
+ **Smartphone (please complete the following information):**
32
+ - Device: [e.g. iPhone6]
33
+ - OS: [e.g. iOS8.1]
34
+ - Browser [e.g. stock browser, safari]
35
+ - Version [e.g. 22]
36
+
37
+ **Additional context**
38
+ Add any other context about the problem here.
@@ -0,0 +1,20 @@
1
+ ---
2
+ name: Feature request
3
+ about: Suggest an idea for this project
4
+ title: ''
5
+ labels: ''
6
+ assignees: ''
7
+
8
+ ---
9
+
10
+ **Is your feature request related to a problem? Please describe.**
11
+ A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
12
+
13
+ **Describe the solution you'd like**
14
+ A clear and concise description of what you want to happen.
15
+
16
+ **Describe alternatives you've considered**
17
+ A clear and concise description of any alternative solutions or features you've considered.
18
+
19
+ **Additional context**
20
+ Add any other context or screenshots about the feature request here.
@@ -0,0 +1,27 @@
1
+ ---
2
+ name: User story
3
+ about: This template provides a basic structure for user story issues.
4
+ title: ''
5
+ labels: ''
6
+ assignees: ''
7
+
8
+ ---
9
+
10
+ # User story
11
+ As a ..., I want to ..., so I can ...
12
+
13
+ *Ideally, this is in the issue title, but if not, you can put it here. If so, delete this section.*
14
+
15
+ # Acceptance criteria
16
+ - [ ] This is something that can be verified to show that this user story is satisfied.
17
+
18
+ # Sprint Ready Checklist
19
+ - [ ] 1. Acceptance criteria defined
20
+ - [ ] 2. Team understands acceptance criteria
21
+ - [ ] 3. Team has defined solution / steps to satisfy acceptance criteria
22
+ - [ ] 4. Acceptance criteria is verifiable / testable
23
+ - [ ] 5. External / 3rd Party dependencies identified
24
+ - [ ] 6. Ticket is prioritized and sized
25
+
26
+ # Notes
27
+ *Add any helpful notes here.*
@@ -0,0 +1,19 @@
1
+ # To get started with Dependabot version updates, you'll need to specify which
2
+ # package ecosystems to update and where the package manifests are located.
3
+ # Please see the documentation for all configuration options:
4
+ # https://docs.github.com/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file
5
+
6
+ version: 2
7
+ updates:
8
+ # Enable version updates for GitHub Actions
9
+ - package-ecosystem: "github-actions"
10
+ # Workflow files stored in the default location of `.github/workflows`
11
+ # You don't need to specify `/.github/workflows` for `directory`. You can use `directory: "/"`.
12
+ directory: "/"
13
+ schedule:
14
+ interval: "weekly"
15
+ # Enable version updates for pip
16
+ - package-ecosystem: "pip"
17
+ directory: "/"
18
+ schedule:
19
+ interval: "weekly"
@@ -0,0 +1,33 @@
1
+ name: Bump Version
2
+
3
+ on:
4
+ workflow_run:
5
+ workflows: ["CI"]
6
+ branches: [ main ]
7
+ types: [ completed ]
8
+ workflow_dispatch:
9
+
10
+ permissions:
11
+ contents: write # needed to push commits/tags
12
+ id-token: write # needed if your reusable workflow exchanges OIDC tokens
13
+
14
+ concurrency:
15
+ group: bump-${{ github.workflow }}-${{ github.event.workflow_run.head_branch || github.ref }}
16
+ cancel-in-progress: true
17
+
18
+ jobs:
19
+ bump:
20
+ # Only run when:
21
+ # • a CI run just succeeded (and the head commit message doesn't start with 'bump:')
22
+ # • OR this is a manual dispatch
23
+ if: >
24
+ (github.event_name == 'workflow_run' &&
25
+ github.event.workflow_run.conclusion == 'success' &&
26
+ !startsWith(github.event.workflow_run.head_commit.message, 'bump:')) ||
27
+ (github.event_name == 'workflow_dispatch' &&
28
+ github.ref == 'refs/heads/main')
29
+ uses: AllenNeuralDynamics/galen-uv-workflows/.github/workflows/bump-version.yml@v2
30
+ with:
31
+ default-branch: main
32
+ secrets:
33
+ repo-token: ${{ secrets.SERVICE_TOKEN }}
@@ -0,0 +1,38 @@
1
+ name: CI
2
+
3
+ on:
4
+ workflow_dispatch:
5
+ push:
6
+ branches: [ main ]
7
+ pull_request:
8
+ branches: [ main ]
9
+ types: [opened, synchronize, reopened, ready_for_review]
10
+
11
+ permissions:
12
+ contents: read
13
+ pull-requests: read
14
+
15
+ concurrency:
16
+ group: ${{ github.workflow }}-${{ github.head_ref || github.ref }}
17
+ cancel-in-progress: true
18
+
19
+ jobs:
20
+ run-ci:
21
+ strategy:
22
+ matrix:
23
+ os: [ubuntu-latest]
24
+ python-version: ["3.11", "3.13"]
25
+
26
+ if: >
27
+ (github.event_name != 'pull_request' || github.event.pull_request.draft == false) &&
28
+ github.actor != 'github-actions[bot]' &&
29
+ !(github.event_name == 'push' && startsWith(github.event.head_commit.message, 'bump:'))
30
+
31
+ uses: AllenNeuralDynamics/galen-uv-workflows/.github/workflows/ci.yml@v2
32
+ with:
33
+ os: ${{ matrix.os }}
34
+ python-version: ${{ matrix.python-version }}
35
+ package-name: aind_code_ocean_pipeline_utils
36
+ run-mypy: true
37
+ secrets:
38
+ repo-token: ${{ secrets.GITHUB_TOKEN }}
@@ -0,0 +1,25 @@
1
+ name: "Release"
2
+
3
+ on:
4
+ push:
5
+ tags:
6
+ - 'v[0-9]*' # semver tags
7
+ workflow_dispatch:
8
+
9
+ permissions:
10
+ contents: write # create release + upload assets
11
+
12
+ concurrency:
13
+ group: release
14
+ cancel-in-progress: false # let releases finish
15
+
16
+ jobs:
17
+ run-release:
18
+ uses: AllenNeuralDynamics/galen-uv-workflows/.github/workflows/publish.yml@v2
19
+ with:
20
+ tag-name: ${{ github.ref_name }}
21
+ python-version: "3.13"
22
+ publish-to-pypi: true
23
+ secrets:
24
+ repo-token: ${{ secrets.GITHUB_TOKEN }}
25
+ pypi-token: ${{ secrets.AIND_PYPI_TOKEN }}
@@ -0,0 +1,153 @@
1
+ # Byte-compiled / optimized / DLL files
2
+ __pycache__/
3
+ *.py[cod]
4
+ *$py.class
5
+
6
+ # C extensions
7
+ *.so
8
+
9
+ # Distribution / packaging
10
+ .Python
11
+ build/
12
+ develop-eggs/
13
+ dist/
14
+ downloads/
15
+ eggs/
16
+ .eggs/
17
+ lib/
18
+ lib64/
19
+ parts/
20
+ sdist/
21
+ var/
22
+ wheels/
23
+ pip-wheel-metadata/
24
+ share/python-wheels/
25
+ *.egg-info/
26
+ .installed.cfg
27
+ *.egg
28
+ MANIFEST
29
+
30
+ # PyInstaller
31
+ # Usually these files are written by a python script from a template
32
+ # before PyInstaller builds the exe, so as to inject date/other infos into it.
33
+ *.manifest
34
+ *.spec
35
+
36
+ # Installer logs
37
+ pip-log.txt
38
+ pip-delete-this-directory.txt
39
+
40
+ # Unit test / coverage reports
41
+ htmlcov/
42
+ .tox/
43
+ .nox/
44
+ .coverage
45
+ .coverage.*
46
+ .cache
47
+ nosetests.xml
48
+ coverage.xml
49
+ *.cover
50
+ *.py,cover
51
+ .hypothesis/
52
+ .pytest_cache/
53
+
54
+ # Translations
55
+ *.mo
56
+ *.pot
57
+
58
+ # Django stuff:
59
+ *.log
60
+ local_settings.py
61
+ db.sqlite3
62
+ db.sqlite3-journal
63
+
64
+ # Flask stuff:
65
+ instance/
66
+ .webassets-cache
67
+
68
+ # Scrapy stuff:
69
+ .scrapy
70
+
71
+ # Sphinx documentation
72
+ docs/build/
73
+
74
+ # PyBuilder
75
+ target/
76
+
77
+ # Jupyter Notebook
78
+ .ipynb_checkpoints
79
+
80
+ # IPython
81
+ profile_default/
82
+ ipython_config.py
83
+
84
+ # pyenv
85
+ # .python-version
86
+
87
+ # pipenv
88
+ # According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
89
+ # However, in case of collaboration, if having platform-specific dependencies or dependencies
90
+ # having no cross-platform support, pipenv may install dependencies that don't work, or not
91
+ # install all needed dependencies.
92
+ #Pipfile.lock
93
+
94
+ # PEP 582; used by e.g. github.com/David-OConnor/pyflow
95
+ __pypackages__/
96
+
97
+ # Celery stuff
98
+ celerybeat-schedule
99
+ celerybeat.pid
100
+
101
+ # SageMath parsed files
102
+ *.sage.py
103
+
104
+ # Environments
105
+ .env
106
+ .venv
107
+ env/
108
+ venv/
109
+ ENV/
110
+ env.bak/
111
+ venv.bak/
112
+
113
+ # Spyder project settings
114
+ .spyderproject
115
+ .spyproject
116
+
117
+ # Rope project settings
118
+ .ropeproject
119
+
120
+ # mkdocs documentation
121
+ /site
122
+
123
+ # mypy
124
+ .mypy_cache/
125
+ .dmypy.json
126
+ dmypy.json
127
+
128
+ # Pyre type checker
129
+ .pyre/
130
+
131
+ # PyCharm
132
+ # JetBrains specific template is maintained in a separate JetBrains.gitignore that can
133
+ # be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
134
+ # and can be added to the global gitignore or merged into this file. For a more nuclear
135
+ # option (not recommended) you can uncomment the following to ignore the entire idea folder.
136
+ .idea/
137
+
138
+ # MacOs
139
+ **/.DS_Store
140
+
141
+ # VSCode
142
+ .vscode/
143
+
144
+ # Scratch / working directory
145
+ scratch/
146
+ TODO.md
147
+
148
+ # Claude
149
+ .claude/
150
+
151
+ # Repo setup scripts (generated by template, not meant to be committed)
152
+ setup_repo.sh
153
+ configure_repo.sh
@@ -0,0 +1,71 @@
1
+ # Changelog
2
+
3
+ All notable changes to this project will be documented in this file.
4
+
5
+ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
+ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
+
8
+
9
+ ### Feat
10
+
11
+ - re-export cli + provenance from top level; extend README
12
+ - **log**: add build_progress and make_progress_callback
13
+ - **provenance**: add capsule_commit and package_version
14
+ - **cli**: add parse_truthy for CO app-panel parameters
15
+ - re-export role_dispatch + diagnostics from top level; extend README
16
+ - **diagnostics**: add data-tree and memory reporters
17
+ - **role_dispatch**: add launcher/worker/aggregator skeleton
18
+ - re-export core API from top-level package
19
+ - **threading_utils**: add contextvars-preserving submit wrapper
20
+ - **log**: add rich-aware logging under [rich] extra
21
+ - **cache**: add input_fingerprint for cache keys
22
+ - **io**: add retry_on_oserror and atomic writes
23
+ - **process**: add graceful shutdown module
24
+
25
+ ## v0.4.2 (2026-07-22)
26
+
27
+ ### Fix
28
+
29
+ - publish to pypi
30
+
31
+ ## v0.4.1 (2026-06-04)
32
+
33
+ ### Perf
34
+
35
+ - **step**: lazy-import aind-data-schema so the metadata tax is near-zero
36
+
37
+ ## v0.4.0 (2026-06-03)
38
+
39
+ ### Feat
40
+
41
+ - **step**: add capsule_step decorator for frictionless processing.json
42
+
43
+ ## v0.3.0 (2026-06-03)
44
+
45
+ ### Feat
46
+
47
+ - add optional metadata module for processing.json DAG assembly
48
+
49
+ ## v0.2.0 (2026-04-23)
50
+
51
+ ### Feat
52
+
53
+ - add file handler
54
+
55
+ ## v0.1.0 (2026-04-21)
56
+
57
+ ### Feat
58
+
59
+ - re-export cli + provenance from top level; extend README
60
+ - **log**: add build_progress and make_progress_callback
61
+ - **provenance**: add capsule_commit and package_version
62
+ - **cli**: add parse_truthy for CO app-panel parameters
63
+ - re-export role_dispatch + diagnostics from top level; extend README
64
+ - **diagnostics**: add data-tree and memory reporters
65
+ - **role_dispatch**: add launcher/worker/aggregator skeleton
66
+ - re-export core API from top-level package
67
+ - **threading_utils**: add contextvars-preserving submit wrapper
68
+ - **log**: add rich-aware logging under [rich] extra
69
+ - **cache**: add input_fingerprint for cache keys
70
+ - **io**: add retry_on_oserror and atomic writes
71
+ - **process**: add graceful shutdown module
@@ -0,0 +1,88 @@
1
+ # CLAUDE.md
2
+
3
+ This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
4
+
5
+ ## Commands
6
+
7
+ ```bash
8
+ # Install dependencies
9
+ uv sync
10
+
11
+ # Run all checks (formatting, linting, type checking, tests)
12
+ ./scripts/run_linters_and_checks.sh -c
13
+
14
+ # Run tests
15
+ uv run pytest
16
+
17
+ # Run a single test file
18
+ uv run pytest tests/test_example.py
19
+
20
+ # Run a single test by name
21
+ uv run pytest -k "test_name"
22
+
23
+ # Formatting
24
+ uv run ruff format
25
+
26
+ # Linting
27
+ uv run ruff check
28
+ uv run ruff check --fix
29
+
30
+ # Type checking
31
+ uv run mypy
32
+
33
+ # Spell checking
34
+ uv run codespell --check-filenames
35
+
36
+ ```
37
+
38
+ Always use `uv run` to execute commands, `uv add` to add dependencies, and `uv sync` to set up the environment. Never use bare `pip` or `python`.
39
+
40
+ ## Architecture
41
+
42
+ This is a Python package using a `src/` layout. Source code lives in `src/aind_code_ocean_pipeline_utils/`, tests in `tests/`.
43
+
44
+ - Build system: hatchling
45
+ - Formatting/linting: ruff (line length 120, numpy docstring convention)
46
+ - Testing: pytest with coverage reporting
47
+ - Type checking: mypy (strict mode)
48
+ - Versioning: commitizen (semantic versioning via conventional commits)
49
+
50
+ ### Package layout
51
+
52
+ Planned module structure (see `TODO.md` for full API sketches and rationale):
53
+
54
+ ```
55
+ src/aind_code_ocean_pipeline_utils/
56
+ ├── process.py # graceful shutdown — SIGINT/SIGTERM → GracefulExit(BaseException)
57
+ ├── io.py # retry_on_oserror, atomic_json_write / atomic_write_text
58
+ ├── cache.py # input_fingerprint — SHA256 of canonical JSON
59
+ ├── log.py # rich+stdlib-logging compatibility (optional extra [rich])
60
+ └── threading_utils.py # copy_context()-per-submit ThreadPoolExecutor wrapper
61
+ ```
62
+
63
+ Module names deliberately avoid shadowing stdlib (`logging`, `concurrent`) so sibling modules can `import logging` / `from concurrent.futures import ...` without ambiguity.
64
+
65
+ **Core (`process`, `io`, `cache`) stays stdlib-only.** Optional modules gate heavy deps via named extras (e.g. `pip install aind-code-ocean-pipeline-utils[rich]`). Any new dependency outside those three modules must come with its own extra.
66
+
67
+ ### Release plan
68
+
69
+ - **v0.1.0** — `process` + `io` + `cache` (stdlib-only)
70
+ - **v0.2.0** — add `log` with `[rich]` extra
71
+ - **v0.3.0** — add `threading_utils` (stdlib-only, no extra)
72
+
73
+ ### Design invariants to preserve
74
+
75
+ These are load-bearing — every module has a subtle bug it exists to prevent. Don't relax them without understanding the original failure mode documented in `TODO.md`:
76
+
77
+ - `process.GracefulExit` inherits from `BaseException`, not `Exception`, so consumer `except Exception:` blocks don't swallow shutdown signals. Signal handlers flip a `threading.Event` and return — never call `sys.exit`, `logger.exception`, or other non-async-signal-safe code from inside the handler. Exit code = `128 + signum`. Second signal escalates via `os._exit`.
78
+ - `io.retry_on_oserror` uses a narrow `TRANSIENT_ERRNOS` frozenset (EIO, EAGAIN, EBUSY, network errnos). Permanent errors (ENOENT, EACCES, EINVAL) must raise immediately — retrying them hides config typos behind minutes of backoff. Use `os.replace` (not `os.rename`) for cross-platform atomicity. `fsync` defaults to True.
79
+ - `cache.input_fingerprint` requires JSON-serializable input and raises `TypeError` on anything else. Callers coerce `Path → str`, `ndarray → list`, etc. at the call site. Return value is prefixed `sha256:` so the algorithm can change without breaking string comparisons.
80
+ - `threading_utils.submit_with_context` calls `copy_context()` **per submit**, not once shared across submits. A shared Context raises `RuntimeError` when active on two threads concurrently (bit `ecephys-mipmap-zarr` at `prefetch_chunks >= 2`).
81
+ - `log.install_rich_handler` returns the `Console` object so the caller can pass the same one to `rich.progress.Progress(console=...)`. Not sharing it is what causes `logger.exception` inside `with Progress():` to lose its traceback tail.
82
+
83
+ ### Target consumers
84
+
85
+ - `ecephys-mipmap-builder-capsule` (local path: `/home/galen.lynch/Documents/Code/ecephys-mipmap-builder-capsule`) — reference consumer for shaking out API friction. First migration target.
86
+ - `pl-oversplitting-analysis-capsule` (ccg monorepo) — has none of the patterns; its `--merge-only` resume does a raw file-exists check with no fingerprint validation. Migration candidate after first bug report.
87
+
88
+ Note: `ecephys-mipmap-zarr` is **not** a target — it is Code-Ocean-agnostic and should not depend on this package.
@@ -0,0 +1,22 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Allen Institute for Neural Dynamics
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
22
+