Skip to main content

class Sweeps

service_api: 'ServiceApi',
entity: 'str',
project: 'str',
per_page: 'int' = 50

Description

A lazy iterator over a collection of Sweep objects.

Args

  • service_api: The service API used to query W&B.
  • entity: The entity which owns the sweeps.
  • project: The project which contains the sweeps.
  • per_page: The number of sweeps to fetch per request to the API.

Examples

from wandb.apis.public import Api

sweeps = Api().project(name="project_name", entity="entity").sweeps()

# Iterate over sweeps and print details
for sweep in sweeps:
    print(f"Sweep name: {sweep.name}")
    print(f"Sweep ID: {sweep.id}")
    print(f"Sweep URL: {sweep.url}")
    print("----------")

Methods

method next

self
Return the next item from the iterator. When exhausted, raise StopIteration

method update_variables

self
Update the query variables for the next page fetch.