> ## Documentation Index
> Fetch the complete documentation index at: https://wb-21fd5541-update-reference-docs-60.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Sweep

export const GitHubLink = ({url, compact = false}) => <a href={url} target="_blank" rel="noopener noreferrer" className={compact ? "source-link" : "github-source-link"}>
    {compact ? "ソースを表示" : <>
    <svg width="20" height="20" viewBox="0 0 24 24" fill="currentColor" xmlns="http://www.w3.org/2000/svg">
      <path d="M12 0C5.37 0 0 5.37 0 12c0 5.31 3.435 9.795 8.205 11.385.6.105.825-.255.825-.57 0-.285-.015-1.23-.015-2.235-3.015.555-3.795-.735-4.035-1.41-.135-.345-.72-1.41-1.23-1.695-.42-.225-1.02-.78-.015-.795.945-.015 1.62.87 1.845 1.23 1.08 1.815 2.805 1.305 3.495.99.105-.78.42-1.305.765-1.605-2.67-.3-5.46-1.335-5.46-5.925 0-1.305.465-2.385 1.23-3.225-.12-.3-.54-1.53.12-3.18 0 0 1.005-.315 3.3 1.23.96-.27 1.98-.405 3-.405s2.04.135 3 .405c2.295-1.56 3.3-1.23 3.3-1.23.66 1.65.24 2.88.12 3.18.765.84 1.23 1.905 1.23 3.225 0 4.605-2.805 5.625-5.475 5.925.435.375.81 1.095.81 2.22 0 1.605-.015 2.895-.015 3.3 0 .315.225.69.825.57A12.02 12.02 0 0024 12c0-6.63-5.37-12-12-12z" />
    </svg>
    GitHub のソース
      </>}
  </a>;

<GitHubLink compact url="https://github.com/wandb/wandb/blob/main/wandb/apis/public/sweeps.py#L272" />

## <Badge color="yellow" size="lg" shape="rounded">クラス</Badge> wandb.apis.public.Sweep

sweep に関連付けられた Runs の一覧。

```python theme={null}
(service_api: 'ServiceApi',
entity: 'str',
project: 'str',
sweep_id: 'str',
attrs: 'Mapping[str, Any] | None' = None)
```

<div id="args">
  ## 引数
</div>

<ResponseField name="service_api" type="ServiceApi">
  説明はありません。
</ResponseField>

<ResponseField name="entity" type="str">
  説明はありません。
</ResponseField>

<ResponseField name="project" type="str">
  説明はありません。
</ResponseField>

<ResponseField name="sweep_id" type="str">
  説明はありません。
</ResponseField>

<ResponseField name="attrs" type="Mapping[str, Any] | None">
  説明はありません。
</ResponseField>

<div id="attributes">
  ## 属性
</div>

* `runs` (`Runs`): run のリスト
* `id` (`str`): Sweep ID
* `project` (`str`): この sweep が属するプロジェクトの名
* `config` (`dict`): sweep の設定を含む辞書
* `state` (`str`): sweep の状態。"Finished"、"Failed"、"Crashed"、または "Running" のいずれかになります。
* `expected_run_count` (`int`): この sweep で想定される run 数

<div id="properties">
  ## プロパティ
</div>

<ResponseField name="config" type="">
  sweep で使用する sweep 設定。
</ResponseField>

<ResponseField name="entity" type="str">
  sweep に関連付けられた entity。
</ResponseField>

<ResponseField name="expected_run_count" type="int | None">
  sweep 内の想定される Runs 数を返します。無限に Runs する場合は None を返します。
</ResponseField>

<ResponseField name="name" type="">
  sweep の名前。

  次の優先順位で、存在する最初の名前を返します。

  1. ユーザーが編集した表示名
  2. 作成時に設定された名前
  3. Sweep ID
</ResponseField>

<ResponseField name="order" type="">
  sweep の順序キーを返します。
</ResponseField>

<ResponseField name="path" type="">
  project のパスを返します。

  パスは、entity、プロジェクト名、sweep ID を含むリストです。
</ResponseField>

<ResponseField name="url" type="">
  sweep の URL。

  sweep URL は、entity、project、「sweeps」という語、および sweep ID.run\_id から生成されます。
  SaaS ユーザーの場合、形式は
  `https://wandb.ai/entity/project/sweeps/sweeps_ID` です。
</ResponseField>

<ResponseField name="username" type="str">
  非推奨です。代わりに `Sweep.entity` を使用してください。
</ResponseField>

<div id="methods">
  ## メソッド
</div>

### <Badge color="blue" size="lg" shape="rounded">メソッド</Badge> Sweep.agent()

```python theme={null}
self,
agent_id: 'str'
```

ID を指定して、この sweep のエージェントをクエリします。

<div id="arguments">
  ##### 引数
</div>

<ResponseField name="agent_id" type="str">
  検索するエージェントの ID。
</ResponseField>

### <Badge color="blue" size="lg" shape="rounded">メソッド</Badge> Sweep.agents()

```python theme={null}
self
```

この sweep に含まれるすべてのエージェントの一覧をクエリします。

### <Badge color="blue" size="lg" shape="rounded">メソッド</Badge> Sweep.best\_run()

```python theme={null}
(self, order=None)
```

設定で定義されたメトリクス、または指定された順序でソートされた最良の run を返します。

<div id="arguments">
  ##### 引数
</div>

<ResponseField name="order" type="_empty">
  説明は提供されていません。
</ResponseField>

### <Badge color="blue" size="lg" shape="rounded">メソッド</Badge> Sweep.enqueue\_run()

```python theme={null}
self,
config: 'dict',
display_name: 'str | None' = None
```

sweep の run をキューに登録します。

<div id="arguments">
  ##### 引数
</div>

<ResponseField name="config" type="dict">
  run の設定。
</ResponseField>

<ResponseField name="display_name" type="str | None">
  run の表示名 (省略可) 。
</ResponseField>

<div id="raises">
  ##### 例外
</div>

* `UnsupportedError`: サーバーが sweep run のキューへの追加をサポートしていない場合。

### <Badge color="blue" size="lg" shape="rounded">メソッド</Badge> Sweep.get()

```python theme={null}
(api: 'Api',
entity: 'str | None' = None,
project: 'str | None' = None,
sid: 'str | None' = None,
order: 'str | None' = None,
query: 'str | None' = None, **kwargs)
```

クラウドバックエンドに対してクエリを実行します。

<div id="arguments">
  ##### 引数
</div>

<ResponseField name="api" type="Api">
  W\&B API のインスタンス。
</ResponseField>

<ResponseField name="entity" type="str | None">
  project を所有する entity (ユーザー名またはチーム) 。
</ResponseField>

<ResponseField name="project" type="str | None">
  sweep を取得する project の名。
</ResponseField>

<ResponseField name="sid" type="str | None">
  クエリする sweep ID。
</ResponseField>

<ResponseField name="order" type="str | None">
  sweep の Runs を返す順序。
</ResponseField>

<ResponseField name="query" type="str | None">
  クエリの実行に使用するクエリ。
</ResponseField>

<ResponseField name="kwargs" type="_empty">
  説明はありません。
</ResponseField>

### <Badge color="blue" size="lg" shape="rounded">メソッド</Badge> Sweep.to\_html()

```python theme={null}
self,
height: 'int' = 420,
hidden: 'bool' = False
```

この sweep を表示する iframe を含む HTML を生成します。

<div id="arguments">
  ##### 引数
</div>

<ResponseField name="height" type="int">
  説明はありません。
</ResponseField>

<ResponseField name="hidden" type="bool">
  説明はありません。
</ResponseField>
