Skip to content

Follow reduces the rows without a result (ADR 0013) - #240

Merged
SimonHeybrock merged 2 commits into
mainfrom
236-follow-reduces-new-rows
Nov 19, 2026
Merged

SimonHeybrock merged 2 commits into
mainfrom
236-follow-reduces-new-rows

Conversation

@SimonHeybrock

Copy link
Copy Markdown
Member

Second pull request for #236. It changes what a step of Follow reduces, as ADR 0013 decides, on the model as it is.

candidates = not_reduced(batch.results())   # ready, and no record under the label
batch.reduce(not_reduced(batch.state(candidates)))

A row that has a record is never reduced by a step: not one that is outdated, failed, or cancelled. A person reduces it. Before, a step also reduced a row again when a cell at a column that the source fills had changed, unless a person had set a cell of it. That rule needed to know who wrote each cell, which ADR 0012 removes.

  • state.not_reduced replaces state.arrived. RowState.set_by_hand, RowState.changed_by_hand and Automatic(at=) go, with the page texts that rest on them.
  • A step compares only the rows without a result with their request. On a toy batch of 3000 rows named by run number a step went from 1.7 s to 0.06 s.
  • User story E1 (a reflectometry series: one row per sample whose list of runs grows) cannot be met under this rule. It is marked as expected to fail, and user-stories.md says so. Whether ADR 0013 is amended for it or the story changes is open.

🤖 Generated with Claude Code

SimonHeybrock and others added 2 commits November 19, 2026 12:09
ADR 0013, "What a step reduces": a step of Follow reduces the rows that
are ready and have no record under the label. A row with a result is
left to a person, also one that is outdated, failed or was cancelled.

state.not_reduced replaces state.arrived, and refused_again reads it, so
it no longer needs the states compared. RowState.set_by_hand,
RowState.changed_by_hand and Batch._set_by_hand go, and Automatic loses
its columns `at`: neither who set a cell nor which column changed
decides what a step reduces. A row that a person adds or edits before
it has a result is reduced by the next step once it is complete.

The page loses Following.at and the text "Set by hand, so Follow leaves
it to you"; the switch says that Follow reduces the rows that are new.

Story E1 (a series that grows) cannot be met under this rule and is
marked xfail, with the reason under E1 in user-stories.md.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…review

A step reads the results of all rows, and compares with their results
only the rows without one, the only rows it may reduce. So a row with a
result costs a step no resolving, also when it names its files by run.
With refused settings, `refused` names the same candidates: the rows
without a result that are ready as given.

Documents that still stated the old rule are patched: the developer
README, story E4, the guide's "Writing a source", LoKI's pair_by_sample,
the Mantid prior-art note, and the cost of a step. The section "One
label, one batch" becomes "The records of a label are the results".
ADR 0013 says that a row cancelled by a restart is left to a person.

Tests: the cases of "a row with a result is left to a person" are one
parametrized test per layer, and the cases that pass whatever the
comparison says (runs that arrive again, a file named by run) assert
that the row reads completed. A list in another order differs. The
switch says "not reduced yet", since "new" will mean "not considered".

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@SimonHeybrock SimonHeybrock self-assigned this Nov 19, 2026
@SimonHeybrock
SimonHeybrock merged commit 1c0e6bc into main Nov 19, 2026
2 checks passed
@SimonHeybrock
SimonHeybrock deleted the 236-follow-reduces-new-rows branch November 19, 2026 12:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant