Repository navigation
Batch: documents and code agree, in the guide's terms - #267
Merged
Merged
Conversation
…ide's terms Five changes of 2026-11-23 (#260, #261, #263, #264, #265) changed names, classes and files of the batch system. A sweep read the guide, the other documents, and every docstring and comment of the batch layer against the code. False sentences, about 30. Among them: the command does no step; the manager writes `considered`; a stopped batch stops for good; `Batch.put` is the only writer of `rows.json`; `BatchManager.version` moves when another batch follows; a `KeyError` of application code is a refusal; no process handles SIGTERM but `essapps-batch follow` (true, and the batch page is now said not to: checked on the demo). Terms, about 190 places: batch table, files table, the rows of a row source and table file where "table" stood alone; parameter column and note column; row source where "source" could be the file source. ADRs 0011 to 0013 are corrected in place, as the index of the ADRs says a changed decision is: `fills` as the blanks of `settings.json`, the row source with `Intake`, a batch that follows again, the command that follows, and "only `put` changes a batch table" where they said "only a person". The guide's definition of a batch says how "a spec, settings and a batch table" relates to "a template and a table" of ADR 0012 and the command's help. Its command list has `files`, and rule 6 names the three refusals. The LoKI batch notebook: a file of the command line is written `path:files/...`, and its template has no `blanks`, which nothing reads. No code changes. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Since said() moved to ess.apps.errors, a pydantic ValidationError that code
of the application raises, such as a row source that validates its
metadata, reached the page and the command as pydantic's raw text, with
its input value and a URL. Before, the web layer's why() worded it per
field ("run must be a valid integer"). The wording is a property of the
exception, so said() gives it, and said_at() holds the rule for one reason
at a field; the page's say() is said_at() with its own field messages, and
why() keeps only the KeyError, which said() names with its type.
The table of refusals.py listed a ValidationError raised by the batch
layer; none is raised there (definition.py turns it into a ValueError).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
fits() was asked only where the page offers choices, so the command and code could make a batch of a spec that lacks a parameter that its source fills: its fills then named a parameter that is no parameter of the spec. Intake.create refuses it with a ValueError that names the spec, the source and the parameters the spec lacks, after the source is looked up and before it is listed, so the order of the other refusals stays. The page's check is an offer of choices, not a rule. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
make_setting dropped the column, wrote rows.json and held the frame itself, beside put: two writers of rows.json, against "only put changes a batch table". It is one put of the frame without the column, after the settings are written, so the order settings.json then rows.json stays. Nothing observable changes: the frame without the column always differs from the one held, so put's check for an equal frame never skips the write; put types and checks the fills as the lines did, forgets the resolved cells, writes before it holds the frame, and moves the version once. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
BatchManager.create, Intake.create, NewBatch (and what the page sends), state.problems, state.row_states, forms.held and forms.tree took columns=, beside Batch.parameter_columns for the same thing. The argument gets the name of the attribute; a columns that means the columns of a frame stays. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
described joins a person's run table to the files table of a folder and knows no batch, so it sits beside scan_folder, whose rows it describes. ess.apps.folder needs the extra files already (scipp, h5py), which holds pandas too; it imports nothing of ess.apps.batch, and import ess.apps still loads neither it nor pandas. Its tests move to the tests of folder. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
main refused a --source, or the NAME of rows, that is not in --sources with its own message, beside Intake's refusal of the same; and rows called rows_of itself beside Intake.rows_of. rows opens the folder with the bindings, so it asks the intake, and reduce --source reaches Intake.create: both say "the source p is not registered" with exit status 2. What stays of the command's own check is what no intake can say: rows and reduce --source without -s/--sources are a wrong command line, as for offered, take and follow. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The command's follow and the page's tick each wrote "Follow could not step: " before said(error). intake.step_failure holds the wording, beside Intake.step, whose exception it says; ess.apps.errors knows no Follow. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
What the definitions keep under a key was called a table, a fourth kind beside the batch table, the files table and a table file. The docstrings of definition, manager and intake and the guide say "entry". The word "entry" those docstrings used for a field of the data of an entry, such as "considered" of source.json, is "field". Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The descriptions of show, reduce, offered, take, remove, rows, files and export, the help of --with, TABLE of reduce and export, and the template's how-to said bare "table". Each says batch table, table file, files table, run table, or the rows that the row source makes, as the guide's terms do. So does the refusal of a table file with --source. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A review checked the sweep of documents and docstrings against the code: - Rule 1 of the guide names make_column and make_setting among the callers of put, which they are. - The command's help says "a batch is a template and a batch table" and what a parameter column is in one phrase; two lines over 80 characters are wrapped. - The hint of Remove says what goes: the title, description, settings and batch table, and whether the batch follows; the row source is code of the application and stays. - RowSource.fills names columns, which a batch keeps as parameter columns: the rows of a source know no spec. - Step 3 of the guide's example says that row 60340 reads outdated at the put, and 60339 stays earlier. - ADR 0011: intake.follow also lets a batch follow that never followed. - Bare "table" in the guide, the page's README and the LoKI notebook names what it is. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The marker was registered in the pytest options of essinstruments only, so a run of the tests of both packages from the root of the repository, which reads no pyproject.toml, refused it under --strict-markers at collection. The LoKI conftest registers it in pytest_configure, which pytest calls when it loads that conftest, before the test modules that carry the mark are imported. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Since the command asks the intake, its message said only "the source p is not registered"; the command's own check listed the names, which a person needs to correct the command line. Intake._source names them, or "none", for the command, the page and code alike. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
With a key, make_setting read the cell of the column before it checked that the column is one, so a parameter without a column, or a note, raised pandas' KeyError, though the docstring promises a ValueError. The check that values() makes is one method that both call first; the batch is left as it was. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
said() words a pydantic ValidationError per field, but three places
flattened the error to its text before said() saw it: the SourceError of
a step (auto.step), the refusal of offered (Intake.offered), and the
message of the command for a ValueError (cli.main). So Follow on the page
and in the command, offered on the page, and rows, reduce --source, take
and offered of the command still showed pydantic's raw text. Each says
said(error); a plain ValueError reads as before.
Also noted: on the base, make_setting('name', '1') on a note column
succeeded: it wrote the setting name, which is no parameter, dropped the
note, and from then on state() raised SubmitError, also after the batch
was read again. Commit "Batch.make_setting refuses a name that is no
parameter column" refuses it.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Asking the intake moved the refusal of a misspelt --source or rows NAME after the opening of the folder: a fresh folder got a log.jsonl, and while follow held the folder the person read that the folder is held, with exit status 1, where the name was wrong. That a name is in --sources is a fact of the command line, so main refuses it again before the folder is opened, with exit status 2. intake.not_registered holds the wording, which the command and Intake._source share. rows still calls Intake.rows_of. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
files --with calls folder.described, and rows calls intake.rows_of. The other rows of the table were checked against cli.py and hold. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The refusal of a spec that does not fit said "has no parameter a, b" when several are missing; it says "parameters" then. The guide called a setting and a command "an entry" of a dict, beside the entries of the definitions; it says "item" there. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Brings the batch system to a point where it can be reviewed in depth (#259): every sentence of the documents and docstrings checked against the code, in the terms of the guide, and the places fixed where the code broke a rule that the guide states. No feature is added.
1. The sweep (first commit, text only). Three readers went through the guide from "One example followed through" on, the other documents (
automatic-reduction.md, the page's README, ADRs 0011 to 0013, the stories, the LoKI batch notebook), and every docstring and comment of the batch layer. A fourth checked the result against the code and compared the syntax trees of the changed Python files: no code changed.considered" (Intakedoes); "stops the batch that follows, for good" (it can follow again since A batch that stopped following can follow again #263);BatchManager.versionmoves when another batch follows (Intake.versiondoes).2. Code that broke a stated rule.
putchanges a batch tableBatch.make_settingwroterows.jsonitselfput; no observable changefillsnamed something that is no parameterIntake.createrefuses:the spec find has no parameter transmission, which the source pairs fillsrows, and worded an unknown--sourceits own wayIntake.rows_of; one function words an unknown row source, for the intake and for the command's check before it opens the folderValidationErrorthat a row function raised showed as pydantic's raw text: on the page since #265, in Follow and the command before that tooess.apps.errors.saidwords it per field, on every path of the page and the commandcreate(columns=...),NewBatch.columns,state.problems(..., columns)besideBatch.parameter_columnsparameter_columnseverywhere, also in the JSON body ofPOST /api/batchesSmaller:
described(joins a run table to the files table, knows no batch) moved frombatch.framestoess.apps.folder; "Follow could not step:" is worded once (intake.step_failure);Batch.make_setting(name, key)refuses a name that is no parameter column (before, a note column was accepted: it wrote a setting that is no parameter, and reading the state of the batch raised from then on; any other name raised pandas'KeyError, a 500 on the page); the command's help strings use the guide's terms.3. Tests. The marker
real_data(#266) is registered in theconftest.pythat uses it. Registered in one package'spyproject.toml, it made apytestrun over both packages from the repository root fail at collection.Checked by a review that ran every command and the page's API on the code before and after, side by side: the differences are the ones above, and
make_settingthroughputmatches in 12 cases (order of the writes, version, a refused write).Not changed, listed in #259 for the review: names in code where one word holds two things (
sourceas a name and as aRowSource;table;following/follows), the structure ofcli.py, andintake.follow(label)on a batch made with a last row.🤖 Generated with Claude Code