Documentation
¶
Overview ¶
Package sheets reads the directory where the record mode of the board saves the measurement's sheets, and tutor-eval draw the sheets it draws, against the sheet plan: for each plan sheet its last file, read and checked as a sample. A file is a sample of spec's eval protocol, which its first key tells; one of tutor-sample v0 is a problem of its sheet, and tutor-eval convert writes it as a sample of the protocol. From it come the summary of what is recorded, without the handwriting, and the split of the sheets into a development and a test part.
Index ¶
- Constants
- func Differences(sh *sample.PlanSheet, s *sample.Sample) []sample.Problem
- func ErasurePlace(sh *sample.PlanSheet, s *sample.Sample, e sample.Erasure) int
- func Lopsided(plan *sample.Plan, sp *sample.Split) (noDev, noTest []sample.Scenario)
- func Numbers(list []int) string
- func OfProtocol(data []byte) bool
- func Split(r *Recorded, seed int64, dev int) (*sample.Split, error)
- func Stale(r *Recorded, sp *sample.Split) []int
- func Summary(r *Recorded) string
- type Chosen
- type Recorded
- type Sheet
Constants ¶
const SplitFile = "split.json"
SplitFile is the name of the split's file in the directory of sheets.
const V0Problem = "(a file of tutor-sample v0: tutor-eval convert writes it as a sample of the protocol)"
V0Problem is the problem of a sheet whose file is of tutor-sample v0, which no reader but tutor-eval convert takes.
Variables ¶
This section is empty.
Functions ¶
func Differences ¶
Differences names how the markup of a sheet differs from its plan sheet: in its lines, its answer, its outcome, its first error, its trap and its planned erasure, each at the path of the sample's field. The board saves such a sheet all the same, as what was written the author knows, and the summary names such sheets. On a sheet of a plan of parts the markup's lines are its parts: the notes name them parts, and the strokes of the planned erasure stood where their place on the plane puts them (ErasurePlace), not by bands down the sheet.
func ErasurePlace ¶
ErasurePlace is the number of the line of a sheet's markup that most of an erasure's strokes stood on, or 0 for none: by bands down the sheet (lines.ErasureLine). On a sheet of a plan of parts it is the number of the part, by the place of the strokes on the plane (lines.ErasurePart), as a free-form solution has no lines down the sheet.
func Lopsided ¶
Lopsided names the scenarios a split leaves out of a part: those with no sheet in the development part, and those with none in the test part. Each comes in the order of sample.Scenarios.
func OfProtocol ¶ added in v0.1.5
OfProtocol reports whether a file is a JSON object that names a protocol at its top level, whatever it names, as a sample of spec's eval protocol does and one of tutor-sample v0 does not. It reads the keys and skips their values, the crops' PNG among them, without decoding them.
func Split ¶
Split divides the sheets into a development part of dev sheets and a test part. Each scenario gives the development part its share of dev, as near its share of the plan as whole sheets allow: the shares left over go to the scenarios with the largest remainders, and of two as large, to the one that comes first among sample.Scenarios. Which of a scenario's sheets go, the seed decides: they stand in the order of the SHA-256 of the seed and the file's name. Every sheet of the plan must be recorded and pass the check.
func Stale ¶
Stale names the sheets of a split whose file no longer counts for them in the directory: one saved again since the split, or one whose file is gone.
func Summary ¶
Summary says what the directory holds against the plan, in numbers and names only: no point, no stroke and no text of a line, nothing of the handwriting. The counts by task, scenario and outcome, the erasures, the frames, the sheets drawn by code, the mouse and the markup off the plan, named by the paths of its fields as the board names them (Differences), are of the sheets that pass the check.
Types ¶
type Chosen ¶
type Chosen struct {
Set string
Number int
File string
Sample *sample.Sample
Task *sample.Task
Plan *sample.PlanSheet
// ID and Truth are the sample's of the protocol, for the runner's report.
ID string
Truth []evalsample.Truth
}
Chosen is a sheet that a run asks of: its set, the name of its directory of sheets, its number in the plan and its file, its sample, which passes its check, its task, and its sheet of the plan.
type Recorded ¶
type Recorded struct {
Sheets []Sheet
// Other names the files that are neither a saved sheet of the plan nor the split: other names,
// or the names of another plan's sheets. They are not read.
Other []string
}
Recorded is the directory of sheets read against the plan.
func Read ¶
func Read(dir string, plan *sample.Plan, bank *evalsample.Bank, check samplecheck.Check) (*Recorded, error)
Read reads the directory against the plan and the bank. A file that does not pass is a problem of its sheet, not an error; the error is a directory that cannot be read, or a check that cannot run. A sample of the protocol is held to its rules by check, spec's code (samplecheck.Run), and refused when it breaks one; with no check, as tutor-eval draw reads the directory only to see which sheets it holds, it is not.
type Sheet ¶
type Sheet struct {
Plan *sample.PlanSheet
// File is the name of the sheet's last file, the one that counts, or "" when it has none yet;
// Files counts its files.
File string
Files int
// Sample is the sample in File once it passes the check with the bank and is the plan sheet's
// task and scenario. When it is not, Problems names where it fails, by paths alone: nothing of
// the handwriting.
Sample *sample.Sample
Problems []string
// Refused is why the runner refuses the sample of the protocol in File, as the protocol has it,
// or nil: a refused sample has no Sample and no Problems, and nothing of it goes to AI.
Refused *evalsample.Refusal
// Mouse is set when a mouse wrote a stroke of the sample of the protocol, as its pointer says.
Mouse bool
// ID is the ID of the sample of the protocol, and Truth the truth of its answer slot: what the
// runner's report takes of it.
ID string
Truth []evalsample.Truth
}
Sheet is a plan sheet as the directory holds it.