Repository navigation
smappy: one command, with gui options, info and convert - #184
Merged
Merged
Conversation
Every argument was a file to open: `smappy-gui -h` opened the windows and failed to read a file called "-h". Now argparse reads them, with --help and --version, and three options that do at the start what the menus do: --workspace (File > Workspace > Open), --restore (File > Open and restore) and --open PLUGIN, a plugin in a window of its own, by its path or its name. A missing file, a plugin no one has or --restore on anything but one smappy HDF5 file is said in the terminal before any window opens. The GUI's main takes the options as arguments; `start_with` does them in the windows, so a test can. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
`info` says what a file holds -- its files, each one's localizations, pixel size and frame time, the cameras, the columns, the ROIs and the results -- read through a Session as the GUI reads it, so a SMAP or smappy file of several files is shown as those files. It is the check that otherwise means opening the file and looking. `convert` writes it as File > Save does (smappy HDF5, the default: files, cameras, ROIs and results kept) or as Save localizations does (csv, ThunderSTORM, Picasso: every localization and column), and says what those formats cannot hold. It names its output after the input with the reader's suffix off (X_sml.mat -> X.hdf5), and writes over no file unless --force, and never over the one it reads. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
`smappy gui`, `smappy info`, `smappy convert`, `smappy fit`, `smappy batch` and the rest: each subcommand is the module its smappy-xxx script runs, given the rest of the line, so `smappy fit -h` is `smappy-fit -h` and the usage lines say `smappy fit`. `smappy -h` lists them all without importing Qt, numpy or torch; a mistyped one is answered with the nearest. `python -m smappy` is the same, for an environment whose scripts are not on the PATH. The smappy-xxx names stay: scripts, MCP clients' settings and the batch window start them by those, and a test holds each to its command. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
smappynames everything SMAPpy runs from a terminal, and two new commands do what otherwise needs a script or a window.smappy--smappy gui,smappy info,smappy convert,smappy fit,smappy batch, ... Each subcommand is the module itssmappy-xxxscript runs, given the rest of the line, sosmappy fit -hissmappy-fit -hand its usage line sayssmappy fit.smappy -hlists them without importing Qt, numpy or torch; a mistyped one is answered with the nearest.python -m smappyis the same. Thesmappy-xxxnames stay -- scripts, MCP clients and the batch window start them by those -- and a test holds each to its command.smappy guireads its options. Every argument used to be a file to open:smappy-gui -hopened the windows and failed to read a file called "-h". Now argparse reads them, with--helpand--version, and:--workspace FILE.yaml-- start with a saved workspace (File > Workspace > Open)--restore-- one smappy HDF5 file, with its saved session (File > Open and restore)--open PLUGIN-- a plugin in a window of its own, by its path or its name (--open RCC), repeatableA missing file, an unknown plugin or a misused option is said in the terminal before any window opens. The handoff (
--handoff) and the updater's restart start it as before.smappy info FILE ...-- what a file holds: its files with their localizations, pixel size and frame time, the cameras, the columns, the ROIs and results. Read through aSession, so a SMAP or smappy file of several files shows as those files.smappy convert IN [OUT]-- smappy HDF5 by default, beside the input (X_sml.mat->X.hdf5), keeping the files, cameras, ROIs and results;--format csv | ThunderSTORM | Picassothrough Save localizations, every localization and column, saying what the format cannot hold. Writes over nothing without--force, and never over its input.Three commits: the GUI's options,
infoandconvert, thensmappyover them all and a README section.--slow -n auto: 3648 passed, 5 failed, 30 skippedtest_fit_decode, the DECODE pages intest_plugin_docs/test_panel_docs), which need torch: not installed here, and they fail the same onmain.test_drop_files::test_a_stack_goes_to_the_fitter_open_on_the_localize_tabfailed once under-n auto; it passes alone three times and with its file, on this branch and onmain.Tried by hand:
infoandconverton a real 18-file SMAP_sml.mat(2.9 M localizations, 50 sites) and its converted HDF5, which give the same summary; the GUI started offscreen on it with--open RCC --open "Analysis/Drift/COMET"ran without an error.🤖 Generated with Claude Code