From 2b12ba411143829967f84eaae33d283931692e7c Mon Sep 17 00:00:00 2001 From: Noah Luna <15202580+ngrayluna@users.noreply.github.com> Date: Tue, 16 Dec 2025 14:44:46 -0800 Subject: [PATCH] sdk v0.23.1 --- docs.json | 3 + .../automations/metricthresholdfilter.mdx | 5 +- .../python/automations/metriczscorefilter.mdx | 63 +++++++++++++++++++ .../python/automations/onaddartifactalias.mdx | 21 ++++++- .../python/automations/oncreateartifact.mdx | 18 +++++- .../ref/python/automations/onlinkartifact.mdx | 21 ++++++- models/ref/python/automations/onrunmetric.mdx | 21 ++++++- models/ref/python/automations/onrunstate.mdx | 50 +++++++++++++++ .../ref/python/automations/runstatefilter.mdx | 59 +++++++++++++++++ models/ref/python/automations/sendwebhook.mdx | 2 +- models/ref/python/experiments/run.mdx | 4 +- models/ref/python/experiments/settings.mdx | 62 ++++++++++++++---- models/ref/python/functions/init.mdx | 8 +-- models/ref/python/functions/login.mdx | 37 +++++++---- .../python/public-api/artifactcollection.mdx | 2 +- .../python/public-api/artifactcollections.mdx | 8 ++- .../ref/python/public-api/artifactfiles.mdx | 14 +++-- models/ref/python/public-api/artifacts.mdx | 11 +++- .../ref/python/public-api/artifacttypes.mdx | 7 ++- models/ref/python/public-api/automations.mdx | 2 - models/ref/python/public-api/registry.mdx | 2 +- models/ref/python/public-api/run.mdx | 39 +++++++++++- models/ref/python/public-api/runartifacts.mdx | 9 ++- models/ref/python/public-api/runs.mdx | 3 +- 24 files changed, 413 insertions(+), 58 deletions(-) create mode 100644 models/ref/python/automations/metriczscorefilter.mdx create mode 100644 models/ref/python/automations/onrunstate.mdx create mode 100644 models/ref/python/automations/runstatefilter.mdx diff --git a/docs.json b/docs.json index f8ae7178f1..f1002bc068 100644 --- a/docs.json +++ b/docs.json @@ -579,12 +579,15 @@ "models/ref/python/automations/automation", "models/ref/python/automations/donothing", "models/ref/python/automations/metricchangefilter", + "models/ref/python/automations/metriczscorefilter", "models/ref/python/automations/metricthresholdfilter", "models/ref/python/automations/newautomation", "models/ref/python/automations/onaddartifactalias", "models/ref/python/automations/oncreateartifact", "models/ref/python/automations/onlinkartifact", "models/ref/python/automations/onrunmetric", + "models/ref/python/automations/onrunstate", + "models/ref/python/automations/runstatefilter", "models/ref/python/automations/sendnotification", "models/ref/python/automations/sendwebhook" ] diff --git a/models/ref/python/automations/metricthresholdfilter.mdx b/models/ref/python/automations/metricthresholdfilter.mdx index 88f3ba44a6..18587f72b8 100644 --- a/models/ref/python/automations/metricthresholdfilter.mdx +++ b/models/ref/python/automations/metricthresholdfilter.mdx @@ -10,7 +10,10 @@ import { GitHubLink } from '/snippets/en/_includes/github-source-link.mdx'; ## class `MetricThresholdFilter` -Filter that compares a metric value against a user-defined threshold. +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. ### method `MetricThresholdFilter.__init__` diff --git a/models/ref/python/automations/metriczscorefilter.mdx b/models/ref/python/automations/metriczscorefilter.mdx new file mode 100644 index 0000000000..a477f05bec --- /dev/null +++ b/models/ref/python/automations/metriczscorefilter.mdx @@ -0,0 +1,63 @@ +--- +title: MetricZScoreFilter +namespace: automations_namespace +python_object_type: class +--- +import { GitHubLink } from '/snippets/en/_includes/github-source-link.mdx'; + + + + + +## class `MetricZScoreFilter` +Usage docs: https://docs.pydantic.dev/2.10/concepts/models/ + +A base class for creating Pydantic models. + +Attributes: + __class_vars__: The names of the class variables defined on the model. + __private_attributes__: Metadata about the private attributes of the model. + __signature__: The synthesized `__init__` [`Signature`][inspect.Signature] of the model. + + __pydantic_complete__: Whether model building is completed, or if there are still undefined fields. + __pydantic_core_schema__: The core schema of the model. + __pydantic_custom_init__: Whether the model has a custom `__init__` function. + __pydantic_decorators__: Metadata containing the decorators defined on the model. + This replaces `Model.__validators__` and `Model.__root_validators__` from Pydantic V1. + __pydantic_generic_metadata__: Metadata for generic models; contains data used for a similar purpose to + __args__, __origin__, __parameters__ in typing-module generics. May eventually be replaced by these. + __pydantic_parent_namespace__: Parent namespace of the model, used for automatic rebuilding of models. + __pydantic_post_init__: The name of the post-init method for the model, if defined. + __pydantic_root_model__: Whether the model is a [`RootModel`][pydantic.root_model.RootModel]. + __pydantic_serializer__: The `pydantic-core` `SchemaSerializer` used to dump instances of the model. + __pydantic_validator__: The `pydantic-core` `SchemaValidator` used to validate instances of the model. + + __pydantic_fields__: A dictionary of field names and their corresponding [`FieldInfo`][pydantic.fields.FieldInfo] objects. + __pydantic_computed_fields__: A dictionary of computed field names and their corresponding [`ComputedFieldInfo`][pydantic.fields.ComputedFieldInfo] objects. + + __pydantic_extra__: A dictionary containing extra values, if [`extra`][pydantic.config.ConfigDict.extra] + is set to `'allow'`. + __pydantic_fields_set__: The names of fields explicitly set during instantiation. + __pydantic_private__: Values of private attributes set on the model instance. + + +### method `MetricZScoreFilter.__init__` + +```python +__init__( + name: 'str', + window: 'int' = 30, + threshold: 'Annotated | Annotated' = 3.0, + change_dir: 'ChangeDir' = ANY +) → None +``` + +**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. diff --git a/models/ref/python/automations/onaddartifactalias.mdx b/models/ref/python/automations/onaddartifactalias.mdx index 3667ff4de1..a0b5084396 100644 --- a/models/ref/python/automations/onaddartifactalias.mdx +++ b/models/ref/python/automations/onaddartifactalias.mdx @@ -12,6 +12,23 @@ import { GitHubLink } from '/snippets/en/_includes/github-source-link.mdx'; ## class `OnAddArtifactAlias` A new alias is assigned to an artifact. +Examples: + Define an event that triggers whenever the alias "prod" is assigned to + any artifact in the collection "my-collection": + + ```python + from wandb import Api + from wandb.automations import OnAddArtifactAlias, ArtifactEvent + + api = Api() + collection = api.artifact_collection(name="my-collection", type_name="model") + + event = OnAddArtifactAlias( + scope=collection, + filter=ArtifactEvent.alias.eq("prod"), + ) + ``` + ### method `OnAddArtifactAlias.__init__` @@ -19,7 +36,7 @@ A new alias is assigned to an artifact. __init__( event_type: 'Literal[ADD_ARTIFACT_ALIAS]' = ADD_ARTIFACT_ALIAS, scope: '_ArtifactSequenceScope | _ArtifactPortfolioScope | ProjectScope', - filter: 'And | Or | Nor | Not | Lt | Gt | Lte | Gte | Eq | Ne | In | NotIn | Exists | Regex | Contains | dict[str, Any] | FilterExpr' = And([]) + filter: 'And | Or | Nor | Not | Lt | Gt | Lte | Gte | Eq | Ne | In | NotIn | Exists | Regex | Contains | FilterExpr | dict[str, Any]' = And(()) ) → None ``` @@ -27,7 +44,7 @@ __init__( - `event_type` (Literal[ADD_ARTIFACT_ALIAS]): - `scope` (Union[_ArtifactSequenceScope, _ArtifactPortfolioScope, ProjectScope]): The scope of the event. - - `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. + - `filter` (Union[And, Or, Nor, Not, Lt, Gt, Lte, Gte, Eq, Ne, In, NotIn, Exists, Regex, Contains, FilterExpr, Dict[str, Any]]): Additional conditions(s), if any, that are required for this event to trigger. **Returns:** An `OnAddArtifactAlias` object. diff --git a/models/ref/python/automations/oncreateartifact.mdx b/models/ref/python/automations/oncreateartifact.mdx index 5471563efc..948a5fb46d 100644 --- a/models/ref/python/automations/oncreateartifact.mdx +++ b/models/ref/python/automations/oncreateartifact.mdx @@ -12,6 +12,20 @@ import { GitHubLink } from '/snippets/en/_includes/github-source-link.mdx'; ## class `OnCreateArtifact` A new artifact is created. +Examples: + Define an event that triggers when a new artifact is created in the + collection "my-collection": + + ```python + from wandb import Api + from wandb.automations import OnCreateArtifact + + api = Api() + collection = api.artifact_collection(name="my-collection", type_name="model") + + event = OnCreateArtifact(scope=collection) + ``` + ### method `OnCreateArtifact.__init__` @@ -19,7 +33,7 @@ A new artifact is created. __init__( event_type: 'Literal[CREATE_ARTIFACT]' = CREATE_ARTIFACT, scope: '_ArtifactSequenceScope | _ArtifactPortfolioScope', - filter: 'And | Or | Nor | Not | Lt | Gt | Lte | Gte | Eq | Ne | In | NotIn | Exists | Regex | Contains | dict[str, Any] | FilterExpr' = And([]) + filter: 'And | Or | Nor | Not | Lt | Gt | Lte | Gte | Eq | Ne | In | NotIn | Exists | Regex | Contains | FilterExpr | dict[str, Any]' = And(()) ) → None ``` @@ -27,7 +41,7 @@ __init__( - `event_type` (Literal[CREATE_ARTIFACT]): - `scope` (Union[_ArtifactSequenceScope, _ArtifactPortfolioScope]): The scope of the event: must be an artifact collection. - - `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. + - `filter` (Union[And, Or, Nor, Not, Lt, Gt, Lte, Gte, Eq, Ne, In, NotIn, Exists, Regex, Contains, FilterExpr, Dict[str, Any]]): Additional conditions(s), if any, that are required for this event to trigger. **Returns:** An `OnCreateArtifact` object. diff --git a/models/ref/python/automations/onlinkartifact.mdx b/models/ref/python/automations/onlinkartifact.mdx index 08fe6f2d75..8b9198718a 100644 --- a/models/ref/python/automations/onlinkartifact.mdx +++ b/models/ref/python/automations/onlinkartifact.mdx @@ -12,6 +12,23 @@ import { GitHubLink } from '/snippets/en/_includes/github-source-link.mdx'; ## class `OnLinkArtifact` A new artifact is linked to a collection. +Examples: + Define an event that triggers when an artifact is linked to the + collection "my-collection" with the alias "prod": + + ```python + from wandb import Api + from wandb.automations import OnLinkArtifact, ArtifactEvent + + api = Api() + collection = api.artifact_collection(name="my-collection", type_name="model") + + event = OnLinkArtifact( + scope=collection, + filter=ArtifactEvent.alias.eq("prod"), + ) + ``` + ### method `OnLinkArtifact.__init__` @@ -19,7 +36,7 @@ A new artifact is linked to a collection. __init__( event_type: 'Literal[LINK_ARTIFACT]' = LINK_ARTIFACT, scope: '_ArtifactSequenceScope | _ArtifactPortfolioScope | ProjectScope', - filter: 'And | Or | Nor | Not | Lt | Gt | Lte | Gte | Eq | Ne | In | NotIn | Exists | Regex | Contains | dict[str, Any] | FilterExpr' = And([]) + filter: 'And | Or | Nor | Not | Lt | Gt | Lte | Gte | Eq | Ne | In | NotIn | Exists | Regex | Contains | FilterExpr | dict[str, Any]' = And(()) ) → None ``` @@ -27,7 +44,7 @@ __init__( - `event_type` (Literal[LINK_ARTIFACT]): - `scope` (Union[_ArtifactSequenceScope, _ArtifactPortfolioScope, ProjectScope]): The scope of the event. - - `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. + - `filter` (Union[And, Or, Nor, Not, Lt, Gt, Lte, Gte, Eq, Ne, In, NotIn, Exists, Regex, Contains, FilterExpr, Dict[str, Any]]): Additional conditions(s), if any, that are required for this event to trigger. **Returns:** An `OnLinkArtifact` object. diff --git a/models/ref/python/automations/onrunmetric.mdx b/models/ref/python/automations/onrunmetric.mdx index 61c2fca29e..ec947118fb 100644 --- a/models/ref/python/automations/onrunmetric.mdx +++ b/models/ref/python/automations/onrunmetric.mdx @@ -12,12 +12,29 @@ import { GitHubLink } from '/snippets/en/_includes/github-source-link.mdx'; ## class `OnRunMetric` A run metric satisfies a user-defined condition. +Examples: + Define an event that triggers for any run in project "my-project" when + the average of the last 5 values of metric "my-metric" exceeds 123.45: + + ```python + from wandb import Api + from wandb.automations import OnRunMetric, RunEvent + + api = Api() + project = api.project(name="my-project") + + event = OnRunMetric( + scope=project, + filter=RunEvent.metric("my-metric").avg(5).gt(123.45), + ) + ``` + ### method `OnRunMetric.__init__` ```python __init__( - event_type: 'Literal[RUN_METRIC_THRESHOLD, RUN_METRIC_CHANGE]', + event_type: 'Literal[RUN_METRIC_THRESHOLD, RUN_METRIC_CHANGE, RUN_METRIC_ZSCORE]', scope: 'ProjectScope', filter: 'RunMetricFilter' ) → None @@ -25,7 +42,7 @@ __init__( **Args:** - - `event_type` (Literal[RUN_METRIC_THRESHOLD, RUN_METRIC_CHANGE]): + - `event_type` (Literal[RUN_METRIC_THRESHOLD, RUN_METRIC_CHANGE, RUN_METRIC_ZSCORE]): - `scope` (ProjectScope): The scope of the event: must be a project. - `filter` (RunMetricFilter): Run and/or metric condition(s) that must be satisfied for this event to trigger. diff --git a/models/ref/python/automations/onrunstate.mdx b/models/ref/python/automations/onrunstate.mdx new file mode 100644 index 0000000000..0b244da66f --- /dev/null +++ b/models/ref/python/automations/onrunstate.mdx @@ -0,0 +1,50 @@ +--- +title: OnRunState +namespace: automations_namespace +python_object_type: class +--- +import { GitHubLink } from '/snippets/en/_includes/github-source-link.mdx'; + + + + + +## class `OnRunState` +A run state changes. + +Examples: + Define an event that triggers for any run in project "my-project" when + its state changes to "finished" (i.e. succeeded) or "failed": + + ```python + from wandb import Api + from wandb.automations import OnRunState + + api = Api() + project = api.project(name="my-project") + + event = OnRunState( + scope=project, + filter=RunEvent.state.in_(["finished", "failed"]), + ) + ``` + + +### method `OnRunState.__init__` + +```python +__init__( + event_type: 'Literal[RUN_STATE]' = RUN_STATE, + scope: 'ProjectScope', + filter: 'RunStateFilter' +) → None +``` + +**Args:** + + - `event_type` (Literal[RUN_STATE]): + - `scope` (ProjectScope): The scope of the event: must be a project. + - `filter` (RunStateFilter): Run state condition(s) that must be satisfied for this event to trigger. + +**Returns:** + An `OnRunState` object. diff --git a/models/ref/python/automations/runstatefilter.mdx b/models/ref/python/automations/runstatefilter.mdx new file mode 100644 index 0000000000..1a1fbadbca --- /dev/null +++ b/models/ref/python/automations/runstatefilter.mdx @@ -0,0 +1,59 @@ +--- +title: RunStateFilter +namespace: automations_namespace +python_object_type: class +--- +import { GitHubLink } from '/snippets/en/_includes/github-source-link.mdx'; + + + + + +## class `RunStateFilter` +Usage docs: https://docs.pydantic.dev/2.10/concepts/models/ + +A base class for creating Pydantic models. + +Attributes: + __class_vars__: The names of the class variables defined on the model. + __private_attributes__: Metadata about the private attributes of the model. + __signature__: The synthesized `__init__` [`Signature`][inspect.Signature] of the model. + + __pydantic_complete__: Whether model building is completed, or if there are still undefined fields. + __pydantic_core_schema__: The core schema of the model. + __pydantic_custom_init__: Whether the model has a custom `__init__` function. + __pydantic_decorators__: Metadata containing the decorators defined on the model. + This replaces `Model.__validators__` and `Model.__root_validators__` from Pydantic V1. + __pydantic_generic_metadata__: Metadata for generic models; contains data used for a similar purpose to + __args__, __origin__, __parameters__ in typing-module generics. May eventually be replaced by these. + __pydantic_parent_namespace__: Parent namespace of the model, used for automatic rebuilding of models. + __pydantic_post_init__: The name of the post-init method for the model, if defined. + __pydantic_root_model__: Whether the model is a [`RootModel`][pydantic.root_model.RootModel]. + __pydantic_serializer__: The `pydantic-core` `SchemaSerializer` used to dump instances of the model. + __pydantic_validator__: The `pydantic-core` `SchemaValidator` used to validate instances of the model. + + __pydantic_fields__: A dictionary of field names and their corresponding [`FieldInfo`][pydantic.fields.FieldInfo] objects. + __pydantic_computed_fields__: A dictionary of computed field names and their corresponding [`ComputedFieldInfo`][pydantic.fields.ComputedFieldInfo] objects. + + __pydantic_extra__: A dictionary containing extra values, if [`extra`][pydantic.config.ConfigDict.extra] + is set to `'allow'`. + __pydantic_fields_set__: The names of fields explicitly set during instantiation. + __pydantic_private__: Values of private attributes set on the model instance. + + +### method `RunStateFilter.__init__` + +```python +__init__( + run: 'And | Or | Nor | Not | Lt | Gt | Lte | Gte | Eq | Ne | In | NotIn | Exists | Regex | Contains | FilterExpr | dict[str, Any]' = And(()), + state: 'StateFilter' +) → None +``` + +**Args:** + + - `run` (Union[And, Or, Nor, Not, Lt, Gt, Lte, Gte, Eq, Ne, In, NotIn, Exists, Regex, Contains, FilterExpr, Dict[str, Any]]): Filters that must match any runs that will trigger this event. + - `state` (StateFilter): Run state condition(s) that must be satisfied for this event to trigger. + +**Returns:** + An `RunStateFilter` object. diff --git a/models/ref/python/automations/sendwebhook.mdx b/models/ref/python/automations/sendwebhook.mdx index 6f593e1723..f2fef31c07 100644 --- a/models/ref/python/automations/sendwebhook.mdx +++ b/models/ref/python/automations/sendwebhook.mdx @@ -37,7 +37,7 @@ __init__( ```python from_integration( integration: 'WebhookIntegration', - payload: 'Optional[SerializedToJson[dict[str, Any]]]' = None + payload: 'Optional[JsonEncoded[dict[str, Any]]]' = None ) → Self ``` diff --git a/models/ref/python/experiments/run.mdx b/models/ref/python/experiments/run.mdx index 45b197b6c0..881962fd85 100644 --- a/models/ref/python/experiments/run.mdx +++ b/models/ref/python/experiments/run.mdx @@ -767,8 +767,8 @@ Declare an artifact as an output of a run. log_code( root: 'str | None' = '.', name: 'str | None' = None, - include_fn: 'Callable[[str, str], bool] | Callable[[str], bool]' = , - exclude_fn: 'Callable[[str, str], bool] | Callable[[str], bool]' = + include_fn: 'Callable[[str, str], bool] | Callable[[str], bool]' = , + exclude_fn: 'Callable[[str, str], bool] | Callable[[str], bool]' = ) → Artifact | None ``` diff --git a/models/ref/python/experiments/settings.mdx b/models/ref/python/experiments/settings.mdx index 4d4ca099a8..f262e3326f 100644 --- a/models/ref/python/experiments/settings.mdx +++ b/models/ref/python/experiments/settings.mdx @@ -34,7 +34,7 @@ The settings are organized into three categories: __init__( allow_offline_artifacts: 'bool' = True, allow_val_change: 'bool' = False, - anonymous: 'Literal['allow', 'must', 'never'] | None' = None, + anonymous: 'object' = , api_key: 'str | None' = None, azure_account_url_to_access_key: 'dict[str, str] | None' = None, base_url: 'str' = 'https://api.wandb.ai', @@ -111,6 +111,7 @@ __init__( symlink: 'bool' = None, sync_tensorboard: 'bool | None' = None, table_raise_on_max_row_limit_exceeded: 'bool' = False, + use_dot_wandb: 'bool | None' = None, username: 'str | None' = None, x_cli_only_mode: 'bool' = False, x_disable_meta: 'bool' = False, @@ -156,7 +157,7 @@ __init__( x_service_wait: 'float' = 30.0, x_skip_transaction_log: 'bool' = False, x_start_time: 'float | None' = None, - x_stats_pid: 'int' = 42802, + x_stats_pid: 'int' = 55923, x_stats_sampling_interval: 'float' = 15.0, x_stats_neuron_monitor_config_path: 'str | None' = None, x_stats_dcgm_exporter: 'str | None' = None, @@ -184,16 +185,7 @@ __init__( - `allow_offline_artifacts` (bool): Flag to allow table artifacts to be synced in offline mode. To revert to the old behavior, set this to False. - `allow_val_change` (bool): Flag to allow modification of `Config` values after they've been set. - - `anonymous` (Optional[Literal['allow', 'must', 'never']]): Controls anonymous data logging. - Possible values are: - - "never": requires you to link your W&B account before - tracking the run, so you don't accidentally create an anonymous - run. - - "allow": lets a logged-in user track runs with their account, but - lets someone who is running the script without a W&B account see - the charts in the UI. - - "must": sends the run to an anonymous account instead of to a - signed-up user account. + - `anonymous` (object): Deprecated and will be removed. - `api_key` (Optional[str]): The W&B API key. - `azure_account_url_to_access_key` (Optional[Dict[str, str]]): Mapping of Azure account URLs to their corresponding access keys for Azure integration. - `base_url` (str): The URL of the W&B backend for data synchronization. @@ -331,6 +323,9 @@ __init__( - `symlink` (bool): Whether to use symlinks (True by default except on Windows). - `sync_tensorboard` (Optional[bool]): Whether to synchronize TensorBoard logs with W&B. - `table_raise_on_max_row_limit_exceeded` (bool): Whether to raise an exception when table row limits are exceeded. + - `use_dot_wandb` (Optional[bool]): Whether to use a hidden `.wandb` or visible `wandb` directory for run data. + If True, the SDK uses `.wandb`. If False, `wandb`. + If not set, defaults to `.wandb` if it already exists, otherwise `wandb`. - `username` (Optional[str]): Username. - `x_disable_meta` (bool): Flag to disable the collection of system metadata. @@ -432,6 +427,49 @@ __init__( **Returns:** An `Settings` object. + + +### method `Settings.validate_mutual_exclusion_of_branching_args` + +```python +validate_mutual_exclusion_of_branching_args() → Self +``` + +Check if `fork_from`, `resume`, and `resume_from` are mutually exclusive. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/models/ref/python/functions/init.mdx b/models/ref/python/functions/init.mdx index a6846beedc..d86add38cd 100644 --- a/models/ref/python/functions/init.mdx +++ b/models/ref/python/functions/init.mdx @@ -29,7 +29,6 @@ init( job_type: 'str | None' = None, mode: "Literal['online', 'offline', 'disabled', 'shared'] | None" = None, force: 'bool | None' = None, - anonymous: "Literal['never', 'allow', 'must'] | None" = None, reinit: "bool | Literal[None, 'default', 'return_previous', 'finish_previous', 'create_new']" = None, resume: "bool | Literal['allow', 'never', 'must', 'auto'] | None" = None, resume_from: 'str | None' = None, @@ -38,7 +37,8 @@ init( tensorboard: 'bool | None' = None, sync_tensorboard: 'bool | None' = None, monitor_gym: 'bool | None' = None, - settings: 'Settings | dict[str, Any] | None' = None + settings: 'Settings | dict[str, Any] | None' = None, + anonymous: 'DoNotSet' = ) → Run ``` @@ -73,10 +73,6 @@ Run IDs must not contain any of the following special characters `/ \ # ? % :` - `"disabled"`: Disables all W&B functionality, making the run’s methods no-ops. Typically used in testing to bypass W&B operations. - `"shared"`: (This is an experimental feature). Allows multiple processes, possibly on different machines, to simultaneously log to the same run. In this approach you use a primary node and one or more worker nodes to log data to the same run. Within the primary node you initialize a run. For each worker node, initialize a run using the run ID used by the primary node. - `force`: Determines if a W&B login is required to run the script. If `True`, the user must be logged in to W&B; otherwise, the script will not proceed. If `False` (default), the script can proceed without a login, switching to offline mode if the user is not logged in. - - `anonymous`: Specifies the level of control over anonymous data logging. Available options are: - - `"never"` (default): Requires you to link your W&B account before tracking the run. This prevents unintentional creation of anonymous runs by ensuring each run is associated with an account. - - `"allow"`: Enables a logged-in user to track runs with their account, but also allows someone running the script without a W&B account to view the charts and data in the UI. - - `"must"`: Forces the run to be logged to an anonymous account, even if the user is logged in. - `reinit`: Shorthand for the "reinit" setting. Determines the behavior of `wandb.init()` when a run is active. - `resume`: Controls the behavior when resuming a run with the specified `id`. Available options are: - `"allow"`: If a run with the specified `id` exists, it will resume from the last step; otherwise, a new run will be created. diff --git a/models/ref/python/functions/login.mdx b/models/ref/python/functions/login.mdx index 9b7bfc4d21..94119e65c2 100644 --- a/models/ref/python/functions/login.mdx +++ b/models/ref/python/functions/login.mdx @@ -14,35 +14,46 @@ import { GitHubLink } from '/snippets/en/_includes/github-source-link.mdx'; ```python login( - anonymous: "Literal['must', 'allow', 'never'] | None" = None, key: 'str | None' = None, relogin: 'bool | None' = None, host: 'str | None' = None, force: 'bool | None' = None, timeout: 'int | None' = None, verify: 'bool' = False, - referrer: 'str | None' = None + referrer: 'str | None' = None, + anonymous: 'DoNotSet' = ) → bool ``` -Set up W&B login credentials. +Log into W&B. -By default, this will only store credentials locally without verifying them with the W&B server. To verify credentials, pass `verify=True`. +You generally don't have to use this because most W&B methods that need authentication can log in implicitly. This is the programmatic counterpart to the `wandb login` CLI. + +This updates global credentials for the session (affecting all wandb usage in the current Python process after this call) and possibly the .netrc file. + +If the identity_token_file setting is set, like through the WANDB_IDENTITY_TOKEN_FILE environment variable, then this is a no-op. + +Otherwise, if an explicit API key is provided, it is used and written to the system .netrc file. If no key is provided, but the session is already authenticated, then the session key is used for verification (if verify is True) and the .netrc file is not updated. + +If none of the above is true, then this gets the API key from the first of: + + +- The WANDB_API_KEY environment variable +- The api_key setting in a system or workspace settings file +- The .netrc file (either ~/.netrc, ~/_netrc or the path specified by the NETRC environment variable) +- An interactive prompt (if available) **Args:** - - `anonymous`: Set to "must", "allow", or "never". If set to "must", always log a user in anonymously. If set to "allow", only create an anonymous user if the user isn't already logged in. If set to "never", never log a user anonymously. Default set to "never". Defaults to `None`. - `key`: The API key to use. - - `relogin`: If true, will re-prompt for API key. - - `host`: The host to connect to. - - `force`: If true, will force a relogin. - - `timeout`: Number of seconds to wait for user input. - - `verify`: Verify the credentials with the W&B server. - - `referrer`: The referrer to use in the URL login request. - - + - `relogin`: If true, get the API key from an interactive prompt, skipping reading .netrc, environment variables, etc. + - `host`: The W&B server URL to connect to. + - `force`: If true, disallows selecting offline mode in the interactive prompt. + - `timeout`: Number of seconds to wait for user input in the interactive prompt. This can be used as a failsafe if an interactive prompt is incorrectly shown in a non-interactive environment. + - `verify`: Verify the credentials with the W&B server and raise an AuthenticationError on failure. + - `referrer`: The referrer to use in the URL login request for analytics. diff --git a/models/ref/python/public-api/artifactcollection.mdx b/models/ref/python/public-api/artifactcollection.mdx index 6a16e74cbd..55ad850099 100644 --- a/models/ref/python/public-api/artifactcollection.mdx +++ b/models/ref/python/public-api/artifactcollection.mdx @@ -28,7 +28,7 @@ An artifact collection that represents a group of related artifacts. ### property ArtifactCollection.aliases -Artifact Collection Aliases. +The aliases for all artifact versions contained in this collection. diff --git a/models/ref/python/public-api/artifactcollections.mdx b/models/ref/python/public-api/artifactcollections.mdx index 93fa3cac39..12f795febb 100644 --- a/models/ref/python/public-api/artifactcollections.mdx +++ b/models/ref/python/public-api/artifactcollections.mdx @@ -24,7 +24,7 @@ Artifact collections of a specific type in a project. - `per_page`: The number of artifact collections to fetch per page. Default is 50. -### property ArtifactCollections.length +### property ArtifactCollections.cursor @@ -32,5 +32,11 @@ Artifact collections of a specific type in a project. --- +### property ArtifactCollections.more + + + + + diff --git a/models/ref/python/public-api/artifactfiles.mdx b/models/ref/python/public-api/artifactfiles.mdx index 7d4fe7d06a..5bc5fc3c9e 100644 --- a/models/ref/python/public-api/artifactfiles.mdx +++ b/models/ref/python/public-api/artifactfiles.mdx @@ -14,7 +14,7 @@ import { GitHubLink } from '/snippets/en/_includes/github-source-link.mdx'; A paginator for files in an artifact. -### property ArtifactFiles.length +### property ArtifactFiles.cursor @@ -22,6 +22,13 @@ A paginator for files in an artifact. --- +### property ArtifactFiles.more + + + + + +--- ### property ArtifactFiles.path @@ -31,7 +38,6 @@ Returns the path of the artifact. -**Returns:** - - `list[str]`: The path property value. ---- +**Returns:** + - `list[str]`: The path property value. \ No newline at end of file diff --git a/models/ref/python/public-api/artifacts.mdx b/models/ref/python/public-api/artifacts.mdx index 8ba84c30e2..979106c092 100644 --- a/models/ref/python/public-api/artifacts.mdx +++ b/models/ref/python/public-api/artifacts.mdx @@ -30,7 +30,7 @@ Optionally pass in filters to narrow down the results based on specific criteria - `tags`: Optional string or list of strings to filter artifacts by tags. -### property Artifacts.length +### property Artifacts.cursor @@ -38,4 +38,13 @@ Optionally pass in filters to narrow down the results based on specific criteria --- +### property Artifacts.more + + + + + + + +--- diff --git a/models/ref/python/public-api/artifacttypes.mdx b/models/ref/python/public-api/artifacttypes.mdx index 05c35fae05..fc395478c3 100644 --- a/models/ref/python/public-api/artifacttypes.mdx +++ b/models/ref/python/public-api/artifacttypes.mdx @@ -14,7 +14,7 @@ import { GitHubLink } from '/snippets/en/_includes/github-source-link.mdx'; An lazy iterator of `ArtifactType` objects for a specific project. -### property ArtifactTypes.QUERY +### property ArtifactTypes.cursor @@ -22,6 +22,11 @@ An lazy iterator of `ArtifactType` objects for a specific project. --- +### property ArtifactTypes.more + + + + diff --git a/models/ref/python/public-api/automations.mdx b/models/ref/python/public-api/automations.mdx index 44f03c1e41..17f2184268 100644 --- a/models/ref/python/public-api/automations.mdx +++ b/models/ref/python/public-api/automations.mdx @@ -10,6 +10,4 @@ import { GitHubLink } from '/snippets/en/_includes/github-source-link.mdx'; -## class `Automations` -An lazy iterator of `Automation` objects. diff --git a/models/ref/python/public-api/registry.mdx b/models/ref/python/public-api/registry.mdx index 464f3f7d23..85f1e43eaf 100644 --- a/models/ref/python/public-api/registry.mdx +++ b/models/ref/python/public-api/registry.mdx @@ -93,7 +93,7 @@ Description of the registry. **Returns:** - - `str`: The description property value. + - `str | None`: The description property value. --- ### property Registry.entity diff --git a/models/ref/python/public-api/run.mdx b/models/ref/python/public-api/run.mdx index d7010379f9..fdd656cd57 100644 --- a/models/ref/python/public-api/run.mdx +++ b/models/ref/python/public-api/run.mdx @@ -23,7 +23,8 @@ __init__( run_id: 'str', attrs: 'Mapping | None' = None, include_sweeps: 'bool' = True, - lazy: 'bool' = True + lazy: 'bool' = True, + api: 'public.Api | None' = None ) ``` @@ -56,7 +57,8 @@ __init__( - `path` (str): Unique identifier [entity]/[project]/[run_id] - `notes` (str): Notes about the run - `read_only` (boolean): Whether the run is editable - - `history_keys` (str): Keys of the history metrics that have been logged with `wandb.log({"key": "value"})` + - `history_keys` (str): Keys of the history metrics that have been + - `logged with `wandb.log({"key"`: "value"})` - `metadata` (str): Metadata about the run from wandb-metadata.json @@ -168,6 +170,39 @@ This API is deprecated. Use `entity` instead. +--- + +### method `Run.beta_scan_history` + +```python +beta_scan_history( + keys: 'list[str] | None' = None, + page_size=1000, + min_step=0, + max_step=None, + use_cache=True +) → public.BetaHistoryScan +``` + +Returns an iterable collection of all history records for a run. + +This function is still in development and may not work as expected. It uses wandb-core to read history from a run's exported parquet history locally. + + + +**Args:** + + - `keys`: list of metrics to read from the run's history. if no keys are provided then all metrics will be returned. + - `page_size`: the number of history records to read at a time. + - `min_step`: The minimum step to start reading history from (inclusive). + - `max_step`: The maximum step to read history up to (exclusive). + - `use_cache`: When set to True, checks the WANDB_CACHE_DIR for a run history. If the run history is not found in the cache, it will be downloaded from the server. If set to False, the run history will be downloaded every time. + + + +**Returns:** + A BetaHistoryScan object, which can be iterator over to get history records. + --- ### classmethod `Run.create` diff --git a/models/ref/python/public-api/runartifacts.mdx b/models/ref/python/public-api/runartifacts.mdx index aabec3c6a3..986eb15e31 100644 --- a/models/ref/python/public-api/runartifacts.mdx +++ b/models/ref/python/public-api/runartifacts.mdx @@ -14,7 +14,7 @@ import { GitHubLink } from '/snippets/en/_includes/github-source-link.mdx'; An iterable collection of artifacts associated with a specific run. -### property RunArtifacts.length +### property RunArtifacts.cursor @@ -22,4 +22,11 @@ An iterable collection of artifacts associated with a specific run. --- +### property RunArtifacts.more + + + + + + diff --git a/models/ref/python/public-api/runs.mdx b/models/ref/python/public-api/runs.mdx index 582de1053a..7093a89288 100644 --- a/models/ref/python/public-api/runs.mdx +++ b/models/ref/python/public-api/runs.mdx @@ -28,7 +28,8 @@ __init__( order: 'str' = '+created_at', per_page: 'int' = 50, include_sweeps: 'bool' = True, - lazy: 'bool' = True + lazy: 'bool' = True, + api: 'public.Api | None' = None ) ```