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
impl ResultSet
Sourcepub fn open_dir(
dir: &Path,
series_budget: usize,
) -> Result<Self, ResultSetError>
Available on non-WebAssembly only.
pub fn open_dir( dir: &Path, series_budget: usize, ) -> Result<Self, ResultSetError>
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.
Sourcepub fn from_files(
files: Vec<(String, Vec<u8>)>,
series_budget: usize,
) -> Result<Self, ResultSetError>
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.
Sourcepub fn recorded_builds(&self, role: BuildRole) -> Vec<RecordedBuild>
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.
Sourcepub fn dir(&self) -> Option<&Path>
pub fn dir(&self) -> Option<&Path>
Directory the files were read from, None for files passed as bytes.
Sourcepub fn value_columns(&self) -> &[String]
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.
Sourcepub fn reducer_columns(&self) -> &[String]
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.
Sourcepub fn stat_columns(&self) -> &[String]
pub fn stat_columns(&self) -> &[String]
Names of the stat columns of series.csv, one per value of a series row.
Sourcepub fn run(&self, run_id: u64) -> Option<&RunRow>
pub fn run(&self, run_id: u64) -> Option<&RunRow>
Returns run run_id, or None when runs.csv holds no such run.
Sourcepub fn held_series_count(&self) -> usize
pub fn held_series_count(&self) -> usize
Number of runs held with their series.
Sourcepub fn is_complete(&self) -> bool
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.
Sourcepub fn schema_matches(&self, schema: ModelSchema<'_>) -> bool
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.
Sourcepub fn replay(
&self,
schema: ModelSchema<'_>,
run_id: u64,
) -> Result<Replay, ResultReplayError>
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.
Sourcepub fn search_table(&self, file: &str) -> Option<&str>
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.
Sourcepub fn search_history(&self) -> Result<Option<SearchHistory>, ResultSetError>
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.
Sourcepub fn read_run_series(
&self,
run_ids: &BTreeSet<u64>,
series_budget: usize,
) -> Result<DirectorySeries, ResultSetError>
Available on non-WebAssembly only.
pub fn read_run_series( &self, run_ids: &BTreeSet<u64>, series_budget: usize, ) -> Result<DirectorySeries, ResultSetError>
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.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ResultSet
impl RefUnwindSafe for ResultSet
impl Send for ResultSet
impl Sync for ResultSet
impl Unpin for ResultSet
impl UnsafeUnpin for ResultSet
impl UnwindSafe for ResultSet
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
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