auto-options-python 0.1.4__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.
- auto_options_python-0.1.4/.github/workflows/create_doc.yml +47 -0
- auto_options_python-0.1.4/.github/workflows/test_and_deploy.yml +76 -0
- auto_options_python-0.1.4/.gitignore +213 -0
- auto_options_python-0.1.4/LICENSE +21 -0
- auto_options_python-0.1.4/PKG-INFO +58 -0
- auto_options_python-0.1.4/README.md +2 -0
- auto_options_python-0.1.4/docs/Makefile +20 -0
- auto_options_python-0.1.4/docs/make.bat +35 -0
- auto_options_python-0.1.4/docs/source/auto-options-python.rst +22 -0
- auto_options_python-0.1.4/docs/source/autooptions.array_util.rst +4 -0
- auto_options_python-0.1.4/docs/source/autooptions.napari_util.rst +4 -0
- auto_options_python-0.1.4/docs/source/autooptions.options.rst +4 -0
- auto_options_python-0.1.4/docs/source/autooptions.qtutil.rst +4 -0
- auto_options_python-0.1.4/docs/source/autooptions.widget.rst +4 -0
- auto_options_python-0.1.4/docs/source/conf.py +85 -0
- auto_options_python-0.1.4/docs/source/index.rst +10 -0
- auto_options_python-0.1.4/docs/source/modules.rst +7 -0
- auto_options_python-0.1.4/docs/source/user/installation.rst +6 -0
- auto_options_python-0.1.4/docs/source/user/introduction.rst +47 -0
- auto_options_python-0.1.4/docs/source/user/user_documentation.rst +8 -0
- auto_options_python-0.1.4/pyproject.toml +124 -0
- auto_options_python-0.1.4/setup.cfg +4 -0
- auto_options_python-0.1.4/src/auto_options_python.egg-info/PKG-INFO +58 -0
- auto_options_python-0.1.4/src/auto_options_python.egg-info/SOURCES.txt +39 -0
- auto_options_python-0.1.4/src/auto_options_python.egg-info/dependency_links.txt +1 -0
- auto_options_python-0.1.4/src/auto_options_python.egg-info/requires.txt +6 -0
- auto_options_python-0.1.4/src/auto_options_python.egg-info/top_level.txt +2 -0
- auto_options_python-0.1.4/src/autooptions/__init__.py +16 -0
- auto_options_python-0.1.4/src/autooptions/_tests/__init__.py +0 -0
- auto_options_python-0.1.4/src/autooptions/_tests/test_array_util.py +24 -0
- auto_options_python-0.1.4/src/autooptions/_tests/test_napari_util.py +146 -0
- auto_options_python-0.1.4/src/autooptions/_tests/test_options.py +172 -0
- auto_options_python-0.1.4/src/autooptions/_tests/test_qtutil.py +245 -0
- auto_options_python-0.1.4/src/autooptions/_tests/test_widget.py +132 -0
- auto_options_python-0.1.4/src/autooptions/_version.py +24 -0
- auto_options_python-0.1.4/src/autooptions/array_util.py +39 -0
- auto_options_python-0.1.4/src/autooptions/napari_util.py +133 -0
- auto_options_python-0.1.4/src/autooptions/options.py +311 -0
- auto_options_python-0.1.4/src/autooptions/qtutil.py +270 -0
- auto_options_python-0.1.4/src/autooptions/widget.py +370 -0
- auto_options_python-0.1.4/src/scratch/options.py +36 -0
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
name: Docs
|
|
2
|
+
on:
|
|
3
|
+
push:
|
|
4
|
+
branches:
|
|
5
|
+
- main
|
|
6
|
+
- npe2
|
|
7
|
+
tags:
|
|
8
|
+
- "v*" # Push events to matching v*, i.e. v1.0, v20.15.10
|
|
9
|
+
pull_request:
|
|
10
|
+
branches:
|
|
11
|
+
- main
|
|
12
|
+
- npe2
|
|
13
|
+
workflow_dispatch:
|
|
14
|
+
permissions:
|
|
15
|
+
contents: write
|
|
16
|
+
jobs:
|
|
17
|
+
docs:
|
|
18
|
+
runs-on: ubuntu-latest
|
|
19
|
+
steps:
|
|
20
|
+
- name: Checkout
|
|
21
|
+
uses: actions/checkout@v3
|
|
22
|
+
- name: Set up Python
|
|
23
|
+
uses: actions/setup-python@v5
|
|
24
|
+
with:
|
|
25
|
+
python-version: "3.11"
|
|
26
|
+
- name: Install dependencies
|
|
27
|
+
run: |
|
|
28
|
+
pip install "napari[all]"
|
|
29
|
+
pip install numpy magicgui qtpy pyperclip
|
|
30
|
+
pip install git+https://github.com/MontpellierRessourcesImagerie/auto-options-python.git
|
|
31
|
+
pip install sphinx sphinx_rtd_theme
|
|
32
|
+
- name: Sphinx build
|
|
33
|
+
run: |
|
|
34
|
+
pip install .
|
|
35
|
+
sphinx-apidoc -T -f -e -o docs/source/ src/autooptions
|
|
36
|
+
cd ./docs
|
|
37
|
+
make html
|
|
38
|
+
cd ..
|
|
39
|
+
- name: Deploy
|
|
40
|
+
uses: peaceiris/actions-gh-pages@v3
|
|
41
|
+
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }}
|
|
42
|
+
with:
|
|
43
|
+
publish_branch: gh-pages
|
|
44
|
+
github_token: ${{ secrets.GITHUB_TOKEN }}
|
|
45
|
+
publish_dir: docs/build/html
|
|
46
|
+
force_orphan: true
|
|
47
|
+
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
# This workflows will upload a Python Package using Twine when a release is created
|
|
2
|
+
# For more information see: https://help.github.com/en/actions/language-and-framework-guides/using-python-with-github-actions#publishing-to-package-registries
|
|
3
|
+
|
|
4
|
+
name: tests
|
|
5
|
+
|
|
6
|
+
on:
|
|
7
|
+
release:
|
|
8
|
+
types: [created]
|
|
9
|
+
workflow_dispatch:
|
|
10
|
+
|
|
11
|
+
jobs:
|
|
12
|
+
test:
|
|
13
|
+
name: ${{ matrix.platform }} py${{ matrix.python-version }}
|
|
14
|
+
runs-on: ${{ matrix.platform }}
|
|
15
|
+
timeout-minutes: 30
|
|
16
|
+
strategy:
|
|
17
|
+
matrix:
|
|
18
|
+
platform: [ubuntu-latest, windows-latest, macos-latest]
|
|
19
|
+
python-version: ["3.10"]
|
|
20
|
+
|
|
21
|
+
steps:
|
|
22
|
+
- uses: actions/checkout@v4
|
|
23
|
+
|
|
24
|
+
- name: Set up Python ${{ matrix.python-version }}
|
|
25
|
+
uses: actions/setup-python@v5
|
|
26
|
+
with:
|
|
27
|
+
python-version: ${{ matrix.python-version }}
|
|
28
|
+
|
|
29
|
+
# these libraries enable testing on Qt on linux
|
|
30
|
+
- uses: tlambert03/setup-qt-libs@v1
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
# note: if you need dependencies from conda, considering using
|
|
34
|
+
# setup-miniconda: https://github.com/conda-incubator/setup-miniconda
|
|
35
|
+
# and
|
|
36
|
+
# tox-conda: https://github.com/tox-dev/tox-conda
|
|
37
|
+
- name: Install dependencies
|
|
38
|
+
run: |
|
|
39
|
+
python -m pip install --upgrade pip
|
|
40
|
+
python -m pip install setuptools tox tox-gh-actions
|
|
41
|
+
|
|
42
|
+
# this runs the platform-specific tests declared in tox.ini
|
|
43
|
+
- name: Test with tox
|
|
44
|
+
uses: aganders3/headless-gui@v2
|
|
45
|
+
with:
|
|
46
|
+
run: python -m tox
|
|
47
|
+
env:
|
|
48
|
+
PLATFORM: ${{ matrix.platform }}
|
|
49
|
+
|
|
50
|
+
- name: Coverage
|
|
51
|
+
uses: codecov/codecov-action@v3
|
|
52
|
+
|
|
53
|
+
deploy:
|
|
54
|
+
# this will run when you have tagged a commit, starting with "v*"
|
|
55
|
+
# and requires that you have put your twine API key in your
|
|
56
|
+
# github secrets (see readme for details)
|
|
57
|
+
needs: [test]
|
|
58
|
+
runs-on: ubuntu-latest
|
|
59
|
+
if: contains(github.ref, 'tags')
|
|
60
|
+
steps:
|
|
61
|
+
- uses: actions/checkout@v4
|
|
62
|
+
- name: Set up Python
|
|
63
|
+
uses: actions/setup-python@v5
|
|
64
|
+
with:
|
|
65
|
+
python-version: "3.x"
|
|
66
|
+
- name: Install dependencies
|
|
67
|
+
run: |
|
|
68
|
+
python -m pip install --upgrade pip
|
|
69
|
+
pip install -U setuptools setuptools_scm wheel twine build
|
|
70
|
+
- name: Build and publish
|
|
71
|
+
env:
|
|
72
|
+
TWINE_USERNAME: __token__
|
|
73
|
+
TWINE_PASSWORD: ${{ secrets.TWINE_API_KEY }}
|
|
74
|
+
run: |
|
|
75
|
+
python -m build .
|
|
76
|
+
twine upload dist/*
|
|
@@ -0,0 +1,213 @@
|
|
|
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
|
+
*_version.py
|
|
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
|
+
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
|
+
|
|
128
|
+
# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
|
|
129
|
+
__pypackages__/
|
|
130
|
+
|
|
131
|
+
# Celery stuff
|
|
132
|
+
celerybeat-schedule
|
|
133
|
+
celerybeat.pid
|
|
134
|
+
|
|
135
|
+
# SageMath parsed files
|
|
136
|
+
*.sage.py
|
|
137
|
+
|
|
138
|
+
# Environments
|
|
139
|
+
.env
|
|
140
|
+
.envrc
|
|
141
|
+
.venv
|
|
142
|
+
env/
|
|
143
|
+
venv/
|
|
144
|
+
ENV/
|
|
145
|
+
env.bak/
|
|
146
|
+
venv.bak/
|
|
147
|
+
|
|
148
|
+
# Spyder project settings
|
|
149
|
+
.spyderproject
|
|
150
|
+
.spyproject
|
|
151
|
+
|
|
152
|
+
# Rope project settings
|
|
153
|
+
.ropeproject
|
|
154
|
+
|
|
155
|
+
# mkdocs documentation
|
|
156
|
+
/site
|
|
157
|
+
|
|
158
|
+
# mypy
|
|
159
|
+
.mypy_cache/
|
|
160
|
+
.dmypy.json
|
|
161
|
+
dmypy.json
|
|
162
|
+
|
|
163
|
+
# Pyre type checker
|
|
164
|
+
.pyre/
|
|
165
|
+
|
|
166
|
+
# pytype static type analyzer
|
|
167
|
+
.pytype/
|
|
168
|
+
|
|
169
|
+
# Cython debug symbols
|
|
170
|
+
cython_debug/
|
|
171
|
+
|
|
172
|
+
# PyCharm
|
|
173
|
+
# JetBrains specific template is maintained in a separate JetBrains.gitignore that can
|
|
174
|
+
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
|
|
175
|
+
# and can be added to the global gitignore or merged into this file. For a more nuclear
|
|
176
|
+
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
|
|
177
|
+
#.idea/
|
|
178
|
+
|
|
179
|
+
# Abstra
|
|
180
|
+
# Abstra is an AI-powered process automation framework.
|
|
181
|
+
# Ignore directories containing user credentials, local state, and settings.
|
|
182
|
+
# Learn more at https://abstra.io/docs
|
|
183
|
+
.abstra/
|
|
184
|
+
|
|
185
|
+
# Visual Studio Code
|
|
186
|
+
# Visual Studio Code specific template is maintained in a separate VisualStudioCode.gitignore
|
|
187
|
+
# that can be found at https://github.com/github/gitignore/blob/main/Global/VisualStudioCode.gitignore
|
|
188
|
+
# and can be added to the global gitignore or merged into this file. However, if you prefer,
|
|
189
|
+
# you could uncomment the following to ignore the entire vscode folder
|
|
190
|
+
# .vscode/
|
|
191
|
+
|
|
192
|
+
# Ruff stuff:
|
|
193
|
+
.ruff_cache/
|
|
194
|
+
|
|
195
|
+
# PyPI configuration file
|
|
196
|
+
.pypirc
|
|
197
|
+
|
|
198
|
+
# Cursor
|
|
199
|
+
# Cursor is an AI-powered code editor. `.cursorignore` specifies files/directories to
|
|
200
|
+
# exclude from AI features like autocomplete and code analysis. Recommended for sensitive data
|
|
201
|
+
# refer to https://docs.cursor.com/context/ignore-files
|
|
202
|
+
.cursorignore
|
|
203
|
+
.cursorindexingignore
|
|
204
|
+
|
|
205
|
+
# Marimo
|
|
206
|
+
marimo/_static/
|
|
207
|
+
marimo/_lsp/
|
|
208
|
+
__marimo__/
|
|
209
|
+
|
|
210
|
+
# ide settings
|
|
211
|
+
.idea
|
|
212
|
+
|
|
213
|
+
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 Montpellier Ressources Imagerie
|
|
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.
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: auto-options-python
|
|
3
|
+
Version: 0.1.4
|
|
4
|
+
Summary: Mange command options in python and create QWidgets for them.
|
|
5
|
+
Author: Volker Baecker
|
|
6
|
+
Author-email: volker.baecker@mri.cnrs.fr
|
|
7
|
+
License: MIT License
|
|
8
|
+
|
|
9
|
+
Copyright (c) 2025 Montpellier Ressources Imagerie
|
|
10
|
+
|
|
11
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
12
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
13
|
+
in the Software without restriction, including without limitation the rights
|
|
14
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
15
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
16
|
+
furnished to do so, subject to the following conditions:
|
|
17
|
+
|
|
18
|
+
The above copyright notice and this permission notice shall be included in all
|
|
19
|
+
copies or substantial portions of the Software.
|
|
20
|
+
|
|
21
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
22
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
23
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
24
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
25
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
26
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
27
|
+
SOFTWARE.
|
|
28
|
+
|
|
29
|
+
Project-URL: Bug Tracker, https://github.com/MontpellierRessourcesImagerie/auto-options-python/issues
|
|
30
|
+
Project-URL: Documentation, https://montpellierressourcesimagerie.github.io/auto-options-python/
|
|
31
|
+
Project-URL: Source Code, https://github.com/MontpellierRessourcesImagerie/auto-options-python
|
|
32
|
+
Project-URL: User Support, https://github.com/MontpellierRessourcesImagerie/auto-options-python/issues
|
|
33
|
+
Classifier: Development Status :: 4 - Beta
|
|
34
|
+
Classifier: Framework :: napari
|
|
35
|
+
Classifier: Intended Audience :: Developers
|
|
36
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
37
|
+
Classifier: Operating System :: OS Independent
|
|
38
|
+
Classifier: Programming Language :: Python
|
|
39
|
+
Classifier: Programming Language :: Python :: 3
|
|
40
|
+
Classifier: Programming Language :: Python :: 3 :: Only
|
|
41
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
42
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
43
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
44
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
45
|
+
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
46
|
+
Requires-Python: >=3.10
|
|
47
|
+
Description-Content-Type: text/markdown
|
|
48
|
+
License-File: LICENSE
|
|
49
|
+
Requires-Dist: appdirs
|
|
50
|
+
Requires-Dist: pyqt5
|
|
51
|
+
Requires-Dist: qtpy
|
|
52
|
+
Requires-Dist: napari
|
|
53
|
+
Requires-Dist: pyperclip
|
|
54
|
+
Requires-Dist: matplotlib
|
|
55
|
+
Dynamic: license-file
|
|
56
|
+
|
|
57
|
+
# auto-options-python
|
|
58
|
+
Mange command options in python and create QWidgets for them.
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
# Minimal makefile for Sphinx documentation
|
|
2
|
+
#
|
|
3
|
+
|
|
4
|
+
# You can set these variables from the command line, and also
|
|
5
|
+
# from the environment for the first two.
|
|
6
|
+
SPHINXOPTS ?=
|
|
7
|
+
SPHINXBUILD ?= sphinx-build
|
|
8
|
+
SOURCEDIR = source
|
|
9
|
+
BUILDDIR = build
|
|
10
|
+
|
|
11
|
+
# Put it first so that "make" without argument is like "make help".
|
|
12
|
+
help:
|
|
13
|
+
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
|
|
14
|
+
|
|
15
|
+
.PHONY: help Makefile
|
|
16
|
+
|
|
17
|
+
# Catch-all target: route all unknown targets to Sphinx using the new
|
|
18
|
+
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
|
|
19
|
+
%: Makefile
|
|
20
|
+
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
@ECHO OFF
|
|
2
|
+
|
|
3
|
+
pushd %~dp0
|
|
4
|
+
|
|
5
|
+
REM Command file for Sphinx documentation
|
|
6
|
+
|
|
7
|
+
if "%SPHINXBUILD%" == "" (
|
|
8
|
+
set SPHINXBUILD=sphinx-build
|
|
9
|
+
)
|
|
10
|
+
set SOURCEDIR=source
|
|
11
|
+
set BUILDDIR=build
|
|
12
|
+
|
|
13
|
+
%SPHINXBUILD% >NUL 2>NUL
|
|
14
|
+
if errorlevel 9009 (
|
|
15
|
+
echo.
|
|
16
|
+
echo.The 'sphinx-build' command was not found. Make sure you have Sphinx
|
|
17
|
+
echo.installed, then set the SPHINXBUILD environment variable to point
|
|
18
|
+
echo.to the full path of the 'sphinx-build' executable. Alternatively you
|
|
19
|
+
echo.may add the Sphinx directory to PATH.
|
|
20
|
+
echo.
|
|
21
|
+
echo.If you don't have Sphinx installed, grab it from
|
|
22
|
+
echo.https://www.sphinx-doc.org/
|
|
23
|
+
exit /b 1
|
|
24
|
+
)
|
|
25
|
+
|
|
26
|
+
if "%1" == "" goto help
|
|
27
|
+
|
|
28
|
+
%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%
|
|
29
|
+
goto end
|
|
30
|
+
|
|
31
|
+
:help
|
|
32
|
+
%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%
|
|
33
|
+
|
|
34
|
+
:end
|
|
35
|
+
popd
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
autooptions package
|
|
2
|
+
===================
|
|
3
|
+
|
|
4
|
+
Submodules
|
|
5
|
+
----------
|
|
6
|
+
|
|
7
|
+
.. toctree::
|
|
8
|
+
:maxdepth: 4
|
|
9
|
+
|
|
10
|
+
autooptions.array_util
|
|
11
|
+
autooptions.napari_util
|
|
12
|
+
autooptions.options
|
|
13
|
+
autooptions.qtutil
|
|
14
|
+
autooptions.widget
|
|
15
|
+
|
|
16
|
+
Module contents
|
|
17
|
+
---------------
|
|
18
|
+
|
|
19
|
+
.. automodule:: autooptions
|
|
20
|
+
:members:
|
|
21
|
+
:undoc-members:
|
|
22
|
+
:show-inheritance:
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
# Configuration file for the Sphinx documentation builder.
|
|
2
|
+
#
|
|
3
|
+
# This file only contains a selection of the most common options. For a full
|
|
4
|
+
# list see the documentation:
|
|
5
|
+
# https://www.sphinx-doc.org/en/master/usage/configuration.html
|
|
6
|
+
|
|
7
|
+
# -- Path setup --------------------------------------------------------------
|
|
8
|
+
|
|
9
|
+
# If extensions (or modules to document with autodoc) are in another directory,
|
|
10
|
+
# add these directories to sys.path here. If the directory is relative to the
|
|
11
|
+
# documentation root, use os.path.abspath to make it absolute, like shown here.
|
|
12
|
+
#
|
|
13
|
+
import os
|
|
14
|
+
import sys
|
|
15
|
+
sys.path.insert(0, os.path.abspath('../../src'))
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
# -- Project information -----------------------------------------------------
|
|
19
|
+
|
|
20
|
+
project = 'napari-autooptions'
|
|
21
|
+
copyright = '2026, INSERM'
|
|
22
|
+
author = 'Volker Baecker, Clement Benedetti'
|
|
23
|
+
|
|
24
|
+
# The full version, including alpha/beta/rc tags
|
|
25
|
+
release = 'v0.1'
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
# -- General configuration ---------------------------------------------------
|
|
29
|
+
|
|
30
|
+
# Add any Sphinx extension module names here, as strings. They can be
|
|
31
|
+
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
|
|
32
|
+
# ones.
|
|
33
|
+
extensions = [
|
|
34
|
+
'sphinx.ext.autodoc',
|
|
35
|
+
'sphinx.ext.linkcode'
|
|
36
|
+
]
|
|
37
|
+
|
|
38
|
+
# Add any paths that contain templates here, relative to this directory.
|
|
39
|
+
templates_path = ['_templates']
|
|
40
|
+
|
|
41
|
+
# List of patterns, relative to source directory, that match files and
|
|
42
|
+
# directories to ignore when looking for source files.
|
|
43
|
+
# This pattern also affects html_static_path and html_extra_path.
|
|
44
|
+
exclude_patterns = []
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
# -- Options for HTML output -------------------------------------------------
|
|
48
|
+
|
|
49
|
+
# The theme to use for HTML and HTML Help pages. See the documentation for
|
|
50
|
+
# a list of builtin themes.
|
|
51
|
+
#
|
|
52
|
+
#html_theme = 'alabaster'
|
|
53
|
+
html_theme = "sphinx_rtd_theme"
|
|
54
|
+
|
|
55
|
+
# Add any paths that contain custom static files (such as style sheets) here,
|
|
56
|
+
# relative to this directory. They are copied after the builtin static files,
|
|
57
|
+
# so a file named "default.css" will overwrite the builtin "default.css".
|
|
58
|
+
html_static_path = ['_static']
|
|
59
|
+
|
|
60
|
+
# Options for the linkcode extension
|
|
61
|
+
# ----------------------------------
|
|
62
|
+
# Resolve function
|
|
63
|
+
# This function is used to populate the (source) links in the API
|
|
64
|
+
def linkcode_resolve(domain, info):
|
|
65
|
+
def find_source():
|
|
66
|
+
# try to find the file and line number, based on code from numpy:
|
|
67
|
+
# https://github.com/numpy/numpy/blob/master/doc/source/conf.py#L286
|
|
68
|
+
obj = sys.modules[info['module']]
|
|
69
|
+
for part in info['fullname'].split('.'):
|
|
70
|
+
obj = getattr(obj, part)
|
|
71
|
+
import inspect
|
|
72
|
+
import os
|
|
73
|
+
fn = inspect.getsourcefile(obj)
|
|
74
|
+
fn = os.path.relpath(fn, start=os.path.abspath('..'))
|
|
75
|
+
source, lineno = inspect.getsourcelines(obj)
|
|
76
|
+
return fn, lineno, lineno + len(source) - 1
|
|
77
|
+
|
|
78
|
+
if domain != 'py' or not info['module']:
|
|
79
|
+
return None
|
|
80
|
+
try:
|
|
81
|
+
filename = '%s#L%d-L%d' % find_source()
|
|
82
|
+
except Exception:
|
|
83
|
+
filename = info['module'].replace('.', '/') + '.py'
|
|
84
|
+
return "https://github.com/MontpellierRessourcesImagerie/auto-options-python/blob/main/%s" % (filename)
|
|
85
|
+
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
Introduction
|
|
2
|
+
============
|
|
3
|
+
.. figure:: https://dev.mri.cnrs.fr/attachments/download/4544/autooptions_conv.png
|
|
4
|
+
:width: 250
|
|
5
|
+
:align: center
|
|
6
|
+
:alt: the napari-bigfish plugin
|
|
7
|
+
|
|
8
|
+
Fig. 1.1 - A simple dialog created with autooptions
|
|
9
|
+
|
|
10
|
+
Autooptions allows to create options for operations in napari, in a simple way. Autooptions automatically saves and
|
|
11
|
+
loads non transient options. It can create a dialog from the options, in which the user can change the values of the
|
|
12
|
+
options. It updates combo-boxes containing layers of a given type when layers of that type are added or removed in
|
|
13
|
+
napari. The user can provide callbacks that are called when the value of an option changes.
|
|
14
|
+
|
|
15
|
+
The option types currently supported are:
|
|
16
|
+
|
|
17
|
+
- Image
|
|
18
|
+
- FFT (specific to 3D-toolbox)
|
|
19
|
+
- Labels
|
|
20
|
+
- Points
|
|
21
|
+
- Int
|
|
22
|
+
- Float
|
|
23
|
+
- Choice
|
|
24
|
+
- String
|
|
25
|
+
- Boolean
|
|
26
|
+
|
|
27
|
+
The layer types (FFT, Labels, Points and Image) and Choice will be represented via combo-boxes in the dialog. Boolean
|
|
28
|
+
is using a checkbox and the others are using input fields.
|
|
29
|
+
|
|
30
|
+
The code to create the options-dialog in Fig.1.1 is:
|
|
31
|
+
|
|
32
|
+
.. code-block:: python
|
|
33
|
+
|
|
34
|
+
import napari
|
|
35
|
+
from autooptions.options import Options
|
|
36
|
+
from autooptions.widget import OptionsWidget
|
|
37
|
+
|
|
38
|
+
options = Options("3D Toolbox", "Convolution")
|
|
39
|
+
options.addImage()
|
|
40
|
+
option.addImage(name="kernel")
|
|
41
|
+
options.addChoice("mode", choices=["same", "valid", "full"])
|
|
42
|
+
options.addChoice("method", choices=["auto", "direct", "fft"])
|
|
43
|
+
options.load()
|
|
44
|
+
widget = OptionsWidget(self.viewer, self.options, self)
|
|
45
|
+
widget.addApplyButton(None)
|
|
46
|
+
viewer = napari.Viewer()
|
|
47
|
+
viewer.window.add_dock_widget(widget, name=options.optionsName)
|