juxt 1.1.2__tar.gz → 1.3.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.
@@ -1,6 +1,6 @@
1
- Metadata-Version: 2.4
1
+ Metadata-Version: 2.5
2
2
  Name: juxt
3
- Version: 1.1.2
3
+ Version: 1.3.0
4
4
  Summary: Fast desktop tool for navigating N-dimensional hypercubes of plots
5
5
  Project-URL: Homepage, https://github.com/ColinMoldenhauer/juxt
6
6
  Project-URL: Documentation, https://juxt.readthedocs.io
@@ -73,6 +73,8 @@ juxt config.yaml # explicit config file
73
73
 
74
74
  For directory and remote-directory modes, filenames are split on separators (`_` and `/` by default) and any position with more than one distinct value becomes an axis. You'll be prompted to name the axes on first run; use `-a` to skip.
75
75
 
76
+ Run `juxt` with no argument and it opens a dialog instead: a **Browse** tab for picking a directory (auto-discover), and a **Build path** tab for typing a `{placeholder}` template by hand, with `Tab` completing real directories and files along the way.
77
+
76
78
  ## Config
77
79
 
78
80
  ### Auto-discover mode
@@ -152,6 +154,33 @@ Use `:mode tap|seek|pin` in the command bar to switch navigation modes.
152
154
 
153
155
  Press `:` to open the command bar (vim-style). Tab-completion narrows candidates as you type.
154
156
 
157
+ Path arguments complete with `{placeholders}` in place: `:pattern plots/{sensor}/2⇥` lists what every sensor directory holds, so a template is built top-down instead of completing a concrete path and deleting the parts that should vary. `{` + `Tab` completes an existing axis name, and anonymous `{}` placeholders are numbered automatically.
158
+
159
+ ## Shell completion
160
+
161
+ The same completion works at the shell prompt. Add one line to `~/.bashrc`:
162
+
163
+ ```bash
164
+ eval "$(juxt --bash-completion)"
165
+ ```
166
+
167
+ zsh needs `bashcompinit` first:
168
+
169
+ ```zsh
170
+ autoload -U bashcompinit && bashcompinit
171
+ eval "$(juxt --bash-completion)"
172
+ ```
173
+
174
+ Then `juxt plots/{sensor}/2⇥` completes at the prompt, as do the command-line options. ble.sh is handled as well, through its own hook. Reload the shell (`source ~/.bashrc`, or open a new terminal) for it to take effect.
175
+
176
+ Point `JUXT_COMPLETE` at `juxt-complete` if juxt lives in a virtualenv you do not activate:
177
+
178
+ ```bash
179
+ export JUXT_COMPLETE=~/env/juxt/bin/juxt-complete
180
+ ```
181
+
182
+ Placeholders standing for a known kind of value complete only as far as that value: `plots/{date}⇥` stops at `plots/{date}_` rather than swallowing the rest of the filename. The names that count are the ones listed under `placeholders:` in `~/.juxt/settings.yaml`, which juxt seeds with `date datetime time year month day doy` — edit or delete them, and completion follows. Date-style shorthands such as `{yyyy-mm-dd}` are recognised on sight, with or without an entry.
183
+
155
184
  | Command | Action |
156
185
  |---|---|
157
186
  | `:q` | quit |
@@ -159,7 +188,13 @@ Press `:` to open the command bar (vim-style). Tab-completion narrows candidates
159
188
  | `:fit height` / `:fit width` | fit to height or width |
160
189
  | `:zoom N` | set zoom to N% |
161
190
  | `:fullscreen` | toggle fullscreen |
162
- | `:mode twin\|multi\|case` | switch navigation mode |
191
+ | `:mode tap\|seek\|pin` | switch navigation mode |
192
+ | `:grid [AXIS]` | tile an axis into a grid of viewports |
193
+ | `:grid AXIS VAL …` | grid with a value subset |
194
+ | `:grid-dialog` | open the grid builder dialogue (`Ctrl+Shift+G`) |
195
+ | `:grid-layout NxM` | change grid layout without exiting |
196
+ | `:ungrid` | return to single-image view |
197
+ | `:grid-sharex` / `:grid-sharey` | toggle synchronized pan/zoom |
163
198
 
164
199
  ## Controls
165
200
 
@@ -177,4 +212,6 @@ Press `:` to open the command bar (vim-style). Tab-completion narrows candidates
177
212
  | Key | Action |
178
213
  |---|---|
179
214
  | `Enter` | toggle fullscreen |
180
- | `Ctrl+H` | toggle status bar |
215
+ | `Ctrl+Shift+H` | toggle status bar |
216
+ | `Ctrl+Shift+I` | toggle info sidebar |
217
+ | `Ctrl+Shift+G` | open the grid builder dialogue |
@@ -40,6 +40,8 @@ juxt config.yaml # explicit config file
40
40
 
41
41
  For directory and remote-directory modes, filenames are split on separators (`_` and `/` by default) and any position with more than one distinct value becomes an axis. You'll be prompted to name the axes on first run; use `-a` to skip.
42
42
 
43
+ Run `juxt` with no argument and it opens a dialog instead: a **Browse** tab for picking a directory (auto-discover), and a **Build path** tab for typing a `{placeholder}` template by hand, with `Tab` completing real directories and files along the way.
44
+
43
45
  ## Config
44
46
 
45
47
  ### Auto-discover mode
@@ -119,6 +121,33 @@ Use `:mode tap|seek|pin` in the command bar to switch navigation modes.
119
121
 
120
122
  Press `:` to open the command bar (vim-style). Tab-completion narrows candidates as you type.
121
123
 
124
+ Path arguments complete with `{placeholders}` in place: `:pattern plots/{sensor}/2⇥` lists what every sensor directory holds, so a template is built top-down instead of completing a concrete path and deleting the parts that should vary. `{` + `Tab` completes an existing axis name, and anonymous `{}` placeholders are numbered automatically.
125
+
126
+ ## Shell completion
127
+
128
+ The same completion works at the shell prompt. Add one line to `~/.bashrc`:
129
+
130
+ ```bash
131
+ eval "$(juxt --bash-completion)"
132
+ ```
133
+
134
+ zsh needs `bashcompinit` first:
135
+
136
+ ```zsh
137
+ autoload -U bashcompinit && bashcompinit
138
+ eval "$(juxt --bash-completion)"
139
+ ```
140
+
141
+ Then `juxt plots/{sensor}/2⇥` completes at the prompt, as do the command-line options. ble.sh is handled as well, through its own hook. Reload the shell (`source ~/.bashrc`, or open a new terminal) for it to take effect.
142
+
143
+ Point `JUXT_COMPLETE` at `juxt-complete` if juxt lives in a virtualenv you do not activate:
144
+
145
+ ```bash
146
+ export JUXT_COMPLETE=~/env/juxt/bin/juxt-complete
147
+ ```
148
+
149
+ Placeholders standing for a known kind of value complete only as far as that value: `plots/{date}⇥` stops at `plots/{date}_` rather than swallowing the rest of the filename. The names that count are the ones listed under `placeholders:` in `~/.juxt/settings.yaml`, which juxt seeds with `date datetime time year month day doy` — edit or delete them, and completion follows. Date-style shorthands such as `{yyyy-mm-dd}` are recognised on sight, with or without an entry.
150
+
122
151
  | Command | Action |
123
152
  |---|---|
124
153
  | `:q` | quit |
@@ -126,7 +155,13 @@ Press `:` to open the command bar (vim-style). Tab-completion narrows candidates
126
155
  | `:fit height` / `:fit width` | fit to height or width |
127
156
  | `:zoom N` | set zoom to N% |
128
157
  | `:fullscreen` | toggle fullscreen |
129
- | `:mode twin\|multi\|case` | switch navigation mode |
158
+ | `:mode tap\|seek\|pin` | switch navigation mode |
159
+ | `:grid [AXIS]` | tile an axis into a grid of viewports |
160
+ | `:grid AXIS VAL …` | grid with a value subset |
161
+ | `:grid-dialog` | open the grid builder dialogue (`Ctrl+Shift+G`) |
162
+ | `:grid-layout NxM` | change grid layout without exiting |
163
+ | `:ungrid` | return to single-image view |
164
+ | `:grid-sharex` / `:grid-sharey` | toggle synchronized pan/zoom |
130
165
 
131
166
  ## Controls
132
167
 
@@ -144,4 +179,6 @@ Press `:` to open the command bar (vim-style). Tab-completion narrows candidates
144
179
  | Key | Action |
145
180
  |---|---|
146
181
  | `Enter` | toggle fullscreen |
147
- | `Ctrl+H` | toggle status bar |
182
+ | `Ctrl+Shift+H` | toggle status bar |
183
+ | `Ctrl+Shift+I` | toggle info sidebar |
184
+ | `Ctrl+Shift+G` | open the grid builder dialogue |
@@ -7,10 +7,23 @@ import socket
7
7
  import sys
8
8
  from pathlib import Path
9
9
 
10
- from PySide6.QtCore import Qt, QSocketNotifier, QTimer
11
- from PySide6.QtGui import QCursor, QIcon
12
- from PySide6.QtWidgets import QApplication, QFileDialog, QInputDialog, QLineEdit, QProgressDialog
13
-
10
+ from .complete import SCRIPT_FLAGS, WORDS_FLAG, normalize_template
11
+ from .complete import main as _complete_main
12
+
13
+ # Shell completion runs on every Tab press, so answer it here — before Qt is
14
+ # imported — which also lets `juxt` itself back the completion when the
15
+ # standalone binary is all a user has installed.
16
+ if len(sys.argv) > 1 and sys.argv[1] in (*SCRIPT_FLAGS, WORDS_FLAG):
17
+ sys.exit(_complete_main(sys.argv[1:]))
18
+
19
+ from PySide6.QtCore import Qt, QSocketNotifier, QTimer # noqa: E402
20
+ from PySide6.QtGui import QCursor, QIcon # noqa: E402
21
+ from PySide6.QtWidgets import ( # noqa: E402
22
+ QApplication,
23
+ QInputDialog,
24
+ QLineEdit,
25
+ QProgressDialog,
26
+ )
14
27
  from .config import Config, _auto_keys, dump_config, load_config
15
28
  from .detect import (
16
29
  _axes_from_local_template,
@@ -24,6 +37,7 @@ from .detect import (
24
37
  )
25
38
  from .loader import preload, preload_remote
26
39
  from .settings import load_settings
40
+ from .startup import StartupDialog
27
41
  from .viewer import MainWindow
28
42
 
29
43
  log = logging.getLogger(__name__)
@@ -97,11 +111,37 @@ def _print_help() -> None:
97
111
  "",
98
112
  "keys (all modes)",
99
113
  None, # horizontal rule
100
- "↑ ↓ ← → navigate axes",
101
- "Space toggle between two positions",
102
- "1–9 jump to Nth value on active axis",
103
- ": command mode (:fit :zoom N :q)",
104
- "Ctrl+H toggle status bar",
114
+ "↑ ↓ ← → navigate axes",
115
+ "Space toggle between two positions",
116
+ "Home / End first / last value on active axis",
117
+ "1–9 jump to Nth value on active axis",
118
+ "Enter toggle fullscreen",
119
+ "Escape exit fullscreen / cancel",
120
+ ": command mode (:fit :zoom N :q)",
121
+ "Ctrl+C cancel command / value picker",
122
+ "Ctrl+Shift+H toggle status bar",
123
+ "Ctrl+Shift+I toggle info sidebar",
124
+ "Ctrl+Shift+G open the grid builder",
125
+ "",
126
+ "view controls",
127
+ None, # horizontal rule
128
+ "0 reset zoom to 100%",
129
+ "double-click fit image to window",
130
+ "drag pan the image",
131
+ "wheel step the ←/→ axis",
132
+ "Shift+wheel step the ↑/↓ axis",
133
+ "Ctrl+wheel zoom under the cursor",
134
+ "",
135
+ "mode keys",
136
+ None, # horizontal rule
137
+ "tap letter +1 on that axis (Letter = −1)",
138
+ " Ctrl+letter open value picker",
139
+ "seek letter incremental axis → value search",
140
+ "pin letter focus axis, then use arrows",
141
+ " Ctrl+letter open value picker",
142
+ "",
143
+ "Key bindings are configurable in",
144
+ "~/.juxt/settings.yaml (also via :settings).",
105
145
  "",
106
146
  ]
107
147
  pad = 2
@@ -123,10 +163,11 @@ def _print_help() -> None:
123
163
  PATH accepts several forms (auto-detected):
124
164
  /path/to/dir scan directory, detect axes from filenames
125
165
  plots/{sensor}_{date}.png local template with explicit placeholders
166
+ plots/{}/{}.png anonymous placeholders, named axis_1, axis_2, …
126
167
  host:/path/to/dir remote directory over SSH (requires juxt[ssh])
127
168
  host:/path/{sensor}.png remote template over SSH (requires juxt[ssh])
128
169
  config.yaml explicit YAML config file
129
- (default: opens a directory picker)
170
+ (default: opens a dialog to browse a directory or build a template)
130
171
 
131
172
  -s, --separator SEP [...] separator(s) for auto-detection
132
173
  -a, --auto skip axis naming prompt
@@ -138,12 +179,29 @@ def _print_help() -> None:
138
179
  --axis-v NAME lock ↑/↓ to this axis on startup
139
180
  --squeeze drop axes with only one value
140
181
  --name NAME session name shown in window title (default: template basename)
182
+
183
+ grid view
184
+ --grid AXIS enter grid view for AXIS on startup
185
+ (or build one in the UI with Ctrl+Shift+G)
186
+ --grid-values VAL ... show only these values in the grid (requires --grid)
187
+ --grid-layout NxM explicit grid layout, e.g. 2x3 (requires --grid)
188
+ --no-sharex disable synchronized horizontal pan/zoom in grid view
189
+ --no-sharey disable synchronized vertical pan/zoom in grid view
141
190
  -h, --help show this message and exit
142
191
 
143
- navigation modes (switch with :mode)
144
- tap letter=+1/LETTER=-1 on that axis (default)
145
- seek type to search axes and values by prefix
146
- pin letter focuses axis; arrows navigate""")
192
+ shell completion (bash / zsh)
193
+ eval "$(juxt --bash-completion)" complete options and {placeholder} paths
194
+
195
+ commands (press : in the viewer, Tab completes)
196
+ :fit :fit-width :fit-height :zoom N :fullscreen
197
+ :grid AXIS [VALUES|NxM] :grid-dialog :grid-layout NxM :ungrid
198
+ :grid-sharex on|off :grid-sharey on|off
199
+ :axis-h NAME :axis-v NAME :axis-auto :swap-axes
200
+ :mode tap|seek|pin :switch-last :info
201
+ :pattern PATH :reload :watch true|false
202
+ :remove-axis NAME :remove-value AXIS VALUE
203
+ :change-key AXIS LETTER :settings
204
+ :copy-image :copy-path :write [PATH] :quit""")
147
205
 
148
206
 
149
207
  class _HelpAction(argparse.Action):
@@ -170,6 +228,14 @@ def _parse_args() -> argparse.Namespace:
170
228
  p.add_argument("--axis-v", metavar="NAME", default=None)
171
229
  p.add_argument("--squeeze", action="store_true", default=False)
172
230
  p.add_argument("--name", metavar="NAME", default=None)
231
+
232
+ g = p.add_argument_group("grid view")
233
+ g.add_argument("--grid", metavar="AXIS", default=None)
234
+ g.add_argument("--grid-values", metavar="VAL", nargs="+", default=None)
235
+ g.add_argument("--grid-layout", metavar="NxM", default=None)
236
+ g.add_argument("--no-sharex", action="store_true", default=False)
237
+ g.add_argument("--no-sharey", action="store_true", default=False)
238
+
173
239
  p.add_argument("-h", "--help", action=_HelpAction)
174
240
  return p.parse_args()
175
241
 
@@ -228,20 +294,17 @@ def main():
228
294
  return _pw_cache[0]
229
295
 
230
296
  if args.path is None:
231
- dlg = QFileDialog(None, "Select image directory", str(Path.home()))
232
- dlg.setFileMode(QFileDialog.FileMode.Directory)
233
- dlg.setOption(QFileDialog.Option.ShowDirsOnly, True)
234
- dlg.setOption(QFileDialog.Option.DontUseNativeDialog, True)
235
- if not app_icon.isNull():
236
- dlg.setWindowIcon(app_icon)
297
+ dlg = StartupDialog(str(Path.home()), app_icon=app_icon)
298
+ QTimer.singleShot(0, lambda: dlg.move(
299
+ _startup_screen.geometry().center() - dlg.rect().center()))
237
300
  QTimer.singleShot(0, lambda: _force_focus(dlg))
238
- chosen = dlg.selectedFiles()[0] if dlg.exec() else ""
301
+ chosen = dlg.chosen_path() if dlg.exec() else ""
239
302
  if not chosen:
240
303
  sys.exit(0)
241
304
  args.path = chosen
242
305
 
243
306
  try:
244
- raw = args.path
307
+ raw = normalize_template(args.path) # anonymous {} → {axis_1}, {axis_2}, …
245
308
  if _is_remote_pattern(raw):
246
309
  remote_cfg, remote_tmpl = _parse_remote_pattern(raw)
247
310
  if '{' in remote_tmpl:
@@ -372,6 +435,28 @@ def main():
372
435
  if name and name not in axis_names:
373
436
  print(f"Warning: {flag} {name!r} not found in axes {axis_names}", file=sys.stderr)
374
437
 
438
+ grid_layout: tuple[int, int] | None = None
439
+ if args.grid_layout:
440
+ import re as _re
441
+ m = _re.match(r'^(\d+)x(\d+)$', args.grid_layout, _re.IGNORECASE)
442
+ if not m:
443
+ print(f"Warning: --grid-layout {args.grid_layout!r} is not a valid NxM layout, ignoring",
444
+ file=sys.stderr)
445
+ elif int(m.group(1)) < 1 or int(m.group(2)) < 1:
446
+ print(f"Warning: --grid-layout {args.grid_layout!r} needs rows and cols >= 1, ignoring",
447
+ file=sys.stderr)
448
+ else:
449
+ grid_layout = (int(m.group(1)), int(m.group(2)))
450
+
451
+ if args.grid and args.grid not in axis_names:
452
+ print(f"Warning: --grid {args.grid!r} not found in axes {axis_names}", file=sys.stderr)
453
+
454
+ if args.grid_values and not args.grid:
455
+ print("Warning: --grid-values has no effect without --grid", file=sys.stderr)
456
+
457
+ if args.grid_layout and not args.grid:
458
+ print("Warning: --grid-layout has no effect without --grid", file=sys.stderr)
459
+
375
460
  window = MainWindow(
376
461
  config, pixmaps,
377
462
  watch=not args.no_watch,
@@ -384,6 +469,13 @@ def main():
384
469
  session_name=args.name,
385
470
  seek_greedy=settings.seek_greedy,
386
471
  keybindings=settings.keybindings,
472
+ highlight=settings.highlight,
473
+ highlight_candidates=settings.highlight_candidates,
474
+ grid=args.grid,
475
+ grid_values=args.grid_values,
476
+ grid_layout=grid_layout,
477
+ grid_sharex=not args.no_sharex,
478
+ grid_sharey=not args.no_sharey,
387
479
  )
388
480
  window.move(_startup_screen.geometry().topLeft())
389
481
  window.showMaximized()
@@ -18,7 +18,7 @@ version_tuple: tuple[int | str, ...]
18
18
  commit_id: str | None
19
19
  __commit_id__: str | None
20
20
 
21
- __version__ = version = '1.1.2'
22
- __version_tuple__ = version_tuple = (1, 1, 2)
21
+ __version__ = version = '1.3.0'
22
+ __version_tuple__ = version_tuple = (1, 3, 0)
23
23
 
24
24
  __commit_id__ = commit_id = None