Skip to content

Commit 8f6d121

Browse files
authored
SDK Release: Manual SDK v23.0 (#1895)
## Description Manual SDK Release for v23.0 Fixed some rendering issues in source. See accompanying PR: wandb/wandb#10930 <!-- Uncomment and add a description of the change --> <!-- Optionally, uncomment the heading and add details about how you tested the change and how reviewers should test it. For example: ## Testing - [ ] Local build succeeds without errors (`mint dev`) - [ ] Local link check succeeds without errors (`mint broken-links`) - [ ] PR tests succeed Replace the `[ ]` with `[x]` to check off the item instead of leaving it unchecked. Otherwise, delete this entire section from opening to closing comment. --> <!-- Optionally, uncomment the heading and add one or more lines like these. Otherwise, delete this entire section from opening to closing comment. ## Related issues - Fixes DOCS-12345 - Fixes #12345 -->
1 parent bf8bf7a commit 8f6d121

19 files changed

Lines changed: 342 additions & 128 deletions

models/ref/python.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
title: Python SDK 0.22.2
2+
title: Python SDK 0.23.0
33
module:
44
---
55
The W&B Python SDK, accessible at `wandb`, enables you to train and fine-tune models, and manage models from experimentation to production.

models/ref/python/automations/automation.mdx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,14 @@ import { GitHubLink } from '/snippets/en/_includes/github-source-link.mdx';
1010

1111

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

1515

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

1818
```python
1919
__init__(
20-
typename__: 'Literal['Trigger']' = 'Trigger',
20+
typename__: 'Literal' = 'Trigger',
2121
id: 'str',
2222
created_at: 'datetime',
2323
updated_at: 'datetime | None' = None,
@@ -32,7 +32,7 @@ __init__(
3232

3333
**Args:**
3434

35-
- `typename__` (Literal['Trigger']):
35+
- `typename__` (Literal):
3636
- `id` (str):
3737
- `created_at` (datetime): The date and time when this automation was created.
3838
- `updated_at` (Optional[datetime]): The date and time when this automation was last updated, if applicable.

models/ref/python/automations/metricchangefilter.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import { GitHubLink } from '/snippets/en/_includes/github-source-link.mdx';
1010

1111

1212
## <kbd>class</kbd> `MetricChangeFilter`
13-
Defines a filter that compares a change in a run metric against a user-defined threshold.
13+
Filter that compares a **change** in a metric value to a user-defined threshold.
1414

1515
The change is calculated over "tumbling" windows, i.e. the difference
1616
between the current window and the non-overlapping prior window.
@@ -38,7 +38,7 @@ __init__(
3838
- `window` (int):
3939
- `cmp` (None): Ignored.
4040
- `threshold` (Union[Annotated, Annotated]):
41-
- `prior_window` (int): Size of the prior window over which the metric is aggregated (ignored if `agg is None`).
41+
- `prior_window` (int): Size of the "prior" metric aggregation window (ignored if `agg` is ``None``).
4242
If omitted, defaults to the size of the current window.
4343
- `change_type` (ChangeType):
4444
- `change_dir` (ChangeDir):

models/ref/python/automations/metricthresholdfilter.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import { GitHubLink } from '/snippets/en/_includes/github-source-link.mdx';
1010

1111

1212
## <kbd>class</kbd> `MetricThresholdFilter`
13-
Defines a filter that compares a run metric against a user-defined threshold value.
13+
Filter that compares a metric value against a user-defined threshold.
1414

1515

1616
### <kbd>method</kbd> `MetricThresholdFilter.__init__`
@@ -30,7 +30,7 @@ __init__(
3030
- `name` (str):
3131
- `agg` (Optional[Agg]):
3232
- `window` (int):
33-
- `cmp` (Literal['$gte', '$gt', '$lt', '$lte']): Comparison operator used to compare the metric value (left) vs. the threshold value (right).
33+
- `cmp` (Literal['$gte', '$gt', '$lt', '$lte']): Comparison operator between the metric value (left) vs. the threshold (right).
3434
- `threshold` (Union[Annotated, Annotated]):
3535

3636
**Returns:**

models/ref/python/automations/onaddartifactalias.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ __init__(
2727

2828
- `event_type` (Literal[ADD_ARTIFACT_ALIAS]):
2929
- `scope` (Union[_ArtifactSequenceScope, _ArtifactPortfolioScope, ProjectScope]): The scope of the event.
30-
- `filter` (Union[And, Or, Nor, Not, Lt, Gt, Lte, Gte, Eq, Ne, In, NotIn, Exists, Regex, Contains, Dict[str, Any], FilterExpr]): Additional condition(s), if any, that must be met for this event to trigger an automation.
30+
- `filter` (Union[And, Or, Nor, Not, Lt, Gt, Lte, Gte, Eq, Ne, In, NotIn, Exists, Regex, Contains, Dict[str, Any], FilterExpr]): Additional conditions(s), if any, that are required for this event to trigger.
3131

3232
**Returns:**
3333
An `OnAddArtifactAlias` object.

models/ref/python/automations/oncreateartifact.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@ __init__(
2626
**Args:**
2727

2828
- `event_type` (Literal[CREATE_ARTIFACT]):
29-
- `scope` (Union[_ArtifactSequenceScope, _ArtifactPortfolioScope]): The scope of the event: only artifact collections are valid scopes for this event.
30-
- `filter` (Union[And, Or, Nor, Not, Lt, Gt, Lte, Gte, Eq, Ne, In, NotIn, Exists, Regex, Contains, Dict[str, Any], FilterExpr]): Additional condition(s), if any, that must be met for this event to trigger an automation.
29+
- `scope` (Union[_ArtifactSequenceScope, _ArtifactPortfolioScope]): The scope of the event: must be an artifact collection.
30+
- `filter` (Union[And, Or, Nor, Not, Lt, Gt, Lte, Gte, Eq, Ne, In, NotIn, Exists, Regex, Contains, Dict[str, Any], FilterExpr]): Additional conditions(s), if any, that are required for this event to trigger.
3131

3232
**Returns:**
3333
An `OnCreateArtifact` object.

models/ref/python/automations/onlinkartifact.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ __init__(
2727

2828
- `event_type` (Literal[LINK_ARTIFACT]):
2929
- `scope` (Union[_ArtifactSequenceScope, _ArtifactPortfolioScope, ProjectScope]): The scope of the event.
30-
- `filter` (Union[And, Or, Nor, Not, Lt, Gt, Lte, Gte, Eq, Ne, In, NotIn, Exists, Regex, Contains, Dict[str, Any], FilterExpr]): Additional condition(s), if any, that must be met for this event to trigger an automation.
30+
- `filter` (Union[And, Or, Nor, Not, Lt, Gt, Lte, Gte, Eq, Ne, In, NotIn, Exists, Regex, Contains, Dict[str, Any], FilterExpr]): Additional conditions(s), if any, that are required for this event to trigger.
3131

3232
**Returns:**
3333
An `OnLinkArtifact` object.

models/ref/python/automations/onrunmetric.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@ __init__(
2626
**Args:**
2727

2828
- `event_type` (Literal[RUN_METRIC_THRESHOLD, RUN_METRIC_CHANGE]):
29-
- `scope` (ProjectScope): The scope of the event: only projects are valid scopes for this event.
30-
- `filter` (RunMetricFilter): Run and/or metric condition(s) that must be satisfied for this event to trigger an automation.
29+
- `scope` (ProjectScope): The scope of the event: must be a project.
30+
- `filter` (RunMetricFilter): Run and/or metric condition(s) that must be satisfied for this event to trigger.
3131

3232
**Returns:**
3333
An `OnRunMetric` object.

models/ref/python/data-types/image.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,8 @@ This class handles various image data formats and automatically normalizes pixel
4343
- `data_or_path`: Accepts NumPy array/pytorch tensor of image data, a PIL image object, or a path to an image file. If a NumPy array or pytorch tensor is provided, the image data will be saved to the given file type. If the values are not in the range [0, 255] or all values are in the range [0, 1], the image pixel values will be normalized to the range [0, 255] unless `normalize` is set to `False`.
4444
- pytorch tensor should be in the format (channel, height, width)
4545
- NumPy array should be in the format (height, width, channel)
46-
- `mode`: The PIL mode for an image. Most common are "L", "RGB",
47-
- `"RGBA". Full explanation at https`: //pillow.readthedocs.io/en/stable/handbook/concepts.html#modes
46+
- `mode`: The PIL mode for an image. Most common are "L", "RGB", "RGBA".
47+
- `Full Pillow docs for more information https`: //pillow.readthedocs.io/en/stable/handbook/concepts.html#modes
4848
- `caption`: Label for display of image.
4949
- `grouping`: The grouping number for the image.
5050
- `classes`: A list of class information for the image, used for labeling bounding boxes, and image masks.

models/ref/python/experiments/artifact.mdx

Lines changed: 27 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -32,12 +32,11 @@ __init__(
3232
**Args:**
3333

3434
- `name` (str): A human-readable name for the artifact. Use the name to identify a specific artifact in the W&B App UI or programmatically. You can interactively reference an artifact with the `use_artifact` Public API. A name can contain letters, numbers, underscores, hyphens, and dots. The name must be unique across a project.
35-
- `type` (str): The artifact's type. Use the type of an artifact to both organize and differentiate artifacts. You can use any string that contains letters, numbers, underscores, hyphens, and dots. Common types include `dataset` or `model`. Include `model` within your type string if you want to link the artifact to the W&B Model Registry. Note that some types reserved for internal use and cannot be set by users. Such types include `job` and types that start with `wandb-`.
36-
- `description (str | None) = None`: A description of the artifact. For Model or Dataset Artifacts, add documentation for your standardized team model or dataset card. View an artifact's description programmatically with the `Artifact.description` attribute or programmatically with the W&B App UI. W&B renders the description as markdown in the W&B App.
37-
- `metadata (dict[str, Any] | None) = None`: Additional information about an artifact. Specify metadata as a dictionary of key-value pairs. You can specify no more than 100 total keys.
35+
- `type` (str): The artifact's type. Use the type of an artifact to both organize and differentiate artifacts. You can use any string that contains letters, numbers, underscores, hyphens, and dots. Common types include `dataset` or `model`. Include `model` within your type string if you want to link the artifact to the W&B Model Registry. Note that some types reserved for internal use and cannot be set by users. Such types include `job` and types that start with `wandb-`.
36+
- `description (str | None) = None`: A description of the artifact. For Model or Dataset Artifacts, add documentation for your standardized team model or dataset card. View an artifact's description programmatically with the `Artifact.description` attribute or programmatically with the W&B App UI. W&B renders the description as markdown in the W&B App.
37+
- `metadata (dict[str, Any] | None) = None`: Additional information about an artifact. Specify metadata as a dictionary of key-value pairs. You can specify no more than 100 total keys.
3838
- `incremental`: Use `Artifact.new_draft()` method instead to modify an existing artifact.
3939
- `use_as`: Deprecated.
40-
- `is_link`: Boolean indication of if the artifact is a linked artifact(`True`) or source artifact(`False`).
4140

4241

4342

@@ -68,9 +67,11 @@ Aliases are mutable references that you can programmatically reference. Change a
6867

6968
### <kbd>property</kbd> Artifact.collection
7069

71-
The collection this artifact was retrieved from.
70+
The collection this artifact is retrieved from.
7271

73-
A collection is an ordered group of artifact versions. If this artifact was retrieved from a portfolio / linked collection, that collection will be returned rather than the collection that an artifact version originated from. The collection that an artifact originates from is known as the source sequence.
72+
A collection is an ordered group of artifact versions. If this artifact is retrieved from a collection that it is linked to, return that collection. Otherwise, return the collection that the artifact version originates from.
73+
74+
The collection that an artifact originates from is known as the source sequence.
7475

7576

7677

@@ -145,7 +146,7 @@ The number of files (including references).
145146

146147
### <kbd>property</kbd> Artifact.history_step
147148

148-
The nearest step at which history metrics were logged for the source run of the artifact.
149+
The nearest step which logged history metrics for this artifact's source run.
149150

150151

151152

@@ -193,7 +194,9 @@ True: The artifact is a link artifact to a source artifact. False: The artifact
193194

194195
Returns a list of all the linked artifacts of a source artifact.
195196

196-
If the artifact is a link artifact (`artifact.is_link == True`), it will return an empty list. Limited to 500 results.
197+
If this artifact is a link artifact (`artifact.is_link == True`), it will return an empty list.
198+
199+
Limited to 500 results.
197200

198201

199202

@@ -275,9 +278,9 @@ Includes any references tracked by this artifact.
275278

276279
### <kbd>property</kbd> Artifact.source_artifact
277280

278-
Returns the source artifact. The source artifact is the original logged artifact.
281+
Returns the source artifact, which is the original logged artifact.
279282

280-
If the artifact itself is a source artifact (`artifact.is_link == False`), it will return itself.
283+
If this artifact is a source artifact (`artifact.is_link == False`), it will return itself.
281284

282285

283286

@@ -439,7 +442,7 @@ Deprecated.
439442

440443
The artifact's version.
441444

442-
A string with the format `v{number}`. If the artifact is a link artifact, the version will be from the linked collection.
445+
A string with the format `v{number}`. If this is a link artifact, the version will be from the linked collection.
443446

444447

445448

@@ -504,9 +507,9 @@ Add a local directory to the artifact.
504507
- `name`: The subdirectory name within an artifact. The name you specify appears in the W&B App UI nested by artifact's `type`. Defaults to the root of the artifact.
505508
- `skip_cache`: If set to `True`, W&B will not copy/move files to the cache while uploading
506509
- `policy`: By default, "mutable".
507-
- mutable: Create a temporary copy of the file to prevent corruption during upload.
508-
- immutable: Disable protection, rely on the user not to delete or change the file.
509-
- `merge`: If `False` (default), throws ValueError if a file was already added in a previous add_dir call and its content has changed. If `True`, overwrites existing files with changed content. Always adds new files and never removes files. To replace an entire directory, pass a name when adding the directory using `add_dir(local_path, name=my_prefix)` and call `remove(my_prefix)` to remove the directory, then add it again.
510+
- mutable: Create a temporary copy of the file to prevent corruption during upload.
511+
- immutable: Disable protection, rely on the user not to delete or change the file.
512+
- `merge`: If `False` (default), throws ValueError if a file was already added in a previous add_dir call and its content has changed. If `True`, overwrites existing files with changed content. Always adds new files and never removes files. To replace an entire directory, pass a name when adding the directory using `add_dir(local_path, name=my_prefix)` and call `remove(my_prefix)` to remove the directory, then add it again.
510513

511514

512515

@@ -590,7 +593,7 @@ For any other scheme, the digest is just a hash of the URI and the size is left
590593

591594
- `uri`: The URI path of the reference to add. The URI path can be an object returned from `Artifact.get_entry` to store a reference to another artifact's entry.
592595
- `name`: The path within the artifact to place the contents of this reference.
593-
- `checksum`: Whether or not to checksum the resource(s) located at the reference URI. Checksumming is strongly recommended as it enables automatic integrity validation. Disabling checksumming will speed up artifact creation but reference directories will not iterated through so the objects in the directory will not be saved to the artifact. We recommend setting `checksum=False` when adding reference objects, in which case a new version will only be created if the reference URI changes.
596+
- `checksum`: Whether or not to checksum the resource(s) located at the reference URI. Checksumming is strongly recommended as it enables automatic integrity validation. Disabling checksumming will speed up artifact creation but reference directories will not iterated through so the objects in the directory will not be saved to the artifact. We recommend setting `checksum=False` when adding reference objects, in which case a new version will only be created if the reference URI changes.
594597
- `max_objects`: The maximum number of objects to consider when adding a reference that points to directory or bucket store prefix. By default, the maximum number of objects allowed for Amazon S3, GCS, Azure, and local files is 10,000,000. Other URI schemas do not have a maximum.
595598

596599

@@ -645,13 +648,13 @@ Delete an artifact and its files.
645648

646649
If called on a linked artifact, only the link is deleted, and the source artifact is unaffected.
647650

648-
Use `artifact.unlink()` instead of `artifact.delete()` to remove a link between a source artifact and a linked artifact.
651+
Use `Artifact.unlink()` instead of `Artifact.delete()` to remove a link between a source artifact and a collection.
649652

650653

651654

652655
**Args:**
653656

654-
- `delete_aliases`: If set to `True`, deletes all aliases associated with the artifact. Otherwise, this raises an exception if the artifact has existing aliases. This parameter is ignored if the artifact is linked (a member of a portfolio collection).
657+
- `delete_aliases`: If set to `True`, delete all aliases associated with the artifact. If `False`, raise an exception if the artifact has existing aliases. This parameter is ignored if the artifact is retrieved from a collection it is linked to.
655658

656659

657660

@@ -685,7 +688,7 @@ Existing files located within `root` are not modified. Explicitly delete `root`
685688
- `allow_missing_references`: If set to `True`, any invalid reference paths will be ignored while downloading referenced files.
686689
- `skip_cache`: If set to `True`, the artifact cache will be skipped when downloading and W&B will download each file into the default root or specified download directory.
687690
- `path_prefix`: If specified, only files with a path that starts with the given prefix will be downloaded. Uses unix format (forward slashes).
688-
- `multipart`: If set to `None` (default), the artifact will be downloaded in parallel using multipart download if individual file size is greater than 2GB. If set to `True` or `False`, the artifact will be downloaded in parallel or serially regardless of the file size.
691+
- `multipart`: If set to `None` (default), the artifact will be downloaded in parallel using multipart download if individual file size is greater than 2GB. If set to `True` or `False`, the artifact will be downloaded in parallel or serially regardless of the file size.
689692

690693

691694

@@ -887,17 +890,17 @@ Returns the artifact encoded to the JSON format.
887890
### <kbd>method</kbd> `Artifact.link`
888891

889892
```python
890-
link(target_path: 'str', aliases: 'list[str] | None' = None) → Artifact
893+
link(target_path: 'str', aliases: 'Iterable[str] | None' = None) → Artifact
891894
```
892895

893-
Link this artifact to a portfolio (a promoted collection of artifacts).
896+
Link this artifact to a collection.
894897

895898

896899

897900
**Args:**
898901

899-
- `target_path`: The path to the portfolio inside a project. The target path must adhere to one of the following schemas `{portfolio}`, `{project}/{portfolio}` or `{entity}/{project}/{portfolio}`. To link the artifact to the Model Registry, rather than to a generic portfolio inside a project, set `target_path` to the following schema `{"model-registry"}/{Registered Model Name}` or `{entity}/{"model-registry"}/{Registered Model Name}`.
900-
- `aliases`: A list of strings that uniquely identifies the artifact inside the specified portfolio.
902+
- `target_path`: The path of the collection. Path consists of the prefix "wandb-registry-" along with the registry name and the collection name `wandb-registry-{REGISTRY_NAME}/{COLLECTION_NAME}`.
903+
- `aliases`: Add one or more aliases to the linked artifact. The "latest" alias is automatically applied to the most recent artifact you link.
901904

902905

903906

@@ -1040,14 +1043,14 @@ If currently in a run, that run will log this artifact. If not currently in a ru
10401043
unlink() → None
10411044
```
10421045

1043-
Unlink this artifact if it is currently a member of a promoted collection of artifacts.
1046+
Unlink this artifact if it is a linked member of an artifact collection.
10441047

10451048

10461049

10471050
**Raises:**
10481051

10491052
- `ArtifactNotLoggedError`: If the artifact is not logged.
1050-
- `ValueError`: If the artifact is not linked, in other words, it is not a member of a portfolio collection.
1053+
- `ValueError`: If the artifact is not linked to any collection.
10511054

10521055
---
10531056

0 commit comments

Comments
 (0)