Skip to content

PR3: napari widget button for plate overview #10

Description

@ferrinm

Part of #7. Depends on PR2.

What

Add a "Generate plate overview" button to PhenixDataLoaderWidget.

Behavior

  • Button is disabled until an experiment is loaded
  • Click → QFileDialog.getExistingDirectory() defaulting to the experiment directory
  • Calls generate_plate_overview(experiment_path, chosen_dir) with sensible defaults (the function's defaults are designed to "just work" — no widget-side config in v1)
  • On completion, opens the chosen directory in the OS file viewer:
    • macOS: subprocess.run(["open", dir])
    • Linux: subprocess.run(["xdg-open", dir])
    • Windows: subprocess.run(["explorer", dir])
  • Status message shown in the widget's existing status area

Acceptance criteria

  • Button visible in a sensible existing widget section (e.g. near the "Save data" button)
  • Correctly enabled/disabled with the rest of the controls (see _set_controls_enabled in _widget.py:1062)
  • pytest-qt test verifying button wiring: mock QFileDialog, mock the OS-open call, verify generate_plate_overview is invoked with the expected args
  • All existing widget tests still pass

Out of scope

  • Configuring overview parameters from the widget (advanced users call the function from a script)
  • Progress feedback inside the napari window (terminal tqdm is enough for v1)
  • Running in a background thread (the napari UI will block during overview generation; acceptable for a diagnostic action)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions