Skip to main content
GitHub source

class Runs

A lazy iterator of Run objects associated with a project and optional filter. Runs are retrieved in pages from the W&B server as needed. This is generally used indirectly using the Api.runs namespace.

method Runs.__init__

__init__(
    client: 'RetryingClient',
    entity: 'str',
    project: 'str',
    filters: 'dict[str, Any] | None' = None,
    order: 'str' = '+created_at',
    per_page: 'int' = 50,
    include_sweeps: 'bool' = True,
    lazy: 'bool' = True,
    api: 'public.Api | None' = None
)
Args:
  • client: (wandb.apis.public.RetryingClient) The API client to use for requests.
  • entity: (str) The entity (username or team) that owns the project.
  • project: (str) The name of the project to fetch runs from.
  • filters: (Optional[Dict[str, Any]]) A dictionary of filters to apply to the runs query.
  • order: (str) Order can be created_at, heartbeat_at, config.*.value, or summary_metrics.*. If you prepend order with a + order is ascending (default). If you prepend order with a - order is descending. The default order is run.created_at from oldest to newest.
  • per_page: (int) The number of runs to fetch per request (default is 50).
  • include_sweeps: (bool) Whether to include sweep information in the runs. Defaults to True.

property Runs.length


method Runs.histories

histories(
    samples: 'int' = 500,
    keys: 'list[str] | None' = None,
    x_axis: 'str' = '_step',
    format: "Literal['default', 'pandas', 'polars']" = 'default',
    stream: "Literal['default', 'system']" = 'default'
) → list[dict[str, Any]] | pd.DataFrame | pl.DataFrame
Return sampled history metrics for all runs that fit the filters conditions. Args:
  • samples: The number of samples to return per run
  • keys: Only return metrics for specific keys
  • x_axis: Use this metric as the xAxis defaults to _step
  • format: Format to return data in, options are “default”, “pandas”, “polars”
  • stream: “default” for metrics, “system” for machine metrics
Returns:
  • pandas.DataFrame: If format="pandas", returns a pandas.DataFrame of history metrics.
  • polars.DataFrame: If format="polars", returns a polars.DataFrame of history metrics.
  • list of dicts: If format="default", returns a list of dicts containing history metrics with a run_id key.

method Runs.upgrade_to_full

upgrade_to_full() → None
Upgrade this Runs collection from lazy to full mode. This switches to fetching full run data and upgrades any already-loaded Run objects to have full data. Uses parallel loading for better performance when upgrading multiple runs.