spam-gui 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.
- spam_gui-0.1.0/.gitignore +6 -0
- spam_gui-0.1.0/.gitlab-ci.yml +14 -0
- spam_gui-0.1.0/CLAUDE.md +62 -0
- spam_gui-0.1.0/LICENSE.md +601 -0
- spam_gui-0.1.0/OPEN_QUESTIONS.md +28 -0
- spam_gui-0.1.0/PKG-INFO +172 -0
- spam_gui-0.1.0/README.md +141 -0
- spam_gui-0.1.0/SPEC.md +580 -0
- spam_gui-0.1.0/TODO.md +38 -0
- spam_gui-0.1.0/TO_SPAM.md +159 -0
- spam_gui-0.1.0/pyproject.toml +52 -0
- spam_gui-0.1.0/scripts/pages.py +246 -0
- spam_gui-0.1.0/scripts/screenshots.py +271 -0
- spam_gui-0.1.0/setup.cfg +4 -0
- spam_gui-0.1.0/specs/TEMPLATE.md +76 -0
- spam_gui-0.1.0/specs/common-steps.md +84 -0
- spam_gui-0.1.0/specs/modules/ereg.md +82 -0
- spam_gui-0.1.0/specs/modules/mmr.md +232 -0
- spam_gui-0.1.0/src/spam_gui/__init__.py +31 -0
- spam_gui-0.1.0/src/spam_gui/app.py +98 -0
- spam_gui-0.1.0/src/spam_gui/core/__init__.py +19 -0
- spam_gui-0.1.0/src/spam_gui/core/io.py +186 -0
- spam_gui-0.1.0/src/spam_gui/core/parts.py +407 -0
- spam_gui-0.1.0/src/spam_gui/core/phi.py +136 -0
- spam_gui-0.1.0/src/spam_gui/core/volumes.py +639 -0
- spam_gui-0.1.0/src/spam_gui/gui/__init__.py +19 -0
- spam_gui-0.1.0/src/spam_gui/gui/busy.py +114 -0
- spam_gui-0.1.0/src/spam_gui/gui/controls.py +510 -0
- spam_gui-0.1.0/src/spam_gui/gui/dialogs.py +154 -0
- spam_gui-0.1.0/src/spam_gui/gui/layers.py +68 -0
- spam_gui-0.1.0/src/spam_gui/gui/plotting.py +68 -0
- spam_gui-0.1.0/src/spam_gui/gui/points.py +244 -0
- spam_gui-0.1.0/src/spam_gui/gui/steps.py +479 -0
- spam_gui-0.1.0/src/spam_gui/gui/widgets.py +525 -0
- spam_gui-0.1.0/src/spam_gui/gui/window.py +750 -0
- spam_gui-0.1.0/src/spam_gui/gui/windows.py +1170 -0
- spam_gui-0.1.0/src/spam_gui/modules/__init__.py +27 -0
- spam_gui-0.1.0/src/spam_gui/modules/common/__init__.py +16 -0
- spam_gui-0.1.0/src/spam_gui/modules/common/twoimages.py +1719 -0
- spam_gui-0.1.0/src/spam_gui/modules/ereg.py +163 -0
- spam_gui-0.1.0/src/spam_gui/modules/mmr.py +2624 -0
- spam_gui-0.1.0/src/spam_gui/napari.yaml +11 -0
- spam_gui-0.1.0/src/spam_gui/panel.py +44 -0
- spam_gui-0.1.0/src/spam_gui/phases.py +131 -0
- spam_gui-0.1.0/src/spam_gui/resources/spam-horizontal.png +0 -0
- spam_gui-0.1.0/src/spam_gui/resources/spam-logo.png +0 -0
- spam_gui-0.1.0/src/spam_gui/settings.py +65 -0
- spam_gui-0.1.0/src/spam_gui/tospam/DIC/__init__.py +19 -0
- spam_gui-0.1.0/src/spam_gui/tospam/DIC/multimodalSteps.py +354 -0
- spam_gui-0.1.0/src/spam_gui/tospam/__init__.py +25 -0
- spam_gui-0.1.0/src/spam_gui.egg-info/PKG-INFO +172 -0
- spam_gui-0.1.0/src/spam_gui.egg-info/SOURCES.txt +69 -0
- spam_gui-0.1.0/src/spam_gui.egg-info/dependency_links.txt +1 -0
- spam_gui-0.1.0/src/spam_gui.egg-info/entry_points.txt +5 -0
- spam_gui-0.1.0/src/spam_gui.egg-info/requires.txt +10 -0
- spam_gui-0.1.0/src/spam_gui.egg-info/scm_file_list.json +65 -0
- spam_gui-0.1.0/src/spam_gui.egg-info/scm_version.json +8 -0
- spam_gui-0.1.0/src/spam_gui.egg-info/top_level.txt +1 -0
- spam_gui-0.1.0/tests/conftest.py +17 -0
- spam_gui-0.1.0/tests/gui/closing.py +75 -0
- spam_gui-0.1.0/tests/gui/ereg.py +171 -0
- spam_gui-0.1.0/tests/gui/screens.py +89 -0
- spam_gui-0.1.0/tests/gui/sizes.py +165 -0
- spam_gui-0.1.0/tests/gui/workflow.py +672 -0
- spam_gui-0.1.0/tests/test_app.py +42 -0
- spam_gui-0.1.0/tests/test_gui.py +65 -0
- spam_gui-0.1.0/tests/test_layers.py +136 -0
- spam_gui-0.1.0/tests/test_multimodalSteps.py +79 -0
- spam_gui-0.1.0/tests/test_parts.py +304 -0
- spam_gui-0.1.0/tests/test_settings.py +46 -0
- spam_gui-0.1.0/tests/test_volumes.py +246 -0
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
# The website of the docs (the Markdown files of the repository, as pages to review in a browser), published by
|
|
2
|
+
# GitLab Pages on each push to the default branch. Made by scripts/pages.py; to look at it locally:
|
|
3
|
+
# pip install -e ".[dev]" && python scripts/pages.py (then open public/index.html)
|
|
4
|
+
|
|
5
|
+
pages:
|
|
6
|
+
image: python:3.12-slim
|
|
7
|
+
script:
|
|
8
|
+
- pip install --quiet markdown-it-py mdit-py-plugins
|
|
9
|
+
- python scripts/pages.py public
|
|
10
|
+
artifacts:
|
|
11
|
+
paths:
|
|
12
|
+
- public
|
|
13
|
+
rules:
|
|
14
|
+
- if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
|
spam_gui-0.1.0/CLAUDE.md
ADDED
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
# spam-gui
|
|
2
|
+
|
|
3
|
+
Graphical modules for spam (Software for the Practical Analysis of Materials) in a napari window, packaged as `spam_gui`
|
|
4
|
+
(command `spam-gui`). The multimodal registration (`src/spam_gui/modules/mmr.py`) is the first module and the reference
|
|
5
|
+
implementation. More modules will follow; the code is being reorganised for them (SPEC.md section 3.4).
|
|
6
|
+
|
|
7
|
+
## Before any change to a module or to the window
|
|
8
|
+
|
|
9
|
+
spam-gui is made of **modules** (e.g., the multimodal registration): never call them « tools ». A Python file
|
|
10
|
+
is a « file », a part of spam (`spam.DIC`) a « spam package » (SPEC.md, « Words »).
|
|
11
|
+
|
|
12
|
+
Read [SPEC.md](SPEC.md) first, and follow it. It describes what is common to all the modules: how a module is built, how
|
|
13
|
+
the window looks and behaves, how large images are handled, how changes are tested, and how to work with the
|
|
14
|
+
maintainers. Its checklist (section 8) defines when a module is done.
|
|
15
|
+
|
|
16
|
+
Then read the spec of the module concerned, `specs/modules/<module>.md` (e.g., [specs/modules/mmr.md](specs/modules/mmr.md)):
|
|
17
|
+
what the module does, its steps, its state, and the decisions already taken for it, which must not be undone.
|
|
18
|
+
|
|
19
|
+
A new module starts with its spec: copy [specs/TEMPLATE.md](specs/TEMPLATE.md) to `specs/modules/<module>.md` and fill it
|
|
20
|
+
in with the maintainer before writing code.
|
|
21
|
+
|
|
22
|
+
## Rules that always apply
|
|
23
|
+
|
|
24
|
+
- Never change spam's algorithms: the modules call spam as it is. If a result from spam looks wrong, explain why and offer
|
|
25
|
+
options.
|
|
26
|
+
- No image analysis in spam-gui: it calls spam. spam-gui must work with the released spam (0.9.1 or later); an analysis
|
|
27
|
+
function the released spam lacks goes in `src/spam_gui/tospam/` (in folders as spam's, e.g. `tospam/DIC/` for
|
|
28
|
+
`spam.DIC`; written as in spam, without Qt, napari or other spam-gui files), and is listed in
|
|
29
|
+
[TO_SPAM.md](TO_SPAM.md). Check spam first, and ask the maintainer before writing one (SPEC.md section 1).
|
|
30
|
+
- Everything that concerns spam goes in [TO_SPAM.md](TO_SPAM.md) only, documented enough to hand to spam's developers
|
|
31
|
+
(a problem: how to reproduce it, the cause, a fix): nothing else, and no workaround in spam-gui.
|
|
32
|
+
- Don't commit unless asked, and don't offer to: the maintainer handles commits.
|
|
33
|
+
- Work on an up-to-date branch. At the start of a session, before starting a piece of work, and regularly during long
|
|
34
|
+
work: `git fetch`, then `git status -sb`. If the branch is behind its remote (or `main` moved on, for a feature
|
|
35
|
+
branch), say so at once and ask before going on; don't pull, merge or rebase yourself.
|
|
36
|
+
- Check in often: give short updates, stop at each milestone with a screenshot and wait for feedback. When a placement
|
|
37
|
+
or a look is ambiguous, ask with two or three options, each with a small ASCII sketch.
|
|
38
|
+
- Keep the module's spec up to date: decisions taken with the maintainer go in its « Decisions », with their reason
|
|
39
|
+
(« (to confirm) » when it is not known: don't invent one).
|
|
40
|
+
- Keep [TODO.md](TODO.md) up to date: the work planned, in order; mark an item done (with its date) when it is.
|
|
41
|
+
- Keep [OPEN_QUESTIONS.md](OPEN_QUESTIONS.md) up to date: one line for each « to confirm » or « to decide », pointing to
|
|
42
|
+
the details; once answered, write the answer where it belongs and delete the line.
|
|
43
|
+
|
|
44
|
+
## Commands
|
|
45
|
+
|
|
46
|
+
- Tests: `pytest tests`. The window test, which opens the window for about a minute:
|
|
47
|
+
`SPAM_GUI_TESTS=1 pytest tests/test_gui.py`.
|
|
48
|
+
- Lint: `pyflakes src tests` (should report nothing).
|
|
49
|
+
- Run the venv's modules (`python -m pytest`, `python -m pyflakes`): a `pytest` from another environment may be first on
|
|
50
|
+
the PATH.
|
|
51
|
+
- Window test and screenshots on a virtual screen (xvfb), unseen, with napari settings of their own (else the
|
|
52
|
+
maintainer's saved window size is used, and changed):
|
|
53
|
+
`xvfb-run -a -s "-screen 0 1920x1080x24" env NAPARI_CONFIG=<tmp>/settings.yaml QT_QPA_PLATFORM=xcb LIBGL_ALWAYS_SOFTWARE=1 <command>`.
|
|
54
|
+
Check at least 1366×768, 1920×1080 and 3840×2160, both themes, each step with images loaded.
|
|
55
|
+
- Every window test (workflow, sizes, closing) at the three sizes, several at once (about 50 s):
|
|
56
|
+
`python tests/gui/screens.py`. While iterating, one size or one test (`python tests/gui/screens.py 1920x1080`,
|
|
57
|
+
`--only workflow`); all of them before reporting.
|
|
58
|
+
- Screenshots to look at (each step, three sizes, both themes; about 40 s): `python scripts/screenshots.py` (into `public/screenshots/`, with a page showing them: `public/screenshots/index.html`).
|
|
59
|
+
A new feature, module, step or window adds its own there, named `<module>-<step number>-<step title>[-<variant>]`.
|
|
60
|
+
- The docs as a website (the root Markdown files and `specs/`, published by GitLab Pages on each push to the default
|
|
61
|
+
branch): `python scripts/pages.py`, then open `public/index.html`. Keep links between Markdown files relative
|
|
62
|
+
(e.g., `[SPEC.md](SPEC.md#9-decisions)`): they become links between pages.
|