cytorecorder 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.
Potentially problematic release.
This version of cytorecorder might be problematic. Click here for more details.
- cytorecorder-0.1.0/.gitignore +223 -0
- cytorecorder-0.1.0/.pre-commit-config.yaml +70 -0
- cytorecorder-0.1.0/.python-version +1 -0
- cytorecorder-0.1.0/CITATION.cff +47 -0
- cytorecorder-0.1.0/MANIFEST.in +13 -0
- cytorecorder-0.1.0/PKG-INFO +51 -0
- cytorecorder-0.1.0/README.md +34 -0
- cytorecorder-0.1.0/pyproject.toml +134 -0
- cytorecorder-0.1.0/setup.cfg +4 -0
- cytorecorder-0.1.0/src/cytorecorder/__init__.py +5 -0
- cytorecorder-0.1.0/src/cytorecorder/_version.py +24 -0
- cytorecorder-0.1.0/src/cytorecorder/cli.py +69 -0
- cytorecorder-0.1.0/src/cytorecorder/images.py +35 -0
- cytorecorder-0.1.0/src/cytorecorder/main.py +153 -0
- cytorecorder-0.1.0/src/cytorecorder.egg-info/PKG-INFO +51 -0
- cytorecorder-0.1.0/src/cytorecorder.egg-info/SOURCES.txt +23 -0
- cytorecorder-0.1.0/src/cytorecorder.egg-info/dependency_links.txt +1 -0
- cytorecorder-0.1.0/src/cytorecorder.egg-info/entry_points.txt +2 -0
- cytorecorder-0.1.0/src/cytorecorder.egg-info/requires.txt +2 -0
- cytorecorder-0.1.0/src/cytorecorder.egg-info/scm_file_list.json +22 -0
- cytorecorder-0.1.0/src/cytorecorder.egg-info/scm_version.json +8 -0
- cytorecorder-0.1.0/src/cytorecorder.egg-info/top_level.txt +1 -0
- cytorecorder-0.1.0/src/notebooks/example_notebook.ipynb +133 -0
- cytorecorder-0.1.0/src/notebooks/example_notebook.py +48 -0
- cytorecorder-0.1.0/uv.lock +2231 -0
|
@@ -0,0 +1,223 @@
|
|
|
1
|
+
# Byte-compiled / optimized / DLL files
|
|
2
|
+
__pycache__/
|
|
3
|
+
*.py[codz]
|
|
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
|
+
share/python-wheels/
|
|
24
|
+
*.egg-info/
|
|
25
|
+
.installed.cfg
|
|
26
|
+
*.egg
|
|
27
|
+
MANIFEST
|
|
28
|
+
|
|
29
|
+
# PyInstaller
|
|
30
|
+
# Usually these files are written by a python script from a template
|
|
31
|
+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
|
|
32
|
+
*.manifest
|
|
33
|
+
*.spec
|
|
34
|
+
|
|
35
|
+
# Installer logs
|
|
36
|
+
pip-log.txt
|
|
37
|
+
pip-delete-this-directory.txt
|
|
38
|
+
|
|
39
|
+
# Unit test / coverage reports
|
|
40
|
+
htmlcov/
|
|
41
|
+
.tox/
|
|
42
|
+
.nox/
|
|
43
|
+
.coverage
|
|
44
|
+
.coverage.*
|
|
45
|
+
.cache
|
|
46
|
+
nosetests.xml
|
|
47
|
+
coverage.xml
|
|
48
|
+
*.cover
|
|
49
|
+
*.py.cover
|
|
50
|
+
*.lcov
|
|
51
|
+
.hypothesis/
|
|
52
|
+
.pytest_cache/
|
|
53
|
+
cover/
|
|
54
|
+
|
|
55
|
+
# Translations
|
|
56
|
+
*.mo
|
|
57
|
+
*.pot
|
|
58
|
+
|
|
59
|
+
# Django stuff:
|
|
60
|
+
*.log
|
|
61
|
+
local_settings.py
|
|
62
|
+
db.sqlite3
|
|
63
|
+
db.sqlite3-journal
|
|
64
|
+
|
|
65
|
+
# Flask stuff:
|
|
66
|
+
instance/
|
|
67
|
+
.webassets-cache
|
|
68
|
+
|
|
69
|
+
# Scrapy stuff:
|
|
70
|
+
.scrapy
|
|
71
|
+
|
|
72
|
+
# Sphinx documentation
|
|
73
|
+
docs/_build/
|
|
74
|
+
|
|
75
|
+
# PyBuilder
|
|
76
|
+
.pybuilder/
|
|
77
|
+
target/
|
|
78
|
+
|
|
79
|
+
# Jupyter Notebook
|
|
80
|
+
.ipynb_checkpoints
|
|
81
|
+
|
|
82
|
+
# IPython
|
|
83
|
+
profile_default/
|
|
84
|
+
ipython_config.py
|
|
85
|
+
|
|
86
|
+
# pyenv
|
|
87
|
+
# For a library or package, you might want to ignore these files since the code is
|
|
88
|
+
# intended to run in multiple environments; otherwise, check them in:
|
|
89
|
+
# .python-version
|
|
90
|
+
|
|
91
|
+
# pipenv
|
|
92
|
+
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
|
|
93
|
+
# However, in case of collaboration, if having platform-specific dependencies or dependencies
|
|
94
|
+
# having no cross-platform support, pipenv may install dependencies that don't work, or not
|
|
95
|
+
# install all needed dependencies.
|
|
96
|
+
# Pipfile.lock
|
|
97
|
+
|
|
98
|
+
# UV
|
|
99
|
+
# Similar to Pipfile.lock, it is generally recommended to include uv.lock in version control.
|
|
100
|
+
# This is especially recommended for binary packages to ensure reproducibility, and is more
|
|
101
|
+
# commonly ignored for libraries.
|
|
102
|
+
# uv.lock
|
|
103
|
+
|
|
104
|
+
# poetry
|
|
105
|
+
# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
|
|
106
|
+
# This is especially recommended for binary packages to ensure reproducibility, and is more
|
|
107
|
+
# commonly ignored for libraries.
|
|
108
|
+
# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
|
|
109
|
+
# poetry.lock
|
|
110
|
+
# poetry.toml
|
|
111
|
+
|
|
112
|
+
# pdm
|
|
113
|
+
# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
|
|
114
|
+
# pdm recommends including project-wide configuration in pdm.toml, but excluding .pdm-python.
|
|
115
|
+
# https://pdm-project.org/en/latest/usage/project/#working-with-version-control
|
|
116
|
+
# pdm.lock
|
|
117
|
+
# pdm.toml
|
|
118
|
+
.pdm-python
|
|
119
|
+
.pdm-build/
|
|
120
|
+
|
|
121
|
+
# pixi
|
|
122
|
+
# Similar to Pipfile.lock, it is generally recommended to include pixi.lock in version control.
|
|
123
|
+
# pixi.lock
|
|
124
|
+
# Pixi creates a virtual environment in the .pixi directory, just like venv module creates one
|
|
125
|
+
# in the .venv directory. It is recommended not to include this directory in version control.
|
|
126
|
+
.pixi/*
|
|
127
|
+
!.pixi/config.toml
|
|
128
|
+
|
|
129
|
+
# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
|
|
130
|
+
__pypackages__/
|
|
131
|
+
|
|
132
|
+
# Celery stuff
|
|
133
|
+
celerybeat-schedule*
|
|
134
|
+
celerybeat.pid
|
|
135
|
+
|
|
136
|
+
# Redis
|
|
137
|
+
*.rdb
|
|
138
|
+
*.aof
|
|
139
|
+
*.pid
|
|
140
|
+
|
|
141
|
+
# RabbitMQ
|
|
142
|
+
mnesia/
|
|
143
|
+
rabbitmq/
|
|
144
|
+
rabbitmq-data/
|
|
145
|
+
|
|
146
|
+
# ActiveMQ
|
|
147
|
+
activemq-data/
|
|
148
|
+
|
|
149
|
+
# SageMath parsed files
|
|
150
|
+
*.sage.py
|
|
151
|
+
|
|
152
|
+
# Environments
|
|
153
|
+
.env
|
|
154
|
+
.envrc
|
|
155
|
+
.venv
|
|
156
|
+
env/
|
|
157
|
+
venv/
|
|
158
|
+
ENV/
|
|
159
|
+
env.bak/
|
|
160
|
+
venv.bak/
|
|
161
|
+
|
|
162
|
+
# Spyder project settings
|
|
163
|
+
.spyderproject
|
|
164
|
+
.spyproject
|
|
165
|
+
|
|
166
|
+
# Rope project settings
|
|
167
|
+
.ropeproject
|
|
168
|
+
|
|
169
|
+
# mkdocs documentation
|
|
170
|
+
/site
|
|
171
|
+
|
|
172
|
+
# mypy
|
|
173
|
+
.mypy_cache/
|
|
174
|
+
.dmypy.json
|
|
175
|
+
dmypy.json
|
|
176
|
+
|
|
177
|
+
# Pyre type checker
|
|
178
|
+
.pyre/
|
|
179
|
+
|
|
180
|
+
# pytype static type analyzer
|
|
181
|
+
.pytype/
|
|
182
|
+
|
|
183
|
+
# Cython debug symbols
|
|
184
|
+
cython_debug/
|
|
185
|
+
|
|
186
|
+
# PyCharm
|
|
187
|
+
# JetBrains specific template is maintained in a separate JetBrains.gitignore that can
|
|
188
|
+
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
|
|
189
|
+
# and can be added to the global gitignore or merged into this file. For a more nuclear
|
|
190
|
+
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
|
|
191
|
+
# .idea/
|
|
192
|
+
|
|
193
|
+
# Abstra
|
|
194
|
+
# Abstra is an AI-powered process automation framework.
|
|
195
|
+
# Ignore directories containing user credentials, local state, and settings.
|
|
196
|
+
# Learn more at https://abstra.io/docs
|
|
197
|
+
.abstra/
|
|
198
|
+
|
|
199
|
+
# Visual Studio Code
|
|
200
|
+
# Visual Studio Code specific template is maintained in a separate VisualStudioCode.gitignore
|
|
201
|
+
# that can be found at https://github.com/github/gitignore/blob/main/Global/VisualStudioCode.gitignore
|
|
202
|
+
# and can be added to the global gitignore or merged into this file. However, if you prefer,
|
|
203
|
+
# you could uncomment the following to ignore the entire vscode folder
|
|
204
|
+
# .vscode/
|
|
205
|
+
# Temporary file for partial code execution
|
|
206
|
+
tempCodeRunnerFile.py
|
|
207
|
+
|
|
208
|
+
# Ruff stuff:
|
|
209
|
+
.ruff_cache/
|
|
210
|
+
|
|
211
|
+
# PyPI configuration file
|
|
212
|
+
.pypirc
|
|
213
|
+
|
|
214
|
+
# Marimo
|
|
215
|
+
marimo/_static/
|
|
216
|
+
marimo/_lsp/
|
|
217
|
+
__marimo__/
|
|
218
|
+
|
|
219
|
+
# Streamlit
|
|
220
|
+
.streamlit/secrets.toml
|
|
221
|
+
|
|
222
|
+
# project-specific ignores
|
|
223
|
+
_version.py
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
# See https://pre-commit.com for more information
|
|
2
|
+
# See https://pre-commit.com/hooks.html for more hooks
|
|
3
|
+
#
|
|
4
|
+
# This config lives under cytorecorder/ inside the larger
|
|
5
|
+
# WayScience/CytoRecorder monorepo. pre-commit always resolves paths
|
|
6
|
+
# relative to the git top-level, regardless of which directory you invoke
|
|
7
|
+
# it from, so every path here (including this top-level `files:` guard) is
|
|
8
|
+
# written relative to the repo root, not this subdirectory, to keep this
|
|
9
|
+
# subpackage's checks from ever touching the browser app's own files.
|
|
10
|
+
files: ^cytorecorder/
|
|
11
|
+
repos:
|
|
12
|
+
- repo: https://github.com/pre-commit/pre-commit-hooks
|
|
13
|
+
rev: v5.0.0
|
|
14
|
+
hooks:
|
|
15
|
+
- id: trailing-whitespace
|
|
16
|
+
- id: end-of-file-fixer
|
|
17
|
+
- id: check-yaml
|
|
18
|
+
- id: detect-private-key
|
|
19
|
+
- repo: https://github.com/tox-dev/pyproject-fmt
|
|
20
|
+
rev: "v2.6.0"
|
|
21
|
+
hooks:
|
|
22
|
+
- id: pyproject-fmt
|
|
23
|
+
- repo: https://github.com/citation-file-format/cffconvert
|
|
24
|
+
rev: 5295f87c0e261da61a7b919fc754e3a77edd98a7
|
|
25
|
+
hooks:
|
|
26
|
+
- id: validate-cff
|
|
27
|
+
- repo: https://github.com/codespell-project/codespell
|
|
28
|
+
rev: v2.4.1
|
|
29
|
+
hooks:
|
|
30
|
+
- id: codespell
|
|
31
|
+
exclude: |
|
|
32
|
+
(?x)^(
|
|
33
|
+
.*\.lock |
|
|
34
|
+
.*\.csv |
|
|
35
|
+
.*\.cff |
|
|
36
|
+
.*\.ipynb
|
|
37
|
+
)$
|
|
38
|
+
- repo: https://github.com/executablebooks/mdformat
|
|
39
|
+
rev: 0.7.21
|
|
40
|
+
hooks:
|
|
41
|
+
- id: mdformat
|
|
42
|
+
additional_dependencies:
|
|
43
|
+
- mdformat-gfm
|
|
44
|
+
- repo: https://github.com/adrienverge/yamllint
|
|
45
|
+
rev: v1.37.1
|
|
46
|
+
hooks:
|
|
47
|
+
- id: yamllint
|
|
48
|
+
exclude: pre-commit-config.yaml
|
|
49
|
+
- repo: https://github.com/astral-sh/ruff-pre-commit
|
|
50
|
+
rev: "v0.11.11"
|
|
51
|
+
hooks:
|
|
52
|
+
- id: ruff-format
|
|
53
|
+
- id: ruff-check
|
|
54
|
+
- repo: https://github.com/jendrikseipp/vulture
|
|
55
|
+
rev: 'v2.14'
|
|
56
|
+
hooks:
|
|
57
|
+
- id: vulture
|
|
58
|
+
# pass_filenames: false upstream, and pyproject.toml's own
|
|
59
|
+
# [tool.vulture] paths are self-relative (correct for a direct
|
|
60
|
+
# `uv run vulture` from within this directory) but unreachable
|
|
61
|
+
# here since pre-commit's cwd is the monorepo root.
|
|
62
|
+
args: [cytorecorder/src/cytorecorder, cytorecorder/tests, --min-confidence=90]
|
|
63
|
+
- repo: https://github.com/astral-sh/ty-pre-commit
|
|
64
|
+
rev: v0.0.99
|
|
65
|
+
hooks:
|
|
66
|
+
- id: ty
|
|
67
|
+
# --project pins ty to this subpackage's pyproject.toml/venv;
|
|
68
|
+
# without it, ty treats pre-commit's monorepo-root cwd as the
|
|
69
|
+
# project root and fails to resolve this package's own imports.
|
|
70
|
+
args: [--frozen, --project, cytorecorder]
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
3.11
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
# This CITATION.cff file was generated with cffinit.
|
|
2
|
+
# Visit https://bit.ly/cffinit to generate yours today!
|
|
3
|
+
---
|
|
4
|
+
cff-version: 1.2.0
|
|
5
|
+
title: cytorecorder
|
|
6
|
+
message: >-
|
|
7
|
+
If you use this software, please cite it using the
|
|
8
|
+
metadata from the CITATION.cff file.
|
|
9
|
+
type: software
|
|
10
|
+
authors:
|
|
11
|
+
- given-names: Dave
|
|
12
|
+
family-names: Bunten
|
|
13
|
+
orcid: "https://orcid.org/0000-0001-6041-3665"
|
|
14
|
+
- given-names: Jenna
|
|
15
|
+
family-names: Tomkinson
|
|
16
|
+
orcid: "https://orcid.org/0000-0003-2676-5813"
|
|
17
|
+
- given-names: Gregory
|
|
18
|
+
family-names: Way
|
|
19
|
+
orcid: "https://orcid.org/0000-0002-0503-9348"
|
|
20
|
+
repository-code: "https://github.com/WayScience/CytoRecorder"
|
|
21
|
+
abstract: >-
|
|
22
|
+
Local companion CLI for CytoRecorder: confirms a folder of whole microscopy images exists (recursively) and opens the hosted CytoRecorder app so a human can complete the whole-image QC review and export themselves.
|
|
23
|
+
keywords:
|
|
24
|
+
- python
|
|
25
|
+
license: BSD-3-Clause
|
|
26
|
+
references:
|
|
27
|
+
- type: software
|
|
28
|
+
title: "agent-skills"
|
|
29
|
+
authors:
|
|
30
|
+
- given-names: Addy
|
|
31
|
+
family-names: Osmani
|
|
32
|
+
repository-code: "https://github.com/addyosmani/agent-skills"
|
|
33
|
+
license: MIT
|
|
34
|
+
- type: software
|
|
35
|
+
title: "learning-opportunities"
|
|
36
|
+
authors:
|
|
37
|
+
- given-names: Cat
|
|
38
|
+
family-names: Hicks
|
|
39
|
+
repository-code: "https://github.com/DrCatHicks/learning-opportunities"
|
|
40
|
+
license: CC-BY-4.0
|
|
41
|
+
- type: software
|
|
42
|
+
title: "simple-english"
|
|
43
|
+
authors:
|
|
44
|
+
- given-names: Amin
|
|
45
|
+
family-names: Boulegroun
|
|
46
|
+
repository-code: "https://github.com/AminBlg/SimpleEnglish"
|
|
47
|
+
license: MIT
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: cytorecorder
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: Local companion CLI for CytoRecorder: confirms a folder of whole microscopy images exists (recursively) and opens the hosted CytoRecorder app so a human can complete the whole-image QC review and export themselves.
|
|
5
|
+
Author: Dave Bunten
|
|
6
|
+
Project-URL: Homepage, https://github.com/WayScience/CytoRecorder
|
|
7
|
+
Project-URL: Issues, https://github.com/WayScience/CytoRecorder/issues
|
|
8
|
+
Project-URL: Repository, https://github.com/WayScience/CytoRecorder
|
|
9
|
+
Classifier: Programming Language :: Python :: 3 :: Only
|
|
10
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
11
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
12
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
13
|
+
Requires-Python: >=3.11
|
|
14
|
+
Description-Content-Type: text/markdown
|
|
15
|
+
Requires-Dist: fire>=0.7
|
|
16
|
+
Requires-Dist: jinja2>=3.1.6
|
|
17
|
+
|
|
18
|
+
# cytorecorder
|
|
19
|
+
|
|
20
|
+
Local companion CLI for [CytoRecorder](https://wayscience.github.io/CytoRecorder/): confirms a folder of whole microscopy images exists (recursively, including subdirectories) and opens the hosted CytoRecorder app so a human can complete a whole-image quality review and export the results themselves.
|
|
21
|
+
|
|
22
|
+
This CLI does not run a server and does not push data into the browser. A human still drags the input folder into CytoRecorder (or uses its "Upload folder" button) and, when finished, saves the exported `quality_labels.csv` into the output folder themselves. Browsers cannot be made to silently read or write arbitrary local paths, so this stays a manual, two-step handoff by design.
|
|
23
|
+
|
|
24
|
+
## Install
|
|
25
|
+
|
|
26
|
+
```sh
|
|
27
|
+
pip install cytorecorder
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
## Use
|
|
31
|
+
|
|
32
|
+
```sh
|
|
33
|
+
cytorecorder review --input_dir=/path/to/images --output_dir=/path/to/results
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
This:
|
|
37
|
+
|
|
38
|
+
1. Scans `input_dir` recursively for `.png`/`.tif`/`.tiff` files and fails fast if none are found.
|
|
39
|
+
1. Refuses (unless `--force=True`) if `output_dir/quality_labels.csv` already exists and is non-empty, so a review run can't silently clobber a previous export.
|
|
40
|
+
1. Opens the hosted CytoRecorder app at a URL carrying a project name (defaulting to `input_dir`'s own folder name).
|
|
41
|
+
1. Prints the remaining manual steps: drag `input_dir` into the app, switch to Single image mode, label each image, then export the CSV into `output_dir`.
|
|
42
|
+
|
|
43
|
+
Run `cytorecorder review --help` for all options (`--project`, `--app_url`, `--open_browser`, `--force`).
|
|
44
|
+
|
|
45
|
+
## Develop
|
|
46
|
+
|
|
47
|
+
```sh
|
|
48
|
+
uv sync
|
|
49
|
+
uv run --frozen pytest
|
|
50
|
+
uv run pre-commit run --all-files
|
|
51
|
+
```
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
# cytorecorder
|
|
2
|
+
|
|
3
|
+
Local companion CLI for [CytoRecorder](https://wayscience.github.io/CytoRecorder/): confirms a folder of whole microscopy images exists (recursively, including subdirectories) and opens the hosted CytoRecorder app so a human can complete a whole-image quality review and export the results themselves.
|
|
4
|
+
|
|
5
|
+
This CLI does not run a server and does not push data into the browser. A human still drags the input folder into CytoRecorder (or uses its "Upload folder" button) and, when finished, saves the exported `quality_labels.csv` into the output folder themselves. Browsers cannot be made to silently read or write arbitrary local paths, so this stays a manual, two-step handoff by design.
|
|
6
|
+
|
|
7
|
+
## Install
|
|
8
|
+
|
|
9
|
+
```sh
|
|
10
|
+
pip install cytorecorder
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
## Use
|
|
14
|
+
|
|
15
|
+
```sh
|
|
16
|
+
cytorecorder review --input_dir=/path/to/images --output_dir=/path/to/results
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
This:
|
|
20
|
+
|
|
21
|
+
1. Scans `input_dir` recursively for `.png`/`.tif`/`.tiff` files and fails fast if none are found.
|
|
22
|
+
1. Refuses (unless `--force=True`) if `output_dir/quality_labels.csv` already exists and is non-empty, so a review run can't silently clobber a previous export.
|
|
23
|
+
1. Opens the hosted CytoRecorder app at a URL carrying a project name (defaulting to `input_dir`'s own folder name).
|
|
24
|
+
1. Prints the remaining manual steps: drag `input_dir` into the app, switch to Single image mode, label each image, then export the CSV into `output_dir`.
|
|
25
|
+
|
|
26
|
+
Run `cytorecorder review --help` for all options (`--project`, `--app_url`, `--open_browser`, `--force`).
|
|
27
|
+
|
|
28
|
+
## Develop
|
|
29
|
+
|
|
30
|
+
```sh
|
|
31
|
+
uv sync
|
|
32
|
+
uv run --frozen pytest
|
|
33
|
+
uv run pre-commit run --all-files
|
|
34
|
+
```
|
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
build-backend = "setuptools.build_meta"
|
|
3
|
+
requires = [ "setuptools>=64", "setuptools-scm>=8" ]
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
name = "cytorecorder"
|
|
7
|
+
description = "Local companion CLI for CytoRecorder: confirms a folder of whole microscopy images exists (recursively) and opens the hosted CytoRecorder app so a human can complete the whole-image QC review and export themselves."
|
|
8
|
+
readme = "README.md"
|
|
9
|
+
authors = [
|
|
10
|
+
{ name = "Dave Bunten" },
|
|
11
|
+
]
|
|
12
|
+
requires-python = ">=3.11"
|
|
13
|
+
classifiers = [
|
|
14
|
+
"Programming Language :: Python :: 3 :: Only",
|
|
15
|
+
"Programming Language :: Python :: 3.11",
|
|
16
|
+
"Programming Language :: Python :: 3.12",
|
|
17
|
+
"Programming Language :: Python :: 3.13",
|
|
18
|
+
]
|
|
19
|
+
dynamic = [ "version" ]
|
|
20
|
+
dependencies = [
|
|
21
|
+
"fire>=0.7",
|
|
22
|
+
"jinja2>=3.1.6",
|
|
23
|
+
]
|
|
24
|
+
urls.Homepage = "https://github.com/WayScience/CytoRecorder"
|
|
25
|
+
urls.Issues = "https://github.com/WayScience/CytoRecorder/issues"
|
|
26
|
+
urls.Repository = "https://github.com/WayScience/CytoRecorder"
|
|
27
|
+
scripts.cytorecorder = "cytorecorder.cli:trigger"
|
|
28
|
+
|
|
29
|
+
[dependency-groups]
|
|
30
|
+
dev = [
|
|
31
|
+
"coverage[toml]>=7.10.6",
|
|
32
|
+
"poethepoet>=0.34",
|
|
33
|
+
"pre-commit>=4",
|
|
34
|
+
"pytest>=8.3.5",
|
|
35
|
+
"pytest-cov>=6.2.1",
|
|
36
|
+
]
|
|
37
|
+
docs = [
|
|
38
|
+
"myst-nb>=1.2",
|
|
39
|
+
"pydata-sphinx-theme>=0.16.1",
|
|
40
|
+
"sphinx>=8.2.3",
|
|
41
|
+
]
|
|
42
|
+
notebooks = [
|
|
43
|
+
"black>=25.1",
|
|
44
|
+
"isort>=6.0.1",
|
|
45
|
+
"jupyterlab>=4.4.2",
|
|
46
|
+
"jupyterlab-code-formatter>=3.0.2",
|
|
47
|
+
"jupytext>=1.17.1",
|
|
48
|
+
]
|
|
49
|
+
|
|
50
|
+
[tool.setuptools]
|
|
51
|
+
package-dir = { "" = "src" }
|
|
52
|
+
include-package-data = true
|
|
53
|
+
|
|
54
|
+
[tool.setuptools.packages.find]
|
|
55
|
+
where = [ "src" ]
|
|
56
|
+
include = [ "cytorecorder*" ]
|
|
57
|
+
|
|
58
|
+
[tool.setuptools_scm]
|
|
59
|
+
# Search the parent repository for CLI release tags only. The command filters
|
|
60
|
+
# tag selection before the regex extracts the version from the selected tag.
|
|
61
|
+
root = ".."
|
|
62
|
+
git_describe_command = "git describe --dirty --tags --long --match 'cytorecorder-v[0-9]*'"
|
|
63
|
+
tag_regex = "^cytorecorder-v(?P<version>[0-9]+\\.[0-9]+\\.[0-9]+.*)$"
|
|
64
|
+
version_scheme = "no-guess-dev"
|
|
65
|
+
local_scheme = "no-local-version"
|
|
66
|
+
version_file = "src/cytorecorder/_version.py"
|
|
67
|
+
|
|
68
|
+
[tool.ruff]
|
|
69
|
+
target-version = "py311"
|
|
70
|
+
line-length = 88
|
|
71
|
+
fix = true
|
|
72
|
+
lint.select = [
|
|
73
|
+
# flake8-builtins
|
|
74
|
+
"A",
|
|
75
|
+
# flake8-annotations
|
|
76
|
+
"ANN",
|
|
77
|
+
# flake8-comprehensions
|
|
78
|
+
"C4",
|
|
79
|
+
# mccabe
|
|
80
|
+
"C90",
|
|
81
|
+
# pycodestyle
|
|
82
|
+
"E",
|
|
83
|
+
# pyflakes
|
|
84
|
+
"F",
|
|
85
|
+
# isort
|
|
86
|
+
"I",
|
|
87
|
+
# pylint
|
|
88
|
+
"PL",
|
|
89
|
+
# ruff
|
|
90
|
+
"RUF",
|
|
91
|
+
# flake8-simplify
|
|
92
|
+
"SIM",
|
|
93
|
+
"W",
|
|
94
|
+
]
|
|
95
|
+
# Ignore `F401` (unused imports) for `__init__.py` file
|
|
96
|
+
lint.per-file-ignores."__init__.py" = [ "F401" ]
|
|
97
|
+
|
|
98
|
+
[tool.pytest.ini_options]
|
|
99
|
+
pythonpath = [ "." ]
|
|
100
|
+
addopts = [
|
|
101
|
+
"--cov=cytorecorder",
|
|
102
|
+
"--cov-report=term-missing",
|
|
103
|
+
"--cov-report=xml",
|
|
104
|
+
]
|
|
105
|
+
|
|
106
|
+
[tool.coverage.run]
|
|
107
|
+
branch = true
|
|
108
|
+
source = [ "src/cytorecorder" ]
|
|
109
|
+
|
|
110
|
+
[tool.coverage.report]
|
|
111
|
+
show_missing = true
|
|
112
|
+
skip_covered = true
|
|
113
|
+
|
|
114
|
+
[tool.poe.tasks]
|
|
115
|
+
# tasks for development environments
|
|
116
|
+
test.shell = """
|
|
117
|
+
pytest
|
|
118
|
+
"""
|
|
119
|
+
lint.shell = """
|
|
120
|
+
pre-commit run --all-files
|
|
121
|
+
"""
|
|
122
|
+
pipeline.shell = """
|
|
123
|
+
pre-commit run --all-files && pytest
|
|
124
|
+
"""
|
|
125
|
+
jupyter.shell = """
|
|
126
|
+
jupyter lab
|
|
127
|
+
"""
|
|
128
|
+
|
|
129
|
+
[tool.jupytext]
|
|
130
|
+
formats = "ipynb,py:light"
|
|
131
|
+
|
|
132
|
+
[tool.vulture]
|
|
133
|
+
min_confidence = 90
|
|
134
|
+
paths = [ "src/cytorecorder", "tests" ]
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
# file generated by vcs-versioning
|
|
2
|
+
# don't change, don't track in version control
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
__all__ = [
|
|
6
|
+
"__version__",
|
|
7
|
+
"__version_tuple__",
|
|
8
|
+
"version",
|
|
9
|
+
"version_tuple",
|
|
10
|
+
"__commit_id__",
|
|
11
|
+
"commit_id",
|
|
12
|
+
]
|
|
13
|
+
|
|
14
|
+
version: str
|
|
15
|
+
__version__: str
|
|
16
|
+
__version_tuple__: tuple[int | str, ...]
|
|
17
|
+
version_tuple: tuple[int | str, ...]
|
|
18
|
+
commit_id: str | None
|
|
19
|
+
__commit_id__: str | None
|
|
20
|
+
|
|
21
|
+
__version__ = version = '0.1.0'
|
|
22
|
+
__version_tuple__ = version_tuple = (0, 1, 0)
|
|
23
|
+
|
|
24
|
+
__commit_id__ = commit_id = 'g7ffda41'
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
"""
|
|
2
|
+
CLI for cytorecorder
|
|
3
|
+
"""
|
|
4
|
+
|
|
5
|
+
import fire
|
|
6
|
+
from fire.decorators import SetParseFn
|
|
7
|
+
|
|
8
|
+
from cytorecorder.main import DEFAULT_APP_URL, review
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
class cytorecorderCLI:
|
|
12
|
+
@SetParseFn(str, "input_dir", "output_dir", "project", "app_url")
|
|
13
|
+
def review( # noqa: PLR0913 (CLI config surface: one kwarg per launch option)
|
|
14
|
+
self,
|
|
15
|
+
input_dir: str,
|
|
16
|
+
output_dir: str,
|
|
17
|
+
project: str = "",
|
|
18
|
+
app_url: str = DEFAULT_APP_URL,
|
|
19
|
+
open_browser: bool = True,
|
|
20
|
+
force: bool = False,
|
|
21
|
+
enable_voice_notes: bool = False,
|
|
22
|
+
) -> None:
|
|
23
|
+
"""
|
|
24
|
+
Help a human complete a CytoRecorder whole-image quality review:
|
|
25
|
+
confirms real images exist under input_dir (recursively, including
|
|
26
|
+
subdirectories) and opens the hosted CytoRecorder app. The human
|
|
27
|
+
then drags input_dir into the app themselves and, when done,
|
|
28
|
+
exports quality_labels.csv into output_dir from the browser.
|
|
29
|
+
|
|
30
|
+
Args:
|
|
31
|
+
input_dir (str):
|
|
32
|
+
Folder of whole images to review, scanned recursively.
|
|
33
|
+
output_dir (str):
|
|
34
|
+
Folder to save the exported quality_labels.csv into.
|
|
35
|
+
project (str):
|
|
36
|
+
Project name recorded on every label.
|
|
37
|
+
Defaults to the input folder's own name.
|
|
38
|
+
app_url (str):
|
|
39
|
+
Base URL of the hosted CytoRecorder app to open.
|
|
40
|
+
open_browser (bool):
|
|
41
|
+
Whether to open the system browser automatically.
|
|
42
|
+
Defaults to True.
|
|
43
|
+
force (bool):
|
|
44
|
+
Proceed even if output_dir already has a non-empty
|
|
45
|
+
quality_labels.csv. Defaults to False: refuse and raise.
|
|
46
|
+
enable_voice_notes (bool):
|
|
47
|
+
Opened with a project name, CytoRecorder normally skips
|
|
48
|
+
its default public-demo behavior (automatic BioImage
|
|
49
|
+
Archive fetch, per-object voice notes) and just waits for
|
|
50
|
+
the folder to be dragged in. Set this to open with that
|
|
51
|
+
default demo behavior (including voice notes) instead.
|
|
52
|
+
Defaults to False.
|
|
53
|
+
"""
|
|
54
|
+
review(
|
|
55
|
+
input_dir=input_dir,
|
|
56
|
+
output_dir=output_dir,
|
|
57
|
+
project=project,
|
|
58
|
+
app_url=app_url,
|
|
59
|
+
open_browser=open_browser,
|
|
60
|
+
force=force,
|
|
61
|
+
enable_voice_notes=enable_voice_notes,
|
|
62
|
+
)
|
|
63
|
+
|
|
64
|
+
|
|
65
|
+
def trigger() -> None:
|
|
66
|
+
"""
|
|
67
|
+
Trigger the CLI to run.
|
|
68
|
+
"""
|
|
69
|
+
fire.Fire(cytorecorderCLI)
|