Skip to main content

ResultSet

Struct ResultSet 

Source
pub struct ResultSet { /* private fields */ }
Expand description

Results of one sweep, read from an output directory or from its files’ bytes.

Implementations§

Source§

impl ResultSet

Source

pub fn open_dir( dir: &Path, series_budget: usize, ) -> Result<Self, ResultSetError>

Available on non-WebAssembly only.

Reads the output directory at dir, holding at most series_budget bytes of series.

§Errors

Returns ResultSetError when the manifest or runs.csv is missing or cannot be read, the manifest’s spec cannot be read back or the search it records has a setting out of range, or a complete record of a table is not one the sweep writes.

Source

pub fn from_files( files: Vec<(String, Vec<u8>)>, series_budget: usize, ) -> Result<Self, ResultSetError>

Reads the files files of one output directory, each as its name and bytes, holding at most series_budget bytes of series.

A file is known by its contents, so a browser’s renamed download such as runs (1).csv is still read. The one JSON file is the manifest, and a CSV file is runs.csv, series.csv or a search table by its header. The manifest and runs.csv are needed, series.csv and the search tables are read when present, and every other file is left unread.

§Errors

Returns ResultSetError when the manifest or runs.csv is missing or cannot be read, two files hold the same table, the manifest’s spec cannot be read back or the search it records has a setting out of range, or a complete record of a table is not one the sweep writes.

Source

pub fn manifest(&self) -> &Manifest

Manifest as manifest.json holds it.

Source

pub fn recorded_builds(&self, role: BuildRole) -> Vec<RecordedBuild>

Returns every distinct build recorded for role by the manifest’s sessions that wrote runs, in session order, as Manifest::recorded_builds lists them.

A session of a 0.2 manifest records no builds, and is treated as the engine build of its own commit and the manifest’s engine version, with no model build.

Source

pub fn spec(&self) -> &SweepSpec

Spec the sweep ran, as its manifest records it.

Source

pub fn dir(&self) -> Option<&Path>

Directory the files were read from, None for files passed as bytes.

Source

pub fn value_columns(&self) -> &[String]

Names of the parameter and action columns of runs.csv, in order.

Empty when runs.csv has no header yet, as in a directory whose sweep has written no run.

Source

pub fn reducer_columns(&self) -> &[String]

Names of the reducer columns of runs.csv, one per value of a run’s RunOutcome::reducers.

Empty when runs.csv has no header yet.

Source

pub fn stat_columns(&self) -> &[String]

Names of the stat columns of series.csv, one per value of a series row.

Source

pub fn runs(&self) -> &[RunRow]

Runs in the order runs.csv lists them.

Source

pub fn run(&self, run_id: u64) -> Option<&RunRow>

Returns run run_id, or None when runs.csv holds no such run.

Source

pub fn held_series_count(&self) -> usize

Number of runs held with their series.

Source

pub fn is_complete(&self) -> bool

Returns whether the sweep ran every run of its shard.

A directory a sweep left running, aborted or failed, or a merge left incomplete, can be resumed.

Source

pub fn schema_matches(&self, schema: ModelSchema<'_>) -> bool

Returns whether schema declares the parameters, stats and actions the sweep ran with.

A replay of a run through a model that does not match might differ from the run. A host passes entry.schema() for a ModelEntry.

Source

pub fn plan(&self, schema: ModelSchema<'_>) -> Result<Plan, PlanError>

Plans the recorded spec against schema.

§Errors

Returns PlanError when the model rejects the spec.

Source

pub fn replay( &self, schema: ModelSchema<'_>, run_id: u64, ) -> Result<Replay, ResultReplayError>

Returns the Replay of run run_id through the model schema declares.

The spec is planned afresh on each call. A host that replays several runs of a sweep plans once with Self::plan and calls Plan::replay. A search’s run is rebuilt from the config its row records.

§Errors

Returns ResultReplayError when the model rejects the spec, runs.csv holds no run run_id, or the plan assigns the run a different config, replicate, seed or run key than its row. The run key covers the config’s parameter values and action ticks. It also hashes the model’s declarations, so it is compared only while Self::schema_matches holds for schema.

Returns whether the results come from a search.

Source

pub fn search_table(&self, file: &str) -> Option<&str>

Returns the text of the search table file, such as evaluations.csv, or None when the results hold no such table.

Source

pub fn search_history(&self) -> Result<Option<SearchHistory>, ResultSetError>

Returns the course of a search batch by batch, from its tables, or None for a sweep.

§Errors

Returns ResultSetError::Table when a search table cannot be read.

Source

pub fn read_run_series( &self, run_ids: &BTreeSet<u64>, series_budget: usize, ) -> Result<DirectorySeries, ResultSetError>

Available on non-WebAssembly only.

Reads the whole series of each run of run_ids from the directory the set was read from, while the series fit series_budget bytes, as read_directory_series does.

§Errors

Returns ResultSetError::Missing for a set read from bytes, and ResultSetError::Table when series.csv cannot be read or its header does not list the stat columns.

Source

pub fn into_runs(self) -> Vec<RunRow>

Returns the runs in the order runs.csv lists them, and drops the rest of the set.

Trait Implementations§

Source§

impl Clone for ResultSet

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for ResultSet

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> Downcast<T> for T

Source§

fn downcast(&self) -> &T

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> Upcast<T> for T

Source§

fn upcast(&self) -> Option<&T>

Source§

impl<T> WasmNotSend for T
where T: Send,

Source§

impl<T> WasmNotSend for T
where T: Send,

Source§

impl<T> WasmNotSendSync for T

Source§

impl<T> WasmNotSync for T
where T: Sync,

Source§

impl<T> WasmNotSync for T
where T: Sync,