Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions docs.json
Original file line number Diff line number Diff line change
Expand Up @@ -910,7 +910,7 @@
"group": "Global Functions",
"pages": [
"models/ref/python/functions",
"models/ref/python/functions/agent",
"models/ref/python/functions/box3d",
"models/ref/python/functions/controller",
"models/ref/python/functions/finish",
"models/ref/python/functions/init",
Expand All @@ -926,7 +926,6 @@
"pages": [
"models/ref/python/data-types",
"models/ref/python/data-types/audio",
"models/ref/python/data-types/box3d",
"models/ref/python/data-types/evaltable",
"models/ref/python/data-types/histogram",
"models/ref/python/data-types/html",
Expand Down
74 changes: 40 additions & 34 deletions models/ref/python/automations/automation.mdx
Original file line number Diff line number Diff line change
@@ -1,47 +1,53 @@
---
title: Automation
namespace: automations_namespace
python_object_type: class
kind: class
namespace: wandb.automations.automations
---

import { GitHubLink } from '/snippets/_includes/github-source-link.mdx';

<GitHubLink url="https://github.com/wandb/wandb/blob/main/wandb/automations/automations.py" />

<GitHubLink url="https://github.com/wandb/wandb/blob/main/wandb/automations/automations.py#L19" />



## <kbd>class</kbd> Automation
```python
*,
__typename: Literal['Trigger'] = 'Trigger',
id: typing.Annotated[str, Strict(strict=True)],
createdAt: datetime.datetime,
updatedAt: datetime.datetime | None = None,
name: str,
description: str | None,
enabled: bool,
scope: typing.Annotated[wandb.automations.scopes._ArtifactSequenceScope | wandb.automations.scopes._ArtifactPortfolioScope | wandb.automations.scopes.ProjectScope, BeforeValidator(func=<function parse_scope>, json_schema_input_type=PydanticUndefined)],
event: wandb.automations.events.SavedEvent,
action: typing.Annotated[wandb.automations.actions.SavedLaunchJobAction | wandb.automations.actions.SavedNotificationAction | wandb.automations.actions.SavedWebhookAction | wandb.automations.actions.SavedNoOpAction, BeforeValidator(func=<function parse_saved_action>, json_schema_input_type=PydanticUndefined)]
```

## Description

## <kbd>class</kbd> `Automation`
A local instance of a saved W&B automation that supports editing.


### <kbd>method</kbd> `Automation.__init__`

```python
__init__(
typename__: 'Literal['Trigger']' = 'Trigger',
id: 'str',
created_at: 'datetime',
updated_at: 'datetime.datetime | None' = None,
name: 'str',
description: 'str | None',
enabled: 'bool',
scope: 'wandb.automations.scopes._ArtifactSequenceScope | wandb.automations.scopes._ArtifactPortfolioScope | wandb.automations.scopes.ProjectScope',
event: 'SavedEvent',
action: 'wandb.automations.actions.SavedLaunchJobAction | wandb.automations.actions.SavedNotificationAction | wandb.automations.actions.SavedWebhookAction | wandb.automations.actions.SavedNoOpAction'
) → None
```
## Args

- `id`:
- `createdAt`: The date and time when this automation was created.
- `updatedAt`: The date and time when this automation was last updated, if applicable.
- `name`: The name of this automation.
- `description`: An optional description of this automation.
- `enabled`: Whether this automation is enabled. Only enabled automations will trigger.
- `scope`: The scope in which the triggering event must occur.
- `event`: The event that will trigger this automation.
- `action`: The action that will execute when this automation is triggered.








**Args:**

- `typename__` (Literal['Trigger']):
- `id` (str):
- `created_at` (datetime): The date and time when this automation was created.
- `updated_at` (datetime.datetime | None): The date and time when this automation was last updated, if applicable.
- `name` (str): The name of this automation.
- `description` (str | None): An optional description of this automation.
- `enabled` (bool): Whether this automation is enabled. Only enabled automations will trigger.
- `scope` (wandb.automations.scopes._ArtifactSequenceScope | wandb.automations.scopes._ArtifactPortfolioScope | wandb.automations.scopes.ProjectScope): The scope in which the triggering event must occur.
- `event` (SavedEvent): The event that will trigger this automation.
- `action` (wandb.automations.actions.SavedLaunchJobAction | wandb.automations.actions.SavedNotificationAction | wandb.automations.actions.SavedWebhookAction | wandb.automations.actions.SavedNoOpAction): The action that will execute when this automation is triggered.

**Returns:**
An `Automation` object.
44 changes: 26 additions & 18 deletions models/ref/python/automations/donothing.mdx
Original file line number Diff line number Diff line change
@@ -1,32 +1,40 @@
---
title: DoNothing
namespace: automations_namespace
python_object_type: class
kind: class
namespace: wandb.automations.actions
---

import { GitHubLink } from '/snippets/_includes/github-source-link.mdx';

<GitHubLink url="https://github.com/wandb/wandb/blob/main/wandb/automations/actions.py" />

<GitHubLink url="https://github.com/wandb/wandb/blob/main/wandb/automations/actions.py#L208" />



## <kbd>class</kbd> DoNothing
```python
*,
no_op: typing.Annotated[bool, BeforeValidator(func=<function default_if_none>, json_schema_input_type=PydanticUndefined)] = True,
action_type: Literal[NO_OP] = NO_OP
```

## Description

## <kbd>class</kbd> `DoNothing`
Defines an automation action that intentionally does nothing.


### <kbd>method</kbd> `DoNothing.__init__`

```python
__init__(
no_op: 'bool' = True,
action_type: 'Literal[NO_OP]' = NO_OP
) → None
```
## Args

- `no_op`: Placeholder field which exists only to satisfy backend schema requirements.

There should never be a need to set this field explicitly, as its value is ignored.
- `action_type`:







**Args:**

- `no_op` (bool): Placeholder field which exists only to satisfy backend schema requirements.
There should never be a need to set this field explicitly, as its value is ignored.
- `action_type` (Literal[NO_OP]):

**Returns:**
An `DoNothing` object.
70 changes: 39 additions & 31 deletions models/ref/python/automations/metricchangefilter.mdx
Original file line number Diff line number Diff line change
@@ -1,47 +1,55 @@
---
title: MetricChangeFilter
namespace: automations_namespace
python_object_type: class
kind: class
namespace: wandb.automations._filters.run_metrics
---

import { GitHubLink } from '/snippets/_includes/github-source-link.mdx';

<GitHubLink url="https://github.com/wandb/wandb/blob/main/wandb/automations/_filters/run_metrics.py" />

<GitHubLink url="https://github.com/wandb/wandb/blob/main/wandb/automations/_filters/run_metrics.py#L153" />



## <kbd>class</kbd> MetricChangeFilter
```python
*,
name: str,
agg_op: wandb.automations._filters.run_metrics.Agg | None = None,
current_window_size: typing.Annotated[int, Gt(gt=0)] = 1,
cmp: NoneType = None,
change_amount: Union[Annotated[int, Gt(gt=0)], Annotated[float, Gt(gt=0)]],
prior_window_size: typing.Annotated[int, Gt(gt=0)] = <factory>,
change_type: wandb.automations._filters.run_metrics.ChangeType,
change_dir: wandb.automations._filters.run_metrics.ChangeDir
```

## Description

## <kbd>class</kbd> `MetricChangeFilter`
Filter that compares a **change** in a metric value to a user-defined threshold.

The change is calculated over "tumbling" windows, i.e. the difference
between the current window and the non-overlapping prior window.


### <kbd>method</kbd> `MetricChangeFilter.__init__`

```python
__init__(
name: 'str',
agg: 'wandb.automations._filters.run_metrics.Agg | None' = None,
window: 'int' = 1,
cmp: 'None' = None,
threshold: 'Annotated | Annotated',
prior_window: 'int' = None,
change_type: 'ChangeType',
change_dir: 'ChangeDir'
) → None
```
## Args

- `name`:
- `agg_op`:
- `current_window_size`:
- `cmp`: Ignored.
- `change_amount`:
- `prior_window_size`: Size of the "prior" metric aggregation window (ignored if `agg` is ``None``).

If omitted, defaults to the size of the current window.
- `change_type`:
- `change_dir`:








**Args:**

- `name` (str):
- `agg` (wandb.automations._filters.run_metrics.Agg | None):
- `window` (int):
- `cmp` (None): Ignored.
- `threshold` (Union[Annotated, Annotated]):
- `prior_window` (int): Size of the "prior" metric aggregation window (ignored if `agg` is ``None``).
If omitted, defaults to the size of the current window.
- `change_type` (ChangeType):
- `change_dir` (ChangeDir):

**Returns:**
An `MetricChangeFilter` object.
53 changes: 30 additions & 23 deletions models/ref/python/automations/metricthresholdfilter.mdx
Original file line number Diff line number Diff line change
@@ -1,40 +1,47 @@
---
title: MetricThresholdFilter
namespace: automations_namespace
python_object_type: class
kind: class
namespace: wandb.automations._filters.run_metrics
---

import { GitHubLink } from '/snippets/_includes/github-source-link.mdx';

<GitHubLink url="https://github.com/wandb/wandb/blob/main/wandb/automations/_filters/run_metrics.py" />

<GitHubLink url="https://github.com/wandb/wandb/blob/main/wandb/automations/_filters/run_metrics.py#L126" />



## <kbd>class</kbd> MetricThresholdFilter
```python
*,
name: str,
agg_op: wandb.automations._filters.run_metrics.Agg | None = None,
window_size: typing.Annotated[int, Gt(gt=0)] = 1,
cmp_op: Literal['$gte', '$gt', '$lt', '$lte'],
threshold: Union[Annotated[int, Strict(strict=True)], Annotated[float, Strict(strict=True)]]
```

## Description

## <kbd>class</kbd> `MetricThresholdFilter`
Filter that compares an **absolute** metric value against a user-defined threshold.

The value may be a single value or an aggregated result over a window of
multiple values.


### <kbd>method</kbd> `MetricThresholdFilter.__init__`

```python
__init__(
name: 'str',
agg: 'wandb.automations._filters.run_metrics.Agg | None' = None,
window: 'int' = 1,
cmp: 'Literal['$gte', '$gt', '$lt', '$lte']',
threshold: 'Annotated | Annotated'
) → None
```
## Args

- `name`:
- `agg_op`:
- `window_size`:
- `cmp_op`: Comparison operator between the metric value (left) vs. the threshold (right).
- `threshold`:







**Args:**

- `name` (str):
- `agg` (wandb.automations._filters.run_metrics.Agg | None):
- `window` (int):
- `cmp` (Literal['$gte', '$gt', '$lt', '$lte']): Comparison operator between the metric value (left) vs. the threshold (right).
- `threshold` (Union[Annotated, Annotated]):

**Returns:**
An `MetricThresholdFilter` object.
49 changes: 28 additions & 21 deletions models/ref/python/automations/metriczscorefilter.mdx
Original file line number Diff line number Diff line change
@@ -1,35 +1,42 @@
---
title: MetricZScoreFilter
namespace: automations_namespace
python_object_type: class
kind: class
namespace: wandb.automations._filters.run_metrics
---

import { GitHubLink } from '/snippets/_includes/github-source-link.mdx';

<GitHubLink url="https://github.com/wandb/wandb/blob/main/wandb/automations/_filters/run_metrics.py" />

<GitHubLink url="https://github.com/wandb/wandb/blob/main/wandb/automations/_filters/run_metrics.py#L202" />



## <kbd>class</kbd> MetricZScoreFilter
```python
*,
name: str,
window_size: typing.Annotated[int, Gt(gt=0)] = 30,
threshold: Union[Annotated[int, Gt(gt=0)], Annotated[float, Gt(gt=0)]] = 3.0,
change_dir: wandb.automations._filters.run_metrics.ChangeDir = ANY
```

## Description

## <kbd>class</kbd> `MetricZScoreFilter`
Filter that compares a metric's z-score against a user-defined threshold.


### <kbd>method</kbd> `MetricZScoreFilter.__init__`

```python
__init__(
name: 'str',
window: 'int' = 30,
threshold: 'Annotated | Annotated' = 3.0,
change_dir: 'ChangeDir' = ANY
) → None
```
## Args

- `name`: Name of the observed metric.
- `window_size`: Size of the window to calculate the metric mean and standard deviation over.
- `threshold`: Threshold for the z-score.
- `change_dir`: Direction of the z-score change to watch for.







**Args:**

- `name` (str): Name of the observed metric.
- `window` (int): Size of the window to calculate the metric mean and standard deviation over.
- `threshold` (Union[Annotated, Annotated]): Threshold for the z-score.
- `change_dir` (ChangeDir): Direction of the z-score change to watch for.

**Returns:**
An `MetricZScoreFilter` object.
Loading
Loading