A project workbench for neutron reflectometry analysis at the SNS Liquids Reflectometer (REF_L / BL-4B).
This project is a companion to the AuRE - Automated Reflectivity Evaluator repository.
nr-workbench init scaffolds an analysis project: one directory layout for
every sample, a curated skills/ folder that Claude Code, GitHub Copilot and
OpenCode all read, and a provenance ledger that keeps every result linked to the
script, data, and environment that produced it.
Five steps bring an experiment that is shared on Tiled to your own machine: its runs, its samples and its fits.
-
Install nrw. On macOS and Linux:
curl -fsSL https://raw.githubusercontent.com/neutrons-ai/aure-workbench/main/install.sh | shOn Windows, in PowerShell:
irm https://raw.githubusercontent.com/neutrons-ai/aure-workbench/main/install.ps1 | iex
It needs
git, and brings its own Python. Open a new terminal ifnrwis not found afterwards. docs/install.md explains what the script does, and its options. -
Log in to Tiled:
nrw tiled login
It asks which login: answer
globus. It then prints an address and a code to enter in your browser. -
Pull the experiment, by its IPTS number:
nrw tiled pull --ipts IPTS-34567
That makes the project in a new folder,
IPTS-34567/, holding the experiment's samples, its reduced data and its fits. -
Look at it in your browser:
cd IPTS-34567 nrw serveOpen http://127.0.0.1:8765/experiment.
Ctrl-Cin the terminal stops the server. -
Open the folder in VS Code when you want to work on the analysis with Claude Code or GitHub Copilot: File → Open Folder…, or from the project folder:
code .For Claude, install the Claude Code extension for VS Code; it needs a Claude account. To use Claude for Quick fit with AuRE and for the unattended agent, also install the Claude Code command line,
claude: nrw cannot run the copy inside the extension. Fitting itself needs neither.
To get what others have pushed since, run nrw tiled pull again inside the
project; it needs no --ipts there.
mkdir my-beamtime && cd my-beamtime
nrw init --beamtime june2026 --ipts IPTS-34567
nrw doctor
nrw sample new Sample4 --title "ionomer on copper"Then copy reduced data into samples/Sample4/data/steady/ and
samples/Sample4/data/tnr/, open the folder in VS Code, and work with Claude
Code. nrw init is idempotent and safe to run on top of an existing beamtime
folder — it never overwrites a file you have edited.
Run nrw --help for the full command surface.
The previous way of working was a directory per beamtime, each with its own
layout, and fitting scripts named …-corefine-tNR-test.py, …-t0.py,
… copy.py. It became impossible to say which script produced a published
figure. Writing a time-resolved co-refinement by hand made it worse: the
reference model is 341 lines, ~200 of them copy-pasted parameter tying, with
absolute paths belonging to a different user baked in.
nr-workbench replaces that with:
- One layout.
samples/<id>/for everything; beamtime is metadata. - Immutable, attributed results. Every fit writes a new directory recording the spec, the script, every input hash, and the environment.
- A declarative model spec. Steady-state co-refinement and time-resolved series with functional constraints in one schema, generating a readable, standalone refl1d script.
- Skills the agent actually reads, in the tool-neutral repo-root layout.
| Guide | What it covers |
|---|---|
| Install | What the installer does, its options, upgrading, uninstalling, and installing by hand |
| Getting started | One analysis end to end on real data, from an empty folder to a promoted fit |
| The Experiment page | Organizing a beamtime's runs into samples, then fitting and curating fits in nrw serve |
| Sharing through Tiled | nrw tiled push, status and pull |
| Your first fit | A first model from AuRE, when you have data and no layer stack yet |
| Fitting options | Choosing a fitter and its settings, for nrw's fits and for AuRE's |
| Settings | Which file holds which setting, and what is sent to a language model |
| Provenance | What each fit records, tracing a figure to its fit, and packing a fit for a collaborator |
| Running unattended | Letting an assistant analyse measurements as they arrive |
| The unattended agent, in full | Its limits, what it reads, and choosing an assistant |
| Contributing | The development setup |
Working. The scaffold and skills, the provenance spine, the tNR assessment
tools, the model spec and generator, the web UI — its Experiment page, fit
curation and ISAAC publishing included — and the data tools are all
implemented, along with nrw pack, nrw note, nrw assess, nrw isaac export and push, nrw tiled, and the unattended agent above.
pytest # tests
ruff check src tests # lint (ruff lints and formats; no black)
ruff format --check src tests # format
pre-commit run --all-files # exactly what CI runspre-commit only checks files git tracks, so stage a new file before running
it.
The workflow, code standards, and review process are in .github/copilot-instructions.md, imported by CLAUDE.md. Shared standards live once in skills/.
BSD 3-Clause. See LICENSE.