Learn R Programming

guildai (version 0.0.1)

resolve_run_ids: Resolve run ids

Description

This is a equivalent to runs_info(...)$id, implemented more efficiently.

Usage

resolve_run_ids(runs = NULL, ..., all = TRUE)

Value

A character vector of run ids.

Arguments

runs

a runs selection. If a data.frame, the columns id or run are used as the run id. Otherwise, the arguments are transformed into a character vector of cli arguments, and passed on to guild as a runs filter selection. Wrap the string in I() to avoid quoting the argument for the shell.

...

Other arguments passed on to guild

all

Return all matching runs. If FALSE, it returns the singly most recent run matching the selection criteria.

Details

guild supports a rich syntax for runs selection throughout the api. The same selection syntax is shared by the runs_* family of functions: runs_info(), runs_scalars(), runs_comment(), runs_label(), runs_mark(), runs_tag() runs_delete(),runs_purge(), runs_restore(), runs_export(), runs_import().

Examples

Run this code
if (FALSE) {
resolve_run_ids() # returns all run ids.
resolve_run_ids(1) # last run
resolve_run_ids(1:2) # last 2 runs
resolve_run_ids(1:2, operation = "train.py")

# three ways of getting ids for the currently staged or running runs
resolve_run_ids(staged = TRUE, running = TRUE)
resolve_run_ids("--staged", "--running")
resolve_run_ids(c("--staged", "--running"))
resolve_run_ids(I("--staged --running"))

# resolve_run_ids() uses the same selection rules and syntax as runs_info()
stopifnot(identical(
  resolve_run_ids(),
  runs_info()$id
))
}

Run the code above in your browser using DataLab