Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 25 additions & 27 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -1,40 +1,36 @@
<!--
This is the canonical operational checklist for quantem.widget pull requests.
It is intentionally thorough so humans and coding agents can select the right
gates and leave reproducible, automation-friendly evidence. Links are absolute
because relative links do not resolve in PR descriptions.

How to use: keep the Core checklist, then expand and complete only the
sections your change touches. Delete sections that do not apply — a reviewer
should only see boxes that are relevant to this PR. Either verify each box
yourself or have a coding agent verify it and check it off for you; mark an
item that is in a relevant section but does not apply as "n/a — reason".
### What problem does it solve?

<!--
Describe the concrete user or scientific-workflow problem. Explain why the
change is needed; do not merely summarize the files that changed.
-->

## Summary
### What should reviewer(s) do?

<!-- What does this PR change, and why? -->
<!--
Give reviewers a short, specific path through the important behavior, files,
or UI. Include only the actions needed to judge this change.
-->

## Verification
### Verification

<!--
Keep this concise and use "n/a" where a field does not apply. These structured
fields help reviewers and coding agents reproduce the scientific workflow and
select any missing gates without relying on private logs.

- Checks run:
- User workflow exercised:
- Data: source category (public/synthetic/private), shape, dtype, raw size:
- Backend and hardware:
- Load/render/interaction timing:
- Evidence artifacts or screenshots:
List the checks that actually ran and their results. For UI or scientific
workflow changes, include the exercised workflow, representative data,
backend/hardware, and visual or timing evidence when relevant. Omit fields
that do not apply.
-->

<!--
Internal preflight checklist for authors and coding agents. Use every relevant
item during authoring and review, but do not expose this checklist
in the rendered PR. Put only the resulting reviewer actions and verification
evidence in the three visible sections above.

## Core checklist (every PR)

- [ ] The change includes focused tests for Python state/export behavior and
frontend build coverage where possible; start with `PYTHONPATH=src:. pytest -q`
frontend build coverage where possible; start with `PYTHONPATH=src pytest -q`
and `npm run build`, or run `scripts/widget_local_signoff.sh`.
- [ ] Before committing, inspect `git status --short` and `git diff --stat`;
do not commit generated HTML, docs builds, screenshots, local notebooks,
Expand All @@ -48,8 +44,9 @@ select any missing gates without relying on private logs.
Saving a notebook after running widget cells stores that state silently;
strip it before committing:
`jq 'del(.metadata.widgets)' <nb>.ipynb > tmp && mv tmp <nb>.ipynb`
- [ ] Only the sections below that this PR touches are kept; the rest are
deleted from this description.
- [ ] Use every checklist item relevant to this PR. Keep the full checklist
hidden, and copy only the resulting actions or evidence into the visible
description.

<details>
<summary><b>Python API and docs</b> — new widget, loader, or API change</summary>
Expand Down Expand Up @@ -198,6 +195,7 @@ select any missing gates without relying on private logs.
state. See [GitHub preview](https://github.com/electronmicroscopy/quantem.widget/blob/main/docs/github-preview.md).

</details>
-->

---

Expand Down
37 changes: 4 additions & 33 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@ and 5D-STEM segmentation and clustering work
([paper](https://academic.oup.com/mam/article-abstract/32/3/ozag044/8701498))
and the source data ([Zenodo](https://zenodo.org/records/18167694)).

**[Start with the documentation](https://electronmicroscopy.github.io/quantem.widget/)**
to load ARINA 4D-STEM data in Jupyter, open `Show4DSTEM`, and explore the
interactive widgets.

> `quantem.widget` is currently a prototype on
> [TestPyPI](https://test.pypi.org/project/quantem-widget/) and is built on the
> [`quantem`](https://github.com/electronmicroscopy/quantem) core.
Expand All @@ -31,39 +35,6 @@ pip install -i https://test.pypi.org/simple/ \
See the [installation guide](https://electronmicroscopy.github.io/quantem.widget/install.html)
for backend setup, Colab instructions, and verification.

## Quick start

Open an image or microscopy dataset without writing a notebook:

```bash
quantem show image.tif
quantem show3d ./frames/
quantem show4dstem ./masters/
```

Or construct widgets directly in Python:

```python
import numpy as np
from quantem.widget import Show2D, Show4DSTEM

Show2D(np.random.random((512, 512)))
Show4DSTEM(np.random.random((64, 64, 128, 128)))
```

For real 4D-STEM data, load a master file onto the available GPU:

```python
from quantem.gpu.io import load
from quantem.widget import Show4DSTEM

Show4DSTEM(load("scan_master.h5"))
```

The [command-line guide](https://electronmicroscopy.github.io/quantem.widget/cli.html)
and [tutorials](https://electronmicroscopy.github.io/quantem.widget/tutorials/download_data.html)
cover data loading, HTML export, public example datasets, and complete workflows.

## Widgets

| Widget | Use it for | Learn more |
Expand Down
27 changes: 21 additions & 6 deletions docs/intro.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,24 +13,39 @@ and 5D-STEM segmentation and clustering work
([paper](https://academic.oup.com/mam/article-abstract/32/3/ozag044/8701498))
and the source data ([Zenodo](https://zenodo.org/records/18167694)).

## Start with ARINA 4D-STEM in Jupyter

The demo above is the same `Show4DSTEM` workflow you can use at the microscope.
After [installing](install), open a Jupyter notebook, load a completed ARINA
`*_master.h5` file, and pass the result directly to the widget:

```python
from quantem.gpu.io import load
from quantem.widget import Show1D, Show2D, Show3D, Show3DSlices, Show4DSTEM, ShowPtycho, ShowEDS, ShowDiffraction, ShowFolder
from quantem.widget import Show4DSTEM

data = load("/data/session/scan_000_master.h5")
viewer = Show4DSTEM(data)
viewer
```

## Quickest start: no notebook needed
`load(...)` selects CUDA or Apple Metal automatically. Leave `viewer` as the
final line, then move through scan positions or drag the detector to update the
virtual image. Continue with the [Show4DSTEM tutorial](tutorials/show4dstem) or
[Load and I/O](api/io).

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

toom uch text, keep it shorter.

## Prefer the command line?

After [installing](install), point the `quantem` command at a file or folder and
it renders the right viewer in your browser:
Point the `quantem` command at a file or folder when you want the same viewers
without writing a notebook:

```bash
quantem show2d image.tif # an image -> Show2D
quantem show3d ./frames/ # a folder of frames -> Show3D scrub
quantem show4dstem ./masters/ # 4D-STEM master(s) -> live viewer (or --html)
```

It saves to `~/Downloads`, opens automatically, and picks the GPU (CUDA / Apple
Metal) for you. Full details on [the command line](cli) page.
It saves to `~/Downloads`, opens automatically, and picks the GPU for you. Full
details are on [the command line](cli) page.

## Built for two platforms

Expand Down