From 6671ffddf40c6ed907a88c5c8f4c3ec1e6606566 Mon Sep 17 00:00:00 2001 From: Noah Luna <15202580+ngrayluna@users.noreply.github.com> Date: Tue, 23 Jun 2026 21:37:38 -0700 Subject: [PATCH 1/9] latest --- models/ref/python/automations/automation.mdx | 583 ++++++- models/ref/python/automations/donothing.mdx | 542 +++++- .../python/automations/metricchangefilter.mdx | 566 ++++++- .../automations/metricthresholdfilter.mdx | 553 +++++- .../python/automations/metriczscorefilter.mdx | 549 +++++- .../ref/python/automations/newautomation.mdx | 560 ++++++- .../python/automations/onaddartifactalias.mdx | 562 ++++++- .../python/automations/onaddartifacttag.mdx | 562 ++++++- .../python/automations/onaddcollectiontag.mdx | 561 ++++++- .../python/automations/oncreateartifact.mdx | 562 ++++++- .../ref/python/automations/onlinkartifact.mdx | 562 ++++++- .../automations/onremoveartifacttag.mdx | 561 ++++++- .../automations/onremovecollectiontag.mdx | 561 ++++++- models/ref/python/automations/onrunmetric.mdx | 562 ++++++- models/ref/python/automations/onrunstate.mdx | 562 ++++++- .../python/automations/onunlinkartifact.mdx | 561 ++++++- .../ref/python/automations/runstatefilter.mdx | 541 +++++- .../python/automations/sendnotification.mdx | 575 ++++++- models/ref/python/automations/sendwebhook.mdx | 561 ++++++- models/ref/python/custom-charts/bar.mdx | 59 +- .../python/custom-charts/confusion_matrix.mdx | 90 +- models/ref/python/custom-charts/histogram.mdx | 49 +- models/ref/python/custom-charts/line.mdx | 83 +- .../ref/python/custom-charts/line_series.mdx | 121 +- .../ref/python/custom-charts/plot_table.mdx | 69 +- models/ref/python/custom-charts/pr_curve.mdx | 77 +- models/ref/python/custom-charts/roc_curve.mdx | 70 +- models/ref/python/custom-charts/scatter.mdx | 63 +- models/ref/python/data-types/audio.mdx | 160 +- models/ref/python/data-types/evaltable.mdx | 307 +++- models/ref/python/data-types/histogram.mdx | 125 +- models/ref/python/data-types/html.mdx | 178 +- models/ref/python/data-types/image.mdx | 198 ++- models/ref/python/data-types/molecule.mdx | 236 ++- models/ref/python/data-types/object3d.mdx | 247 ++- models/ref/python/data-types/plotly.mdx | 186 ++- models/ref/python/data-types/table.mdx | 297 +++- models/ref/python/data-types/video.mdx | 204 ++- models/ref/python/experiments/artifact.mdx | 1143 +++++-------- models/ref/python/experiments/run.mdx | 1276 ++++++-------- models/ref/python/experiments/settings.mdx | 1388 ++++++++++------ models/ref/python/functions/controller.mdx | 40 +- models/ref/python/functions/finish.mdx | 47 +- models/ref/python/functions/init.mdx | 168 +- models/ref/python/functions/login.mdx | 91 +- models/ref/python/functions/restore.mdx | 52 +- models/ref/python/functions/setup.mdx | 59 +- models/ref/python/functions/sweep.mdx | 55 +- models/ref/python/functions/teardown.mdx | 39 +- models/ref/python/public-api/agentruns.mdx | 91 +- models/ref/python/public-api/api.mdx | 1478 +++++++---------- .../python/public-api/artifactcollection.mdx | 168 +- .../python/public-api/artifactcollections.mdx | 80 +- .../ref/python/public-api/artifactfiles.mdx | 75 +- models/ref/python/public-api/artifacts.mdx | 76 +- models/ref/python/public-api/artifacttype.mdx | 92 +- .../ref/python/public-api/artifacttypes.mdx | 70 +- models/ref/python/public-api/automations.mdx | 83 +- models/ref/python/public-api/betareport.mdx | 141 +- .../public-api/downloadhistoryresult.mdx | 41 +- models/ref/python/public-api/file.mdx | 111 +- models/ref/python/public-api/files.mdx | 85 +- .../public-api/incompleterunhistoryerror.mdx | 48 +- models/ref/python/public-api/member.mdx | 42 +- models/ref/python/public-api/project.mdx | 131 +- .../public-api/projectartifactcollections.mdx | 77 +- models/ref/python/public-api/projects.mdx | 77 +- models/ref/python/public-api/registry.mdx | 446 ++--- models/ref/python/public-api/reports.mdx | 73 +- models/ref/python/public-api/run.mdx | 741 ++++----- models/ref/python/public-api/runartifacts.mdx | 70 +- models/ref/python/public-api/runs.mdx | 132 +- models/ref/python/public-api/sweep.mdx | 201 ++- models/ref/python/public-api/sweeps.mdx | 71 +- models/ref/python/public-api/team.mdx | 98 +- models/ref/python/public-api/user.mdx | 114 +- 76 files changed, 16927 insertions(+), 5808 deletions(-) diff --git a/models/ref/python/automations/automation.mdx b/models/ref/python/automations/automation.mdx index c336e70984..6dced1738c 100644 --- a/models/ref/python/automations/automation.mdx +++ b/models/ref/python/automations/automation.mdx @@ -1,47 +1,558 @@ --- title: Automation -namespace: automations_namespace -python_object_type: class +kind: class +namespace: wandb.automations.automations --- + import { GitHubLink } from '/snippets/_includes/github-source-link.mdx'; - + + + +```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=, 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=, json_schema_input_type=PydanticUndefined)] +``` + +## Description -## class `Automation` A local instance of a saved W&B automation that supports editing. -### method `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:** - - - `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. + +## Args + +- **__typename**: +- **id**: +- **createdAt**: +- **updatedAt**: +- **name**: +- **description**: +- **enabled**: +- **scope**: +- **event**: +- **action**: + + + + + + +## Methods + +### method construct + +```python +_fields_set: 'set[str] | None' = None, **values: 'Any' +``` + + + +##### Arguments + +- **_fields_set**: +- **values**: + + + + +### method copy + +```python +self, *, +include: 'AbstractSetIntStr | MappingIntStrAny | None' = None, +exclude: 'AbstractSetIntStr | MappingIntStrAny | None' = None, +update: 'Dict[str, Any] | None' = None, +deep: 'bool' = False +``` + +Returns a copy of the model. + +!!! warning "Deprecated" + This method is now deprecated; use `model_copy` instead. + +If you need `include` or `exclude`, use: + +```python {test="skip" lint="skip"} +data = self.model_dump(include=include, exclude=exclude, round_trip=True) +data = {**data, **(update or {})} +copied = self.model_validate(data) +``` + +##### Arguments + +- **include**: Optional set or mapping specifying which fields to include in the copied model. +- **exclude**: Optional set or mapping specifying which fields to exclude in the copied model. +- **update**: Optional dictionary of field-value pairs to override field values in the copied model. +- **deep**: If True, the values of fields that are Pydantic models will be deep-copied. + + + + +### method dict + +```python +self, *, +include: 'IncEx | None' = None, +exclude: 'IncEx | None' = None, +by_alias: 'bool' = False, +exclude_unset: 'bool' = False, +exclude_defaults: 'bool' = False, +exclude_none: 'bool' = False +``` + + + +##### Arguments + +- **include**: +- **exclude**: +- **by_alias**: +- **exclude_unset**: +- **exclude_defaults**: +- **exclude_none**: + + + + +### method from_orm + +```python +obj: 'Any' +``` + + + +##### Arguments + +- **obj**: + + + + +### method json + +```python +self, *, +include: 'IncEx | None' = None, +exclude: 'IncEx | None' = None, +by_alias: 'bool' = False, +exclude_unset: 'bool' = False, +exclude_defaults: 'bool' = False, +exclude_none: 'bool' = False, +encoder: 'Callable[[Any], Any] | None' = PydanticUndefined, +models_as_dict: 'bool' = PydanticUndefined, **dumps_kwargs: 'Any' +``` + + + +##### Arguments + +- **include**: +- **exclude**: +- **by_alias**: +- **exclude_unset**: +- **exclude_defaults**: +- **exclude_none**: +- **encoder**: +- **models_as_dict**: +- **dumps_kwargs**: + + + + +### method model_construct + +```python +_fields_set: 'set[str] | None' = None, **values: 'Any' +``` + +Creates a new instance of the `Model` class with validated data. + +Creates a new model setting `__dict__` and `__pydantic_fields_set__` from trusted or pre-validated data. +Default values are respected, but no other validation is performed. + +!!! note + `model_construct()` generally respects the `model_config.extra` setting on the provided model. + That is, if `model_config.extra == 'allow'`, then all extra passed values are added to the model instance's `__dict__` + and `__pydantic_extra__` fields. If `model_config.extra == 'ignore'` (the default), then all extra passed values are ignored. + Because no validation is performed with a call to `model_construct()`, having `model_config.extra == 'forbid'` does not result in + an error if extra values are passed, but they will be ignored. + +##### Arguments + +- **_fields_set**: A set of field names that were originally explicitly set during instantiation. If provided, this is directly used for the [`model_fields_set`][pydantic.BaseModel.model_fields_set] attribute. Otherwise, the field names from the `values` argument will be used. +- **values**: Trusted or pre-validated data dictionary. + + + + +### method model_copy + +```python +self, *, +update: 'Mapping[str, Any] | None' = None, +deep: 'bool' = False +``` + +!!! abstract "Usage Documentation" + [`model_copy`](../concepts/serialization.md#model_copy) + +Returns a copy of the model. + +!!! note + The underlying instance's [`__dict__`][object.__dict__] attribute is copied. This + might have unexpected side effects if you store anything in it, on top of the model + fields (e.g. the value of [cached properties][functools.cached_property]). + +##### Arguments + +- **update**: Values to change/add in the new model. Note: the data is not validated before creating the new model. You should trust this data. +- **deep**: Set to `True` to make a deep copy of the model. + + + + +### method model_dump + +```python +self, *, +mode: 'str' = 'json', **kwargs: 'Any' +``` + +!!! abstract "Usage Documentation" + [`model_dump`](../concepts/serialization.md#modelmodel_dump) + +Generate a dictionary representation of the model, optionally specifying which fields to include or exclude. + +##### Arguments + +- **mode**: The mode in which `to_python` should run. If mode is 'json', the output will only contain JSON serializable types. If mode is 'python', the output may contain non-JSON-serializable Python objects. +- **kwargs**: + + + + +### method model_dump_json + +```python +self, *, +indent: 'int | None' = None, **kwargs: 'Any' +``` + +!!! abstract "Usage Documentation" + [`model_dump_json`](../concepts/serialization.md#modelmodel_dump_json) + +Generates a JSON representation of the model using Pydantic's `to_json` method. + +##### Arguments + +- **indent**: Indentation to use in the JSON output. If None is passed, the output will be compact. +- **kwargs**: + + + + +### method model_json_schema + +```python +by_alias: 'bool' = True, +ref_template: 'str' = '#/$defs/{model}', +schema_generator: 'type[GenerateJsonSchema]' = , +mode: 'JsonSchemaMode' = 'validation' +``` + +Generates a JSON schema for a model class. + +##### Arguments + +- **by_alias**: Whether to use attribute aliases or not. +- **ref_template**: The reference template. +- **schema_generator**: To override the logic used to generate the JSON schema, as a subclass of `GenerateJsonSchema` with your desired modifications +- **mode**: The mode in which to generate the schema. + + + + +### method model_parametrized_name + +```python +params: 'tuple[type[Any], ...]' +``` + +Compute the class name for parametrizations of generic classes. + +This method can be overridden to achieve a custom naming scheme for generic BaseModels. + +##### Arguments + +- **params**: Tuple of types of the class. Given a generic class `Model` with 2 type variables and a concrete model `Model[str, int]`, the value `(str, int)` would be passed to `params`. + + +##### Raises + +- **TypeError**: Raised when trying to generate concrete names for non-generic models. + + +### method model_post_init + +```python +self, +context: 'Any', / +``` + +Override this method to perform additional initialization after `__init__` and `model_construct`. +This is useful if you want to do some validation that requires the entire model to be initialized. + +##### Arguments + +- **context**: + + + + +### method model_rebuild + +```python +*, +force: 'bool' = False, +raise_errors: 'bool' = True, +_parent_namespace_depth: 'int' = 2, +_types_namespace: 'MappingNamespace | None' = None +``` + +Try to rebuild the pydantic-core schema for the model. + +This may be necessary when one of the annotations is a ForwardRef which could not be resolved during +the initial attempt to build the schema, and automatic rebuilding fails. + +##### Arguments + +- **force**: Whether to force the rebuilding of the model schema, defaults to `False`. +- **raise_errors**: Whether to raise errors, defaults to `True`. +- **_parent_namespace_depth**: The depth level of the parent namespace, defaults to 2. +- **_types_namespace**: The types namespace, defaults to `None`. + + + + +### method model_validate + +```python +obj: 'Any', *, +strict: 'bool | None' = None, +from_attributes: 'bool | None' = None, +context: 'Any | None' = None, +by_alias: 'bool | None' = None, +by_name: 'bool | None' = None +``` + +Validate a pydantic model instance. + +##### Arguments + +- **obj**: The object to validate. +- **strict**: Whether to enforce types strictly. +- **from_attributes**: Whether to extract data from object attributes. +- **context**: Additional context to pass to the validator. +- **by_alias**: Whether to use the field's alias when validating against the provided input data. +- **by_name**: Whether to use the field's name when validating against the provided input data. + + +##### Raises + +- **ValidationError**: If the object could not be validated. + + +### method model_validate_json + +```python +json_data: 'str | bytes | bytearray', *, +strict: 'bool | None' = None, +context: 'Any | None' = None, +by_alias: 'bool | None' = None, +by_name: 'bool | None' = None +``` + +!!! abstract "Usage Documentation" + [JSON Parsing](../concepts/json.md#json-parsing) + +Validate the given JSON data against the Pydantic model. + +##### Arguments + +- **json_data**: The JSON data to validate. +- **strict**: Whether to enforce types strictly. +- **context**: Extra variables to pass to the validator. +- **by_alias**: Whether to use the field's alias when validating against the provided input data. +- **by_name**: Whether to use the field's name when validating against the provided input data. + + +##### Raises + +- **ValidationError**: If `json_data` is not a JSON string or the object could not be validated. + + +### method model_validate_strings + +```python +obj: 'Any', *, +strict: 'bool | None' = None, +context: 'Any | None' = None, +by_alias: 'bool | None' = None, +by_name: 'bool | None' = None +``` + +Validate the given object with string data against the Pydantic model. + +##### Arguments + +- **obj**: The object containing string data to validate. +- **strict**: Whether to enforce types strictly. +- **context**: Extra variables to pass to the validator. +- **by_alias**: Whether to use the field's alias when validating against the provided input data. +- **by_name**: Whether to use the field's name when validating against the provided input data. + + + + +### method parse_file + +```python +path: 'str | Path', *, +content_type: 'str | None' = None, +encoding: 'str' = 'utf8', +proto: 'DeprecatedParseProtocol | None' = None, +allow_pickle: 'bool' = False +``` + + + +##### Arguments + +- **path**: +- **content_type**: +- **encoding**: +- **proto**: +- **allow_pickle**: + + + + +### method parse_obj + +```python +obj: 'Any' +``` + + + +##### Arguments + +- **obj**: + + + + +### method parse_raw + +```python +b: 'str | bytes', *, +content_type: 'str | None' = None, +encoding: 'str' = 'utf8', +proto: 'DeprecatedParseProtocol | None' = None, +allow_pickle: 'bool' = False +``` + + + +##### Arguments + +- **b**: +- **content_type**: +- **encoding**: +- **proto**: +- **allow_pickle**: + + + + +### method schema + +```python +by_alias: 'bool' = True, +ref_template: 'str' = '#/$defs/{model}' +``` + + + +##### Arguments + +- **by_alias**: +- **ref_template**: + + + + +### method schema_json + +```python +*, +by_alias: 'bool' = True, +ref_template: 'str' = '#/$defs/{model}', **dumps_kwargs: 'Any' +``` + + + +##### Arguments + +- **by_alias**: +- **ref_template**: +- **dumps_kwargs**: + + + + +### method update_forward_refs + +```python +**localns: 'Any' +``` + + + +##### Arguments + +- **localns**: + + + + +### method validate + +```python +value: 'Any' +``` + + + +##### Arguments + +- **value**: + + + + + + diff --git a/models/ref/python/automations/donothing.mdx b/models/ref/python/automations/donothing.mdx index 79caedf77a..21e3da1f45 100644 --- a/models/ref/python/automations/donothing.mdx +++ b/models/ref/python/automations/donothing.mdx @@ -1,32 +1,542 @@ --- title: DoNothing -namespace: automations_namespace -python_object_type: class +kind: class +namespace: wandb.automations.actions --- + import { GitHubLink } from '/snippets/_includes/github-source-link.mdx'; - + + + +```python +*, +no_op: typing.Annotated[bool, BeforeValidator(func=, json_schema_input_type=PydanticUndefined)] = True, +action_type: Literal[NO_OP] = NO_OP +``` + +## Description -## class `DoNothing` Defines an automation action that intentionally does nothing. -### method `DoNothing.__init__` + +## Args + +- **no_op**: +- **action_type**: + + + + + + +## Methods + +### method construct + +```python +_fields_set: 'set[str] | None' = None, **values: 'Any' +``` + + + +##### Arguments + +- **_fields_set**: +- **values**: + + + + +### method copy + +```python +self, *, +include: 'AbstractSetIntStr | MappingIntStrAny | None' = None, +exclude: 'AbstractSetIntStr | MappingIntStrAny | None' = None, +update: 'Dict[str, Any] | None' = None, +deep: 'bool' = False +``` + +Returns a copy of the model. + +!!! warning "Deprecated" + This method is now deprecated; use `model_copy` instead. + +If you need `include` or `exclude`, use: + +```python {test="skip" lint="skip"} +data = self.model_dump(include=include, exclude=exclude, round_trip=True) +data = {**data, **(update or {})} +copied = self.model_validate(data) +``` + +##### Arguments + +- **include**: Optional set or mapping specifying which fields to include in the copied model. +- **exclude**: Optional set or mapping specifying which fields to exclude in the copied model. +- **update**: Optional dictionary of field-value pairs to override field values in the copied model. +- **deep**: If True, the values of fields that are Pydantic models will be deep-copied. + + + + +### method dict + +```python +self, *, +include: 'IncEx | None' = None, +exclude: 'IncEx | None' = None, +by_alias: 'bool' = False, +exclude_unset: 'bool' = False, +exclude_defaults: 'bool' = False, +exclude_none: 'bool' = False +``` + + + +##### Arguments + +- **include**: +- **exclude**: +- **by_alias**: +- **exclude_unset**: +- **exclude_defaults**: +- **exclude_none**: + + + + +### method from_orm ```python -__init__( - no_op: 'bool' = True, - action_type: 'Literal[NO_OP]' = NO_OP -) → None +obj: 'Any' ``` -**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. + +##### Arguments + +- **obj**: + + + + +### method json + +```python +self, *, +include: 'IncEx | None' = None, +exclude: 'IncEx | None' = None, +by_alias: 'bool' = False, +exclude_unset: 'bool' = False, +exclude_defaults: 'bool' = False, +exclude_none: 'bool' = False, +encoder: 'Callable[[Any], Any] | None' = PydanticUndefined, +models_as_dict: 'bool' = PydanticUndefined, **dumps_kwargs: 'Any' +``` + + + +##### Arguments + +- **include**: +- **exclude**: +- **by_alias**: +- **exclude_unset**: +- **exclude_defaults**: +- **exclude_none**: +- **encoder**: +- **models_as_dict**: +- **dumps_kwargs**: + + + + +### method model_construct + +```python +_fields_set: 'set[str] | None' = None, **values: 'Any' +``` + +Creates a new instance of the `Model` class with validated data. + +Creates a new model setting `__dict__` and `__pydantic_fields_set__` from trusted or pre-validated data. +Default values are respected, but no other validation is performed. + +!!! note + `model_construct()` generally respects the `model_config.extra` setting on the provided model. + That is, if `model_config.extra == 'allow'`, then all extra passed values are added to the model instance's `__dict__` + and `__pydantic_extra__` fields. If `model_config.extra == 'ignore'` (the default), then all extra passed values are ignored. + Because no validation is performed with a call to `model_construct()`, having `model_config.extra == 'forbid'` does not result in + an error if extra values are passed, but they will be ignored. + +##### Arguments + +- **_fields_set**: A set of field names that were originally explicitly set during instantiation. If provided, this is directly used for the [`model_fields_set`][pydantic.BaseModel.model_fields_set] attribute. Otherwise, the field names from the `values` argument will be used. +- **values**: Trusted or pre-validated data dictionary. + + + + +### method model_copy + +```python +self, *, +update: 'Mapping[str, Any] | None' = None, +deep: 'bool' = False +``` + +!!! abstract "Usage Documentation" + [`model_copy`](../concepts/serialization.md#model_copy) + +Returns a copy of the model. + +!!! note + The underlying instance's [`__dict__`][object.__dict__] attribute is copied. This + might have unexpected side effects if you store anything in it, on top of the model + fields (e.g. the value of [cached properties][functools.cached_property]). + +##### Arguments + +- **update**: Values to change/add in the new model. Note: the data is not validated before creating the new model. You should trust this data. +- **deep**: Set to `True` to make a deep copy of the model. + + + + +### method model_dump + +```python +self, *, +mode: 'str' = 'json', **kwargs: 'Any' +``` + +!!! abstract "Usage Documentation" + [`model_dump`](../concepts/serialization.md#modelmodel_dump) + +Generate a dictionary representation of the model, optionally specifying which fields to include or exclude. + +##### Arguments + +- **mode**: The mode in which `to_python` should run. If mode is 'json', the output will only contain JSON serializable types. If mode is 'python', the output may contain non-JSON-serializable Python objects. +- **kwargs**: + + + + +### method model_dump_json + +```python +self, *, +indent: 'int | None' = None, **kwargs: 'Any' +``` + +!!! abstract "Usage Documentation" + [`model_dump_json`](../concepts/serialization.md#modelmodel_dump_json) + +Generates a JSON representation of the model using Pydantic's `to_json` method. + +##### Arguments + +- **indent**: Indentation to use in the JSON output. If None is passed, the output will be compact. +- **kwargs**: + + + + +### method model_json_schema + +```python +by_alias: 'bool' = True, +ref_template: 'str' = '#/$defs/{model}', +schema_generator: 'type[GenerateJsonSchema]' = , +mode: 'JsonSchemaMode' = 'validation' +``` + +Generates a JSON schema for a model class. + +##### Arguments + +- **by_alias**: Whether to use attribute aliases or not. +- **ref_template**: The reference template. +- **schema_generator**: To override the logic used to generate the JSON schema, as a subclass of `GenerateJsonSchema` with your desired modifications +- **mode**: The mode in which to generate the schema. + + + + +### method model_parametrized_name + +```python +params: 'tuple[type[Any], ...]' +``` + +Compute the class name for parametrizations of generic classes. + +This method can be overridden to achieve a custom naming scheme for generic BaseModels. + +##### Arguments + +- **params**: Tuple of types of the class. Given a generic class `Model` with 2 type variables and a concrete model `Model[str, int]`, the value `(str, int)` would be passed to `params`. + + +##### Raises + +- **TypeError**: Raised when trying to generate concrete names for non-generic models. + + +### method model_post_init + +```python +self, +context: 'Any', / +``` + +Override this method to perform additional initialization after `__init__` and `model_construct`. +This is useful if you want to do some validation that requires the entire model to be initialized. + +##### Arguments + +- **context**: + + + + +### method model_rebuild + +```python +*, +force: 'bool' = False, +raise_errors: 'bool' = True, +_parent_namespace_depth: 'int' = 2, +_types_namespace: 'MappingNamespace | None' = None +``` + +Try to rebuild the pydantic-core schema for the model. + +This may be necessary when one of the annotations is a ForwardRef which could not be resolved during +the initial attempt to build the schema, and automatic rebuilding fails. + +##### Arguments + +- **force**: Whether to force the rebuilding of the model schema, defaults to `False`. +- **raise_errors**: Whether to raise errors, defaults to `True`. +- **_parent_namespace_depth**: The depth level of the parent namespace, defaults to 2. +- **_types_namespace**: The types namespace, defaults to `None`. + + + + +### method model_validate + +```python +obj: 'Any', *, +strict: 'bool | None' = None, +from_attributes: 'bool | None' = None, +context: 'Any | None' = None, +by_alias: 'bool | None' = None, +by_name: 'bool | None' = None +``` + +Validate a pydantic model instance. + +##### Arguments + +- **obj**: The object to validate. +- **strict**: Whether to enforce types strictly. +- **from_attributes**: Whether to extract data from object attributes. +- **context**: Additional context to pass to the validator. +- **by_alias**: Whether to use the field's alias when validating against the provided input data. +- **by_name**: Whether to use the field's name when validating against the provided input data. + + +##### Raises + +- **ValidationError**: If the object could not be validated. + + +### method model_validate_json + +```python +json_data: 'str | bytes | bytearray', *, +strict: 'bool | None' = None, +context: 'Any | None' = None, +by_alias: 'bool | None' = None, +by_name: 'bool | None' = None +``` + +!!! abstract "Usage Documentation" + [JSON Parsing](../concepts/json.md#json-parsing) + +Validate the given JSON data against the Pydantic model. + +##### Arguments + +- **json_data**: The JSON data to validate. +- **strict**: Whether to enforce types strictly. +- **context**: Extra variables to pass to the validator. +- **by_alias**: Whether to use the field's alias when validating against the provided input data. +- **by_name**: Whether to use the field's name when validating against the provided input data. + + +##### Raises + +- **ValidationError**: If `json_data` is not a JSON string or the object could not be validated. + + +### method model_validate_strings + +```python +obj: 'Any', *, +strict: 'bool | None' = None, +context: 'Any | None' = None, +by_alias: 'bool | None' = None, +by_name: 'bool | None' = None +``` + +Validate the given object with string data against the Pydantic model. + +##### Arguments + +- **obj**: The object containing string data to validate. +- **strict**: Whether to enforce types strictly. +- **context**: Extra variables to pass to the validator. +- **by_alias**: Whether to use the field's alias when validating against the provided input data. +- **by_name**: Whether to use the field's name when validating against the provided input data. + + + + +### method parse_file + +```python +path: 'str | Path', *, +content_type: 'str | None' = None, +encoding: 'str' = 'utf8', +proto: 'DeprecatedParseProtocol | None' = None, +allow_pickle: 'bool' = False +``` + + + +##### Arguments + +- **path**: +- **content_type**: +- **encoding**: +- **proto**: +- **allow_pickle**: + + + + +### method parse_obj + +```python +obj: 'Any' +``` + + + +##### Arguments + +- **obj**: + + + + +### method parse_raw + +```python +b: 'str | bytes', *, +content_type: 'str | None' = None, +encoding: 'str' = 'utf8', +proto: 'DeprecatedParseProtocol | None' = None, +allow_pickle: 'bool' = False +``` + + + +##### Arguments + +- **b**: +- **content_type**: +- **encoding**: +- **proto**: +- **allow_pickle**: + + + + +### method schema + +```python +by_alias: 'bool' = True, +ref_template: 'str' = '#/$defs/{model}' +``` + + + +##### Arguments + +- **by_alias**: +- **ref_template**: + + + + +### method schema_json + +```python +*, +by_alias: 'bool' = True, +ref_template: 'str' = '#/$defs/{model}', **dumps_kwargs: 'Any' +``` + + + +##### Arguments + +- **by_alias**: +- **ref_template**: +- **dumps_kwargs**: + + + + +### method update_forward_refs + +```python +**localns: 'Any' +``` + + + +##### Arguments + +- **localns**: + + + + +### method validate + +```python +value: 'Any' +``` + + + +##### Arguments + +- **value**: + + + + + + diff --git a/models/ref/python/automations/metricchangefilter.mdx b/models/ref/python/automations/metricchangefilter.mdx index 607ed8f60a..2fe3a8b246 100644 --- a/models/ref/python/automations/metricchangefilter.mdx +++ b/models/ref/python/automations/metricchangefilter.mdx @@ -1,47 +1,557 @@ --- 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'; - + + + +```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)] = , +change_type: wandb.automations._filters.run_metrics.ChangeType, +change_dir: wandb.automations._filters.run_metrics.ChangeDir +``` + +## Description -## class `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. -### method `MetricChangeFilter.__init__` + +## Args + +- **name**: +- **agg_op**: +- **current_window_size**: +- **cmp**: +- **change_amount**: +- **prior_window_size**: +- **change_type**: +- **change_dir**: + + + + + + +## Methods + +### method construct + +```python +_fields_set: 'set[str] | None' = None, **values: 'Any' +``` + + + +##### Arguments + +- **_fields_set**: +- **values**: + + + + +### method copy + +```python +self, *, +include: 'AbstractSetIntStr | MappingIntStrAny | None' = None, +exclude: 'AbstractSetIntStr | MappingIntStrAny | None' = None, +update: 'Dict[str, Any] | None' = None, +deep: 'bool' = False +``` + +Returns a copy of the model. + +!!! warning "Deprecated" + This method is now deprecated; use `model_copy` instead. + +If you need `include` or `exclude`, use: + +```python {test="skip" lint="skip"} +data = self.model_dump(include=include, exclude=exclude, round_trip=True) +data = {**data, **(update or {})} +copied = self.model_validate(data) +``` + +##### Arguments + +- **include**: Optional set or mapping specifying which fields to include in the copied model. +- **exclude**: Optional set or mapping specifying which fields to exclude in the copied model. +- **update**: Optional dictionary of field-value pairs to override field values in the copied model. +- **deep**: If True, the values of fields that are Pydantic models will be deep-copied. + + + + +### method dict + +```python +self, *, +include: 'IncEx | None' = None, +exclude: 'IncEx | None' = None, +by_alias: 'bool' = False, +exclude_unset: 'bool' = False, +exclude_defaults: 'bool' = False, +exclude_none: 'bool' = False +``` + + + +##### Arguments + +- **include**: +- **exclude**: +- **by_alias**: +- **exclude_unset**: +- **exclude_defaults**: +- **exclude_none**: + + + + +### method from_orm ```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 +obj: 'Any' ``` -**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. + +##### Arguments + +- **obj**: + + + + +### method json + +```python +self, *, +include: 'IncEx | None' = None, +exclude: 'IncEx | None' = None, +by_alias: 'bool' = False, +exclude_unset: 'bool' = False, +exclude_defaults: 'bool' = False, +exclude_none: 'bool' = False, +encoder: 'Callable[[Any], Any] | None' = PydanticUndefined, +models_as_dict: 'bool' = PydanticUndefined, **dumps_kwargs: 'Any' +``` + + + +##### Arguments + +- **include**: +- **exclude**: +- **by_alias**: +- **exclude_unset**: +- **exclude_defaults**: +- **exclude_none**: +- **encoder**: +- **models_as_dict**: +- **dumps_kwargs**: + + + + +### method model_construct + +```python +_fields_set: 'set[str] | None' = None, **values: 'Any' +``` + +Creates a new instance of the `Model` class with validated data. + +Creates a new model setting `__dict__` and `__pydantic_fields_set__` from trusted or pre-validated data. +Default values are respected, but no other validation is performed. + +!!! note + `model_construct()` generally respects the `model_config.extra` setting on the provided model. + That is, if `model_config.extra == 'allow'`, then all extra passed values are added to the model instance's `__dict__` + and `__pydantic_extra__` fields. If `model_config.extra == 'ignore'` (the default), then all extra passed values are ignored. + Because no validation is performed with a call to `model_construct()`, having `model_config.extra == 'forbid'` does not result in + an error if extra values are passed, but they will be ignored. + +##### Arguments + +- **_fields_set**: A set of field names that were originally explicitly set during instantiation. If provided, this is directly used for the [`model_fields_set`][pydantic.BaseModel.model_fields_set] attribute. Otherwise, the field names from the `values` argument will be used. +- **values**: Trusted or pre-validated data dictionary. + + + + +### method model_copy + +```python +self, *, +update: 'Mapping[str, Any] | None' = None, +deep: 'bool' = False +``` + +!!! abstract "Usage Documentation" + [`model_copy`](../concepts/serialization.md#model_copy) + +Returns a copy of the model. + +!!! note + The underlying instance's [`__dict__`][object.__dict__] attribute is copied. This + might have unexpected side effects if you store anything in it, on top of the model + fields (e.g. the value of [cached properties][functools.cached_property]). + +##### Arguments + +- **update**: Values to change/add in the new model. Note: the data is not validated before creating the new model. You should trust this data. +- **deep**: Set to `True` to make a deep copy of the model. + + + + +### method model_dump + +```python +self, *, +mode: 'str' = 'json', **kwargs: 'Any' +``` + +!!! abstract "Usage Documentation" + [`model_dump`](../concepts/serialization.md#modelmodel_dump) + +Generate a dictionary representation of the model, optionally specifying which fields to include or exclude. + +##### Arguments + +- **mode**: The mode in which `to_python` should run. If mode is 'json', the output will only contain JSON serializable types. If mode is 'python', the output may contain non-JSON-serializable Python objects. +- **kwargs**: + + + + +### method model_dump_json + +```python +self, *, +indent: 'int | None' = None, **kwargs: 'Any' +``` + +!!! abstract "Usage Documentation" + [`model_dump_json`](../concepts/serialization.md#modelmodel_dump_json) + +Generates a JSON representation of the model using Pydantic's `to_json` method. + +##### Arguments + +- **indent**: Indentation to use in the JSON output. If None is passed, the output will be compact. +- **kwargs**: + + + + +### method model_json_schema + +```python +by_alias: 'bool' = True, +ref_template: 'str' = '#/$defs/{model}', +schema_generator: 'type[GenerateJsonSchema]' = , +mode: 'JsonSchemaMode' = 'validation' +``` + +Generates a JSON schema for a model class. + +##### Arguments + +- **by_alias**: Whether to use attribute aliases or not. +- **ref_template**: The reference template. +- **schema_generator**: To override the logic used to generate the JSON schema, as a subclass of `GenerateJsonSchema` with your desired modifications +- **mode**: The mode in which to generate the schema. + + + + +### method model_parametrized_name + +```python +params: 'tuple[type[Any], ...]' +``` + +Compute the class name for parametrizations of generic classes. + +This method can be overridden to achieve a custom naming scheme for generic BaseModels. + +##### Arguments + +- **params**: Tuple of types of the class. Given a generic class `Model` with 2 type variables and a concrete model `Model[str, int]`, the value `(str, int)` would be passed to `params`. + + +##### Raises + +- **TypeError**: Raised when trying to generate concrete names for non-generic models. + + +### method model_post_init + +```python +self, +context: 'Any', / +``` + +Override this method to perform additional initialization after `__init__` and `model_construct`. +This is useful if you want to do some validation that requires the entire model to be initialized. + +##### Arguments + +- **context**: + + + + +### method model_rebuild + +```python +*, +force: 'bool' = False, +raise_errors: 'bool' = True, +_parent_namespace_depth: 'int' = 2, +_types_namespace: 'MappingNamespace | None' = None +``` + +Try to rebuild the pydantic-core schema for the model. + +This may be necessary when one of the annotations is a ForwardRef which could not be resolved during +the initial attempt to build the schema, and automatic rebuilding fails. + +##### Arguments + +- **force**: Whether to force the rebuilding of the model schema, defaults to `False`. +- **raise_errors**: Whether to raise errors, defaults to `True`. +- **_parent_namespace_depth**: The depth level of the parent namespace, defaults to 2. +- **_types_namespace**: The types namespace, defaults to `None`. + + + + +### method model_validate + +```python +obj: 'Any', *, +strict: 'bool | None' = None, +from_attributes: 'bool | None' = None, +context: 'Any | None' = None, +by_alias: 'bool | None' = None, +by_name: 'bool | None' = None +``` + +Validate a pydantic model instance. + +##### Arguments + +- **obj**: The object to validate. +- **strict**: Whether to enforce types strictly. +- **from_attributes**: Whether to extract data from object attributes. +- **context**: Additional context to pass to the validator. +- **by_alias**: Whether to use the field's alias when validating against the provided input data. +- **by_name**: Whether to use the field's name when validating against the provided input data. + + +##### Raises + +- **ValidationError**: If the object could not be validated. + + +### method model_validate_json + +```python +json_data: 'str | bytes | bytearray', *, +strict: 'bool | None' = None, +context: 'Any | None' = None, +by_alias: 'bool | None' = None, +by_name: 'bool | None' = None +``` + +!!! abstract "Usage Documentation" + [JSON Parsing](../concepts/json.md#json-parsing) + +Validate the given JSON data against the Pydantic model. + +##### Arguments + +- **json_data**: The JSON data to validate. +- **strict**: Whether to enforce types strictly. +- **context**: Extra variables to pass to the validator. +- **by_alias**: Whether to use the field's alias when validating against the provided input data. +- **by_name**: Whether to use the field's name when validating against the provided input data. + + +##### Raises + +- **ValidationError**: If `json_data` is not a JSON string or the object could not be validated. + + +### method model_validate_strings + +```python +obj: 'Any', *, +strict: 'bool | None' = None, +context: 'Any | None' = None, +by_alias: 'bool | None' = None, +by_name: 'bool | None' = None +``` + +Validate the given object with string data against the Pydantic model. + +##### Arguments + +- **obj**: The object containing string data to validate. +- **strict**: Whether to enforce types strictly. +- **context**: Extra variables to pass to the validator. +- **by_alias**: Whether to use the field's alias when validating against the provided input data. +- **by_name**: Whether to use the field's name when validating against the provided input data. + + + + +### method parse_file + +```python +path: 'str | Path', *, +content_type: 'str | None' = None, +encoding: 'str' = 'utf8', +proto: 'DeprecatedParseProtocol | None' = None, +allow_pickle: 'bool' = False +``` + + + +##### Arguments + +- **path**: +- **content_type**: +- **encoding**: +- **proto**: +- **allow_pickle**: + + + + +### method parse_obj + +```python +obj: 'Any' +``` + + + +##### Arguments + +- **obj**: + + + + +### method parse_raw + +```python +b: 'str | bytes', *, +content_type: 'str | None' = None, +encoding: 'str' = 'utf8', +proto: 'DeprecatedParseProtocol | None' = None, +allow_pickle: 'bool' = False +``` + + + +##### Arguments + +- **b**: +- **content_type**: +- **encoding**: +- **proto**: +- **allow_pickle**: + + + + +### method schema + +```python +by_alias: 'bool' = True, +ref_template: 'str' = '#/$defs/{model}' +``` + + + +##### Arguments + +- **by_alias**: +- **ref_template**: + + + + +### method schema_json + +```python +*, +by_alias: 'bool' = True, +ref_template: 'str' = '#/$defs/{model}', **dumps_kwargs: 'Any' +``` + + + +##### Arguments + +- **by_alias**: +- **ref_template**: +- **dumps_kwargs**: + + + + +### method update_forward_refs + +```python +**localns: 'Any' +``` + + + +##### Arguments + +- **localns**: + + + + +### method validate + +```python +value: 'Any' +``` + + + +##### Arguments + +- **value**: + + + + + + diff --git a/models/ref/python/automations/metricthresholdfilter.mdx b/models/ref/python/automations/metricthresholdfilter.mdx index 85231726c5..969240f8c6 100644 --- a/models/ref/python/automations/metricthresholdfilter.mdx +++ b/models/ref/python/automations/metricthresholdfilter.mdx @@ -1,40 +1,551 @@ --- 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'; - + + + +```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 -## class `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. -### method `MetricThresholdFilter.__init__` + +## Args + +- **name**: +- **agg_op**: +- **window_size**: +- **cmp_op**: +- **threshold**: + + + + + + +## Methods + +### method construct + +```python +_fields_set: 'set[str] | None' = None, **values: 'Any' +``` + + + +##### Arguments + +- **_fields_set**: +- **values**: + + + + +### method copy + +```python +self, *, +include: 'AbstractSetIntStr | MappingIntStrAny | None' = None, +exclude: 'AbstractSetIntStr | MappingIntStrAny | None' = None, +update: 'Dict[str, Any] | None' = None, +deep: 'bool' = False +``` + +Returns a copy of the model. + +!!! warning "Deprecated" + This method is now deprecated; use `model_copy` instead. + +If you need `include` or `exclude`, use: + +```python {test="skip" lint="skip"} +data = self.model_dump(include=include, exclude=exclude, round_trip=True) +data = {**data, **(update or {})} +copied = self.model_validate(data) +``` + +##### Arguments + +- **include**: Optional set or mapping specifying which fields to include in the copied model. +- **exclude**: Optional set or mapping specifying which fields to exclude in the copied model. +- **update**: Optional dictionary of field-value pairs to override field values in the copied model. +- **deep**: If True, the values of fields that are Pydantic models will be deep-copied. + + + + +### method dict + +```python +self, *, +include: 'IncEx | None' = None, +exclude: 'IncEx | None' = None, +by_alias: 'bool' = False, +exclude_unset: 'bool' = False, +exclude_defaults: 'bool' = False, +exclude_none: 'bool' = False +``` + + + +##### Arguments + +- **include**: +- **exclude**: +- **by_alias**: +- **exclude_unset**: +- **exclude_defaults**: +- **exclude_none**: + + + + +### method from_orm ```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 +obj: 'Any' ``` -**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. + +##### Arguments + +- **obj**: + + + + +### method json + +```python +self, *, +include: 'IncEx | None' = None, +exclude: 'IncEx | None' = None, +by_alias: 'bool' = False, +exclude_unset: 'bool' = False, +exclude_defaults: 'bool' = False, +exclude_none: 'bool' = False, +encoder: 'Callable[[Any], Any] | None' = PydanticUndefined, +models_as_dict: 'bool' = PydanticUndefined, **dumps_kwargs: 'Any' +``` + + + +##### Arguments + +- **include**: +- **exclude**: +- **by_alias**: +- **exclude_unset**: +- **exclude_defaults**: +- **exclude_none**: +- **encoder**: +- **models_as_dict**: +- **dumps_kwargs**: + + + + +### method model_construct + +```python +_fields_set: 'set[str] | None' = None, **values: 'Any' +``` + +Creates a new instance of the `Model` class with validated data. + +Creates a new model setting `__dict__` and `__pydantic_fields_set__` from trusted or pre-validated data. +Default values are respected, but no other validation is performed. + +!!! note + `model_construct()` generally respects the `model_config.extra` setting on the provided model. + That is, if `model_config.extra == 'allow'`, then all extra passed values are added to the model instance's `__dict__` + and `__pydantic_extra__` fields. If `model_config.extra == 'ignore'` (the default), then all extra passed values are ignored. + Because no validation is performed with a call to `model_construct()`, having `model_config.extra == 'forbid'` does not result in + an error if extra values are passed, but they will be ignored. + +##### Arguments + +- **_fields_set**: A set of field names that were originally explicitly set during instantiation. If provided, this is directly used for the [`model_fields_set`][pydantic.BaseModel.model_fields_set] attribute. Otherwise, the field names from the `values` argument will be used. +- **values**: Trusted or pre-validated data dictionary. + + + + +### method model_copy + +```python +self, *, +update: 'Mapping[str, Any] | None' = None, +deep: 'bool' = False +``` + +!!! abstract "Usage Documentation" + [`model_copy`](../concepts/serialization.md#model_copy) + +Returns a copy of the model. + +!!! note + The underlying instance's [`__dict__`][object.__dict__] attribute is copied. This + might have unexpected side effects if you store anything in it, on top of the model + fields (e.g. the value of [cached properties][functools.cached_property]). + +##### Arguments + +- **update**: Values to change/add in the new model. Note: the data is not validated before creating the new model. You should trust this data. +- **deep**: Set to `True` to make a deep copy of the model. + + + + +### method model_dump + +```python +self, *, +mode: 'str' = 'json', **kwargs: 'Any' +``` + +!!! abstract "Usage Documentation" + [`model_dump`](../concepts/serialization.md#modelmodel_dump) + +Generate a dictionary representation of the model, optionally specifying which fields to include or exclude. + +##### Arguments + +- **mode**: The mode in which `to_python` should run. If mode is 'json', the output will only contain JSON serializable types. If mode is 'python', the output may contain non-JSON-serializable Python objects. +- **kwargs**: + + + + +### method model_dump_json + +```python +self, *, +indent: 'int | None' = None, **kwargs: 'Any' +``` + +!!! abstract "Usage Documentation" + [`model_dump_json`](../concepts/serialization.md#modelmodel_dump_json) + +Generates a JSON representation of the model using Pydantic's `to_json` method. + +##### Arguments + +- **indent**: Indentation to use in the JSON output. If None is passed, the output will be compact. +- **kwargs**: + + + + +### method model_json_schema + +```python +by_alias: 'bool' = True, +ref_template: 'str' = '#/$defs/{model}', +schema_generator: 'type[GenerateJsonSchema]' = , +mode: 'JsonSchemaMode' = 'validation' +``` + +Generates a JSON schema for a model class. + +##### Arguments + +- **by_alias**: Whether to use attribute aliases or not. +- **ref_template**: The reference template. +- **schema_generator**: To override the logic used to generate the JSON schema, as a subclass of `GenerateJsonSchema` with your desired modifications +- **mode**: The mode in which to generate the schema. + + + + +### method model_parametrized_name + +```python +params: 'tuple[type[Any], ...]' +``` + +Compute the class name for parametrizations of generic classes. + +This method can be overridden to achieve a custom naming scheme for generic BaseModels. + +##### Arguments + +- **params**: Tuple of types of the class. Given a generic class `Model` with 2 type variables and a concrete model `Model[str, int]`, the value `(str, int)` would be passed to `params`. + + +##### Raises + +- **TypeError**: Raised when trying to generate concrete names for non-generic models. + + +### method model_post_init + +```python +self, +context: 'Any', / +``` + +Override this method to perform additional initialization after `__init__` and `model_construct`. +This is useful if you want to do some validation that requires the entire model to be initialized. + +##### Arguments + +- **context**: + + + + +### method model_rebuild + +```python +*, +force: 'bool' = False, +raise_errors: 'bool' = True, +_parent_namespace_depth: 'int' = 2, +_types_namespace: 'MappingNamespace | None' = None +``` + +Try to rebuild the pydantic-core schema for the model. + +This may be necessary when one of the annotations is a ForwardRef which could not be resolved during +the initial attempt to build the schema, and automatic rebuilding fails. + +##### Arguments + +- **force**: Whether to force the rebuilding of the model schema, defaults to `False`. +- **raise_errors**: Whether to raise errors, defaults to `True`. +- **_parent_namespace_depth**: The depth level of the parent namespace, defaults to 2. +- **_types_namespace**: The types namespace, defaults to `None`. + + + + +### method model_validate + +```python +obj: 'Any', *, +strict: 'bool | None' = None, +from_attributes: 'bool | None' = None, +context: 'Any | None' = None, +by_alias: 'bool | None' = None, +by_name: 'bool | None' = None +``` + +Validate a pydantic model instance. + +##### Arguments + +- **obj**: The object to validate. +- **strict**: Whether to enforce types strictly. +- **from_attributes**: Whether to extract data from object attributes. +- **context**: Additional context to pass to the validator. +- **by_alias**: Whether to use the field's alias when validating against the provided input data. +- **by_name**: Whether to use the field's name when validating against the provided input data. + + +##### Raises + +- **ValidationError**: If the object could not be validated. + + +### method model_validate_json + +```python +json_data: 'str | bytes | bytearray', *, +strict: 'bool | None' = None, +context: 'Any | None' = None, +by_alias: 'bool | None' = None, +by_name: 'bool | None' = None +``` + +!!! abstract "Usage Documentation" + [JSON Parsing](../concepts/json.md#json-parsing) + +Validate the given JSON data against the Pydantic model. + +##### Arguments + +- **json_data**: The JSON data to validate. +- **strict**: Whether to enforce types strictly. +- **context**: Extra variables to pass to the validator. +- **by_alias**: Whether to use the field's alias when validating against the provided input data. +- **by_name**: Whether to use the field's name when validating against the provided input data. + + +##### Raises + +- **ValidationError**: If `json_data` is not a JSON string or the object could not be validated. + + +### method model_validate_strings + +```python +obj: 'Any', *, +strict: 'bool | None' = None, +context: 'Any | None' = None, +by_alias: 'bool | None' = None, +by_name: 'bool | None' = None +``` + +Validate the given object with string data against the Pydantic model. + +##### Arguments + +- **obj**: The object containing string data to validate. +- **strict**: Whether to enforce types strictly. +- **context**: Extra variables to pass to the validator. +- **by_alias**: Whether to use the field's alias when validating against the provided input data. +- **by_name**: Whether to use the field's name when validating against the provided input data. + + + + +### method parse_file + +```python +path: 'str | Path', *, +content_type: 'str | None' = None, +encoding: 'str' = 'utf8', +proto: 'DeprecatedParseProtocol | None' = None, +allow_pickle: 'bool' = False +``` + + + +##### Arguments + +- **path**: +- **content_type**: +- **encoding**: +- **proto**: +- **allow_pickle**: + + + + +### method parse_obj + +```python +obj: 'Any' +``` + + + +##### Arguments + +- **obj**: + + + + +### method parse_raw + +```python +b: 'str | bytes', *, +content_type: 'str | None' = None, +encoding: 'str' = 'utf8', +proto: 'DeprecatedParseProtocol | None' = None, +allow_pickle: 'bool' = False +``` + + + +##### Arguments + +- **b**: +- **content_type**: +- **encoding**: +- **proto**: +- **allow_pickle**: + + + + +### method schema + +```python +by_alias: 'bool' = True, +ref_template: 'str' = '#/$defs/{model}' +``` + + + +##### Arguments + +- **by_alias**: +- **ref_template**: + + + + +### method schema_json + +```python +*, +by_alias: 'bool' = True, +ref_template: 'str' = '#/$defs/{model}', **dumps_kwargs: 'Any' +``` + + + +##### Arguments + +- **by_alias**: +- **ref_template**: +- **dumps_kwargs**: + + + + +### method update_forward_refs + +```python +**localns: 'Any' +``` + + + +##### Arguments + +- **localns**: + + + + +### method validate + +```python +value: 'Any' +``` + + + +##### Arguments + +- **value**: + + + + + + diff --git a/models/ref/python/automations/metriczscorefilter.mdx b/models/ref/python/automations/metriczscorefilter.mdx index 7cfa73de00..e690890bca 100644 --- a/models/ref/python/automations/metriczscorefilter.mdx +++ b/models/ref/python/automations/metriczscorefilter.mdx @@ -1,35 +1,546 @@ --- 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'; - + + + +```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 -## class `MetricZScoreFilter` Filter that compares a metric's z-score against a user-defined threshold. -### method `MetricZScoreFilter.__init__` + +## Args + +- **name**: +- **window_size**: +- **threshold**: +- **change_dir**: + + + + + + +## Methods + +### method construct + +```python +_fields_set: 'set[str] | None' = None, **values: 'Any' +``` + + + +##### Arguments + +- **_fields_set**: +- **values**: + + + + +### method copy + +```python +self, *, +include: 'AbstractSetIntStr | MappingIntStrAny | None' = None, +exclude: 'AbstractSetIntStr | MappingIntStrAny | None' = None, +update: 'Dict[str, Any] | None' = None, +deep: 'bool' = False +``` + +Returns a copy of the model. + +!!! warning "Deprecated" + This method is now deprecated; use `model_copy` instead. + +If you need `include` or `exclude`, use: + +```python {test="skip" lint="skip"} +data = self.model_dump(include=include, exclude=exclude, round_trip=True) +data = {**data, **(update or {})} +copied = self.model_validate(data) +``` + +##### Arguments + +- **include**: Optional set or mapping specifying which fields to include in the copied model. +- **exclude**: Optional set or mapping specifying which fields to exclude in the copied model. +- **update**: Optional dictionary of field-value pairs to override field values in the copied model. +- **deep**: If True, the values of fields that are Pydantic models will be deep-copied. + + + + +### method dict + +```python +self, *, +include: 'IncEx | None' = None, +exclude: 'IncEx | None' = None, +by_alias: 'bool' = False, +exclude_unset: 'bool' = False, +exclude_defaults: 'bool' = False, +exclude_none: 'bool' = False +``` + + + +##### Arguments + +- **include**: +- **exclude**: +- **by_alias**: +- **exclude_unset**: +- **exclude_defaults**: +- **exclude_none**: + + + + +### method from_orm ```python -__init__( - name: 'str', - window: 'int' = 30, - threshold: 'Annotated | Annotated' = 3.0, - change_dir: 'ChangeDir' = ANY -) → None +obj: 'Any' ``` -**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. + +##### Arguments + +- **obj**: + + + + +### method json + +```python +self, *, +include: 'IncEx | None' = None, +exclude: 'IncEx | None' = None, +by_alias: 'bool' = False, +exclude_unset: 'bool' = False, +exclude_defaults: 'bool' = False, +exclude_none: 'bool' = False, +encoder: 'Callable[[Any], Any] | None' = PydanticUndefined, +models_as_dict: 'bool' = PydanticUndefined, **dumps_kwargs: 'Any' +``` + + + +##### Arguments + +- **include**: +- **exclude**: +- **by_alias**: +- **exclude_unset**: +- **exclude_defaults**: +- **exclude_none**: +- **encoder**: +- **models_as_dict**: +- **dumps_kwargs**: + + + + +### method model_construct + +```python +_fields_set: 'set[str] | None' = None, **values: 'Any' +``` + +Creates a new instance of the `Model` class with validated data. + +Creates a new model setting `__dict__` and `__pydantic_fields_set__` from trusted or pre-validated data. +Default values are respected, but no other validation is performed. + +!!! note + `model_construct()` generally respects the `model_config.extra` setting on the provided model. + That is, if `model_config.extra == 'allow'`, then all extra passed values are added to the model instance's `__dict__` + and `__pydantic_extra__` fields. If `model_config.extra == 'ignore'` (the default), then all extra passed values are ignored. + Because no validation is performed with a call to `model_construct()`, having `model_config.extra == 'forbid'` does not result in + an error if extra values are passed, but they will be ignored. + +##### Arguments + +- **_fields_set**: A set of field names that were originally explicitly set during instantiation. If provided, this is directly used for the [`model_fields_set`][pydantic.BaseModel.model_fields_set] attribute. Otherwise, the field names from the `values` argument will be used. +- **values**: Trusted or pre-validated data dictionary. + + + + +### method model_copy + +```python +self, *, +update: 'Mapping[str, Any] | None' = None, +deep: 'bool' = False +``` + +!!! abstract "Usage Documentation" + [`model_copy`](../concepts/serialization.md#model_copy) + +Returns a copy of the model. + +!!! note + The underlying instance's [`__dict__`][object.__dict__] attribute is copied. This + might have unexpected side effects if you store anything in it, on top of the model + fields (e.g. the value of [cached properties][functools.cached_property]). + +##### Arguments + +- **update**: Values to change/add in the new model. Note: the data is not validated before creating the new model. You should trust this data. +- **deep**: Set to `True` to make a deep copy of the model. + + + + +### method model_dump + +```python +self, *, +mode: 'str' = 'json', **kwargs: 'Any' +``` + +!!! abstract "Usage Documentation" + [`model_dump`](../concepts/serialization.md#modelmodel_dump) + +Generate a dictionary representation of the model, optionally specifying which fields to include or exclude. + +##### Arguments + +- **mode**: The mode in which `to_python` should run. If mode is 'json', the output will only contain JSON serializable types. If mode is 'python', the output may contain non-JSON-serializable Python objects. +- **kwargs**: + + + + +### method model_dump_json + +```python +self, *, +indent: 'int | None' = None, **kwargs: 'Any' +``` + +!!! abstract "Usage Documentation" + [`model_dump_json`](../concepts/serialization.md#modelmodel_dump_json) + +Generates a JSON representation of the model using Pydantic's `to_json` method. + +##### Arguments + +- **indent**: Indentation to use in the JSON output. If None is passed, the output will be compact. +- **kwargs**: + + + + +### method model_json_schema + +```python +by_alias: 'bool' = True, +ref_template: 'str' = '#/$defs/{model}', +schema_generator: 'type[GenerateJsonSchema]' = , +mode: 'JsonSchemaMode' = 'validation' +``` + +Generates a JSON schema for a model class. + +##### Arguments + +- **by_alias**: Whether to use attribute aliases or not. +- **ref_template**: The reference template. +- **schema_generator**: To override the logic used to generate the JSON schema, as a subclass of `GenerateJsonSchema` with your desired modifications +- **mode**: The mode in which to generate the schema. + + + + +### method model_parametrized_name + +```python +params: 'tuple[type[Any], ...]' +``` + +Compute the class name for parametrizations of generic classes. + +This method can be overridden to achieve a custom naming scheme for generic BaseModels. + +##### Arguments + +- **params**: Tuple of types of the class. Given a generic class `Model` with 2 type variables and a concrete model `Model[str, int]`, the value `(str, int)` would be passed to `params`. + + +##### Raises + +- **TypeError**: Raised when trying to generate concrete names for non-generic models. + + +### method model_post_init + +```python +self, +context: 'Any', / +``` + +Override this method to perform additional initialization after `__init__` and `model_construct`. +This is useful if you want to do some validation that requires the entire model to be initialized. + +##### Arguments + +- **context**: + + + + +### method model_rebuild + +```python +*, +force: 'bool' = False, +raise_errors: 'bool' = True, +_parent_namespace_depth: 'int' = 2, +_types_namespace: 'MappingNamespace | None' = None +``` + +Try to rebuild the pydantic-core schema for the model. + +This may be necessary when one of the annotations is a ForwardRef which could not be resolved during +the initial attempt to build the schema, and automatic rebuilding fails. + +##### Arguments + +- **force**: Whether to force the rebuilding of the model schema, defaults to `False`. +- **raise_errors**: Whether to raise errors, defaults to `True`. +- **_parent_namespace_depth**: The depth level of the parent namespace, defaults to 2. +- **_types_namespace**: The types namespace, defaults to `None`. + + + + +### method model_validate + +```python +obj: 'Any', *, +strict: 'bool | None' = None, +from_attributes: 'bool | None' = None, +context: 'Any | None' = None, +by_alias: 'bool | None' = None, +by_name: 'bool | None' = None +``` + +Validate a pydantic model instance. + +##### Arguments + +- **obj**: The object to validate. +- **strict**: Whether to enforce types strictly. +- **from_attributes**: Whether to extract data from object attributes. +- **context**: Additional context to pass to the validator. +- **by_alias**: Whether to use the field's alias when validating against the provided input data. +- **by_name**: Whether to use the field's name when validating against the provided input data. + + +##### Raises + +- **ValidationError**: If the object could not be validated. + + +### method model_validate_json + +```python +json_data: 'str | bytes | bytearray', *, +strict: 'bool | None' = None, +context: 'Any | None' = None, +by_alias: 'bool | None' = None, +by_name: 'bool | None' = None +``` + +!!! abstract "Usage Documentation" + [JSON Parsing](../concepts/json.md#json-parsing) + +Validate the given JSON data against the Pydantic model. + +##### Arguments + +- **json_data**: The JSON data to validate. +- **strict**: Whether to enforce types strictly. +- **context**: Extra variables to pass to the validator. +- **by_alias**: Whether to use the field's alias when validating against the provided input data. +- **by_name**: Whether to use the field's name when validating against the provided input data. + + +##### Raises + +- **ValidationError**: If `json_data` is not a JSON string or the object could not be validated. + + +### method model_validate_strings + +```python +obj: 'Any', *, +strict: 'bool | None' = None, +context: 'Any | None' = None, +by_alias: 'bool | None' = None, +by_name: 'bool | None' = None +``` + +Validate the given object with string data against the Pydantic model. + +##### Arguments + +- **obj**: The object containing string data to validate. +- **strict**: Whether to enforce types strictly. +- **context**: Extra variables to pass to the validator. +- **by_alias**: Whether to use the field's alias when validating against the provided input data. +- **by_name**: Whether to use the field's name when validating against the provided input data. + + + + +### method parse_file + +```python +path: 'str | Path', *, +content_type: 'str | None' = None, +encoding: 'str' = 'utf8', +proto: 'DeprecatedParseProtocol | None' = None, +allow_pickle: 'bool' = False +``` + + + +##### Arguments + +- **path**: +- **content_type**: +- **encoding**: +- **proto**: +- **allow_pickle**: + + + + +### method parse_obj + +```python +obj: 'Any' +``` + + + +##### Arguments + +- **obj**: + + + + +### method parse_raw + +```python +b: 'str | bytes', *, +content_type: 'str | None' = None, +encoding: 'str' = 'utf8', +proto: 'DeprecatedParseProtocol | None' = None, +allow_pickle: 'bool' = False +``` + + + +##### Arguments + +- **b**: +- **content_type**: +- **encoding**: +- **proto**: +- **allow_pickle**: + + + + +### method schema + +```python +by_alias: 'bool' = True, +ref_template: 'str' = '#/$defs/{model}' +``` + + + +##### Arguments + +- **by_alias**: +- **ref_template**: + + + + +### method schema_json + +```python +*, +by_alias: 'bool' = True, +ref_template: 'str' = '#/$defs/{model}', **dumps_kwargs: 'Any' +``` + + + +##### Arguments + +- **by_alias**: +- **ref_template**: +- **dumps_kwargs**: + + + + +### method update_forward_refs + +```python +**localns: 'Any' +``` + + + +##### Arguments + +- **localns**: + + + + +### method validate + +```python +value: 'Any' +``` + + + +##### Arguments + +- **value**: + + + + + + diff --git a/models/ref/python/automations/newautomation.mdx b/models/ref/python/automations/newautomation.mdx index 8d083004fe..ee9811dd7f 100644 --- a/models/ref/python/automations/newautomation.mdx +++ b/models/ref/python/automations/newautomation.mdx @@ -1,44 +1,554 @@ --- title: NewAutomation -namespace: automations_namespace -python_object_type: class +kind: class +namespace: wandb.automations.automations --- + import { GitHubLink } from '/snippets/_includes/github-source-link.mdx'; - + + + +```python +*, +name: str | None = None, +description: str | None = None, +enabled: bool | None = None, +event: Optional[Annotated[wandb.automations.events.OnLinkArtifact | wandb.automations.events.OnAddArtifactAlias | wandb.automations.events.OnAddArtifactTag | wandb.automations.events.OnRemoveArtifactTag | wandb.automations.events.OnAddCollectionTag | wandb.automations.events.OnRemoveCollectionTag | wandb.automations.events.OnCreateArtifact | wandb.automations.events.OnUnlinkArtifact | wandb.automations.events.OnRunMetric | wandb.automations.events.OnRunState, FieldInfo(annotation=NoneType, required=True, discriminator='event_type')]] = None, +action: Optional[Annotated[wandb.automations.actions.SendNotification | wandb.automations.actions.SendWebhook | wandb.automations.actions.DoNothing, BeforeValidator(func=, json_schema_input_type=PydanticUndefined), FieldInfo(annotation=NoneType, required=True, discriminator='action_type')]] = None +``` + +## Description -## class `NewAutomation` A new automation to be created. -### method `NewAutomation.__init__` + +## Args + +- **name**: +- **description**: +- **enabled**: +- **event**: +- **action**: + + + + +## Properties + +### property scope + +The scope in which the triggering event must occur. + + + +## Methods + +### method construct ```python -__init__( - name: 'str | None' = None, - description: 'str | None' = None, - enabled: 'bool | None' = None, - event: 'Annotated | None' = None, - action: 'Annotated | None' = None -) → None +_fields_set: 'set[str] | None' = None, **values: 'Any' ``` -**Args:** - - - `name` (str | None): The name of this automation. - - `description` (str | None): An optional description of this automation. - - `enabled` (bool | None): Whether this automation is enabled. Only enabled automations will trigger. - - `event` (Optional[Annotated]): The event that will trigger this automation. - - `action` (Optional[Annotated]): The action that will execute when this automation is triggered. -**Returns:** - An `NewAutomation` object. -### property `NewAutomation.scope` +##### Arguments + +- **_fields_set**: +- **values**: + + + + +### method copy + +```python +self, *, +include: 'AbstractSetIntStr | MappingIntStrAny | None' = None, +exclude: 'AbstractSetIntStr | MappingIntStrAny | None' = None, +update: 'Dict[str, Any] | None' = None, +deep: 'bool' = False +``` + +Returns a copy of the model. + +!!! warning "Deprecated" + This method is now deprecated; use `model_copy` instead. + +If you need `include` or `exclude`, use: + +```python {test="skip" lint="skip"} +data = self.model_dump(include=include, exclude=exclude, round_trip=True) +data = {**data, **(update or {})} +copied = self.model_validate(data) +``` + +##### Arguments + +- **include**: Optional set or mapping specifying which fields to include in the copied model. +- **exclude**: Optional set or mapping specifying which fields to exclude in the copied model. +- **update**: Optional dictionary of field-value pairs to override field values in the copied model. +- **deep**: If True, the values of fields that are Pydantic models will be deep-copied. + + + + +### method dict + +```python +self, *, +include: 'IncEx | None' = None, +exclude: 'IncEx | None' = None, +by_alias: 'bool' = False, +exclude_unset: 'bool' = False, +exclude_defaults: 'bool' = False, +exclude_none: 'bool' = False +``` + + + +##### Arguments + +- **include**: +- **exclude**: +- **by_alias**: +- **exclude_unset**: +- **exclude_defaults**: +- **exclude_none**: + + + + +### method from_orm + +```python +obj: 'Any' +``` + + + +##### Arguments + +- **obj**: + + + + +### method json + +```python +self, *, +include: 'IncEx | None' = None, +exclude: 'IncEx | None' = None, +by_alias: 'bool' = False, +exclude_unset: 'bool' = False, +exclude_defaults: 'bool' = False, +exclude_none: 'bool' = False, +encoder: 'Callable[[Any], Any] | None' = PydanticUndefined, +models_as_dict: 'bool' = PydanticUndefined, **dumps_kwargs: 'Any' +``` + + + +##### Arguments + +- **include**: +- **exclude**: +- **by_alias**: +- **exclude_unset**: +- **exclude_defaults**: +- **exclude_none**: +- **encoder**: +- **models_as_dict**: +- **dumps_kwargs**: + + + + +### method model_construct + +```python +_fields_set: 'set[str] | None' = None, **values: 'Any' +``` + +Creates a new instance of the `Model` class with validated data. + +Creates a new model setting `__dict__` and `__pydantic_fields_set__` from trusted or pre-validated data. +Default values are respected, but no other validation is performed. + +!!! note + `model_construct()` generally respects the `model_config.extra` setting on the provided model. + That is, if `model_config.extra == 'allow'`, then all extra passed values are added to the model instance's `__dict__` + and `__pydantic_extra__` fields. If `model_config.extra == 'ignore'` (the default), then all extra passed values are ignored. + Because no validation is performed with a call to `model_construct()`, having `model_config.extra == 'forbid'` does not result in + an error if extra values are passed, but they will be ignored. + +##### Arguments + +- **_fields_set**: A set of field names that were originally explicitly set during instantiation. If provided, this is directly used for the [`model_fields_set`][pydantic.BaseModel.model_fields_set] attribute. Otherwise, the field names from the `values` argument will be used. +- **values**: Trusted or pre-validated data dictionary. + + + + +### method model_copy + +```python +self, *, +update: 'Mapping[str, Any] | None' = None, +deep: 'bool' = False +``` + +!!! abstract "Usage Documentation" + [`model_copy`](../concepts/serialization.md#model_copy) + +Returns a copy of the model. + +!!! note + The underlying instance's [`__dict__`][object.__dict__] attribute is copied. This + might have unexpected side effects if you store anything in it, on top of the model + fields (e.g. the value of [cached properties][functools.cached_property]). + +##### Arguments + +- **update**: Values to change/add in the new model. Note: the data is not validated before creating the new model. You should trust this data. +- **deep**: Set to `True` to make a deep copy of the model. + + + + +### method model_dump + +```python +self, *, +mode: 'str' = 'json', **kwargs: 'Any' +``` + +!!! abstract "Usage Documentation" + [`model_dump`](../concepts/serialization.md#modelmodel_dump) + +Generate a dictionary representation of the model, optionally specifying which fields to include or exclude. + +##### Arguments + +- **mode**: The mode in which `to_python` should run. If mode is 'json', the output will only contain JSON serializable types. If mode is 'python', the output may contain non-JSON-serializable Python objects. +- **kwargs**: + + + + +### method model_dump_json + +```python +self, *, +indent: 'int | None' = None, **kwargs: 'Any' +``` + +!!! abstract "Usage Documentation" + [`model_dump_json`](../concepts/serialization.md#modelmodel_dump_json) + +Generates a JSON representation of the model using Pydantic's `to_json` method. + +##### Arguments + +- **indent**: Indentation to use in the JSON output. If None is passed, the output will be compact. +- **kwargs**: + + + + +### method model_json_schema + +```python +by_alias: 'bool' = True, +ref_template: 'str' = '#/$defs/{model}', +schema_generator: 'type[GenerateJsonSchema]' = , +mode: 'JsonSchemaMode' = 'validation' +``` + +Generates a JSON schema for a model class. + +##### Arguments + +- **by_alias**: Whether to use attribute aliases or not. +- **ref_template**: The reference template. +- **schema_generator**: To override the logic used to generate the JSON schema, as a subclass of `GenerateJsonSchema` with your desired modifications +- **mode**: The mode in which to generate the schema. + + + + +### method model_parametrized_name + +```python +params: 'tuple[type[Any], ...]' +``` + +Compute the class name for parametrizations of generic classes. + +This method can be overridden to achieve a custom naming scheme for generic BaseModels. + +##### Arguments + +- **params**: Tuple of types of the class. Given a generic class `Model` with 2 type variables and a concrete model `Model[str, int]`, the value `(str, int)` would be passed to `params`. + + +##### Raises + +- **TypeError**: Raised when trying to generate concrete names for non-generic models. + + +### method model_post_init + +```python +self, +context: 'Any', / +``` + +Override this method to perform additional initialization after `__init__` and `model_construct`. +This is useful if you want to do some validation that requires the entire model to be initialized. + +##### Arguments + +- **context**: + + + + +### method model_rebuild + +```python +*, +force: 'bool' = False, +raise_errors: 'bool' = True, +_parent_namespace_depth: 'int' = 2, +_types_namespace: 'MappingNamespace | None' = None +``` + +Try to rebuild the pydantic-core schema for the model. + +This may be necessary when one of the annotations is a ForwardRef which could not be resolved during +the initial attempt to build the schema, and automatic rebuilding fails. + +##### Arguments + +- **force**: Whether to force the rebuilding of the model schema, defaults to `False`. +- **raise_errors**: Whether to raise errors, defaults to `True`. +- **_parent_namespace_depth**: The depth level of the parent namespace, defaults to 2. +- **_types_namespace**: The types namespace, defaults to `None`. + + + + +### method model_validate + +```python +obj: 'Any', *, +strict: 'bool | None' = None, +from_attributes: 'bool | None' = None, +context: 'Any | None' = None, +by_alias: 'bool | None' = None, +by_name: 'bool | None' = None +``` + +Validate a pydantic model instance. + +##### Arguments + +- **obj**: The object to validate. +- **strict**: Whether to enforce types strictly. +- **from_attributes**: Whether to extract data from object attributes. +- **context**: Additional context to pass to the validator. +- **by_alias**: Whether to use the field's alias when validating against the provided input data. +- **by_name**: Whether to use the field's name when validating against the provided input data. + + +##### Raises + +- **ValidationError**: If the object could not be validated. + + +### method model_validate_json + +```python +json_data: 'str | bytes | bytearray', *, +strict: 'bool | None' = None, +context: 'Any | None' = None, +by_alias: 'bool | None' = None, +by_name: 'bool | None' = None +``` + +!!! abstract "Usage Documentation" + [JSON Parsing](../concepts/json.md#json-parsing) + +Validate the given JSON data against the Pydantic model. + +##### Arguments + +- **json_data**: The JSON data to validate. +- **strict**: Whether to enforce types strictly. +- **context**: Extra variables to pass to the validator. +- **by_alias**: Whether to use the field's alias when validating against the provided input data. +- **by_name**: Whether to use the field's name when validating against the provided input data. + + +##### Raises + +- **ValidationError**: If `json_data` is not a JSON string or the object could not be validated. + + +### method model_validate_strings + +```python +obj: 'Any', *, +strict: 'bool | None' = None, +context: 'Any | None' = None, +by_alias: 'bool | None' = None, +by_name: 'bool | None' = None +``` + +Validate the given object with string data against the Pydantic model. + +##### Arguments + +- **obj**: The object containing string data to validate. +- **strict**: Whether to enforce types strictly. +- **context**: Extra variables to pass to the validator. +- **by_alias**: Whether to use the field's alias when validating against the provided input data. +- **by_name**: Whether to use the field's name when validating against the provided input data. + + + + +### method parse_file + +```python +path: 'str | Path', *, +content_type: 'str | None' = None, +encoding: 'str' = 'utf8', +proto: 'DeprecatedParseProtocol | None' = None, +allow_pickle: 'bool' = False +``` + + + +##### Arguments + +- **path**: +- **content_type**: +- **encoding**: +- **proto**: +- **allow_pickle**: + + + + +### method parse_obj + +```python +obj: 'Any' +``` + + + +##### Arguments + +- **obj**: + + + + +### method parse_raw + +```python +b: 'str | bytes', *, +content_type: 'str | None' = None, +encoding: 'str' = 'utf8', +proto: 'DeprecatedParseProtocol | None' = None, +allow_pickle: 'bool' = False +``` + + + +##### Arguments + +- **b**: +- **content_type**: +- **encoding**: +- **proto**: +- **allow_pickle**: + + + + +### method schema + +```python +by_alias: 'bool' = True, +ref_template: 'str' = '#/$defs/{model}' +``` + + + +##### Arguments + +- **by_alias**: +- **ref_template**: + + + + +### method schema_json + +```python +*, +by_alias: 'bool' = True, +ref_template: 'str' = '#/$defs/{model}', **dumps_kwargs: 'Any' +``` + + + +##### Arguments + +- **by_alias**: +- **ref_template**: +- **dumps_kwargs**: + + + + +### method update_forward_refs + +```python +**localns: 'Any' +``` + + + +##### Arguments + +- **localns**: + + + + +### method validate + +```python +value: 'Any' +``` + + + +##### Arguments + +- **value**: + + + + -The scope in which the triggering event must occur. -**Returns:** - - `AutomationScope | None`: The scope property value. diff --git a/models/ref/python/automations/onaddartifactalias.mdx b/models/ref/python/automations/onaddartifactalias.mdx index d421ba32bc..3c030730e5 100644 --- a/models/ref/python/automations/onaddartifactalias.mdx +++ b/models/ref/python/automations/onaddartifactalias.mdx @@ -1,18 +1,38 @@ --- title: OnAddArtifactAlias -namespace: automations_namespace -python_object_type: class +kind: class +namespace: wandb.automations.events --- + import { GitHubLink } from '/snippets/_includes/github-source-link.mdx'; - + + + +```python +*, +event_type: Literal[ADD_ARTIFACT_ALIAS] = ADD_ARTIFACT_ALIAS, +scope: typing.Annotated[wandb.automations.scopes._ArtifactSequenceScope | wandb.automations.scopes._ArtifactPortfolioScope | wandb.automations.scopes.ProjectScope, BeforeValidator(func=, json_schema_input_type=PydanticUndefined)], +filter: typing.Annotated[wandb.automations._filters.operators.And | wandb.automations._filters.operators.Or | wandb.automations._filters.operators.Nor | wandb.automations._filters.operators.Not | wandb.automations._filters.operators.Lt | wandb.automations._filters.operators.Gt | wandb.automations._filters.operators.Lte | wandb.automations._filters.operators.Gte | wandb.automations._filters.operators.Eq | wandb.automations._filters.operators.Ne | wandb.automations._filters.operators.In | wandb.automations._filters.operators.NotIn | wandb.automations._filters.operators.Exists | wandb.automations._filters.operators.Regex | wandb.automations._filters.operators.Contains | wandb.automations._filters.expressions.FilterExpr | dict[str, typing.Any], Json, BeforeValidator(func=, json_schema_input_type=PydanticUndefined), PlainSerializer(func=, return_type=PydanticUndefined, when_used='always'), AfterValidator(func=)] = And(()) +``` + +## Description -## class `OnAddArtifactAlias` A new alias is assigned to an artifact. -Examples: + + +## Args + +- **event_type**: +- **scope**: +- **filter**: + + +## Examples + Define an event that triggers whenever the alias "prod" is assigned to any artifact in the collection "my-collection": @@ -30,21 +50,527 @@ event = OnAddArtifactAlias( ``` -### method `OnAddArtifactAlias.__init__` + +## Methods + +### method construct + +```python +_fields_set: 'set[str] | None' = None, **values: 'Any' +``` + + + +##### Arguments + +- **_fields_set**: +- **values**: + + + + +### method copy + +```python +self, *, +include: 'AbstractSetIntStr | MappingIntStrAny | None' = None, +exclude: 'AbstractSetIntStr | MappingIntStrAny | None' = None, +update: 'Dict[str, Any] | None' = None, +deep: 'bool' = False +``` + +Returns a copy of the model. + +!!! warning "Deprecated" + This method is now deprecated; use `model_copy` instead. + +If you need `include` or `exclude`, use: + +```python {test="skip" lint="skip"} +data = self.model_dump(include=include, exclude=exclude, round_trip=True) +data = {**data, **(update or {})} +copied = self.model_validate(data) +``` + +##### Arguments + +- **include**: Optional set or mapping specifying which fields to include in the copied model. +- **exclude**: Optional set or mapping specifying which fields to exclude in the copied model. +- **update**: Optional dictionary of field-value pairs to override field values in the copied model. +- **deep**: If True, the values of fields that are Pydantic models will be deep-copied. + + + + +### method dict + +```python +self, *, +include: 'IncEx | None' = None, +exclude: 'IncEx | None' = None, +by_alias: 'bool' = False, +exclude_unset: 'bool' = False, +exclude_defaults: 'bool' = False, +exclude_none: 'bool' = False +``` + + + +##### Arguments + +- **include**: +- **exclude**: +- **by_alias**: +- **exclude_unset**: +- **exclude_defaults**: +- **exclude_none**: + + + + +### method from_orm + +```python +obj: 'Any' +``` + + + +##### Arguments + +- **obj**: + + + + +### method json + +```python +self, *, +include: 'IncEx | None' = None, +exclude: 'IncEx | None' = None, +by_alias: 'bool' = False, +exclude_unset: 'bool' = False, +exclude_defaults: 'bool' = False, +exclude_none: 'bool' = False, +encoder: 'Callable[[Any], Any] | None' = PydanticUndefined, +models_as_dict: 'bool' = PydanticUndefined, **dumps_kwargs: 'Any' +``` + + + +##### Arguments + +- **include**: +- **exclude**: +- **by_alias**: +- **exclude_unset**: +- **exclude_defaults**: +- **exclude_none**: +- **encoder**: +- **models_as_dict**: +- **dumps_kwargs**: + + + + +### method model_construct + +```python +_fields_set: 'set[str] | None' = None, **values: 'Any' +``` + +Creates a new instance of the `Model` class with validated data. + +Creates a new model setting `__dict__` and `__pydantic_fields_set__` from trusted or pre-validated data. +Default values are respected, but no other validation is performed. + +!!! note + `model_construct()` generally respects the `model_config.extra` setting on the provided model. + That is, if `model_config.extra == 'allow'`, then all extra passed values are added to the model instance's `__dict__` + and `__pydantic_extra__` fields. If `model_config.extra == 'ignore'` (the default), then all extra passed values are ignored. + Because no validation is performed with a call to `model_construct()`, having `model_config.extra == 'forbid'` does not result in + an error if extra values are passed, but they will be ignored. + +##### Arguments + +- **_fields_set**: A set of field names that were originally explicitly set during instantiation. If provided, this is directly used for the [`model_fields_set`][pydantic.BaseModel.model_fields_set] attribute. Otherwise, the field names from the `values` argument will be used. +- **values**: Trusted or pre-validated data dictionary. + + + + +### method model_copy + +```python +self, *, +update: 'Mapping[str, Any] | None' = None, +deep: 'bool' = False +``` + +!!! abstract "Usage Documentation" + [`model_copy`](../concepts/serialization.md#model_copy) + +Returns a copy of the model. + +!!! note + The underlying instance's [`__dict__`][object.__dict__] attribute is copied. This + might have unexpected side effects if you store anything in it, on top of the model + fields (e.g. the value of [cached properties][functools.cached_property]). + +##### Arguments + +- **update**: Values to change/add in the new model. Note: the data is not validated before creating the new model. You should trust this data. +- **deep**: Set to `True` to make a deep copy of the model. + + + + +### method model_dump + +```python +self, *, +mode: 'str' = 'json', **kwargs: 'Any' +``` + +!!! abstract "Usage Documentation" + [`model_dump`](../concepts/serialization.md#modelmodel_dump) + +Generate a dictionary representation of the model, optionally specifying which fields to include or exclude. + +##### Arguments + +- **mode**: The mode in which `to_python` should run. If mode is 'json', the output will only contain JSON serializable types. If mode is 'python', the output may contain non-JSON-serializable Python objects. +- **kwargs**: + + + + +### method model_dump_json + +```python +self, *, +indent: 'int | None' = None, **kwargs: 'Any' +``` + +!!! abstract "Usage Documentation" + [`model_dump_json`](../concepts/serialization.md#modelmodel_dump_json) + +Generates a JSON representation of the model using Pydantic's `to_json` method. + +##### Arguments + +- **indent**: Indentation to use in the JSON output. If None is passed, the output will be compact. +- **kwargs**: + + + + +### method model_json_schema + +```python +by_alias: 'bool' = True, +ref_template: 'str' = '#/$defs/{model}', +schema_generator: 'type[GenerateJsonSchema]' = , +mode: 'JsonSchemaMode' = 'validation' +``` + +Generates a JSON schema for a model class. + +##### Arguments + +- **by_alias**: Whether to use attribute aliases or not. +- **ref_template**: The reference template. +- **schema_generator**: To override the logic used to generate the JSON schema, as a subclass of `GenerateJsonSchema` with your desired modifications +- **mode**: The mode in which to generate the schema. + + + + +### method model_parametrized_name + +```python +params: 'tuple[type[Any], ...]' +``` + +Compute the class name for parametrizations of generic classes. + +This method can be overridden to achieve a custom naming scheme for generic BaseModels. + +##### Arguments + +- **params**: Tuple of types of the class. Given a generic class `Model` with 2 type variables and a concrete model `Model[str, int]`, the value `(str, int)` would be passed to `params`. + + +##### Raises + +- **TypeError**: Raised when trying to generate concrete names for non-generic models. + + +### method model_post_init + +```python +self, +context: 'Any', / +``` + +Override this method to perform additional initialization after `__init__` and `model_construct`. +This is useful if you want to do some validation that requires the entire model to be initialized. + +##### Arguments + +- **context**: + + + + +### method model_rebuild + +```python +*, +force: 'bool' = False, +raise_errors: 'bool' = True, +_parent_namespace_depth: 'int' = 2, +_types_namespace: 'MappingNamespace | None' = None +``` + +Try to rebuild the pydantic-core schema for the model. + +This may be necessary when one of the annotations is a ForwardRef which could not be resolved during +the initial attempt to build the schema, and automatic rebuilding fails. + +##### Arguments + +- **force**: Whether to force the rebuilding of the model schema, defaults to `False`. +- **raise_errors**: Whether to raise errors, defaults to `True`. +- **_parent_namespace_depth**: The depth level of the parent namespace, defaults to 2. +- **_types_namespace**: The types namespace, defaults to `None`. + + + + +### method model_validate + +```python +obj: 'Any', *, +strict: 'bool | None' = None, +from_attributes: 'bool | None' = None, +context: 'Any | None' = None, +by_alias: 'bool | None' = None, +by_name: 'bool | None' = None +``` + +Validate a pydantic model instance. + +##### Arguments + +- **obj**: The object to validate. +- **strict**: Whether to enforce types strictly. +- **from_attributes**: Whether to extract data from object attributes. +- **context**: Additional context to pass to the validator. +- **by_alias**: Whether to use the field's alias when validating against the provided input data. +- **by_name**: Whether to use the field's name when validating against the provided input data. + + +##### Raises + +- **ValidationError**: If the object could not be validated. + + +### method model_validate_json + +```python +json_data: 'str | bytes | bytearray', *, +strict: 'bool | None' = None, +context: 'Any | None' = None, +by_alias: 'bool | None' = None, +by_name: 'bool | None' = None +``` + +!!! abstract "Usage Documentation" + [JSON Parsing](../concepts/json.md#json-parsing) + +Validate the given JSON data against the Pydantic model. + +##### Arguments + +- **json_data**: The JSON data to validate. +- **strict**: Whether to enforce types strictly. +- **context**: Extra variables to pass to the validator. +- **by_alias**: Whether to use the field's alias when validating against the provided input data. +- **by_name**: Whether to use the field's name when validating against the provided input data. + + +##### Raises + +- **ValidationError**: If `json_data` is not a JSON string or the object could not be validated. + + +### method model_validate_strings ```python -__init__( - event_type: 'Literal[ADD_ARTIFACT_ALIAS]' = ADD_ARTIFACT_ALIAS, - scope: 'wandb.automations.scopes._ArtifactSequenceScope | wandb.automations.scopes._ArtifactPortfolioScope | wandb.automations.scopes.ProjectScope', - filter: 'wandb.automations._filters.operators.And | wandb.automations._filters.operators.Or | wandb.automations._filters.operators.Nor | wandb.automations._filters.operators.Not | wandb.automations._filters.operators.Lt | wandb.automations._filters.operators.Gt | wandb.automations._filters.operators.Lte | wandb.automations._filters.operators.Gte | wandb.automations._filters.operators.Eq | wandb.automations._filters.operators.Ne | wandb.automations._filters.operators.In | wandb.automations._filters.operators.NotIn | wandb.automations._filters.operators.Exists | wandb.automations._filters.operators.Regex | wandb.automations._filters.operators.Contains | wandb.automations._filters.expressions.FilterExpr | dict[str, Any]' = And(()) -) → None +obj: 'Any', *, +strict: 'bool | None' = None, +context: 'Any | None' = None, +by_alias: 'bool | None' = None, +by_name: 'bool | None' = None ``` -**Args:** - - - `event_type` (Literal[ADD_ARTIFACT_ALIAS]): - - `scope` (wandb.automations.scopes._ArtifactSequenceScope | wandb.automations.scopes._ArtifactPortfolioScope | wandb.automations.scopes.ProjectScope): The scope of the event. - - `filter` (wandb.automations._filters.operators.And | wandb.automations._filters.operators.Or | wandb.automations._filters.operators.Nor | wandb.automations._filters.operators.Not | wandb.automations._filters.operators.Lt | wandb.automations._filters.operators.Gt | wandb.automations._filters.operators.Lte | wandb.automations._filters.operators.Gte | wandb.automations._filters.operators.Eq | wandb.automations._filters.operators.Ne | wandb.automations._filters.operators.In | wandb.automations._filters.operators.NotIn | wandb.automations._filters.operators.Exists | wandb.automations._filters.operators.Regex | wandb.automations._filters.operators.Contains | wandb.automations._filters.expressions.FilterExpr | dict[str, Any]): Additional conditions(s), if any, that are required for this event to trigger. +Validate the given object with string data against the Pydantic model. + +##### Arguments + +- **obj**: The object containing string data to validate. +- **strict**: Whether to enforce types strictly. +- **context**: Extra variables to pass to the validator. +- **by_alias**: Whether to use the field's alias when validating against the provided input data. +- **by_name**: Whether to use the field's name when validating against the provided input data. + + + + +### method parse_file + +```python +path: 'str | Path', *, +content_type: 'str | None' = None, +encoding: 'str' = 'utf8', +proto: 'DeprecatedParseProtocol | None' = None, +allow_pickle: 'bool' = False +``` + + + +##### Arguments + +- **path**: +- **content_type**: +- **encoding**: +- **proto**: +- **allow_pickle**: + + + + +### method parse_obj + +```python +obj: 'Any' +``` + + + +##### Arguments + +- **obj**: + + + + +### method parse_raw + +```python +b: 'str | bytes', *, +content_type: 'str | None' = None, +encoding: 'str' = 'utf8', +proto: 'DeprecatedParseProtocol | None' = None, +allow_pickle: 'bool' = False +``` + + + +##### Arguments + +- **b**: +- **content_type**: +- **encoding**: +- **proto**: +- **allow_pickle**: + + + + +### method schema + +```python +by_alias: 'bool' = True, +ref_template: 'str' = '#/$defs/{model}' +``` + + + +##### Arguments + +- **by_alias**: +- **ref_template**: + + + + +### method schema_json + +```python +*, +by_alias: 'bool' = True, +ref_template: 'str' = '#/$defs/{model}', **dumps_kwargs: 'Any' +``` + + + +##### Arguments + +- **by_alias**: +- **ref_template**: +- **dumps_kwargs**: + + + + +### method then + +```python +self, +action: 'InputAction' +``` + +Define a new Automation in which this event triggers the given action. + +##### Arguments + +- **action**: + + + + +### method update_forward_refs + +```python +**localns: 'Any' +``` + + + +##### Arguments + +- **localns**: + + + + +### method validate + +```python +value: 'Any' +``` + + + +##### Arguments + +- **value**: + + + + + -**Returns:** - An `OnAddArtifactAlias` object. diff --git a/models/ref/python/automations/onaddartifacttag.mdx b/models/ref/python/automations/onaddartifacttag.mdx index 8b1ad87e11..9e0e660aa4 100644 --- a/models/ref/python/automations/onaddartifacttag.mdx +++ b/models/ref/python/automations/onaddartifacttag.mdx @@ -1,18 +1,38 @@ --- title: OnAddArtifactTag -namespace: automations_namespace -python_object_type: class +kind: class +namespace: wandb.automations.events --- + import { GitHubLink } from '/snippets/_includes/github-source-link.mdx'; - + + + +```python +*, +event_type: Literal[ADD_ARTIFACT_TAG] = ADD_ARTIFACT_TAG, +scope: typing.Annotated[wandb.automations.scopes._ArtifactSequenceScope | wandb.automations.scopes._ArtifactPortfolioScope | wandb.automations.scopes.ProjectScope, BeforeValidator(func=, json_schema_input_type=PydanticUndefined)], +filter: typing.Annotated[wandb.automations._filters.operators.And | wandb.automations._filters.operators.Or | wandb.automations._filters.operators.Nor | wandb.automations._filters.operators.Not | wandb.automations._filters.operators.Lt | wandb.automations._filters.operators.Gt | wandb.automations._filters.operators.Lte | wandb.automations._filters.operators.Gte | wandb.automations._filters.operators.Eq | wandb.automations._filters.operators.Ne | wandb.automations._filters.operators.In | wandb.automations._filters.operators.NotIn | wandb.automations._filters.operators.Exists | wandb.automations._filters.operators.Regex | wandb.automations._filters.operators.Contains | wandb.automations._filters.expressions.FilterExpr | dict[str, typing.Any], Json, BeforeValidator(func=, json_schema_input_type=PydanticUndefined), PlainSerializer(func=, return_type=PydanticUndefined, when_used='always'), AfterValidator(func=)] = And(()) +``` + +## Description -## class `OnAddArtifactTag` A new tag is assigned to an artifact version. -Examples: + + +## Args + +- **event_type**: +- **scope**: +- **filter**: + + +## Examples + Define an event that triggers whenever the tag "prod" is assigned to any artifact version in the collection "my-collection": @@ -30,21 +50,527 @@ event = OnAddArtifactTag( ``` -### method `OnAddArtifactTag.__init__` + +## Methods + +### method construct + +```python +_fields_set: 'set[str] | None' = None, **values: 'Any' +``` + + + +##### Arguments + +- **_fields_set**: +- **values**: + + + + +### method copy + +```python +self, *, +include: 'AbstractSetIntStr | MappingIntStrAny | None' = None, +exclude: 'AbstractSetIntStr | MappingIntStrAny | None' = None, +update: 'Dict[str, Any] | None' = None, +deep: 'bool' = False +``` + +Returns a copy of the model. + +!!! warning "Deprecated" + This method is now deprecated; use `model_copy` instead. + +If you need `include` or `exclude`, use: + +```python {test="skip" lint="skip"} +data = self.model_dump(include=include, exclude=exclude, round_trip=True) +data = {**data, **(update or {})} +copied = self.model_validate(data) +``` + +##### Arguments + +- **include**: Optional set or mapping specifying which fields to include in the copied model. +- **exclude**: Optional set or mapping specifying which fields to exclude in the copied model. +- **update**: Optional dictionary of field-value pairs to override field values in the copied model. +- **deep**: If True, the values of fields that are Pydantic models will be deep-copied. + + + + +### method dict + +```python +self, *, +include: 'IncEx | None' = None, +exclude: 'IncEx | None' = None, +by_alias: 'bool' = False, +exclude_unset: 'bool' = False, +exclude_defaults: 'bool' = False, +exclude_none: 'bool' = False +``` + + + +##### Arguments + +- **include**: +- **exclude**: +- **by_alias**: +- **exclude_unset**: +- **exclude_defaults**: +- **exclude_none**: + + + + +### method from_orm + +```python +obj: 'Any' +``` + + + +##### Arguments + +- **obj**: + + + + +### method json + +```python +self, *, +include: 'IncEx | None' = None, +exclude: 'IncEx | None' = None, +by_alias: 'bool' = False, +exclude_unset: 'bool' = False, +exclude_defaults: 'bool' = False, +exclude_none: 'bool' = False, +encoder: 'Callable[[Any], Any] | None' = PydanticUndefined, +models_as_dict: 'bool' = PydanticUndefined, **dumps_kwargs: 'Any' +``` + + + +##### Arguments + +- **include**: +- **exclude**: +- **by_alias**: +- **exclude_unset**: +- **exclude_defaults**: +- **exclude_none**: +- **encoder**: +- **models_as_dict**: +- **dumps_kwargs**: + + + + +### method model_construct + +```python +_fields_set: 'set[str] | None' = None, **values: 'Any' +``` + +Creates a new instance of the `Model` class with validated data. + +Creates a new model setting `__dict__` and `__pydantic_fields_set__` from trusted or pre-validated data. +Default values are respected, but no other validation is performed. + +!!! note + `model_construct()` generally respects the `model_config.extra` setting on the provided model. + That is, if `model_config.extra == 'allow'`, then all extra passed values are added to the model instance's `__dict__` + and `__pydantic_extra__` fields. If `model_config.extra == 'ignore'` (the default), then all extra passed values are ignored. + Because no validation is performed with a call to `model_construct()`, having `model_config.extra == 'forbid'` does not result in + an error if extra values are passed, but they will be ignored. + +##### Arguments + +- **_fields_set**: A set of field names that were originally explicitly set during instantiation. If provided, this is directly used for the [`model_fields_set`][pydantic.BaseModel.model_fields_set] attribute. Otherwise, the field names from the `values` argument will be used. +- **values**: Trusted or pre-validated data dictionary. + + + + +### method model_copy + +```python +self, *, +update: 'Mapping[str, Any] | None' = None, +deep: 'bool' = False +``` + +!!! abstract "Usage Documentation" + [`model_copy`](../concepts/serialization.md#model_copy) + +Returns a copy of the model. + +!!! note + The underlying instance's [`__dict__`][object.__dict__] attribute is copied. This + might have unexpected side effects if you store anything in it, on top of the model + fields (e.g. the value of [cached properties][functools.cached_property]). + +##### Arguments + +- **update**: Values to change/add in the new model. Note: the data is not validated before creating the new model. You should trust this data. +- **deep**: Set to `True` to make a deep copy of the model. + + + + +### method model_dump + +```python +self, *, +mode: 'str' = 'json', **kwargs: 'Any' +``` + +!!! abstract "Usage Documentation" + [`model_dump`](../concepts/serialization.md#modelmodel_dump) + +Generate a dictionary representation of the model, optionally specifying which fields to include or exclude. + +##### Arguments + +- **mode**: The mode in which `to_python` should run. If mode is 'json', the output will only contain JSON serializable types. If mode is 'python', the output may contain non-JSON-serializable Python objects. +- **kwargs**: + + + + +### method model_dump_json + +```python +self, *, +indent: 'int | None' = None, **kwargs: 'Any' +``` + +!!! abstract "Usage Documentation" + [`model_dump_json`](../concepts/serialization.md#modelmodel_dump_json) + +Generates a JSON representation of the model using Pydantic's `to_json` method. + +##### Arguments + +- **indent**: Indentation to use in the JSON output. If None is passed, the output will be compact. +- **kwargs**: + + + + +### method model_json_schema + +```python +by_alias: 'bool' = True, +ref_template: 'str' = '#/$defs/{model}', +schema_generator: 'type[GenerateJsonSchema]' = , +mode: 'JsonSchemaMode' = 'validation' +``` + +Generates a JSON schema for a model class. + +##### Arguments + +- **by_alias**: Whether to use attribute aliases or not. +- **ref_template**: The reference template. +- **schema_generator**: To override the logic used to generate the JSON schema, as a subclass of `GenerateJsonSchema` with your desired modifications +- **mode**: The mode in which to generate the schema. + + + + +### method model_parametrized_name + +```python +params: 'tuple[type[Any], ...]' +``` + +Compute the class name for parametrizations of generic classes. + +This method can be overridden to achieve a custom naming scheme for generic BaseModels. + +##### Arguments + +- **params**: Tuple of types of the class. Given a generic class `Model` with 2 type variables and a concrete model `Model[str, int]`, the value `(str, int)` would be passed to `params`. + + +##### Raises + +- **TypeError**: Raised when trying to generate concrete names for non-generic models. + + +### method model_post_init + +```python +self, +context: 'Any', / +``` + +Override this method to perform additional initialization after `__init__` and `model_construct`. +This is useful if you want to do some validation that requires the entire model to be initialized. + +##### Arguments + +- **context**: + + + + +### method model_rebuild + +```python +*, +force: 'bool' = False, +raise_errors: 'bool' = True, +_parent_namespace_depth: 'int' = 2, +_types_namespace: 'MappingNamespace | None' = None +``` + +Try to rebuild the pydantic-core schema for the model. + +This may be necessary when one of the annotations is a ForwardRef which could not be resolved during +the initial attempt to build the schema, and automatic rebuilding fails. + +##### Arguments + +- **force**: Whether to force the rebuilding of the model schema, defaults to `False`. +- **raise_errors**: Whether to raise errors, defaults to `True`. +- **_parent_namespace_depth**: The depth level of the parent namespace, defaults to 2. +- **_types_namespace**: The types namespace, defaults to `None`. + + + + +### method model_validate + +```python +obj: 'Any', *, +strict: 'bool | None' = None, +from_attributes: 'bool | None' = None, +context: 'Any | None' = None, +by_alias: 'bool | None' = None, +by_name: 'bool | None' = None +``` + +Validate a pydantic model instance. + +##### Arguments + +- **obj**: The object to validate. +- **strict**: Whether to enforce types strictly. +- **from_attributes**: Whether to extract data from object attributes. +- **context**: Additional context to pass to the validator. +- **by_alias**: Whether to use the field's alias when validating against the provided input data. +- **by_name**: Whether to use the field's name when validating against the provided input data. + + +##### Raises + +- **ValidationError**: If the object could not be validated. + + +### method model_validate_json + +```python +json_data: 'str | bytes | bytearray', *, +strict: 'bool | None' = None, +context: 'Any | None' = None, +by_alias: 'bool | None' = None, +by_name: 'bool | None' = None +``` + +!!! abstract "Usage Documentation" + [JSON Parsing](../concepts/json.md#json-parsing) + +Validate the given JSON data against the Pydantic model. + +##### Arguments + +- **json_data**: The JSON data to validate. +- **strict**: Whether to enforce types strictly. +- **context**: Extra variables to pass to the validator. +- **by_alias**: Whether to use the field's alias when validating against the provided input data. +- **by_name**: Whether to use the field's name when validating against the provided input data. + + +##### Raises + +- **ValidationError**: If `json_data` is not a JSON string or the object could not be validated. + + +### method model_validate_strings ```python -__init__( - event_type: 'Literal[ADD_ARTIFACT_TAG]' = ADD_ARTIFACT_TAG, - scope: 'wandb.automations.scopes._ArtifactSequenceScope | wandb.automations.scopes._ArtifactPortfolioScope | wandb.automations.scopes.ProjectScope', - filter: 'wandb.automations._filters.operators.And | wandb.automations._filters.operators.Or | wandb.automations._filters.operators.Nor | wandb.automations._filters.operators.Not | wandb.automations._filters.operators.Lt | wandb.automations._filters.operators.Gt | wandb.automations._filters.operators.Lte | wandb.automations._filters.operators.Gte | wandb.automations._filters.operators.Eq | wandb.automations._filters.operators.Ne | wandb.automations._filters.operators.In | wandb.automations._filters.operators.NotIn | wandb.automations._filters.operators.Exists | wandb.automations._filters.operators.Regex | wandb.automations._filters.operators.Contains | wandb.automations._filters.expressions.FilterExpr | dict[str, Any]' = And(()) -) → None +obj: 'Any', *, +strict: 'bool | None' = None, +context: 'Any | None' = None, +by_alias: 'bool | None' = None, +by_name: 'bool | None' = None ``` -**Args:** - - - `event_type` (Literal[ADD_ARTIFACT_TAG]): - - `scope` (wandb.automations.scopes._ArtifactSequenceScope | wandb.automations.scopes._ArtifactPortfolioScope | wandb.automations.scopes.ProjectScope): The scope of the event. - - `filter` (wandb.automations._filters.operators.And | wandb.automations._filters.operators.Or | wandb.automations._filters.operators.Nor | wandb.automations._filters.operators.Not | wandb.automations._filters.operators.Lt | wandb.automations._filters.operators.Gt | wandb.automations._filters.operators.Lte | wandb.automations._filters.operators.Gte | wandb.automations._filters.operators.Eq | wandb.automations._filters.operators.Ne | wandb.automations._filters.operators.In | wandb.automations._filters.operators.NotIn | wandb.automations._filters.operators.Exists | wandb.automations._filters.operators.Regex | wandb.automations._filters.operators.Contains | wandb.automations._filters.expressions.FilterExpr | dict[str, Any]): Additional conditions(s), if any, that are required for this event to trigger. +Validate the given object with string data against the Pydantic model. + +##### Arguments + +- **obj**: The object containing string data to validate. +- **strict**: Whether to enforce types strictly. +- **context**: Extra variables to pass to the validator. +- **by_alias**: Whether to use the field's alias when validating against the provided input data. +- **by_name**: Whether to use the field's name when validating against the provided input data. + + + + +### method parse_file + +```python +path: 'str | Path', *, +content_type: 'str | None' = None, +encoding: 'str' = 'utf8', +proto: 'DeprecatedParseProtocol | None' = None, +allow_pickle: 'bool' = False +``` + + + +##### Arguments + +- **path**: +- **content_type**: +- **encoding**: +- **proto**: +- **allow_pickle**: + + + + +### method parse_obj + +```python +obj: 'Any' +``` + + + +##### Arguments + +- **obj**: + + + + +### method parse_raw + +```python +b: 'str | bytes', *, +content_type: 'str | None' = None, +encoding: 'str' = 'utf8', +proto: 'DeprecatedParseProtocol | None' = None, +allow_pickle: 'bool' = False +``` + + + +##### Arguments + +- **b**: +- **content_type**: +- **encoding**: +- **proto**: +- **allow_pickle**: + + + + +### method schema + +```python +by_alias: 'bool' = True, +ref_template: 'str' = '#/$defs/{model}' +``` + + + +##### Arguments + +- **by_alias**: +- **ref_template**: + + + + +### method schema_json + +```python +*, +by_alias: 'bool' = True, +ref_template: 'str' = '#/$defs/{model}', **dumps_kwargs: 'Any' +``` + + + +##### Arguments + +- **by_alias**: +- **ref_template**: +- **dumps_kwargs**: + + + + +### method then + +```python +self, +action: 'InputAction' +``` + +Define a new Automation in which this event triggers the given action. + +##### Arguments + +- **action**: + + + + +### method update_forward_refs + +```python +**localns: 'Any' +``` + + + +##### Arguments + +- **localns**: + + + + +### method validate + +```python +value: 'Any' +``` + + + +##### Arguments + +- **value**: + + + + + -**Returns:** - An `OnAddArtifactTag` object. diff --git a/models/ref/python/automations/onaddcollectiontag.mdx b/models/ref/python/automations/onaddcollectiontag.mdx index b68c28ce86..70fdd70b7d 100644 --- a/models/ref/python/automations/onaddcollectiontag.mdx +++ b/models/ref/python/automations/onaddcollectiontag.mdx @@ -1,33 +1,560 @@ --- title: OnAddCollectionTag -namespace: automations_namespace -python_object_type: class +kind: class +namespace: wandb.automations.events --- + import { GitHubLink } from '/snippets/_includes/github-source-link.mdx'; - + + + +```python +*, +event_type: Literal[ADD_COLLECTION_TAG] = ADD_COLLECTION_TAG, +scope: typing.Annotated[wandb.automations.scopes._ArtifactSequenceScope | wandb.automations.scopes._ArtifactPortfolioScope | wandb.automations.scopes.ProjectScope, BeforeValidator(func=, json_schema_input_type=PydanticUndefined)], +filter: typing.Annotated[wandb.automations._filters.operators.And | wandb.automations._filters.operators.Or | wandb.automations._filters.operators.Nor | wandb.automations._filters.operators.Not | wandb.automations._filters.operators.Lt | wandb.automations._filters.operators.Gt | wandb.automations._filters.operators.Lte | wandb.automations._filters.operators.Gte | wandb.automations._filters.operators.Eq | wandb.automations._filters.operators.Ne | wandb.automations._filters.operators.In | wandb.automations._filters.operators.NotIn | wandb.automations._filters.operators.Exists | wandb.automations._filters.operators.Regex | wandb.automations._filters.operators.Contains | wandb.automations._filters.expressions.FilterExpr | dict[str, typing.Any], Json, BeforeValidator(func=, json_schema_input_type=PydanticUndefined), PlainSerializer(func=, return_type=PydanticUndefined, when_used='always'), AfterValidator(func=)] = And(()) +``` + +## Description -## class `OnAddCollectionTag` A new tag is assigned to an artifact collection. -### method `OnAddCollectionTag.__init__` + +## Args + +- **event_type**: +- **scope**: +- **filter**: + + + + + + +## Methods + +### method construct + +```python +_fields_set: 'set[str] | None' = None, **values: 'Any' +``` + + + +##### Arguments + +- **_fields_set**: +- **values**: + + + + +### method copy + +```python +self, *, +include: 'AbstractSetIntStr | MappingIntStrAny | None' = None, +exclude: 'AbstractSetIntStr | MappingIntStrAny | None' = None, +update: 'Dict[str, Any] | None' = None, +deep: 'bool' = False +``` + +Returns a copy of the model. + +!!! warning "Deprecated" + This method is now deprecated; use `model_copy` instead. + +If you need `include` or `exclude`, use: + +```python {test="skip" lint="skip"} +data = self.model_dump(include=include, exclude=exclude, round_trip=True) +data = {**data, **(update or {})} +copied = self.model_validate(data) +``` + +##### Arguments + +- **include**: Optional set or mapping specifying which fields to include in the copied model. +- **exclude**: Optional set or mapping specifying which fields to exclude in the copied model. +- **update**: Optional dictionary of field-value pairs to override field values in the copied model. +- **deep**: If True, the values of fields that are Pydantic models will be deep-copied. + + + + +### method dict + +```python +self, *, +include: 'IncEx | None' = None, +exclude: 'IncEx | None' = None, +by_alias: 'bool' = False, +exclude_unset: 'bool' = False, +exclude_defaults: 'bool' = False, +exclude_none: 'bool' = False +``` + + + +##### Arguments + +- **include**: +- **exclude**: +- **by_alias**: +- **exclude_unset**: +- **exclude_defaults**: +- **exclude_none**: + + + + +### method from_orm + +```python +obj: 'Any' +``` + + + +##### Arguments + +- **obj**: + + + + +### method json + +```python +self, *, +include: 'IncEx | None' = None, +exclude: 'IncEx | None' = None, +by_alias: 'bool' = False, +exclude_unset: 'bool' = False, +exclude_defaults: 'bool' = False, +exclude_none: 'bool' = False, +encoder: 'Callable[[Any], Any] | None' = PydanticUndefined, +models_as_dict: 'bool' = PydanticUndefined, **dumps_kwargs: 'Any' +``` + + + +##### Arguments + +- **include**: +- **exclude**: +- **by_alias**: +- **exclude_unset**: +- **exclude_defaults**: +- **exclude_none**: +- **encoder**: +- **models_as_dict**: +- **dumps_kwargs**: + + + + +### method model_construct + +```python +_fields_set: 'set[str] | None' = None, **values: 'Any' +``` + +Creates a new instance of the `Model` class with validated data. + +Creates a new model setting `__dict__` and `__pydantic_fields_set__` from trusted or pre-validated data. +Default values are respected, but no other validation is performed. + +!!! note + `model_construct()` generally respects the `model_config.extra` setting on the provided model. + That is, if `model_config.extra == 'allow'`, then all extra passed values are added to the model instance's `__dict__` + and `__pydantic_extra__` fields. If `model_config.extra == 'ignore'` (the default), then all extra passed values are ignored. + Because no validation is performed with a call to `model_construct()`, having `model_config.extra == 'forbid'` does not result in + an error if extra values are passed, but they will be ignored. + +##### Arguments + +- **_fields_set**: A set of field names that were originally explicitly set during instantiation. If provided, this is directly used for the [`model_fields_set`][pydantic.BaseModel.model_fields_set] attribute. Otherwise, the field names from the `values` argument will be used. +- **values**: Trusted or pre-validated data dictionary. + + + + +### method model_copy + +```python +self, *, +update: 'Mapping[str, Any] | None' = None, +deep: 'bool' = False +``` + +!!! abstract "Usage Documentation" + [`model_copy`](../concepts/serialization.md#model_copy) + +Returns a copy of the model. + +!!! note + The underlying instance's [`__dict__`][object.__dict__] attribute is copied. This + might have unexpected side effects if you store anything in it, on top of the model + fields (e.g. the value of [cached properties][functools.cached_property]). + +##### Arguments + +- **update**: Values to change/add in the new model. Note: the data is not validated before creating the new model. You should trust this data. +- **deep**: Set to `True` to make a deep copy of the model. + + + + +### method model_dump + +```python +self, *, +mode: 'str' = 'json', **kwargs: 'Any' +``` + +!!! abstract "Usage Documentation" + [`model_dump`](../concepts/serialization.md#modelmodel_dump) + +Generate a dictionary representation of the model, optionally specifying which fields to include or exclude. + +##### Arguments + +- **mode**: The mode in which `to_python` should run. If mode is 'json', the output will only contain JSON serializable types. If mode is 'python', the output may contain non-JSON-serializable Python objects. +- **kwargs**: + + + + +### method model_dump_json + +```python +self, *, +indent: 'int | None' = None, **kwargs: 'Any' +``` + +!!! abstract "Usage Documentation" + [`model_dump_json`](../concepts/serialization.md#modelmodel_dump_json) + +Generates a JSON representation of the model using Pydantic's `to_json` method. + +##### Arguments + +- **indent**: Indentation to use in the JSON output. If None is passed, the output will be compact. +- **kwargs**: + + + + +### method model_json_schema ```python -__init__( - event_type: 'Literal[ADD_COLLECTION_TAG]' = ADD_COLLECTION_TAG, - scope: 'wandb.automations.scopes._ArtifactSequenceScope | wandb.automations.scopes._ArtifactPortfolioScope | wandb.automations.scopes.ProjectScope', - filter: 'wandb.automations._filters.operators.And | wandb.automations._filters.operators.Or | wandb.automations._filters.operators.Nor | wandb.automations._filters.operators.Not | wandb.automations._filters.operators.Lt | wandb.automations._filters.operators.Gt | wandb.automations._filters.operators.Lte | wandb.automations._filters.operators.Gte | wandb.automations._filters.operators.Eq | wandb.automations._filters.operators.Ne | wandb.automations._filters.operators.In | wandb.automations._filters.operators.NotIn | wandb.automations._filters.operators.Exists | wandb.automations._filters.operators.Regex | wandb.automations._filters.operators.Contains | wandb.automations._filters.expressions.FilterExpr | dict[str, Any]' = And(()) -) → None +by_alias: 'bool' = True, +ref_template: 'str' = '#/$defs/{model}', +schema_generator: 'type[GenerateJsonSchema]' = , +mode: 'JsonSchemaMode' = 'validation' ``` -**Args:** - - - `event_type` (Literal[ADD_COLLECTION_TAG]): - - `scope` (wandb.automations.scopes._ArtifactSequenceScope | wandb.automations.scopes._ArtifactPortfolioScope | wandb.automations.scopes.ProjectScope): The scope of the event. - - `filter` (wandb.automations._filters.operators.And | wandb.automations._filters.operators.Or | wandb.automations._filters.operators.Nor | wandb.automations._filters.operators.Not | wandb.automations._filters.operators.Lt | wandb.automations._filters.operators.Gt | wandb.automations._filters.operators.Lte | wandb.automations._filters.operators.Gte | wandb.automations._filters.operators.Eq | wandb.automations._filters.operators.Ne | wandb.automations._filters.operators.In | wandb.automations._filters.operators.NotIn | wandb.automations._filters.operators.Exists | wandb.automations._filters.operators.Regex | wandb.automations._filters.operators.Contains | wandb.automations._filters.expressions.FilterExpr | dict[str, Any]): Additional conditions(s), if any, that are required for this event to trigger. +Generates a JSON schema for a model class. + +##### Arguments + +- **by_alias**: Whether to use attribute aliases or not. +- **ref_template**: The reference template. +- **schema_generator**: To override the logic used to generate the JSON schema, as a subclass of `GenerateJsonSchema` with your desired modifications +- **mode**: The mode in which to generate the schema. + + + + +### method model_parametrized_name + +```python +params: 'tuple[type[Any], ...]' +``` + +Compute the class name for parametrizations of generic classes. + +This method can be overridden to achieve a custom naming scheme for generic BaseModels. + +##### Arguments + +- **params**: Tuple of types of the class. Given a generic class `Model` with 2 type variables and a concrete model `Model[str, int]`, the value `(str, int)` would be passed to `params`. + + +##### Raises + +- **TypeError**: Raised when trying to generate concrete names for non-generic models. + + +### method model_post_init + +```python +self, +context: 'Any', / +``` + +Override this method to perform additional initialization after `__init__` and `model_construct`. +This is useful if you want to do some validation that requires the entire model to be initialized. + +##### Arguments + +- **context**: + + + + +### method model_rebuild + +```python +*, +force: 'bool' = False, +raise_errors: 'bool' = True, +_parent_namespace_depth: 'int' = 2, +_types_namespace: 'MappingNamespace | None' = None +``` + +Try to rebuild the pydantic-core schema for the model. + +This may be necessary when one of the annotations is a ForwardRef which could not be resolved during +the initial attempt to build the schema, and automatic rebuilding fails. + +##### Arguments + +- **force**: Whether to force the rebuilding of the model schema, defaults to `False`. +- **raise_errors**: Whether to raise errors, defaults to `True`. +- **_parent_namespace_depth**: The depth level of the parent namespace, defaults to 2. +- **_types_namespace**: The types namespace, defaults to `None`. + + + + +### method model_validate + +```python +obj: 'Any', *, +strict: 'bool | None' = None, +from_attributes: 'bool | None' = None, +context: 'Any | None' = None, +by_alias: 'bool | None' = None, +by_name: 'bool | None' = None +``` + +Validate a pydantic model instance. + +##### Arguments + +- **obj**: The object to validate. +- **strict**: Whether to enforce types strictly. +- **from_attributes**: Whether to extract data from object attributes. +- **context**: Additional context to pass to the validator. +- **by_alias**: Whether to use the field's alias when validating against the provided input data. +- **by_name**: Whether to use the field's name when validating against the provided input data. + + +##### Raises + +- **ValidationError**: If the object could not be validated. + + +### method model_validate_json + +```python +json_data: 'str | bytes | bytearray', *, +strict: 'bool | None' = None, +context: 'Any | None' = None, +by_alias: 'bool | None' = None, +by_name: 'bool | None' = None +``` + +!!! abstract "Usage Documentation" + [JSON Parsing](../concepts/json.md#json-parsing) + +Validate the given JSON data against the Pydantic model. + +##### Arguments + +- **json_data**: The JSON data to validate. +- **strict**: Whether to enforce types strictly. +- **context**: Extra variables to pass to the validator. +- **by_alias**: Whether to use the field's alias when validating against the provided input data. +- **by_name**: Whether to use the field's name when validating against the provided input data. + + +##### Raises + +- **ValidationError**: If `json_data` is not a JSON string or the object could not be validated. + + +### method model_validate_strings + +```python +obj: 'Any', *, +strict: 'bool | None' = None, +context: 'Any | None' = None, +by_alias: 'bool | None' = None, +by_name: 'bool | None' = None +``` + +Validate the given object with string data against the Pydantic model. + +##### Arguments + +- **obj**: The object containing string data to validate. +- **strict**: Whether to enforce types strictly. +- **context**: Extra variables to pass to the validator. +- **by_alias**: Whether to use the field's alias when validating against the provided input data. +- **by_name**: Whether to use the field's name when validating against the provided input data. + + + + +### method parse_file + +```python +path: 'str | Path', *, +content_type: 'str | None' = None, +encoding: 'str' = 'utf8', +proto: 'DeprecatedParseProtocol | None' = None, +allow_pickle: 'bool' = False +``` + + + +##### Arguments + +- **path**: +- **content_type**: +- **encoding**: +- **proto**: +- **allow_pickle**: + + + + +### method parse_obj + +```python +obj: 'Any' +``` + + + +##### Arguments + +- **obj**: + + + + +### method parse_raw + +```python +b: 'str | bytes', *, +content_type: 'str | None' = None, +encoding: 'str' = 'utf8', +proto: 'DeprecatedParseProtocol | None' = None, +allow_pickle: 'bool' = False +``` + + + +##### Arguments + +- **b**: +- **content_type**: +- **encoding**: +- **proto**: +- **allow_pickle**: + + + + +### method schema + +```python +by_alias: 'bool' = True, +ref_template: 'str' = '#/$defs/{model}' +``` + + + +##### Arguments + +- **by_alias**: +- **ref_template**: + + + + +### method schema_json + +```python +*, +by_alias: 'bool' = True, +ref_template: 'str' = '#/$defs/{model}', **dumps_kwargs: 'Any' +``` + + + +##### Arguments + +- **by_alias**: +- **ref_template**: +- **dumps_kwargs**: + + + + +### method then + +```python +self, +action: 'InputAction' +``` + +Define a new Automation in which this event triggers the given action. + +##### Arguments + +- **action**: + + + + +### method update_forward_refs + +```python +**localns: 'Any' +``` + + + +##### Arguments + +- **localns**: + + + + +### method validate + +```python +value: 'Any' +``` + + + +##### Arguments + +- **value**: + + + + + -**Returns:** - An `OnAddCollectionTag` object. diff --git a/models/ref/python/automations/oncreateartifact.mdx b/models/ref/python/automations/oncreateartifact.mdx index e647751cd8..091a7767d6 100644 --- a/models/ref/python/automations/oncreateartifact.mdx +++ b/models/ref/python/automations/oncreateartifact.mdx @@ -1,18 +1,38 @@ --- title: OnCreateArtifact -namespace: automations_namespace -python_object_type: class +kind: class +namespace: wandb.automations.events --- + import { GitHubLink } from '/snippets/_includes/github-source-link.mdx'; - + + + +```python +*, +event_type: Literal[CREATE_ARTIFACT] = CREATE_ARTIFACT, +scope: typing.Annotated[wandb.automations.scopes._ArtifactSequenceScope | wandb.automations.scopes._ArtifactPortfolioScope, BeforeValidator(func=, json_schema_input_type=PydanticUndefined)], +filter: typing.Annotated[wandb.automations._filters.operators.And | wandb.automations._filters.operators.Or | wandb.automations._filters.operators.Nor | wandb.automations._filters.operators.Not | wandb.automations._filters.operators.Lt | wandb.automations._filters.operators.Gt | wandb.automations._filters.operators.Lte | wandb.automations._filters.operators.Gte | wandb.automations._filters.operators.Eq | wandb.automations._filters.operators.Ne | wandb.automations._filters.operators.In | wandb.automations._filters.operators.NotIn | wandb.automations._filters.operators.Exists | wandb.automations._filters.operators.Regex | wandb.automations._filters.operators.Contains | wandb.automations._filters.expressions.FilterExpr | dict[str, typing.Any], Json, BeforeValidator(func=, json_schema_input_type=PydanticUndefined), PlainSerializer(func=, return_type=PydanticUndefined, when_used='always'), AfterValidator(func=)] = And(()) +``` + +## Description -## class `OnCreateArtifact` A new artifact is created. -Examples: + + +## Args + +- **event_type**: +- **scope**: +- **filter**: + + +## Examples + Define an event that triggers when a new artifact is created in the collection "my-collection": @@ -27,21 +47,527 @@ event = OnCreateArtifact(scope=collection) ``` -### method `OnCreateArtifact.__init__` + +## Methods + +### method construct + +```python +_fields_set: 'set[str] | None' = None, **values: 'Any' +``` + + + +##### Arguments + +- **_fields_set**: +- **values**: + + + + +### method copy + +```python +self, *, +include: 'AbstractSetIntStr | MappingIntStrAny | None' = None, +exclude: 'AbstractSetIntStr | MappingIntStrAny | None' = None, +update: 'Dict[str, Any] | None' = None, +deep: 'bool' = False +``` + +Returns a copy of the model. + +!!! warning "Deprecated" + This method is now deprecated; use `model_copy` instead. + +If you need `include` or `exclude`, use: + +```python {test="skip" lint="skip"} +data = self.model_dump(include=include, exclude=exclude, round_trip=True) +data = {**data, **(update or {})} +copied = self.model_validate(data) +``` + +##### Arguments + +- **include**: Optional set or mapping specifying which fields to include in the copied model. +- **exclude**: Optional set or mapping specifying which fields to exclude in the copied model. +- **update**: Optional dictionary of field-value pairs to override field values in the copied model. +- **deep**: If True, the values of fields that are Pydantic models will be deep-copied. + + + + +### method dict + +```python +self, *, +include: 'IncEx | None' = None, +exclude: 'IncEx | None' = None, +by_alias: 'bool' = False, +exclude_unset: 'bool' = False, +exclude_defaults: 'bool' = False, +exclude_none: 'bool' = False +``` + + + +##### Arguments + +- **include**: +- **exclude**: +- **by_alias**: +- **exclude_unset**: +- **exclude_defaults**: +- **exclude_none**: + + + + +### method from_orm + +```python +obj: 'Any' +``` + + + +##### Arguments + +- **obj**: + + + + +### method json + +```python +self, *, +include: 'IncEx | None' = None, +exclude: 'IncEx | None' = None, +by_alias: 'bool' = False, +exclude_unset: 'bool' = False, +exclude_defaults: 'bool' = False, +exclude_none: 'bool' = False, +encoder: 'Callable[[Any], Any] | None' = PydanticUndefined, +models_as_dict: 'bool' = PydanticUndefined, **dumps_kwargs: 'Any' +``` + + + +##### Arguments + +- **include**: +- **exclude**: +- **by_alias**: +- **exclude_unset**: +- **exclude_defaults**: +- **exclude_none**: +- **encoder**: +- **models_as_dict**: +- **dumps_kwargs**: + + + + +### method model_construct + +```python +_fields_set: 'set[str] | None' = None, **values: 'Any' +``` + +Creates a new instance of the `Model` class with validated data. + +Creates a new model setting `__dict__` and `__pydantic_fields_set__` from trusted or pre-validated data. +Default values are respected, but no other validation is performed. + +!!! note + `model_construct()` generally respects the `model_config.extra` setting on the provided model. + That is, if `model_config.extra == 'allow'`, then all extra passed values are added to the model instance's `__dict__` + and `__pydantic_extra__` fields. If `model_config.extra == 'ignore'` (the default), then all extra passed values are ignored. + Because no validation is performed with a call to `model_construct()`, having `model_config.extra == 'forbid'` does not result in + an error if extra values are passed, but they will be ignored. + +##### Arguments + +- **_fields_set**: A set of field names that were originally explicitly set during instantiation. If provided, this is directly used for the [`model_fields_set`][pydantic.BaseModel.model_fields_set] attribute. Otherwise, the field names from the `values` argument will be used. +- **values**: Trusted or pre-validated data dictionary. + + + + +### method model_copy + +```python +self, *, +update: 'Mapping[str, Any] | None' = None, +deep: 'bool' = False +``` + +!!! abstract "Usage Documentation" + [`model_copy`](../concepts/serialization.md#model_copy) + +Returns a copy of the model. + +!!! note + The underlying instance's [`__dict__`][object.__dict__] attribute is copied. This + might have unexpected side effects if you store anything in it, on top of the model + fields (e.g. the value of [cached properties][functools.cached_property]). + +##### Arguments + +- **update**: Values to change/add in the new model. Note: the data is not validated before creating the new model. You should trust this data. +- **deep**: Set to `True` to make a deep copy of the model. + + + + +### method model_dump + +```python +self, *, +mode: 'str' = 'json', **kwargs: 'Any' +``` + +!!! abstract "Usage Documentation" + [`model_dump`](../concepts/serialization.md#modelmodel_dump) + +Generate a dictionary representation of the model, optionally specifying which fields to include or exclude. + +##### Arguments + +- **mode**: The mode in which `to_python` should run. If mode is 'json', the output will only contain JSON serializable types. If mode is 'python', the output may contain non-JSON-serializable Python objects. +- **kwargs**: + + + + +### method model_dump_json + +```python +self, *, +indent: 'int | None' = None, **kwargs: 'Any' +``` + +!!! abstract "Usage Documentation" + [`model_dump_json`](../concepts/serialization.md#modelmodel_dump_json) + +Generates a JSON representation of the model using Pydantic's `to_json` method. + +##### Arguments + +- **indent**: Indentation to use in the JSON output. If None is passed, the output will be compact. +- **kwargs**: + + + + +### method model_json_schema + +```python +by_alias: 'bool' = True, +ref_template: 'str' = '#/$defs/{model}', +schema_generator: 'type[GenerateJsonSchema]' = , +mode: 'JsonSchemaMode' = 'validation' +``` + +Generates a JSON schema for a model class. + +##### Arguments + +- **by_alias**: Whether to use attribute aliases or not. +- **ref_template**: The reference template. +- **schema_generator**: To override the logic used to generate the JSON schema, as a subclass of `GenerateJsonSchema` with your desired modifications +- **mode**: The mode in which to generate the schema. + + + + +### method model_parametrized_name + +```python +params: 'tuple[type[Any], ...]' +``` + +Compute the class name for parametrizations of generic classes. + +This method can be overridden to achieve a custom naming scheme for generic BaseModels. + +##### Arguments + +- **params**: Tuple of types of the class. Given a generic class `Model` with 2 type variables and a concrete model `Model[str, int]`, the value `(str, int)` would be passed to `params`. + + +##### Raises + +- **TypeError**: Raised when trying to generate concrete names for non-generic models. + + +### method model_post_init + +```python +self, +context: 'Any', / +``` + +Override this method to perform additional initialization after `__init__` and `model_construct`. +This is useful if you want to do some validation that requires the entire model to be initialized. + +##### Arguments + +- **context**: + + + + +### method model_rebuild + +```python +*, +force: 'bool' = False, +raise_errors: 'bool' = True, +_parent_namespace_depth: 'int' = 2, +_types_namespace: 'MappingNamespace | None' = None +``` + +Try to rebuild the pydantic-core schema for the model. + +This may be necessary when one of the annotations is a ForwardRef which could not be resolved during +the initial attempt to build the schema, and automatic rebuilding fails. + +##### Arguments + +- **force**: Whether to force the rebuilding of the model schema, defaults to `False`. +- **raise_errors**: Whether to raise errors, defaults to `True`. +- **_parent_namespace_depth**: The depth level of the parent namespace, defaults to 2. +- **_types_namespace**: The types namespace, defaults to `None`. + + + + +### method model_validate + +```python +obj: 'Any', *, +strict: 'bool | None' = None, +from_attributes: 'bool | None' = None, +context: 'Any | None' = None, +by_alias: 'bool | None' = None, +by_name: 'bool | None' = None +``` + +Validate a pydantic model instance. + +##### Arguments + +- **obj**: The object to validate. +- **strict**: Whether to enforce types strictly. +- **from_attributes**: Whether to extract data from object attributes. +- **context**: Additional context to pass to the validator. +- **by_alias**: Whether to use the field's alias when validating against the provided input data. +- **by_name**: Whether to use the field's name when validating against the provided input data. + + +##### Raises + +- **ValidationError**: If the object could not be validated. + + +### method model_validate_json + +```python +json_data: 'str | bytes | bytearray', *, +strict: 'bool | None' = None, +context: 'Any | None' = None, +by_alias: 'bool | None' = None, +by_name: 'bool | None' = None +``` + +!!! abstract "Usage Documentation" + [JSON Parsing](../concepts/json.md#json-parsing) + +Validate the given JSON data against the Pydantic model. + +##### Arguments + +- **json_data**: The JSON data to validate. +- **strict**: Whether to enforce types strictly. +- **context**: Extra variables to pass to the validator. +- **by_alias**: Whether to use the field's alias when validating against the provided input data. +- **by_name**: Whether to use the field's name when validating against the provided input data. + + +##### Raises + +- **ValidationError**: If `json_data` is not a JSON string or the object could not be validated. + + +### method model_validate_strings ```python -__init__( - event_type: 'Literal[CREATE_ARTIFACT]' = CREATE_ARTIFACT, - scope: 'wandb.automations.scopes._ArtifactSequenceScope | wandb.automations.scopes._ArtifactPortfolioScope', - filter: 'wandb.automations._filters.operators.And | wandb.automations._filters.operators.Or | wandb.automations._filters.operators.Nor | wandb.automations._filters.operators.Not | wandb.automations._filters.operators.Lt | wandb.automations._filters.operators.Gt | wandb.automations._filters.operators.Lte | wandb.automations._filters.operators.Gte | wandb.automations._filters.operators.Eq | wandb.automations._filters.operators.Ne | wandb.automations._filters.operators.In | wandb.automations._filters.operators.NotIn | wandb.automations._filters.operators.Exists | wandb.automations._filters.operators.Regex | wandb.automations._filters.operators.Contains | wandb.automations._filters.expressions.FilterExpr | dict[str, Any]' = And(()) -) → None +obj: 'Any', *, +strict: 'bool | None' = None, +context: 'Any | None' = None, +by_alias: 'bool | None' = None, +by_name: 'bool | None' = None ``` -**Args:** - - - `event_type` (Literal[CREATE_ARTIFACT]): - - `scope` (wandb.automations.scopes._ArtifactSequenceScope | wandb.automations.scopes._ArtifactPortfolioScope): The scope of the event: must be an artifact collection. - - `filter` (wandb.automations._filters.operators.And | wandb.automations._filters.operators.Or | wandb.automations._filters.operators.Nor | wandb.automations._filters.operators.Not | wandb.automations._filters.operators.Lt | wandb.automations._filters.operators.Gt | wandb.automations._filters.operators.Lte | wandb.automations._filters.operators.Gte | wandb.automations._filters.operators.Eq | wandb.automations._filters.operators.Ne | wandb.automations._filters.operators.In | wandb.automations._filters.operators.NotIn | wandb.automations._filters.operators.Exists | wandb.automations._filters.operators.Regex | wandb.automations._filters.operators.Contains | wandb.automations._filters.expressions.FilterExpr | dict[str, Any]): Additional conditions(s), if any, that are required for this event to trigger. +Validate the given object with string data against the Pydantic model. + +##### Arguments + +- **obj**: The object containing string data to validate. +- **strict**: Whether to enforce types strictly. +- **context**: Extra variables to pass to the validator. +- **by_alias**: Whether to use the field's alias when validating against the provided input data. +- **by_name**: Whether to use the field's name when validating against the provided input data. + + + + +### method parse_file + +```python +path: 'str | Path', *, +content_type: 'str | None' = None, +encoding: 'str' = 'utf8', +proto: 'DeprecatedParseProtocol | None' = None, +allow_pickle: 'bool' = False +``` + + + +##### Arguments + +- **path**: +- **content_type**: +- **encoding**: +- **proto**: +- **allow_pickle**: + + + + +### method parse_obj + +```python +obj: 'Any' +``` + + + +##### Arguments + +- **obj**: + + + + +### method parse_raw + +```python +b: 'str | bytes', *, +content_type: 'str | None' = None, +encoding: 'str' = 'utf8', +proto: 'DeprecatedParseProtocol | None' = None, +allow_pickle: 'bool' = False +``` + + + +##### Arguments + +- **b**: +- **content_type**: +- **encoding**: +- **proto**: +- **allow_pickle**: + + + + +### method schema + +```python +by_alias: 'bool' = True, +ref_template: 'str' = '#/$defs/{model}' +``` + + + +##### Arguments + +- **by_alias**: +- **ref_template**: + + + + +### method schema_json + +```python +*, +by_alias: 'bool' = True, +ref_template: 'str' = '#/$defs/{model}', **dumps_kwargs: 'Any' +``` + + + +##### Arguments + +- **by_alias**: +- **ref_template**: +- **dumps_kwargs**: + + + + +### method then + +```python +self, +action: 'InputAction' +``` + +Define a new Automation in which this event triggers the given action. + +##### Arguments + +- **action**: + + + + +### method update_forward_refs + +```python +**localns: 'Any' +``` + + + +##### Arguments + +- **localns**: + + + + +### method validate + +```python +value: 'Any' +``` + + + +##### Arguments + +- **value**: + + + + + -**Returns:** - An `OnCreateArtifact` object. diff --git a/models/ref/python/automations/onlinkartifact.mdx b/models/ref/python/automations/onlinkartifact.mdx index e25c5f8f3f..d4cbacd902 100644 --- a/models/ref/python/automations/onlinkartifact.mdx +++ b/models/ref/python/automations/onlinkartifact.mdx @@ -1,18 +1,38 @@ --- title: OnLinkArtifact -namespace: automations_namespace -python_object_type: class +kind: class +namespace: wandb.automations.events --- + import { GitHubLink } from '/snippets/_includes/github-source-link.mdx'; - + + + +```python +*, +event_type: Literal[LINK_ARTIFACT] = LINK_ARTIFACT, +scope: typing.Annotated[wandb.automations.scopes._ArtifactSequenceScope | wandb.automations.scopes._ArtifactPortfolioScope | wandb.automations.scopes.ProjectScope, BeforeValidator(func=, json_schema_input_type=PydanticUndefined)], +filter: typing.Annotated[wandb.automations._filters.operators.And | wandb.automations._filters.operators.Or | wandb.automations._filters.operators.Nor | wandb.automations._filters.operators.Not | wandb.automations._filters.operators.Lt | wandb.automations._filters.operators.Gt | wandb.automations._filters.operators.Lte | wandb.automations._filters.operators.Gte | wandb.automations._filters.operators.Eq | wandb.automations._filters.operators.Ne | wandb.automations._filters.operators.In | wandb.automations._filters.operators.NotIn | wandb.automations._filters.operators.Exists | wandb.automations._filters.operators.Regex | wandb.automations._filters.operators.Contains | wandb.automations._filters.expressions.FilterExpr | dict[str, typing.Any], Json, BeforeValidator(func=, json_schema_input_type=PydanticUndefined), PlainSerializer(func=, return_type=PydanticUndefined, when_used='always'), AfterValidator(func=)] = And(()) +``` + +## Description -## class `OnLinkArtifact` A new artifact is linked to a collection. -Examples: + + +## Args + +- **event_type**: +- **scope**: +- **filter**: + + +## Examples + Define an event that triggers when an artifact is linked to the collection "my-collection" with the alias "prod": @@ -30,21 +50,527 @@ event = OnLinkArtifact( ``` -### method `OnLinkArtifact.__init__` + +## Methods + +### method construct + +```python +_fields_set: 'set[str] | None' = None, **values: 'Any' +``` + + + +##### Arguments + +- **_fields_set**: +- **values**: + + + + +### method copy + +```python +self, *, +include: 'AbstractSetIntStr | MappingIntStrAny | None' = None, +exclude: 'AbstractSetIntStr | MappingIntStrAny | None' = None, +update: 'Dict[str, Any] | None' = None, +deep: 'bool' = False +``` + +Returns a copy of the model. + +!!! warning "Deprecated" + This method is now deprecated; use `model_copy` instead. + +If you need `include` or `exclude`, use: + +```python {test="skip" lint="skip"} +data = self.model_dump(include=include, exclude=exclude, round_trip=True) +data = {**data, **(update or {})} +copied = self.model_validate(data) +``` + +##### Arguments + +- **include**: Optional set or mapping specifying which fields to include in the copied model. +- **exclude**: Optional set or mapping specifying which fields to exclude in the copied model. +- **update**: Optional dictionary of field-value pairs to override field values in the copied model. +- **deep**: If True, the values of fields that are Pydantic models will be deep-copied. + + + + +### method dict + +```python +self, *, +include: 'IncEx | None' = None, +exclude: 'IncEx | None' = None, +by_alias: 'bool' = False, +exclude_unset: 'bool' = False, +exclude_defaults: 'bool' = False, +exclude_none: 'bool' = False +``` + + + +##### Arguments + +- **include**: +- **exclude**: +- **by_alias**: +- **exclude_unset**: +- **exclude_defaults**: +- **exclude_none**: + + + + +### method from_orm + +```python +obj: 'Any' +``` + + + +##### Arguments + +- **obj**: + + + + +### method json + +```python +self, *, +include: 'IncEx | None' = None, +exclude: 'IncEx | None' = None, +by_alias: 'bool' = False, +exclude_unset: 'bool' = False, +exclude_defaults: 'bool' = False, +exclude_none: 'bool' = False, +encoder: 'Callable[[Any], Any] | None' = PydanticUndefined, +models_as_dict: 'bool' = PydanticUndefined, **dumps_kwargs: 'Any' +``` + + + +##### Arguments + +- **include**: +- **exclude**: +- **by_alias**: +- **exclude_unset**: +- **exclude_defaults**: +- **exclude_none**: +- **encoder**: +- **models_as_dict**: +- **dumps_kwargs**: + + + + +### method model_construct + +```python +_fields_set: 'set[str] | None' = None, **values: 'Any' +``` + +Creates a new instance of the `Model` class with validated data. + +Creates a new model setting `__dict__` and `__pydantic_fields_set__` from trusted or pre-validated data. +Default values are respected, but no other validation is performed. + +!!! note + `model_construct()` generally respects the `model_config.extra` setting on the provided model. + That is, if `model_config.extra == 'allow'`, then all extra passed values are added to the model instance's `__dict__` + and `__pydantic_extra__` fields. If `model_config.extra == 'ignore'` (the default), then all extra passed values are ignored. + Because no validation is performed with a call to `model_construct()`, having `model_config.extra == 'forbid'` does not result in + an error if extra values are passed, but they will be ignored. + +##### Arguments + +- **_fields_set**: A set of field names that were originally explicitly set during instantiation. If provided, this is directly used for the [`model_fields_set`][pydantic.BaseModel.model_fields_set] attribute. Otherwise, the field names from the `values` argument will be used. +- **values**: Trusted or pre-validated data dictionary. + + + + +### method model_copy + +```python +self, *, +update: 'Mapping[str, Any] | None' = None, +deep: 'bool' = False +``` + +!!! abstract "Usage Documentation" + [`model_copy`](../concepts/serialization.md#model_copy) + +Returns a copy of the model. + +!!! note + The underlying instance's [`__dict__`][object.__dict__] attribute is copied. This + might have unexpected side effects if you store anything in it, on top of the model + fields (e.g. the value of [cached properties][functools.cached_property]). + +##### Arguments + +- **update**: Values to change/add in the new model. Note: the data is not validated before creating the new model. You should trust this data. +- **deep**: Set to `True` to make a deep copy of the model. + + + + +### method model_dump + +```python +self, *, +mode: 'str' = 'json', **kwargs: 'Any' +``` + +!!! abstract "Usage Documentation" + [`model_dump`](../concepts/serialization.md#modelmodel_dump) + +Generate a dictionary representation of the model, optionally specifying which fields to include or exclude. + +##### Arguments + +- **mode**: The mode in which `to_python` should run. If mode is 'json', the output will only contain JSON serializable types. If mode is 'python', the output may contain non-JSON-serializable Python objects. +- **kwargs**: + + + + +### method model_dump_json + +```python +self, *, +indent: 'int | None' = None, **kwargs: 'Any' +``` + +!!! abstract "Usage Documentation" + [`model_dump_json`](../concepts/serialization.md#modelmodel_dump_json) + +Generates a JSON representation of the model using Pydantic's `to_json` method. + +##### Arguments + +- **indent**: Indentation to use in the JSON output. If None is passed, the output will be compact. +- **kwargs**: + + + + +### method model_json_schema + +```python +by_alias: 'bool' = True, +ref_template: 'str' = '#/$defs/{model}', +schema_generator: 'type[GenerateJsonSchema]' = , +mode: 'JsonSchemaMode' = 'validation' +``` + +Generates a JSON schema for a model class. + +##### Arguments + +- **by_alias**: Whether to use attribute aliases or not. +- **ref_template**: The reference template. +- **schema_generator**: To override the logic used to generate the JSON schema, as a subclass of `GenerateJsonSchema` with your desired modifications +- **mode**: The mode in which to generate the schema. + + + + +### method model_parametrized_name + +```python +params: 'tuple[type[Any], ...]' +``` + +Compute the class name for parametrizations of generic classes. + +This method can be overridden to achieve a custom naming scheme for generic BaseModels. + +##### Arguments + +- **params**: Tuple of types of the class. Given a generic class `Model` with 2 type variables and a concrete model `Model[str, int]`, the value `(str, int)` would be passed to `params`. + + +##### Raises + +- **TypeError**: Raised when trying to generate concrete names for non-generic models. + + +### method model_post_init + +```python +self, +context: 'Any', / +``` + +Override this method to perform additional initialization after `__init__` and `model_construct`. +This is useful if you want to do some validation that requires the entire model to be initialized. + +##### Arguments + +- **context**: + + + + +### method model_rebuild + +```python +*, +force: 'bool' = False, +raise_errors: 'bool' = True, +_parent_namespace_depth: 'int' = 2, +_types_namespace: 'MappingNamespace | None' = None +``` + +Try to rebuild the pydantic-core schema for the model. + +This may be necessary when one of the annotations is a ForwardRef which could not be resolved during +the initial attempt to build the schema, and automatic rebuilding fails. + +##### Arguments + +- **force**: Whether to force the rebuilding of the model schema, defaults to `False`. +- **raise_errors**: Whether to raise errors, defaults to `True`. +- **_parent_namespace_depth**: The depth level of the parent namespace, defaults to 2. +- **_types_namespace**: The types namespace, defaults to `None`. + + + + +### method model_validate + +```python +obj: 'Any', *, +strict: 'bool | None' = None, +from_attributes: 'bool | None' = None, +context: 'Any | None' = None, +by_alias: 'bool | None' = None, +by_name: 'bool | None' = None +``` + +Validate a pydantic model instance. + +##### Arguments + +- **obj**: The object to validate. +- **strict**: Whether to enforce types strictly. +- **from_attributes**: Whether to extract data from object attributes. +- **context**: Additional context to pass to the validator. +- **by_alias**: Whether to use the field's alias when validating against the provided input data. +- **by_name**: Whether to use the field's name when validating against the provided input data. + + +##### Raises + +- **ValidationError**: If the object could not be validated. + + +### method model_validate_json + +```python +json_data: 'str | bytes | bytearray', *, +strict: 'bool | None' = None, +context: 'Any | None' = None, +by_alias: 'bool | None' = None, +by_name: 'bool | None' = None +``` + +!!! abstract "Usage Documentation" + [JSON Parsing](../concepts/json.md#json-parsing) + +Validate the given JSON data against the Pydantic model. + +##### Arguments + +- **json_data**: The JSON data to validate. +- **strict**: Whether to enforce types strictly. +- **context**: Extra variables to pass to the validator. +- **by_alias**: Whether to use the field's alias when validating against the provided input data. +- **by_name**: Whether to use the field's name when validating against the provided input data. + + +##### Raises + +- **ValidationError**: If `json_data` is not a JSON string or the object could not be validated. + + +### method model_validate_strings ```python -__init__( - event_type: 'Literal[LINK_ARTIFACT]' = LINK_ARTIFACT, - scope: 'wandb.automations.scopes._ArtifactSequenceScope | wandb.automations.scopes._ArtifactPortfolioScope | wandb.automations.scopes.ProjectScope', - filter: 'wandb.automations._filters.operators.And | wandb.automations._filters.operators.Or | wandb.automations._filters.operators.Nor | wandb.automations._filters.operators.Not | wandb.automations._filters.operators.Lt | wandb.automations._filters.operators.Gt | wandb.automations._filters.operators.Lte | wandb.automations._filters.operators.Gte | wandb.automations._filters.operators.Eq | wandb.automations._filters.operators.Ne | wandb.automations._filters.operators.In | wandb.automations._filters.operators.NotIn | wandb.automations._filters.operators.Exists | wandb.automations._filters.operators.Regex | wandb.automations._filters.operators.Contains | wandb.automations._filters.expressions.FilterExpr | dict[str, Any]' = And(()) -) → None +obj: 'Any', *, +strict: 'bool | None' = None, +context: 'Any | None' = None, +by_alias: 'bool | None' = None, +by_name: 'bool | None' = None ``` -**Args:** - - - `event_type` (Literal[LINK_ARTIFACT]): - - `scope` (wandb.automations.scopes._ArtifactSequenceScope | wandb.automations.scopes._ArtifactPortfolioScope | wandb.automations.scopes.ProjectScope): The scope of the event. - - `filter` (wandb.automations._filters.operators.And | wandb.automations._filters.operators.Or | wandb.automations._filters.operators.Nor | wandb.automations._filters.operators.Not | wandb.automations._filters.operators.Lt | wandb.automations._filters.operators.Gt | wandb.automations._filters.operators.Lte | wandb.automations._filters.operators.Gte | wandb.automations._filters.operators.Eq | wandb.automations._filters.operators.Ne | wandb.automations._filters.operators.In | wandb.automations._filters.operators.NotIn | wandb.automations._filters.operators.Exists | wandb.automations._filters.operators.Regex | wandb.automations._filters.operators.Contains | wandb.automations._filters.expressions.FilterExpr | dict[str, Any]): Additional conditions(s), if any, that are required for this event to trigger. +Validate the given object with string data against the Pydantic model. + +##### Arguments + +- **obj**: The object containing string data to validate. +- **strict**: Whether to enforce types strictly. +- **context**: Extra variables to pass to the validator. +- **by_alias**: Whether to use the field's alias when validating against the provided input data. +- **by_name**: Whether to use the field's name when validating against the provided input data. + + + + +### method parse_file + +```python +path: 'str | Path', *, +content_type: 'str | None' = None, +encoding: 'str' = 'utf8', +proto: 'DeprecatedParseProtocol | None' = None, +allow_pickle: 'bool' = False +``` + + + +##### Arguments + +- **path**: +- **content_type**: +- **encoding**: +- **proto**: +- **allow_pickle**: + + + + +### method parse_obj + +```python +obj: 'Any' +``` + + + +##### Arguments + +- **obj**: + + + + +### method parse_raw + +```python +b: 'str | bytes', *, +content_type: 'str | None' = None, +encoding: 'str' = 'utf8', +proto: 'DeprecatedParseProtocol | None' = None, +allow_pickle: 'bool' = False +``` + + + +##### Arguments + +- **b**: +- **content_type**: +- **encoding**: +- **proto**: +- **allow_pickle**: + + + + +### method schema + +```python +by_alias: 'bool' = True, +ref_template: 'str' = '#/$defs/{model}' +``` + + + +##### Arguments + +- **by_alias**: +- **ref_template**: + + + + +### method schema_json + +```python +*, +by_alias: 'bool' = True, +ref_template: 'str' = '#/$defs/{model}', **dumps_kwargs: 'Any' +``` + + + +##### Arguments + +- **by_alias**: +- **ref_template**: +- **dumps_kwargs**: + + + + +### method then + +```python +self, +action: 'InputAction' +``` + +Define a new Automation in which this event triggers the given action. + +##### Arguments + +- **action**: + + + + +### method update_forward_refs + +```python +**localns: 'Any' +``` + + + +##### Arguments + +- **localns**: + + + + +### method validate + +```python +value: 'Any' +``` + + + +##### Arguments + +- **value**: + + + + + -**Returns:** - An `OnLinkArtifact` object. diff --git a/models/ref/python/automations/onremoveartifacttag.mdx b/models/ref/python/automations/onremoveartifacttag.mdx index c813990c64..d03d64c5c2 100644 --- a/models/ref/python/automations/onremoveartifacttag.mdx +++ b/models/ref/python/automations/onremoveartifacttag.mdx @@ -1,33 +1,560 @@ --- title: OnRemoveArtifactTag -namespace: automations_namespace -python_object_type: class +kind: class +namespace: wandb.automations.events --- + import { GitHubLink } from '/snippets/_includes/github-source-link.mdx'; - + + + +```python +*, +event_type: Literal[REMOVE_ARTIFACT_TAG] = REMOVE_ARTIFACT_TAG, +scope: typing.Annotated[wandb.automations.scopes._ArtifactSequenceScope | wandb.automations.scopes._ArtifactPortfolioScope | wandb.automations.scopes.ProjectScope, BeforeValidator(func=, json_schema_input_type=PydanticUndefined)], +filter: typing.Annotated[wandb.automations._filters.operators.And | wandb.automations._filters.operators.Or | wandb.automations._filters.operators.Nor | wandb.automations._filters.operators.Not | wandb.automations._filters.operators.Lt | wandb.automations._filters.operators.Gt | wandb.automations._filters.operators.Lte | wandb.automations._filters.operators.Gte | wandb.automations._filters.operators.Eq | wandb.automations._filters.operators.Ne | wandb.automations._filters.operators.In | wandb.automations._filters.operators.NotIn | wandb.automations._filters.operators.Exists | wandb.automations._filters.operators.Regex | wandb.automations._filters.operators.Contains | wandb.automations._filters.expressions.FilterExpr | dict[str, typing.Any], Json, BeforeValidator(func=, json_schema_input_type=PydanticUndefined), PlainSerializer(func=, return_type=PydanticUndefined, when_used='always'), AfterValidator(func=)] = And(()) +``` + +## Description -## class `OnRemoveArtifactTag` A tag is removed from an artifact version. -### method `OnRemoveArtifactTag.__init__` + +## Args + +- **event_type**: +- **scope**: +- **filter**: + + + + + + +## Methods + +### method construct + +```python +_fields_set: 'set[str] | None' = None, **values: 'Any' +``` + + + +##### Arguments + +- **_fields_set**: +- **values**: + + + + +### method copy + +```python +self, *, +include: 'AbstractSetIntStr | MappingIntStrAny | None' = None, +exclude: 'AbstractSetIntStr | MappingIntStrAny | None' = None, +update: 'Dict[str, Any] | None' = None, +deep: 'bool' = False +``` + +Returns a copy of the model. + +!!! warning "Deprecated" + This method is now deprecated; use `model_copy` instead. + +If you need `include` or `exclude`, use: + +```python {test="skip" lint="skip"} +data = self.model_dump(include=include, exclude=exclude, round_trip=True) +data = {**data, **(update or {})} +copied = self.model_validate(data) +``` + +##### Arguments + +- **include**: Optional set or mapping specifying which fields to include in the copied model. +- **exclude**: Optional set or mapping specifying which fields to exclude in the copied model. +- **update**: Optional dictionary of field-value pairs to override field values in the copied model. +- **deep**: If True, the values of fields that are Pydantic models will be deep-copied. + + + + +### method dict + +```python +self, *, +include: 'IncEx | None' = None, +exclude: 'IncEx | None' = None, +by_alias: 'bool' = False, +exclude_unset: 'bool' = False, +exclude_defaults: 'bool' = False, +exclude_none: 'bool' = False +``` + + + +##### Arguments + +- **include**: +- **exclude**: +- **by_alias**: +- **exclude_unset**: +- **exclude_defaults**: +- **exclude_none**: + + + + +### method from_orm + +```python +obj: 'Any' +``` + + + +##### Arguments + +- **obj**: + + + + +### method json + +```python +self, *, +include: 'IncEx | None' = None, +exclude: 'IncEx | None' = None, +by_alias: 'bool' = False, +exclude_unset: 'bool' = False, +exclude_defaults: 'bool' = False, +exclude_none: 'bool' = False, +encoder: 'Callable[[Any], Any] | None' = PydanticUndefined, +models_as_dict: 'bool' = PydanticUndefined, **dumps_kwargs: 'Any' +``` + + + +##### Arguments + +- **include**: +- **exclude**: +- **by_alias**: +- **exclude_unset**: +- **exclude_defaults**: +- **exclude_none**: +- **encoder**: +- **models_as_dict**: +- **dumps_kwargs**: + + + + +### method model_construct + +```python +_fields_set: 'set[str] | None' = None, **values: 'Any' +``` + +Creates a new instance of the `Model` class with validated data. + +Creates a new model setting `__dict__` and `__pydantic_fields_set__` from trusted or pre-validated data. +Default values are respected, but no other validation is performed. + +!!! note + `model_construct()` generally respects the `model_config.extra` setting on the provided model. + That is, if `model_config.extra == 'allow'`, then all extra passed values are added to the model instance's `__dict__` + and `__pydantic_extra__` fields. If `model_config.extra == 'ignore'` (the default), then all extra passed values are ignored. + Because no validation is performed with a call to `model_construct()`, having `model_config.extra == 'forbid'` does not result in + an error if extra values are passed, but they will be ignored. + +##### Arguments + +- **_fields_set**: A set of field names that were originally explicitly set during instantiation. If provided, this is directly used for the [`model_fields_set`][pydantic.BaseModel.model_fields_set] attribute. Otherwise, the field names from the `values` argument will be used. +- **values**: Trusted or pre-validated data dictionary. + + + + +### method model_copy + +```python +self, *, +update: 'Mapping[str, Any] | None' = None, +deep: 'bool' = False +``` + +!!! abstract "Usage Documentation" + [`model_copy`](../concepts/serialization.md#model_copy) + +Returns a copy of the model. + +!!! note + The underlying instance's [`__dict__`][object.__dict__] attribute is copied. This + might have unexpected side effects if you store anything in it, on top of the model + fields (e.g. the value of [cached properties][functools.cached_property]). + +##### Arguments + +- **update**: Values to change/add in the new model. Note: the data is not validated before creating the new model. You should trust this data. +- **deep**: Set to `True` to make a deep copy of the model. + + + + +### method model_dump + +```python +self, *, +mode: 'str' = 'json', **kwargs: 'Any' +``` + +!!! abstract "Usage Documentation" + [`model_dump`](../concepts/serialization.md#modelmodel_dump) + +Generate a dictionary representation of the model, optionally specifying which fields to include or exclude. + +##### Arguments + +- **mode**: The mode in which `to_python` should run. If mode is 'json', the output will only contain JSON serializable types. If mode is 'python', the output may contain non-JSON-serializable Python objects. +- **kwargs**: + + + + +### method model_dump_json + +```python +self, *, +indent: 'int | None' = None, **kwargs: 'Any' +``` + +!!! abstract "Usage Documentation" + [`model_dump_json`](../concepts/serialization.md#modelmodel_dump_json) + +Generates a JSON representation of the model using Pydantic's `to_json` method. + +##### Arguments + +- **indent**: Indentation to use in the JSON output. If None is passed, the output will be compact. +- **kwargs**: + + + + +### method model_json_schema ```python -__init__( - event_type: 'Literal[REMOVE_ARTIFACT_TAG]' = REMOVE_ARTIFACT_TAG, - scope: 'wandb.automations.scopes._ArtifactSequenceScope | wandb.automations.scopes._ArtifactPortfolioScope | wandb.automations.scopes.ProjectScope', - filter: 'wandb.automations._filters.operators.And | wandb.automations._filters.operators.Or | wandb.automations._filters.operators.Nor | wandb.automations._filters.operators.Not | wandb.automations._filters.operators.Lt | wandb.automations._filters.operators.Gt | wandb.automations._filters.operators.Lte | wandb.automations._filters.operators.Gte | wandb.automations._filters.operators.Eq | wandb.automations._filters.operators.Ne | wandb.automations._filters.operators.In | wandb.automations._filters.operators.NotIn | wandb.automations._filters.operators.Exists | wandb.automations._filters.operators.Regex | wandb.automations._filters.operators.Contains | wandb.automations._filters.expressions.FilterExpr | dict[str, Any]' = And(()) -) → None +by_alias: 'bool' = True, +ref_template: 'str' = '#/$defs/{model}', +schema_generator: 'type[GenerateJsonSchema]' = , +mode: 'JsonSchemaMode' = 'validation' ``` -**Args:** - - - `event_type` (Literal[REMOVE_ARTIFACT_TAG]): - - `scope` (wandb.automations.scopes._ArtifactSequenceScope | wandb.automations.scopes._ArtifactPortfolioScope | wandb.automations.scopes.ProjectScope): The scope of the event. - - `filter` (wandb.automations._filters.operators.And | wandb.automations._filters.operators.Or | wandb.automations._filters.operators.Nor | wandb.automations._filters.operators.Not | wandb.automations._filters.operators.Lt | wandb.automations._filters.operators.Gt | wandb.automations._filters.operators.Lte | wandb.automations._filters.operators.Gte | wandb.automations._filters.operators.Eq | wandb.automations._filters.operators.Ne | wandb.automations._filters.operators.In | wandb.automations._filters.operators.NotIn | wandb.automations._filters.operators.Exists | wandb.automations._filters.operators.Regex | wandb.automations._filters.operators.Contains | wandb.automations._filters.expressions.FilterExpr | dict[str, Any]): Additional conditions(s), if any, that are required for this event to trigger. +Generates a JSON schema for a model class. + +##### Arguments + +- **by_alias**: Whether to use attribute aliases or not. +- **ref_template**: The reference template. +- **schema_generator**: To override the logic used to generate the JSON schema, as a subclass of `GenerateJsonSchema` with your desired modifications +- **mode**: The mode in which to generate the schema. + + + + +### method model_parametrized_name + +```python +params: 'tuple[type[Any], ...]' +``` + +Compute the class name for parametrizations of generic classes. + +This method can be overridden to achieve a custom naming scheme for generic BaseModels. + +##### Arguments + +- **params**: Tuple of types of the class. Given a generic class `Model` with 2 type variables and a concrete model `Model[str, int]`, the value `(str, int)` would be passed to `params`. + + +##### Raises + +- **TypeError**: Raised when trying to generate concrete names for non-generic models. + + +### method model_post_init + +```python +self, +context: 'Any', / +``` + +Override this method to perform additional initialization after `__init__` and `model_construct`. +This is useful if you want to do some validation that requires the entire model to be initialized. + +##### Arguments + +- **context**: + + + + +### method model_rebuild + +```python +*, +force: 'bool' = False, +raise_errors: 'bool' = True, +_parent_namespace_depth: 'int' = 2, +_types_namespace: 'MappingNamespace | None' = None +``` + +Try to rebuild the pydantic-core schema for the model. + +This may be necessary when one of the annotations is a ForwardRef which could not be resolved during +the initial attempt to build the schema, and automatic rebuilding fails. + +##### Arguments + +- **force**: Whether to force the rebuilding of the model schema, defaults to `False`. +- **raise_errors**: Whether to raise errors, defaults to `True`. +- **_parent_namespace_depth**: The depth level of the parent namespace, defaults to 2. +- **_types_namespace**: The types namespace, defaults to `None`. + + + + +### method model_validate + +```python +obj: 'Any', *, +strict: 'bool | None' = None, +from_attributes: 'bool | None' = None, +context: 'Any | None' = None, +by_alias: 'bool | None' = None, +by_name: 'bool | None' = None +``` + +Validate a pydantic model instance. + +##### Arguments + +- **obj**: The object to validate. +- **strict**: Whether to enforce types strictly. +- **from_attributes**: Whether to extract data from object attributes. +- **context**: Additional context to pass to the validator. +- **by_alias**: Whether to use the field's alias when validating against the provided input data. +- **by_name**: Whether to use the field's name when validating against the provided input data. + + +##### Raises + +- **ValidationError**: If the object could not be validated. + + +### method model_validate_json + +```python +json_data: 'str | bytes | bytearray', *, +strict: 'bool | None' = None, +context: 'Any | None' = None, +by_alias: 'bool | None' = None, +by_name: 'bool | None' = None +``` + +!!! abstract "Usage Documentation" + [JSON Parsing](../concepts/json.md#json-parsing) + +Validate the given JSON data against the Pydantic model. + +##### Arguments + +- **json_data**: The JSON data to validate. +- **strict**: Whether to enforce types strictly. +- **context**: Extra variables to pass to the validator. +- **by_alias**: Whether to use the field's alias when validating against the provided input data. +- **by_name**: Whether to use the field's name when validating against the provided input data. + + +##### Raises + +- **ValidationError**: If `json_data` is not a JSON string or the object could not be validated. + + +### method model_validate_strings + +```python +obj: 'Any', *, +strict: 'bool | None' = None, +context: 'Any | None' = None, +by_alias: 'bool | None' = None, +by_name: 'bool | None' = None +``` + +Validate the given object with string data against the Pydantic model. + +##### Arguments + +- **obj**: The object containing string data to validate. +- **strict**: Whether to enforce types strictly. +- **context**: Extra variables to pass to the validator. +- **by_alias**: Whether to use the field's alias when validating against the provided input data. +- **by_name**: Whether to use the field's name when validating against the provided input data. + + + + +### method parse_file + +```python +path: 'str | Path', *, +content_type: 'str | None' = None, +encoding: 'str' = 'utf8', +proto: 'DeprecatedParseProtocol | None' = None, +allow_pickle: 'bool' = False +``` + + + +##### Arguments + +- **path**: +- **content_type**: +- **encoding**: +- **proto**: +- **allow_pickle**: + + + + +### method parse_obj + +```python +obj: 'Any' +``` + + + +##### Arguments + +- **obj**: + + + + +### method parse_raw + +```python +b: 'str | bytes', *, +content_type: 'str | None' = None, +encoding: 'str' = 'utf8', +proto: 'DeprecatedParseProtocol | None' = None, +allow_pickle: 'bool' = False +``` + + + +##### Arguments + +- **b**: +- **content_type**: +- **encoding**: +- **proto**: +- **allow_pickle**: + + + + +### method schema + +```python +by_alias: 'bool' = True, +ref_template: 'str' = '#/$defs/{model}' +``` + + + +##### Arguments + +- **by_alias**: +- **ref_template**: + + + + +### method schema_json + +```python +*, +by_alias: 'bool' = True, +ref_template: 'str' = '#/$defs/{model}', **dumps_kwargs: 'Any' +``` + + + +##### Arguments + +- **by_alias**: +- **ref_template**: +- **dumps_kwargs**: + + + + +### method then + +```python +self, +action: 'InputAction' +``` + +Define a new Automation in which this event triggers the given action. + +##### Arguments + +- **action**: + + + + +### method update_forward_refs + +```python +**localns: 'Any' +``` + + + +##### Arguments + +- **localns**: + + + + +### method validate + +```python +value: 'Any' +``` + + + +##### Arguments + +- **value**: + + + + + -**Returns:** - An `OnRemoveArtifactTag` object. diff --git a/models/ref/python/automations/onremovecollectiontag.mdx b/models/ref/python/automations/onremovecollectiontag.mdx index dd4ef7864a..107e31c867 100644 --- a/models/ref/python/automations/onremovecollectiontag.mdx +++ b/models/ref/python/automations/onremovecollectiontag.mdx @@ -1,33 +1,560 @@ --- title: OnRemoveCollectionTag -namespace: automations_namespace -python_object_type: class +kind: class +namespace: wandb.automations.events --- + import { GitHubLink } from '/snippets/_includes/github-source-link.mdx'; - + + + +```python +*, +event_type: Literal[REMOVE_COLLECTION_TAG] = REMOVE_COLLECTION_TAG, +scope: typing.Annotated[wandb.automations.scopes._ArtifactSequenceScope | wandb.automations.scopes._ArtifactPortfolioScope | wandb.automations.scopes.ProjectScope, BeforeValidator(func=, json_schema_input_type=PydanticUndefined)], +filter: typing.Annotated[wandb.automations._filters.operators.And | wandb.automations._filters.operators.Or | wandb.automations._filters.operators.Nor | wandb.automations._filters.operators.Not | wandb.automations._filters.operators.Lt | wandb.automations._filters.operators.Gt | wandb.automations._filters.operators.Lte | wandb.automations._filters.operators.Gte | wandb.automations._filters.operators.Eq | wandb.automations._filters.operators.Ne | wandb.automations._filters.operators.In | wandb.automations._filters.operators.NotIn | wandb.automations._filters.operators.Exists | wandb.automations._filters.operators.Regex | wandb.automations._filters.operators.Contains | wandb.automations._filters.expressions.FilterExpr | dict[str, typing.Any], Json, BeforeValidator(func=, json_schema_input_type=PydanticUndefined), PlainSerializer(func=, return_type=PydanticUndefined, when_used='always'), AfterValidator(func=)] = And(()) +``` + +## Description -## class `OnRemoveCollectionTag` A tag is removed from an artifact collection. -### method `OnRemoveCollectionTag.__init__` + +## Args + +- **event_type**: +- **scope**: +- **filter**: + + + + + + +## Methods + +### method construct + +```python +_fields_set: 'set[str] | None' = None, **values: 'Any' +``` + + + +##### Arguments + +- **_fields_set**: +- **values**: + + + + +### method copy + +```python +self, *, +include: 'AbstractSetIntStr | MappingIntStrAny | None' = None, +exclude: 'AbstractSetIntStr | MappingIntStrAny | None' = None, +update: 'Dict[str, Any] | None' = None, +deep: 'bool' = False +``` + +Returns a copy of the model. + +!!! warning "Deprecated" + This method is now deprecated; use `model_copy` instead. + +If you need `include` or `exclude`, use: + +```python {test="skip" lint="skip"} +data = self.model_dump(include=include, exclude=exclude, round_trip=True) +data = {**data, **(update or {})} +copied = self.model_validate(data) +``` + +##### Arguments + +- **include**: Optional set or mapping specifying which fields to include in the copied model. +- **exclude**: Optional set or mapping specifying which fields to exclude in the copied model. +- **update**: Optional dictionary of field-value pairs to override field values in the copied model. +- **deep**: If True, the values of fields that are Pydantic models will be deep-copied. + + + + +### method dict + +```python +self, *, +include: 'IncEx | None' = None, +exclude: 'IncEx | None' = None, +by_alias: 'bool' = False, +exclude_unset: 'bool' = False, +exclude_defaults: 'bool' = False, +exclude_none: 'bool' = False +``` + + + +##### Arguments + +- **include**: +- **exclude**: +- **by_alias**: +- **exclude_unset**: +- **exclude_defaults**: +- **exclude_none**: + + + + +### method from_orm + +```python +obj: 'Any' +``` + + + +##### Arguments + +- **obj**: + + + + +### method json + +```python +self, *, +include: 'IncEx | None' = None, +exclude: 'IncEx | None' = None, +by_alias: 'bool' = False, +exclude_unset: 'bool' = False, +exclude_defaults: 'bool' = False, +exclude_none: 'bool' = False, +encoder: 'Callable[[Any], Any] | None' = PydanticUndefined, +models_as_dict: 'bool' = PydanticUndefined, **dumps_kwargs: 'Any' +``` + + + +##### Arguments + +- **include**: +- **exclude**: +- **by_alias**: +- **exclude_unset**: +- **exclude_defaults**: +- **exclude_none**: +- **encoder**: +- **models_as_dict**: +- **dumps_kwargs**: + + + + +### method model_construct + +```python +_fields_set: 'set[str] | None' = None, **values: 'Any' +``` + +Creates a new instance of the `Model` class with validated data. + +Creates a new model setting `__dict__` and `__pydantic_fields_set__` from trusted or pre-validated data. +Default values are respected, but no other validation is performed. + +!!! note + `model_construct()` generally respects the `model_config.extra` setting on the provided model. + That is, if `model_config.extra == 'allow'`, then all extra passed values are added to the model instance's `__dict__` + and `__pydantic_extra__` fields. If `model_config.extra == 'ignore'` (the default), then all extra passed values are ignored. + Because no validation is performed with a call to `model_construct()`, having `model_config.extra == 'forbid'` does not result in + an error if extra values are passed, but they will be ignored. + +##### Arguments + +- **_fields_set**: A set of field names that were originally explicitly set during instantiation. If provided, this is directly used for the [`model_fields_set`][pydantic.BaseModel.model_fields_set] attribute. Otherwise, the field names from the `values` argument will be used. +- **values**: Trusted or pre-validated data dictionary. + + + + +### method model_copy + +```python +self, *, +update: 'Mapping[str, Any] | None' = None, +deep: 'bool' = False +``` + +!!! abstract "Usage Documentation" + [`model_copy`](../concepts/serialization.md#model_copy) + +Returns a copy of the model. + +!!! note + The underlying instance's [`__dict__`][object.__dict__] attribute is copied. This + might have unexpected side effects if you store anything in it, on top of the model + fields (e.g. the value of [cached properties][functools.cached_property]). + +##### Arguments + +- **update**: Values to change/add in the new model. Note: the data is not validated before creating the new model. You should trust this data. +- **deep**: Set to `True` to make a deep copy of the model. + + + + +### method model_dump + +```python +self, *, +mode: 'str' = 'json', **kwargs: 'Any' +``` + +!!! abstract "Usage Documentation" + [`model_dump`](../concepts/serialization.md#modelmodel_dump) + +Generate a dictionary representation of the model, optionally specifying which fields to include or exclude. + +##### Arguments + +- **mode**: The mode in which `to_python` should run. If mode is 'json', the output will only contain JSON serializable types. If mode is 'python', the output may contain non-JSON-serializable Python objects. +- **kwargs**: + + + + +### method model_dump_json + +```python +self, *, +indent: 'int | None' = None, **kwargs: 'Any' +``` + +!!! abstract "Usage Documentation" + [`model_dump_json`](../concepts/serialization.md#modelmodel_dump_json) + +Generates a JSON representation of the model using Pydantic's `to_json` method. + +##### Arguments + +- **indent**: Indentation to use in the JSON output. If None is passed, the output will be compact. +- **kwargs**: + + + + +### method model_json_schema ```python -__init__( - event_type: 'Literal[REMOVE_COLLECTION_TAG]' = REMOVE_COLLECTION_TAG, - scope: 'wandb.automations.scopes._ArtifactSequenceScope | wandb.automations.scopes._ArtifactPortfolioScope | wandb.automations.scopes.ProjectScope', - filter: 'wandb.automations._filters.operators.And | wandb.automations._filters.operators.Or | wandb.automations._filters.operators.Nor | wandb.automations._filters.operators.Not | wandb.automations._filters.operators.Lt | wandb.automations._filters.operators.Gt | wandb.automations._filters.operators.Lte | wandb.automations._filters.operators.Gte | wandb.automations._filters.operators.Eq | wandb.automations._filters.operators.Ne | wandb.automations._filters.operators.In | wandb.automations._filters.operators.NotIn | wandb.automations._filters.operators.Exists | wandb.automations._filters.operators.Regex | wandb.automations._filters.operators.Contains | wandb.automations._filters.expressions.FilterExpr | dict[str, Any]' = And(()) -) → None +by_alias: 'bool' = True, +ref_template: 'str' = '#/$defs/{model}', +schema_generator: 'type[GenerateJsonSchema]' = , +mode: 'JsonSchemaMode' = 'validation' ``` -**Args:** - - - `event_type` (Literal[REMOVE_COLLECTION_TAG]): - - `scope` (wandb.automations.scopes._ArtifactSequenceScope | wandb.automations.scopes._ArtifactPortfolioScope | wandb.automations.scopes.ProjectScope): The scope of the event. - - `filter` (wandb.automations._filters.operators.And | wandb.automations._filters.operators.Or | wandb.automations._filters.operators.Nor | wandb.automations._filters.operators.Not | wandb.automations._filters.operators.Lt | wandb.automations._filters.operators.Gt | wandb.automations._filters.operators.Lte | wandb.automations._filters.operators.Gte | wandb.automations._filters.operators.Eq | wandb.automations._filters.operators.Ne | wandb.automations._filters.operators.In | wandb.automations._filters.operators.NotIn | wandb.automations._filters.operators.Exists | wandb.automations._filters.operators.Regex | wandb.automations._filters.operators.Contains | wandb.automations._filters.expressions.FilterExpr | dict[str, Any]): Additional conditions(s), if any, that are required for this event to trigger. +Generates a JSON schema for a model class. + +##### Arguments + +- **by_alias**: Whether to use attribute aliases or not. +- **ref_template**: The reference template. +- **schema_generator**: To override the logic used to generate the JSON schema, as a subclass of `GenerateJsonSchema` with your desired modifications +- **mode**: The mode in which to generate the schema. + + + + +### method model_parametrized_name + +```python +params: 'tuple[type[Any], ...]' +``` + +Compute the class name for parametrizations of generic classes. + +This method can be overridden to achieve a custom naming scheme for generic BaseModels. + +##### Arguments + +- **params**: Tuple of types of the class. Given a generic class `Model` with 2 type variables and a concrete model `Model[str, int]`, the value `(str, int)` would be passed to `params`. + + +##### Raises + +- **TypeError**: Raised when trying to generate concrete names for non-generic models. + + +### method model_post_init + +```python +self, +context: 'Any', / +``` + +Override this method to perform additional initialization after `__init__` and `model_construct`. +This is useful if you want to do some validation that requires the entire model to be initialized. + +##### Arguments + +- **context**: + + + + +### method model_rebuild + +```python +*, +force: 'bool' = False, +raise_errors: 'bool' = True, +_parent_namespace_depth: 'int' = 2, +_types_namespace: 'MappingNamespace | None' = None +``` + +Try to rebuild the pydantic-core schema for the model. + +This may be necessary when one of the annotations is a ForwardRef which could not be resolved during +the initial attempt to build the schema, and automatic rebuilding fails. + +##### Arguments + +- **force**: Whether to force the rebuilding of the model schema, defaults to `False`. +- **raise_errors**: Whether to raise errors, defaults to `True`. +- **_parent_namespace_depth**: The depth level of the parent namespace, defaults to 2. +- **_types_namespace**: The types namespace, defaults to `None`. + + + + +### method model_validate + +```python +obj: 'Any', *, +strict: 'bool | None' = None, +from_attributes: 'bool | None' = None, +context: 'Any | None' = None, +by_alias: 'bool | None' = None, +by_name: 'bool | None' = None +``` + +Validate a pydantic model instance. + +##### Arguments + +- **obj**: The object to validate. +- **strict**: Whether to enforce types strictly. +- **from_attributes**: Whether to extract data from object attributes. +- **context**: Additional context to pass to the validator. +- **by_alias**: Whether to use the field's alias when validating against the provided input data. +- **by_name**: Whether to use the field's name when validating against the provided input data. + + +##### Raises + +- **ValidationError**: If the object could not be validated. + + +### method model_validate_json + +```python +json_data: 'str | bytes | bytearray', *, +strict: 'bool | None' = None, +context: 'Any | None' = None, +by_alias: 'bool | None' = None, +by_name: 'bool | None' = None +``` + +!!! abstract "Usage Documentation" + [JSON Parsing](../concepts/json.md#json-parsing) + +Validate the given JSON data against the Pydantic model. + +##### Arguments + +- **json_data**: The JSON data to validate. +- **strict**: Whether to enforce types strictly. +- **context**: Extra variables to pass to the validator. +- **by_alias**: Whether to use the field's alias when validating against the provided input data. +- **by_name**: Whether to use the field's name when validating against the provided input data. + + +##### Raises + +- **ValidationError**: If `json_data` is not a JSON string or the object could not be validated. + + +### method model_validate_strings + +```python +obj: 'Any', *, +strict: 'bool | None' = None, +context: 'Any | None' = None, +by_alias: 'bool | None' = None, +by_name: 'bool | None' = None +``` + +Validate the given object with string data against the Pydantic model. + +##### Arguments + +- **obj**: The object containing string data to validate. +- **strict**: Whether to enforce types strictly. +- **context**: Extra variables to pass to the validator. +- **by_alias**: Whether to use the field's alias when validating against the provided input data. +- **by_name**: Whether to use the field's name when validating against the provided input data. + + + + +### method parse_file + +```python +path: 'str | Path', *, +content_type: 'str | None' = None, +encoding: 'str' = 'utf8', +proto: 'DeprecatedParseProtocol | None' = None, +allow_pickle: 'bool' = False +``` + + + +##### Arguments + +- **path**: +- **content_type**: +- **encoding**: +- **proto**: +- **allow_pickle**: + + + + +### method parse_obj + +```python +obj: 'Any' +``` + + + +##### Arguments + +- **obj**: + + + + +### method parse_raw + +```python +b: 'str | bytes', *, +content_type: 'str | None' = None, +encoding: 'str' = 'utf8', +proto: 'DeprecatedParseProtocol | None' = None, +allow_pickle: 'bool' = False +``` + + + +##### Arguments + +- **b**: +- **content_type**: +- **encoding**: +- **proto**: +- **allow_pickle**: + + + + +### method schema + +```python +by_alias: 'bool' = True, +ref_template: 'str' = '#/$defs/{model}' +``` + + + +##### Arguments + +- **by_alias**: +- **ref_template**: + + + + +### method schema_json + +```python +*, +by_alias: 'bool' = True, +ref_template: 'str' = '#/$defs/{model}', **dumps_kwargs: 'Any' +``` + + + +##### Arguments + +- **by_alias**: +- **ref_template**: +- **dumps_kwargs**: + + + + +### method then + +```python +self, +action: 'InputAction' +``` + +Define a new Automation in which this event triggers the given action. + +##### Arguments + +- **action**: + + + + +### method update_forward_refs + +```python +**localns: 'Any' +``` + + + +##### Arguments + +- **localns**: + + + + +### method validate + +```python +value: 'Any' +``` + + + +##### Arguments + +- **value**: + + + + + -**Returns:** - An `OnRemoveCollectionTag` object. diff --git a/models/ref/python/automations/onrunmetric.mdx b/models/ref/python/automations/onrunmetric.mdx index 7f1d168745..2e57e3b211 100644 --- a/models/ref/python/automations/onrunmetric.mdx +++ b/models/ref/python/automations/onrunmetric.mdx @@ -1,18 +1,38 @@ --- title: OnRunMetric -namespace: automations_namespace -python_object_type: class +kind: class +namespace: wandb.automations.events --- + import { GitHubLink } from '/snippets/_includes/github-source-link.mdx'; - + + + +```python +*, +event_type: Literal[RUN_METRIC_THRESHOLD, RUN_METRIC_CHANGE, RUN_METRIC_ZSCORE], +scope: wandb.automations.scopes.ProjectScope, +filter: typing.Annotated[wandb.automations.events.RunMetricFilter, Json, BeforeValidator(func=, json_schema_input_type=PydanticUndefined), PlainSerializer(func=, return_type=PydanticUndefined, when_used='always')] +``` + +## Description -## class `OnRunMetric` A run metric satisfies a user-defined condition. -Examples: + + +## Args + +- **event_type**: +- **scope**: +- **filter**: + + +## 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: @@ -30,21 +50,527 @@ event = OnRunMetric( ``` -### method `OnRunMetric.__init__` + +## Methods + +### method construct + +```python +_fields_set: 'set[str] | None' = None, **values: 'Any' +``` + + + +##### Arguments + +- **_fields_set**: +- **values**: + + + + +### method copy + +```python +self, *, +include: 'AbstractSetIntStr | MappingIntStrAny | None' = None, +exclude: 'AbstractSetIntStr | MappingIntStrAny | None' = None, +update: 'Dict[str, Any] | None' = None, +deep: 'bool' = False +``` + +Returns a copy of the model. + +!!! warning "Deprecated" + This method is now deprecated; use `model_copy` instead. + +If you need `include` or `exclude`, use: + +```python {test="skip" lint="skip"} +data = self.model_dump(include=include, exclude=exclude, round_trip=True) +data = {**data, **(update or {})} +copied = self.model_validate(data) +``` + +##### Arguments + +- **include**: Optional set or mapping specifying which fields to include in the copied model. +- **exclude**: Optional set or mapping specifying which fields to exclude in the copied model. +- **update**: Optional dictionary of field-value pairs to override field values in the copied model. +- **deep**: If True, the values of fields that are Pydantic models will be deep-copied. + + + + +### method dict + +```python +self, *, +include: 'IncEx | None' = None, +exclude: 'IncEx | None' = None, +by_alias: 'bool' = False, +exclude_unset: 'bool' = False, +exclude_defaults: 'bool' = False, +exclude_none: 'bool' = False +``` + + + +##### Arguments + +- **include**: +- **exclude**: +- **by_alias**: +- **exclude_unset**: +- **exclude_defaults**: +- **exclude_none**: + + + + +### method from_orm + +```python +obj: 'Any' +``` + + + +##### Arguments + +- **obj**: + + + + +### method json + +```python +self, *, +include: 'IncEx | None' = None, +exclude: 'IncEx | None' = None, +by_alias: 'bool' = False, +exclude_unset: 'bool' = False, +exclude_defaults: 'bool' = False, +exclude_none: 'bool' = False, +encoder: 'Callable[[Any], Any] | None' = PydanticUndefined, +models_as_dict: 'bool' = PydanticUndefined, **dumps_kwargs: 'Any' +``` + + + +##### Arguments + +- **include**: +- **exclude**: +- **by_alias**: +- **exclude_unset**: +- **exclude_defaults**: +- **exclude_none**: +- **encoder**: +- **models_as_dict**: +- **dumps_kwargs**: + + + + +### method model_construct + +```python +_fields_set: 'set[str] | None' = None, **values: 'Any' +``` + +Creates a new instance of the `Model` class with validated data. + +Creates a new model setting `__dict__` and `__pydantic_fields_set__` from trusted or pre-validated data. +Default values are respected, but no other validation is performed. + +!!! note + `model_construct()` generally respects the `model_config.extra` setting on the provided model. + That is, if `model_config.extra == 'allow'`, then all extra passed values are added to the model instance's `__dict__` + and `__pydantic_extra__` fields. If `model_config.extra == 'ignore'` (the default), then all extra passed values are ignored. + Because no validation is performed with a call to `model_construct()`, having `model_config.extra == 'forbid'` does not result in + an error if extra values are passed, but they will be ignored. + +##### Arguments + +- **_fields_set**: A set of field names that were originally explicitly set during instantiation. If provided, this is directly used for the [`model_fields_set`][pydantic.BaseModel.model_fields_set] attribute. Otherwise, the field names from the `values` argument will be used. +- **values**: Trusted or pre-validated data dictionary. + + + + +### method model_copy + +```python +self, *, +update: 'Mapping[str, Any] | None' = None, +deep: 'bool' = False +``` + +!!! abstract "Usage Documentation" + [`model_copy`](../concepts/serialization.md#model_copy) + +Returns a copy of the model. + +!!! note + The underlying instance's [`__dict__`][object.__dict__] attribute is copied. This + might have unexpected side effects if you store anything in it, on top of the model + fields (e.g. the value of [cached properties][functools.cached_property]). + +##### Arguments + +- **update**: Values to change/add in the new model. Note: the data is not validated before creating the new model. You should trust this data. +- **deep**: Set to `True` to make a deep copy of the model. + + + + +### method model_dump + +```python +self, *, +mode: 'str' = 'json', **kwargs: 'Any' +``` + +!!! abstract "Usage Documentation" + [`model_dump`](../concepts/serialization.md#modelmodel_dump) + +Generate a dictionary representation of the model, optionally specifying which fields to include or exclude. + +##### Arguments + +- **mode**: The mode in which `to_python` should run. If mode is 'json', the output will only contain JSON serializable types. If mode is 'python', the output may contain non-JSON-serializable Python objects. +- **kwargs**: + + + + +### method model_dump_json + +```python +self, *, +indent: 'int | None' = None, **kwargs: 'Any' +``` + +!!! abstract "Usage Documentation" + [`model_dump_json`](../concepts/serialization.md#modelmodel_dump_json) + +Generates a JSON representation of the model using Pydantic's `to_json` method. + +##### Arguments + +- **indent**: Indentation to use in the JSON output. If None is passed, the output will be compact. +- **kwargs**: + + + + +### method model_json_schema + +```python +by_alias: 'bool' = True, +ref_template: 'str' = '#/$defs/{model}', +schema_generator: 'type[GenerateJsonSchema]' = , +mode: 'JsonSchemaMode' = 'validation' +``` + +Generates a JSON schema for a model class. + +##### Arguments + +- **by_alias**: Whether to use attribute aliases or not. +- **ref_template**: The reference template. +- **schema_generator**: To override the logic used to generate the JSON schema, as a subclass of `GenerateJsonSchema` with your desired modifications +- **mode**: The mode in which to generate the schema. + + + + +### method model_parametrized_name + +```python +params: 'tuple[type[Any], ...]' +``` + +Compute the class name for parametrizations of generic classes. + +This method can be overridden to achieve a custom naming scheme for generic BaseModels. + +##### Arguments + +- **params**: Tuple of types of the class. Given a generic class `Model` with 2 type variables and a concrete model `Model[str, int]`, the value `(str, int)` would be passed to `params`. + + +##### Raises + +- **TypeError**: Raised when trying to generate concrete names for non-generic models. + + +### method model_post_init + +```python +self, +context: 'Any', / +``` + +Override this method to perform additional initialization after `__init__` and `model_construct`. +This is useful if you want to do some validation that requires the entire model to be initialized. + +##### Arguments + +- **context**: + + + + +### method model_rebuild + +```python +*, +force: 'bool' = False, +raise_errors: 'bool' = True, +_parent_namespace_depth: 'int' = 2, +_types_namespace: 'MappingNamespace | None' = None +``` + +Try to rebuild the pydantic-core schema for the model. + +This may be necessary when one of the annotations is a ForwardRef which could not be resolved during +the initial attempt to build the schema, and automatic rebuilding fails. + +##### Arguments + +- **force**: Whether to force the rebuilding of the model schema, defaults to `False`. +- **raise_errors**: Whether to raise errors, defaults to `True`. +- **_parent_namespace_depth**: The depth level of the parent namespace, defaults to 2. +- **_types_namespace**: The types namespace, defaults to `None`. + + + + +### method model_validate + +```python +obj: 'Any', *, +strict: 'bool | None' = None, +from_attributes: 'bool | None' = None, +context: 'Any | None' = None, +by_alias: 'bool | None' = None, +by_name: 'bool | None' = None +``` + +Validate a pydantic model instance. + +##### Arguments + +- **obj**: The object to validate. +- **strict**: Whether to enforce types strictly. +- **from_attributes**: Whether to extract data from object attributes. +- **context**: Additional context to pass to the validator. +- **by_alias**: Whether to use the field's alias when validating against the provided input data. +- **by_name**: Whether to use the field's name when validating against the provided input data. + + +##### Raises + +- **ValidationError**: If the object could not be validated. + + +### method model_validate_json + +```python +json_data: 'str | bytes | bytearray', *, +strict: 'bool | None' = None, +context: 'Any | None' = None, +by_alias: 'bool | None' = None, +by_name: 'bool | None' = None +``` + +!!! abstract "Usage Documentation" + [JSON Parsing](../concepts/json.md#json-parsing) + +Validate the given JSON data against the Pydantic model. + +##### Arguments + +- **json_data**: The JSON data to validate. +- **strict**: Whether to enforce types strictly. +- **context**: Extra variables to pass to the validator. +- **by_alias**: Whether to use the field's alias when validating against the provided input data. +- **by_name**: Whether to use the field's name when validating against the provided input data. + + +##### Raises + +- **ValidationError**: If `json_data` is not a JSON string or the object could not be validated. + + +### method model_validate_strings ```python -__init__( - event_type: 'Literal[RUN_METRIC_THRESHOLD, RUN_METRIC_CHANGE, RUN_METRIC_ZSCORE]', - scope: 'ProjectScope', - filter: 'RunMetricFilter' -) → None +obj: 'Any', *, +strict: 'bool | None' = None, +context: 'Any | None' = None, +by_alias: 'bool | None' = None, +by_name: 'bool | None' = None ``` -**Args:** - - - `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. +Validate the given object with string data against the Pydantic model. + +##### Arguments + +- **obj**: The object containing string data to validate. +- **strict**: Whether to enforce types strictly. +- **context**: Extra variables to pass to the validator. +- **by_alias**: Whether to use the field's alias when validating against the provided input data. +- **by_name**: Whether to use the field's name when validating against the provided input data. + + + + +### method parse_file + +```python +path: 'str | Path', *, +content_type: 'str | None' = None, +encoding: 'str' = 'utf8', +proto: 'DeprecatedParseProtocol | None' = None, +allow_pickle: 'bool' = False +``` + + + +##### Arguments + +- **path**: +- **content_type**: +- **encoding**: +- **proto**: +- **allow_pickle**: + + + + +### method parse_obj + +```python +obj: 'Any' +``` + + + +##### Arguments + +- **obj**: + + + + +### method parse_raw + +```python +b: 'str | bytes', *, +content_type: 'str | None' = None, +encoding: 'str' = 'utf8', +proto: 'DeprecatedParseProtocol | None' = None, +allow_pickle: 'bool' = False +``` + + + +##### Arguments + +- **b**: +- **content_type**: +- **encoding**: +- **proto**: +- **allow_pickle**: + + + + +### method schema + +```python +by_alias: 'bool' = True, +ref_template: 'str' = '#/$defs/{model}' +``` + + + +##### Arguments + +- **by_alias**: +- **ref_template**: + + + + +### method schema_json + +```python +*, +by_alias: 'bool' = True, +ref_template: 'str' = '#/$defs/{model}', **dumps_kwargs: 'Any' +``` + + + +##### Arguments + +- **by_alias**: +- **ref_template**: +- **dumps_kwargs**: + + + + +### method then + +```python +self, +action: 'InputAction' +``` + +Define a new Automation in which this event triggers the given action. + +##### Arguments + +- **action**: + + + + +### method update_forward_refs + +```python +**localns: 'Any' +``` + + + +##### Arguments + +- **localns**: + + + + +### method validate + +```python +value: 'Any' +``` + + + +##### Arguments + +- **value**: + + + + + -**Returns:** - An `OnRunMetric` object. diff --git a/models/ref/python/automations/onrunstate.mdx b/models/ref/python/automations/onrunstate.mdx index e819d73d91..82158b7720 100644 --- a/models/ref/python/automations/onrunstate.mdx +++ b/models/ref/python/automations/onrunstate.mdx @@ -1,18 +1,38 @@ --- title: OnRunState -namespace: automations_namespace -python_object_type: class +kind: class +namespace: wandb.automations.events --- + import { GitHubLink } from '/snippets/_includes/github-source-link.mdx'; - + + + +```python +*, +event_type: Literal[RUN_STATE] = RUN_STATE, +scope: wandb.automations.scopes.ProjectScope, +filter: typing.Annotated[wandb.automations.events.RunStateFilter, Json, BeforeValidator(func=, json_schema_input_type=PydanticUndefined), PlainSerializer(func=, return_type=PydanticUndefined, when_used='always')] +``` + +## Description -## class `OnRunState` A run state changes. -Examples: + + +## Args + +- **event_type**: +- **scope**: +- **filter**: + + +## Examples + Define an event that triggers for any run in project "my-project" when its state changes to "finished" (i.e. succeeded) or "failed": @@ -30,21 +50,527 @@ event = OnRunState( ``` -### method `OnRunState.__init__` + +## Methods + +### method construct + +```python +_fields_set: 'set[str] | None' = None, **values: 'Any' +``` + + + +##### Arguments + +- **_fields_set**: +- **values**: + + + + +### method copy + +```python +self, *, +include: 'AbstractSetIntStr | MappingIntStrAny | None' = None, +exclude: 'AbstractSetIntStr | MappingIntStrAny | None' = None, +update: 'Dict[str, Any] | None' = None, +deep: 'bool' = False +``` + +Returns a copy of the model. + +!!! warning "Deprecated" + This method is now deprecated; use `model_copy` instead. + +If you need `include` or `exclude`, use: + +```python {test="skip" lint="skip"} +data = self.model_dump(include=include, exclude=exclude, round_trip=True) +data = {**data, **(update or {})} +copied = self.model_validate(data) +``` + +##### Arguments + +- **include**: Optional set or mapping specifying which fields to include in the copied model. +- **exclude**: Optional set or mapping specifying which fields to exclude in the copied model. +- **update**: Optional dictionary of field-value pairs to override field values in the copied model. +- **deep**: If True, the values of fields that are Pydantic models will be deep-copied. + + + + +### method dict + +```python +self, *, +include: 'IncEx | None' = None, +exclude: 'IncEx | None' = None, +by_alias: 'bool' = False, +exclude_unset: 'bool' = False, +exclude_defaults: 'bool' = False, +exclude_none: 'bool' = False +``` + + + +##### Arguments + +- **include**: +- **exclude**: +- **by_alias**: +- **exclude_unset**: +- **exclude_defaults**: +- **exclude_none**: + + + + +### method from_orm + +```python +obj: 'Any' +``` + + + +##### Arguments + +- **obj**: + + + + +### method json + +```python +self, *, +include: 'IncEx | None' = None, +exclude: 'IncEx | None' = None, +by_alias: 'bool' = False, +exclude_unset: 'bool' = False, +exclude_defaults: 'bool' = False, +exclude_none: 'bool' = False, +encoder: 'Callable[[Any], Any] | None' = PydanticUndefined, +models_as_dict: 'bool' = PydanticUndefined, **dumps_kwargs: 'Any' +``` + + + +##### Arguments + +- **include**: +- **exclude**: +- **by_alias**: +- **exclude_unset**: +- **exclude_defaults**: +- **exclude_none**: +- **encoder**: +- **models_as_dict**: +- **dumps_kwargs**: + + + + +### method model_construct + +```python +_fields_set: 'set[str] | None' = None, **values: 'Any' +``` + +Creates a new instance of the `Model` class with validated data. + +Creates a new model setting `__dict__` and `__pydantic_fields_set__` from trusted or pre-validated data. +Default values are respected, but no other validation is performed. + +!!! note + `model_construct()` generally respects the `model_config.extra` setting on the provided model. + That is, if `model_config.extra == 'allow'`, then all extra passed values are added to the model instance's `__dict__` + and `__pydantic_extra__` fields. If `model_config.extra == 'ignore'` (the default), then all extra passed values are ignored. + Because no validation is performed with a call to `model_construct()`, having `model_config.extra == 'forbid'` does not result in + an error if extra values are passed, but they will be ignored. + +##### Arguments + +- **_fields_set**: A set of field names that were originally explicitly set during instantiation. If provided, this is directly used for the [`model_fields_set`][pydantic.BaseModel.model_fields_set] attribute. Otherwise, the field names from the `values` argument will be used. +- **values**: Trusted or pre-validated data dictionary. + + + + +### method model_copy + +```python +self, *, +update: 'Mapping[str, Any] | None' = None, +deep: 'bool' = False +``` + +!!! abstract "Usage Documentation" + [`model_copy`](../concepts/serialization.md#model_copy) + +Returns a copy of the model. + +!!! note + The underlying instance's [`__dict__`][object.__dict__] attribute is copied. This + might have unexpected side effects if you store anything in it, on top of the model + fields (e.g. the value of [cached properties][functools.cached_property]). + +##### Arguments + +- **update**: Values to change/add in the new model. Note: the data is not validated before creating the new model. You should trust this data. +- **deep**: Set to `True` to make a deep copy of the model. + + + + +### method model_dump + +```python +self, *, +mode: 'str' = 'json', **kwargs: 'Any' +``` + +!!! abstract "Usage Documentation" + [`model_dump`](../concepts/serialization.md#modelmodel_dump) + +Generate a dictionary representation of the model, optionally specifying which fields to include or exclude. + +##### Arguments + +- **mode**: The mode in which `to_python` should run. If mode is 'json', the output will only contain JSON serializable types. If mode is 'python', the output may contain non-JSON-serializable Python objects. +- **kwargs**: + + + + +### method model_dump_json + +```python +self, *, +indent: 'int | None' = None, **kwargs: 'Any' +``` + +!!! abstract "Usage Documentation" + [`model_dump_json`](../concepts/serialization.md#modelmodel_dump_json) + +Generates a JSON representation of the model using Pydantic's `to_json` method. + +##### Arguments + +- **indent**: Indentation to use in the JSON output. If None is passed, the output will be compact. +- **kwargs**: + + + + +### method model_json_schema + +```python +by_alias: 'bool' = True, +ref_template: 'str' = '#/$defs/{model}', +schema_generator: 'type[GenerateJsonSchema]' = , +mode: 'JsonSchemaMode' = 'validation' +``` + +Generates a JSON schema for a model class. + +##### Arguments + +- **by_alias**: Whether to use attribute aliases or not. +- **ref_template**: The reference template. +- **schema_generator**: To override the logic used to generate the JSON schema, as a subclass of `GenerateJsonSchema` with your desired modifications +- **mode**: The mode in which to generate the schema. + + + + +### method model_parametrized_name + +```python +params: 'tuple[type[Any], ...]' +``` + +Compute the class name for parametrizations of generic classes. + +This method can be overridden to achieve a custom naming scheme for generic BaseModels. + +##### Arguments + +- **params**: Tuple of types of the class. Given a generic class `Model` with 2 type variables and a concrete model `Model[str, int]`, the value `(str, int)` would be passed to `params`. + + +##### Raises + +- **TypeError**: Raised when trying to generate concrete names for non-generic models. + + +### method model_post_init + +```python +self, +context: 'Any', / +``` + +Override this method to perform additional initialization after `__init__` and `model_construct`. +This is useful if you want to do some validation that requires the entire model to be initialized. + +##### Arguments + +- **context**: + + + + +### method model_rebuild + +```python +*, +force: 'bool' = False, +raise_errors: 'bool' = True, +_parent_namespace_depth: 'int' = 2, +_types_namespace: 'MappingNamespace | None' = None +``` + +Try to rebuild the pydantic-core schema for the model. + +This may be necessary when one of the annotations is a ForwardRef which could not be resolved during +the initial attempt to build the schema, and automatic rebuilding fails. + +##### Arguments + +- **force**: Whether to force the rebuilding of the model schema, defaults to `False`. +- **raise_errors**: Whether to raise errors, defaults to `True`. +- **_parent_namespace_depth**: The depth level of the parent namespace, defaults to 2. +- **_types_namespace**: The types namespace, defaults to `None`. + + + + +### method model_validate + +```python +obj: 'Any', *, +strict: 'bool | None' = None, +from_attributes: 'bool | None' = None, +context: 'Any | None' = None, +by_alias: 'bool | None' = None, +by_name: 'bool | None' = None +``` + +Validate a pydantic model instance. + +##### Arguments + +- **obj**: The object to validate. +- **strict**: Whether to enforce types strictly. +- **from_attributes**: Whether to extract data from object attributes. +- **context**: Additional context to pass to the validator. +- **by_alias**: Whether to use the field's alias when validating against the provided input data. +- **by_name**: Whether to use the field's name when validating against the provided input data. + + +##### Raises + +- **ValidationError**: If the object could not be validated. + + +### method model_validate_json + +```python +json_data: 'str | bytes | bytearray', *, +strict: 'bool | None' = None, +context: 'Any | None' = None, +by_alias: 'bool | None' = None, +by_name: 'bool | None' = None +``` + +!!! abstract "Usage Documentation" + [JSON Parsing](../concepts/json.md#json-parsing) + +Validate the given JSON data against the Pydantic model. + +##### Arguments + +- **json_data**: The JSON data to validate. +- **strict**: Whether to enforce types strictly. +- **context**: Extra variables to pass to the validator. +- **by_alias**: Whether to use the field's alias when validating against the provided input data. +- **by_name**: Whether to use the field's name when validating against the provided input data. + + +##### Raises + +- **ValidationError**: If `json_data` is not a JSON string or the object could not be validated. + + +### method model_validate_strings ```python -__init__( - event_type: 'Literal[RUN_STATE]' = RUN_STATE, - scope: 'ProjectScope', - filter: 'RunStateFilter' -) → None +obj: 'Any', *, +strict: 'bool | None' = None, +context: 'Any | None' = None, +by_alias: 'bool | None' = None, +by_name: 'bool | None' = 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. +Validate the given object with string data against the Pydantic model. + +##### Arguments + +- **obj**: The object containing string data to validate. +- **strict**: Whether to enforce types strictly. +- **context**: Extra variables to pass to the validator. +- **by_alias**: Whether to use the field's alias when validating against the provided input data. +- **by_name**: Whether to use the field's name when validating against the provided input data. + + + + +### method parse_file + +```python +path: 'str | Path', *, +content_type: 'str | None' = None, +encoding: 'str' = 'utf8', +proto: 'DeprecatedParseProtocol | None' = None, +allow_pickle: 'bool' = False +``` + + + +##### Arguments + +- **path**: +- **content_type**: +- **encoding**: +- **proto**: +- **allow_pickle**: + + + + +### method parse_obj + +```python +obj: 'Any' +``` + + + +##### Arguments + +- **obj**: + + + + +### method parse_raw + +```python +b: 'str | bytes', *, +content_type: 'str | None' = None, +encoding: 'str' = 'utf8', +proto: 'DeprecatedParseProtocol | None' = None, +allow_pickle: 'bool' = False +``` + + + +##### Arguments + +- **b**: +- **content_type**: +- **encoding**: +- **proto**: +- **allow_pickle**: + + + + +### method schema + +```python +by_alias: 'bool' = True, +ref_template: 'str' = '#/$defs/{model}' +``` + + + +##### Arguments + +- **by_alias**: +- **ref_template**: + + + + +### method schema_json + +```python +*, +by_alias: 'bool' = True, +ref_template: 'str' = '#/$defs/{model}', **dumps_kwargs: 'Any' +``` + + + +##### Arguments + +- **by_alias**: +- **ref_template**: +- **dumps_kwargs**: + + + + +### method then + +```python +self, +action: 'InputAction' +``` + +Define a new Automation in which this event triggers the given action. + +##### Arguments + +- **action**: + + + + +### method update_forward_refs + +```python +**localns: 'Any' +``` + + + +##### Arguments + +- **localns**: + + + + +### method validate + +```python +value: 'Any' +``` + + + +##### Arguments + +- **value**: + + + + + -**Returns:** - An `OnRunState` object. diff --git a/models/ref/python/automations/onunlinkartifact.mdx b/models/ref/python/automations/onunlinkartifact.mdx index 3a63b6bcab..82ffbf221e 100644 --- a/models/ref/python/automations/onunlinkartifact.mdx +++ b/models/ref/python/automations/onunlinkartifact.mdx @@ -1,33 +1,560 @@ --- title: OnUnlinkArtifact -namespace: automations_namespace -python_object_type: class +kind: class +namespace: wandb.automations.events --- + import { GitHubLink } from '/snippets/_includes/github-source-link.mdx'; - + + + +```python +*, +event_type: Literal[UNLINK_ARTIFACT] = UNLINK_ARTIFACT, +scope: typing.Annotated[wandb.automations.scopes._ArtifactSequenceScope | wandb.automations.scopes._ArtifactPortfolioScope | wandb.automations.scopes.ProjectScope, BeforeValidator(func=, json_schema_input_type=PydanticUndefined)], +filter: typing.Annotated[wandb.automations._filters.operators.And | wandb.automations._filters.operators.Or | wandb.automations._filters.operators.Nor | wandb.automations._filters.operators.Not | wandb.automations._filters.operators.Lt | wandb.automations._filters.operators.Gt | wandb.automations._filters.operators.Lte | wandb.automations._filters.operators.Gte | wandb.automations._filters.operators.Eq | wandb.automations._filters.operators.Ne | wandb.automations._filters.operators.In | wandb.automations._filters.operators.NotIn | wandb.automations._filters.operators.Exists | wandb.automations._filters.operators.Regex | wandb.automations._filters.operators.Contains | wandb.automations._filters.expressions.FilterExpr | dict[str, typing.Any], Json, BeforeValidator(func=, json_schema_input_type=PydanticUndefined), PlainSerializer(func=, return_type=PydanticUndefined, when_used='always'), AfterValidator(func=)] = And(()) +``` + +## Description -## class `OnUnlinkArtifact` An artifact version is unlinked from a collection. -### method `OnUnlinkArtifact.__init__` + +## Args + +- **event_type**: +- **scope**: +- **filter**: + + + + + + +## Methods + +### method construct + +```python +_fields_set: 'set[str] | None' = None, **values: 'Any' +``` + + + +##### Arguments + +- **_fields_set**: +- **values**: + + + + +### method copy + +```python +self, *, +include: 'AbstractSetIntStr | MappingIntStrAny | None' = None, +exclude: 'AbstractSetIntStr | MappingIntStrAny | None' = None, +update: 'Dict[str, Any] | None' = None, +deep: 'bool' = False +``` + +Returns a copy of the model. + +!!! warning "Deprecated" + This method is now deprecated; use `model_copy` instead. + +If you need `include` or `exclude`, use: + +```python {test="skip" lint="skip"} +data = self.model_dump(include=include, exclude=exclude, round_trip=True) +data = {**data, **(update or {})} +copied = self.model_validate(data) +``` + +##### Arguments + +- **include**: Optional set or mapping specifying which fields to include in the copied model. +- **exclude**: Optional set or mapping specifying which fields to exclude in the copied model. +- **update**: Optional dictionary of field-value pairs to override field values in the copied model. +- **deep**: If True, the values of fields that are Pydantic models will be deep-copied. + + + + +### method dict + +```python +self, *, +include: 'IncEx | None' = None, +exclude: 'IncEx | None' = None, +by_alias: 'bool' = False, +exclude_unset: 'bool' = False, +exclude_defaults: 'bool' = False, +exclude_none: 'bool' = False +``` + + + +##### Arguments + +- **include**: +- **exclude**: +- **by_alias**: +- **exclude_unset**: +- **exclude_defaults**: +- **exclude_none**: + + + + +### method from_orm + +```python +obj: 'Any' +``` + + + +##### Arguments + +- **obj**: + + + + +### method json + +```python +self, *, +include: 'IncEx | None' = None, +exclude: 'IncEx | None' = None, +by_alias: 'bool' = False, +exclude_unset: 'bool' = False, +exclude_defaults: 'bool' = False, +exclude_none: 'bool' = False, +encoder: 'Callable[[Any], Any] | None' = PydanticUndefined, +models_as_dict: 'bool' = PydanticUndefined, **dumps_kwargs: 'Any' +``` + + + +##### Arguments + +- **include**: +- **exclude**: +- **by_alias**: +- **exclude_unset**: +- **exclude_defaults**: +- **exclude_none**: +- **encoder**: +- **models_as_dict**: +- **dumps_kwargs**: + + + + +### method model_construct + +```python +_fields_set: 'set[str] | None' = None, **values: 'Any' +``` + +Creates a new instance of the `Model` class with validated data. + +Creates a new model setting `__dict__` and `__pydantic_fields_set__` from trusted or pre-validated data. +Default values are respected, but no other validation is performed. + +!!! note + `model_construct()` generally respects the `model_config.extra` setting on the provided model. + That is, if `model_config.extra == 'allow'`, then all extra passed values are added to the model instance's `__dict__` + and `__pydantic_extra__` fields. If `model_config.extra == 'ignore'` (the default), then all extra passed values are ignored. + Because no validation is performed with a call to `model_construct()`, having `model_config.extra == 'forbid'` does not result in + an error if extra values are passed, but they will be ignored. + +##### Arguments + +- **_fields_set**: A set of field names that were originally explicitly set during instantiation. If provided, this is directly used for the [`model_fields_set`][pydantic.BaseModel.model_fields_set] attribute. Otherwise, the field names from the `values` argument will be used. +- **values**: Trusted or pre-validated data dictionary. + + + + +### method model_copy + +```python +self, *, +update: 'Mapping[str, Any] | None' = None, +deep: 'bool' = False +``` + +!!! abstract "Usage Documentation" + [`model_copy`](../concepts/serialization.md#model_copy) + +Returns a copy of the model. + +!!! note + The underlying instance's [`__dict__`][object.__dict__] attribute is copied. This + might have unexpected side effects if you store anything in it, on top of the model + fields (e.g. the value of [cached properties][functools.cached_property]). + +##### Arguments + +- **update**: Values to change/add in the new model. Note: the data is not validated before creating the new model. You should trust this data. +- **deep**: Set to `True` to make a deep copy of the model. + + + + +### method model_dump + +```python +self, *, +mode: 'str' = 'json', **kwargs: 'Any' +``` + +!!! abstract "Usage Documentation" + [`model_dump`](../concepts/serialization.md#modelmodel_dump) + +Generate a dictionary representation of the model, optionally specifying which fields to include or exclude. + +##### Arguments + +- **mode**: The mode in which `to_python` should run. If mode is 'json', the output will only contain JSON serializable types. If mode is 'python', the output may contain non-JSON-serializable Python objects. +- **kwargs**: + + + + +### method model_dump_json + +```python +self, *, +indent: 'int | None' = None, **kwargs: 'Any' +``` + +!!! abstract "Usage Documentation" + [`model_dump_json`](../concepts/serialization.md#modelmodel_dump_json) + +Generates a JSON representation of the model using Pydantic's `to_json` method. + +##### Arguments + +- **indent**: Indentation to use in the JSON output. If None is passed, the output will be compact. +- **kwargs**: + + + + +### method model_json_schema ```python -__init__( - event_type: 'Literal[UNLINK_ARTIFACT]' = UNLINK_ARTIFACT, - scope: 'wandb.automations.scopes._ArtifactSequenceScope | wandb.automations.scopes._ArtifactPortfolioScope | wandb.automations.scopes.ProjectScope', - filter: 'wandb.automations._filters.operators.And | wandb.automations._filters.operators.Or | wandb.automations._filters.operators.Nor | wandb.automations._filters.operators.Not | wandb.automations._filters.operators.Lt | wandb.automations._filters.operators.Gt | wandb.automations._filters.operators.Lte | wandb.automations._filters.operators.Gte | wandb.automations._filters.operators.Eq | wandb.automations._filters.operators.Ne | wandb.automations._filters.operators.In | wandb.automations._filters.operators.NotIn | wandb.automations._filters.operators.Exists | wandb.automations._filters.operators.Regex | wandb.automations._filters.operators.Contains | wandb.automations._filters.expressions.FilterExpr | dict[str, Any]' = And(()) -) → None +by_alias: 'bool' = True, +ref_template: 'str' = '#/$defs/{model}', +schema_generator: 'type[GenerateJsonSchema]' = , +mode: 'JsonSchemaMode' = 'validation' ``` -**Args:** - - - `event_type` (Literal[UNLINK_ARTIFACT]): - - `scope` (wandb.automations.scopes._ArtifactSequenceScope | wandb.automations.scopes._ArtifactPortfolioScope | wandb.automations.scopes.ProjectScope): The scope of the event. - - `filter` (wandb.automations._filters.operators.And | wandb.automations._filters.operators.Or | wandb.automations._filters.operators.Nor | wandb.automations._filters.operators.Not | wandb.automations._filters.operators.Lt | wandb.automations._filters.operators.Gt | wandb.automations._filters.operators.Lte | wandb.automations._filters.operators.Gte | wandb.automations._filters.operators.Eq | wandb.automations._filters.operators.Ne | wandb.automations._filters.operators.In | wandb.automations._filters.operators.NotIn | wandb.automations._filters.operators.Exists | wandb.automations._filters.operators.Regex | wandb.automations._filters.operators.Contains | wandb.automations._filters.expressions.FilterExpr | dict[str, Any]): Additional conditions(s), if any, that are required for this event to trigger. +Generates a JSON schema for a model class. + +##### Arguments + +- **by_alias**: Whether to use attribute aliases or not. +- **ref_template**: The reference template. +- **schema_generator**: To override the logic used to generate the JSON schema, as a subclass of `GenerateJsonSchema` with your desired modifications +- **mode**: The mode in which to generate the schema. + + + + +### method model_parametrized_name + +```python +params: 'tuple[type[Any], ...]' +``` + +Compute the class name for parametrizations of generic classes. + +This method can be overridden to achieve a custom naming scheme for generic BaseModels. + +##### Arguments + +- **params**: Tuple of types of the class. Given a generic class `Model` with 2 type variables and a concrete model `Model[str, int]`, the value `(str, int)` would be passed to `params`. + + +##### Raises + +- **TypeError**: Raised when trying to generate concrete names for non-generic models. + + +### method model_post_init + +```python +self, +context: 'Any', / +``` + +Override this method to perform additional initialization after `__init__` and `model_construct`. +This is useful if you want to do some validation that requires the entire model to be initialized. + +##### Arguments + +- **context**: + + + + +### method model_rebuild + +```python +*, +force: 'bool' = False, +raise_errors: 'bool' = True, +_parent_namespace_depth: 'int' = 2, +_types_namespace: 'MappingNamespace | None' = None +``` + +Try to rebuild the pydantic-core schema for the model. + +This may be necessary when one of the annotations is a ForwardRef which could not be resolved during +the initial attempt to build the schema, and automatic rebuilding fails. + +##### Arguments + +- **force**: Whether to force the rebuilding of the model schema, defaults to `False`. +- **raise_errors**: Whether to raise errors, defaults to `True`. +- **_parent_namespace_depth**: The depth level of the parent namespace, defaults to 2. +- **_types_namespace**: The types namespace, defaults to `None`. + + + + +### method model_validate + +```python +obj: 'Any', *, +strict: 'bool | None' = None, +from_attributes: 'bool | None' = None, +context: 'Any | None' = None, +by_alias: 'bool | None' = None, +by_name: 'bool | None' = None +``` + +Validate a pydantic model instance. + +##### Arguments + +- **obj**: The object to validate. +- **strict**: Whether to enforce types strictly. +- **from_attributes**: Whether to extract data from object attributes. +- **context**: Additional context to pass to the validator. +- **by_alias**: Whether to use the field's alias when validating against the provided input data. +- **by_name**: Whether to use the field's name when validating against the provided input data. + + +##### Raises + +- **ValidationError**: If the object could not be validated. + + +### method model_validate_json + +```python +json_data: 'str | bytes | bytearray', *, +strict: 'bool | None' = None, +context: 'Any | None' = None, +by_alias: 'bool | None' = None, +by_name: 'bool | None' = None +``` + +!!! abstract "Usage Documentation" + [JSON Parsing](../concepts/json.md#json-parsing) + +Validate the given JSON data against the Pydantic model. + +##### Arguments + +- **json_data**: The JSON data to validate. +- **strict**: Whether to enforce types strictly. +- **context**: Extra variables to pass to the validator. +- **by_alias**: Whether to use the field's alias when validating against the provided input data. +- **by_name**: Whether to use the field's name when validating against the provided input data. + + +##### Raises + +- **ValidationError**: If `json_data` is not a JSON string or the object could not be validated. + + +### method model_validate_strings + +```python +obj: 'Any', *, +strict: 'bool | None' = None, +context: 'Any | None' = None, +by_alias: 'bool | None' = None, +by_name: 'bool | None' = None +``` + +Validate the given object with string data against the Pydantic model. + +##### Arguments + +- **obj**: The object containing string data to validate. +- **strict**: Whether to enforce types strictly. +- **context**: Extra variables to pass to the validator. +- **by_alias**: Whether to use the field's alias when validating against the provided input data. +- **by_name**: Whether to use the field's name when validating against the provided input data. + + + + +### method parse_file + +```python +path: 'str | Path', *, +content_type: 'str | None' = None, +encoding: 'str' = 'utf8', +proto: 'DeprecatedParseProtocol | None' = None, +allow_pickle: 'bool' = False +``` + + + +##### Arguments + +- **path**: +- **content_type**: +- **encoding**: +- **proto**: +- **allow_pickle**: + + + + +### method parse_obj + +```python +obj: 'Any' +``` + + + +##### Arguments + +- **obj**: + + + + +### method parse_raw + +```python +b: 'str | bytes', *, +content_type: 'str | None' = None, +encoding: 'str' = 'utf8', +proto: 'DeprecatedParseProtocol | None' = None, +allow_pickle: 'bool' = False +``` + + + +##### Arguments + +- **b**: +- **content_type**: +- **encoding**: +- **proto**: +- **allow_pickle**: + + + + +### method schema + +```python +by_alias: 'bool' = True, +ref_template: 'str' = '#/$defs/{model}' +``` + + + +##### Arguments + +- **by_alias**: +- **ref_template**: + + + + +### method schema_json + +```python +*, +by_alias: 'bool' = True, +ref_template: 'str' = '#/$defs/{model}', **dumps_kwargs: 'Any' +``` + + + +##### Arguments + +- **by_alias**: +- **ref_template**: +- **dumps_kwargs**: + + + + +### method then + +```python +self, +action: 'InputAction' +``` + +Define a new Automation in which this event triggers the given action. + +##### Arguments + +- **action**: + + + + +### method update_forward_refs + +```python +**localns: 'Any' +``` + + + +##### Arguments + +- **localns**: + + + + +### method validate + +```python +value: 'Any' +``` + + + +##### Arguments + +- **value**: + + + + + -**Returns:** - An `OnUnlinkArtifact` object. diff --git a/models/ref/python/automations/runstatefilter.mdx b/models/ref/python/automations/runstatefilter.mdx index 63ac6313cf..817f3d2c32 100644 --- a/models/ref/python/automations/runstatefilter.mdx +++ b/models/ref/python/automations/runstatefilter.mdx @@ -1,31 +1,542 @@ --- title: RunStateFilter -namespace: automations_namespace -python_object_type: class +kind: class +namespace: wandb.automations.events --- + import { GitHubLink } from '/snippets/_includes/github-source-link.mdx'; - + + + +```python +*, +run_filter: typing.Annotated[wandb.automations._filters.operators.And | wandb.automations._filters.operators.Or | wandb.automations._filters.operators.Nor | wandb.automations._filters.operators.Not | wandb.automations._filters.operators.Lt | wandb.automations._filters.operators.Gt | wandb.automations._filters.operators.Lte | wandb.automations._filters.operators.Gte | wandb.automations._filters.operators.Eq | wandb.automations._filters.operators.Ne | wandb.automations._filters.operators.In | wandb.automations._filters.operators.NotIn | wandb.automations._filters.operators.Exists | wandb.automations._filters.operators.Regex | wandb.automations._filters.operators.Contains | wandb.automations._filters.expressions.FilterExpr | dict[str, typing.Any], Json, BeforeValidator(func=, json_schema_input_type=PydanticUndefined), PlainSerializer(func=, return_type=PydanticUndefined, when_used='always'), AfterValidator(func=)] = And(()), +run_state_filter: wandb.automations._filters.run_states.StateFilter +``` + +## Description -## class `RunStateFilter` Represents a filter for triggering events based on changes in run states. -### method `RunStateFilter.__init__` + +## Args + +- **run_filter**: +- **run_state_filter**: + + + + + + +## Methods + +### method construct + +```python +_fields_set: 'set[str] | None' = None, **values: 'Any' +``` + + + +##### Arguments + +- **_fields_set**: +- **values**: + + + + +### method copy + +```python +self, *, +include: 'AbstractSetIntStr | MappingIntStrAny | None' = None, +exclude: 'AbstractSetIntStr | MappingIntStrAny | None' = None, +update: 'Dict[str, Any] | None' = None, +deep: 'bool' = False +``` + +Returns a copy of the model. + +!!! warning "Deprecated" + This method is now deprecated; use `model_copy` instead. + +If you need `include` or `exclude`, use: + +```python {test="skip" lint="skip"} +data = self.model_dump(include=include, exclude=exclude, round_trip=True) +data = {**data, **(update or {})} +copied = self.model_validate(data) +``` + +##### Arguments + +- **include**: Optional set or mapping specifying which fields to include in the copied model. +- **exclude**: Optional set or mapping specifying which fields to exclude in the copied model. +- **update**: Optional dictionary of field-value pairs to override field values in the copied model. +- **deep**: If True, the values of fields that are Pydantic models will be deep-copied. + + + + +### method dict + +```python +self, *, +include: 'IncEx | None' = None, +exclude: 'IncEx | None' = None, +by_alias: 'bool' = False, +exclude_unset: 'bool' = False, +exclude_defaults: 'bool' = False, +exclude_none: 'bool' = False +``` + + + +##### Arguments + +- **include**: +- **exclude**: +- **by_alias**: +- **exclude_unset**: +- **exclude_defaults**: +- **exclude_none**: + + + + +### method from_orm ```python -__init__( - run: 'wandb.automations._filters.operators.And | wandb.automations._filters.operators.Or | wandb.automations._filters.operators.Nor | wandb.automations._filters.operators.Not | wandb.automations._filters.operators.Lt | wandb.automations._filters.operators.Gt | wandb.automations._filters.operators.Lte | wandb.automations._filters.operators.Gte | wandb.automations._filters.operators.Eq | wandb.automations._filters.operators.Ne | wandb.automations._filters.operators.In | wandb.automations._filters.operators.NotIn | wandb.automations._filters.operators.Exists | wandb.automations._filters.operators.Regex | wandb.automations._filters.operators.Contains | wandb.automations._filters.expressions.FilterExpr | dict[str, Any]' = And(()), - state: 'StateFilter' -) → None +obj: 'Any' ``` -**Args:** - - - `run` (wandb.automations._filters.operators.And | wandb.automations._filters.operators.Or | wandb.automations._filters.operators.Nor | wandb.automations._filters.operators.Not | wandb.automations._filters.operators.Lt | wandb.automations._filters.operators.Gt | wandb.automations._filters.operators.Lte | wandb.automations._filters.operators.Gte | wandb.automations._filters.operators.Eq | wandb.automations._filters.operators.Ne | wandb.automations._filters.operators.In | wandb.automations._filters.operators.NotIn | wandb.automations._filters.operators.Exists | wandb.automations._filters.operators.Regex | wandb.automations._filters.operators.Contains | wandb.automations._filters.expressions.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. + +##### Arguments + +- **obj**: + + + + +### method json + +```python +self, *, +include: 'IncEx | None' = None, +exclude: 'IncEx | None' = None, +by_alias: 'bool' = False, +exclude_unset: 'bool' = False, +exclude_defaults: 'bool' = False, +exclude_none: 'bool' = False, +encoder: 'Callable[[Any], Any] | None' = PydanticUndefined, +models_as_dict: 'bool' = PydanticUndefined, **dumps_kwargs: 'Any' +``` + + + +##### Arguments + +- **include**: +- **exclude**: +- **by_alias**: +- **exclude_unset**: +- **exclude_defaults**: +- **exclude_none**: +- **encoder**: +- **models_as_dict**: +- **dumps_kwargs**: + + + + +### method model_construct + +```python +_fields_set: 'set[str] | None' = None, **values: 'Any' +``` + +Creates a new instance of the `Model` class with validated data. + +Creates a new model setting `__dict__` and `__pydantic_fields_set__` from trusted or pre-validated data. +Default values are respected, but no other validation is performed. + +!!! note + `model_construct()` generally respects the `model_config.extra` setting on the provided model. + That is, if `model_config.extra == 'allow'`, then all extra passed values are added to the model instance's `__dict__` + and `__pydantic_extra__` fields. If `model_config.extra == 'ignore'` (the default), then all extra passed values are ignored. + Because no validation is performed with a call to `model_construct()`, having `model_config.extra == 'forbid'` does not result in + an error if extra values are passed, but they will be ignored. + +##### Arguments + +- **_fields_set**: A set of field names that were originally explicitly set during instantiation. If provided, this is directly used for the [`model_fields_set`][pydantic.BaseModel.model_fields_set] attribute. Otherwise, the field names from the `values` argument will be used. +- **values**: Trusted or pre-validated data dictionary. + + + + +### method model_copy + +```python +self, *, +update: 'Mapping[str, Any] | None' = None, +deep: 'bool' = False +``` + +!!! abstract "Usage Documentation" + [`model_copy`](../concepts/serialization.md#model_copy) + +Returns a copy of the model. + +!!! note + The underlying instance's [`__dict__`][object.__dict__] attribute is copied. This + might have unexpected side effects if you store anything in it, on top of the model + fields (e.g. the value of [cached properties][functools.cached_property]). + +##### Arguments + +- **update**: Values to change/add in the new model. Note: the data is not validated before creating the new model. You should trust this data. +- **deep**: Set to `True` to make a deep copy of the model. + + + + +### method model_dump + +```python +self, *, +mode: 'str' = 'json', **kwargs: 'Any' +``` + +!!! abstract "Usage Documentation" + [`model_dump`](../concepts/serialization.md#modelmodel_dump) + +Generate a dictionary representation of the model, optionally specifying which fields to include or exclude. + +##### Arguments + +- **mode**: The mode in which `to_python` should run. If mode is 'json', the output will only contain JSON serializable types. If mode is 'python', the output may contain non-JSON-serializable Python objects. +- **kwargs**: + + + + +### method model_dump_json + +```python +self, *, +indent: 'int | None' = None, **kwargs: 'Any' +``` + +!!! abstract "Usage Documentation" + [`model_dump_json`](../concepts/serialization.md#modelmodel_dump_json) + +Generates a JSON representation of the model using Pydantic's `to_json` method. + +##### Arguments + +- **indent**: Indentation to use in the JSON output. If None is passed, the output will be compact. +- **kwargs**: + + + + +### method model_json_schema + +```python +by_alias: 'bool' = True, +ref_template: 'str' = '#/$defs/{model}', +schema_generator: 'type[GenerateJsonSchema]' = , +mode: 'JsonSchemaMode' = 'validation' +``` + +Generates a JSON schema for a model class. + +##### Arguments + +- **by_alias**: Whether to use attribute aliases or not. +- **ref_template**: The reference template. +- **schema_generator**: To override the logic used to generate the JSON schema, as a subclass of `GenerateJsonSchema` with your desired modifications +- **mode**: The mode in which to generate the schema. + + + + +### method model_parametrized_name + +```python +params: 'tuple[type[Any], ...]' +``` + +Compute the class name for parametrizations of generic classes. + +This method can be overridden to achieve a custom naming scheme for generic BaseModels. + +##### Arguments + +- **params**: Tuple of types of the class. Given a generic class `Model` with 2 type variables and a concrete model `Model[str, int]`, the value `(str, int)` would be passed to `params`. + + +##### Raises + +- **TypeError**: Raised when trying to generate concrete names for non-generic models. + + +### method model_post_init + +```python +self, +context: 'Any', / +``` + +Override this method to perform additional initialization after `__init__` and `model_construct`. +This is useful if you want to do some validation that requires the entire model to be initialized. + +##### Arguments + +- **context**: + + + + +### method model_rebuild + +```python +*, +force: 'bool' = False, +raise_errors: 'bool' = True, +_parent_namespace_depth: 'int' = 2, +_types_namespace: 'MappingNamespace | None' = None +``` + +Try to rebuild the pydantic-core schema for the model. + +This may be necessary when one of the annotations is a ForwardRef which could not be resolved during +the initial attempt to build the schema, and automatic rebuilding fails. + +##### Arguments + +- **force**: Whether to force the rebuilding of the model schema, defaults to `False`. +- **raise_errors**: Whether to raise errors, defaults to `True`. +- **_parent_namespace_depth**: The depth level of the parent namespace, defaults to 2. +- **_types_namespace**: The types namespace, defaults to `None`. + + + + +### method model_validate + +```python +obj: 'Any', *, +strict: 'bool | None' = None, +from_attributes: 'bool | None' = None, +context: 'Any | None' = None, +by_alias: 'bool | None' = None, +by_name: 'bool | None' = None +``` + +Validate a pydantic model instance. + +##### Arguments + +- **obj**: The object to validate. +- **strict**: Whether to enforce types strictly. +- **from_attributes**: Whether to extract data from object attributes. +- **context**: Additional context to pass to the validator. +- **by_alias**: Whether to use the field's alias when validating against the provided input data. +- **by_name**: Whether to use the field's name when validating against the provided input data. + + +##### Raises + +- **ValidationError**: If the object could not be validated. + + +### method model_validate_json + +```python +json_data: 'str | bytes | bytearray', *, +strict: 'bool | None' = None, +context: 'Any | None' = None, +by_alias: 'bool | None' = None, +by_name: 'bool | None' = None +``` + +!!! abstract "Usage Documentation" + [JSON Parsing](../concepts/json.md#json-parsing) + +Validate the given JSON data against the Pydantic model. + +##### Arguments + +- **json_data**: The JSON data to validate. +- **strict**: Whether to enforce types strictly. +- **context**: Extra variables to pass to the validator. +- **by_alias**: Whether to use the field's alias when validating against the provided input data. +- **by_name**: Whether to use the field's name when validating against the provided input data. + + +##### Raises + +- **ValidationError**: If `json_data` is not a JSON string or the object could not be validated. + + +### method model_validate_strings + +```python +obj: 'Any', *, +strict: 'bool | None' = None, +context: 'Any | None' = None, +by_alias: 'bool | None' = None, +by_name: 'bool | None' = None +``` + +Validate the given object with string data against the Pydantic model. + +##### Arguments + +- **obj**: The object containing string data to validate. +- **strict**: Whether to enforce types strictly. +- **context**: Extra variables to pass to the validator. +- **by_alias**: Whether to use the field's alias when validating against the provided input data. +- **by_name**: Whether to use the field's name when validating against the provided input data. + + + + +### method parse_file + +```python +path: 'str | Path', *, +content_type: 'str | None' = None, +encoding: 'str' = 'utf8', +proto: 'DeprecatedParseProtocol | None' = None, +allow_pickle: 'bool' = False +``` + + + +##### Arguments + +- **path**: +- **content_type**: +- **encoding**: +- **proto**: +- **allow_pickle**: + + + + +### method parse_obj + +```python +obj: 'Any' +``` + + + +##### Arguments + +- **obj**: + + + + +### method parse_raw + +```python +b: 'str | bytes', *, +content_type: 'str | None' = None, +encoding: 'str' = 'utf8', +proto: 'DeprecatedParseProtocol | None' = None, +allow_pickle: 'bool' = False +``` + + + +##### Arguments + +- **b**: +- **content_type**: +- **encoding**: +- **proto**: +- **allow_pickle**: + + + + +### method schema + +```python +by_alias: 'bool' = True, +ref_template: 'str' = '#/$defs/{model}' +``` + + + +##### Arguments + +- **by_alias**: +- **ref_template**: + + + + +### method schema_json + +```python +*, +by_alias: 'bool' = True, +ref_template: 'str' = '#/$defs/{model}', **dumps_kwargs: 'Any' +``` + + + +##### Arguments + +- **by_alias**: +- **ref_template**: +- **dumps_kwargs**: + + + + +### method update_forward_refs + +```python +**localns: 'Any' +``` + + + +##### Arguments + +- **localns**: + + + + +### method validate + +```python +value: 'Any' +``` + + + +##### Arguments + +- **value**: + + + + + + diff --git a/models/ref/python/automations/sendnotification.mdx b/models/ref/python/automations/sendnotification.mdx index 5613f57f5d..58ef819062 100644 --- a/models/ref/python/automations/sendnotification.mdx +++ b/models/ref/python/automations/sendnotification.mdx @@ -1,50 +1,569 @@ --- title: SendNotification -namespace: automations_namespace -python_object_type: class +kind: class +namespace: wandb.automations.actions --- + import { GitHubLink } from '/snippets/_includes/github-source-link.mdx'; - + + + +```python +*, +integration_id: typing.Annotated[str, Strict(strict=True)], +text: typing.Annotated[str, BeforeValidator(func=, json_schema_input_type=PydanticUndefined)] = '', +level: typing.Annotated[wandb.automations._generated.enums.AlertSeverity, BeforeValidator(func=, json_schema_input_type=PydanticUndefined), BeforeValidator(func=, json_schema_input_type=PydanticUndefined)] = , +title: typing.Annotated[str, BeforeValidator(func=, json_schema_input_type=PydanticUndefined)] = '', +action_type: Literal[NOTIFICATION] = NOTIFICATION +``` + +## Description -## class `SendNotification` Defines an automation action that sends a (Slack) notification. -### method `SendNotification.__init__` + +## Args + +- **integration_id**: +- **text**: +- **level**: +- **title**: +- **action_type**: + + + + + + +## Methods + +### method construct ```python -__init__( - integration_id: 'str', - message: 'str' = '', - severity: 'AlertSeverity' = , - title: 'str' = '', - action_type: 'Literal[NOTIFICATION]' = NOTIFICATION -) → None +_fields_set: 'set[str] | None' = None, **values: 'Any' ``` -**Args:** - - - `integration_id` (str): The ID of the Slack integration that will be used to send the notification. - - `message` (str): The message body of the sent notification. - - `severity` (AlertSeverity): The severity (`INFO`, `WARN`, `ERROR`) of the sent notification. - - `title` (str): The title of the sent notification. - - `action_type` (Literal[NOTIFICATION]): -**Returns:** - An `SendNotification` object. -### classmethod `SendNotification.from_integration` +##### Arguments + +- **_fields_set**: +- **values**: + + + + +### method copy ```python -from_integration( - integration: 'SlackIntegration', - title: 'str' = '', - text: 'str' = '', - level: 'AlertSeverity' = -) → Self +self, *, +include: 'AbstractSetIntStr | MappingIntStrAny | None' = None, +exclude: 'AbstractSetIntStr | MappingIntStrAny | None' = None, +update: 'Dict[str, Any] | None' = None, +deep: 'bool' = False +``` + +Returns a copy of the model. + +!!! warning "Deprecated" + This method is now deprecated; use `model_copy` instead. + +If you need `include` or `exclude`, use: + +```python {test="skip" lint="skip"} +data = self.model_dump(include=include, exclude=exclude, round_trip=True) +data = {**data, **(update or {})} +copied = self.model_validate(data) +``` + +##### Arguments + +- **include**: Optional set or mapping specifying which fields to include in the copied model. +- **exclude**: Optional set or mapping specifying which fields to exclude in the copied model. +- **update**: Optional dictionary of field-value pairs to override field values in the copied model. +- **deep**: If True, the values of fields that are Pydantic models will be deep-copied. + + + + +### method dict + +```python +self, *, +include: 'IncEx | None' = None, +exclude: 'IncEx | None' = None, +by_alias: 'bool' = False, +exclude_unset: 'bool' = False, +exclude_defaults: 'bool' = False, +exclude_none: 'bool' = False +``` + + + +##### Arguments + +- **include**: +- **exclude**: +- **by_alias**: +- **exclude_unset**: +- **exclude_defaults**: +- **exclude_none**: + + + + +### method from_integration + +```python +integration: 'SlackIntegration', *, +title: 'str' = '', +text: 'str' = '', +level: 'AlertSeverity' = ``` Define a notification action that sends to the given (Slack) integration. + +##### Arguments + +- **integration**: +- **title**: +- **text**: +- **level**: + + + + +### method from_orm + +```python +obj: 'Any' +``` + + + +##### Arguments + +- **obj**: + + + + +### method json + +```python +self, *, +include: 'IncEx | None' = None, +exclude: 'IncEx | None' = None, +by_alias: 'bool' = False, +exclude_unset: 'bool' = False, +exclude_defaults: 'bool' = False, +exclude_none: 'bool' = False, +encoder: 'Callable[[Any], Any] | None' = PydanticUndefined, +models_as_dict: 'bool' = PydanticUndefined, **dumps_kwargs: 'Any' +``` + + + +##### Arguments + +- **include**: +- **exclude**: +- **by_alias**: +- **exclude_unset**: +- **exclude_defaults**: +- **exclude_none**: +- **encoder**: +- **models_as_dict**: +- **dumps_kwargs**: + + + + +### method model_construct + +```python +_fields_set: 'set[str] | None' = None, **values: 'Any' +``` + +Creates a new instance of the `Model` class with validated data. + +Creates a new model setting `__dict__` and `__pydantic_fields_set__` from trusted or pre-validated data. +Default values are respected, but no other validation is performed. + +!!! note + `model_construct()` generally respects the `model_config.extra` setting on the provided model. + That is, if `model_config.extra == 'allow'`, then all extra passed values are added to the model instance's `__dict__` + and `__pydantic_extra__` fields. If `model_config.extra == 'ignore'` (the default), then all extra passed values are ignored. + Because no validation is performed with a call to `model_construct()`, having `model_config.extra == 'forbid'` does not result in + an error if extra values are passed, but they will be ignored. + +##### Arguments + +- **_fields_set**: A set of field names that were originally explicitly set during instantiation. If provided, this is directly used for the [`model_fields_set`][pydantic.BaseModel.model_fields_set] attribute. Otherwise, the field names from the `values` argument will be used. +- **values**: Trusted or pre-validated data dictionary. + + + + +### method model_copy + +```python +self, *, +update: 'Mapping[str, Any] | None' = None, +deep: 'bool' = False +``` + +!!! abstract "Usage Documentation" + [`model_copy`](../concepts/serialization.md#model_copy) + +Returns a copy of the model. + +!!! note + The underlying instance's [`__dict__`][object.__dict__] attribute is copied. This + might have unexpected side effects if you store anything in it, on top of the model + fields (e.g. the value of [cached properties][functools.cached_property]). + +##### Arguments + +- **update**: Values to change/add in the new model. Note: the data is not validated before creating the new model. You should trust this data. +- **deep**: Set to `True` to make a deep copy of the model. + + + + +### method model_dump + +```python +self, *, +mode: 'str' = 'json', **kwargs: 'Any' +``` + +!!! abstract "Usage Documentation" + [`model_dump`](../concepts/serialization.md#modelmodel_dump) + +Generate a dictionary representation of the model, optionally specifying which fields to include or exclude. + +##### Arguments + +- **mode**: The mode in which `to_python` should run. If mode is 'json', the output will only contain JSON serializable types. If mode is 'python', the output may contain non-JSON-serializable Python objects. +- **kwargs**: + + + + +### method model_dump_json + +```python +self, *, +indent: 'int | None' = None, **kwargs: 'Any' +``` + +!!! abstract "Usage Documentation" + [`model_dump_json`](../concepts/serialization.md#modelmodel_dump_json) + +Generates a JSON representation of the model using Pydantic's `to_json` method. + +##### Arguments + +- **indent**: Indentation to use in the JSON output. If None is passed, the output will be compact. +- **kwargs**: + + + + +### method model_json_schema + +```python +by_alias: 'bool' = True, +ref_template: 'str' = '#/$defs/{model}', +schema_generator: 'type[GenerateJsonSchema]' = , +mode: 'JsonSchemaMode' = 'validation' +``` + +Generates a JSON schema for a model class. + +##### Arguments + +- **by_alias**: Whether to use attribute aliases or not. +- **ref_template**: The reference template. +- **schema_generator**: To override the logic used to generate the JSON schema, as a subclass of `GenerateJsonSchema` with your desired modifications +- **mode**: The mode in which to generate the schema. + + + + +### method model_parametrized_name + +```python +params: 'tuple[type[Any], ...]' +``` + +Compute the class name for parametrizations of generic classes. + +This method can be overridden to achieve a custom naming scheme for generic BaseModels. + +##### Arguments + +- **params**: Tuple of types of the class. Given a generic class `Model` with 2 type variables and a concrete model `Model[str, int]`, the value `(str, int)` would be passed to `params`. + + +##### Raises + +- **TypeError**: Raised when trying to generate concrete names for non-generic models. + + +### method model_post_init + +```python +self, +context: 'Any', / +``` + +Override this method to perform additional initialization after `__init__` and `model_construct`. +This is useful if you want to do some validation that requires the entire model to be initialized. + +##### Arguments + +- **context**: + + + + +### method model_rebuild + +```python +*, +force: 'bool' = False, +raise_errors: 'bool' = True, +_parent_namespace_depth: 'int' = 2, +_types_namespace: 'MappingNamespace | None' = None +``` + +Try to rebuild the pydantic-core schema for the model. + +This may be necessary when one of the annotations is a ForwardRef which could not be resolved during +the initial attempt to build the schema, and automatic rebuilding fails. + +##### Arguments + +- **force**: Whether to force the rebuilding of the model schema, defaults to `False`. +- **raise_errors**: Whether to raise errors, defaults to `True`. +- **_parent_namespace_depth**: The depth level of the parent namespace, defaults to 2. +- **_types_namespace**: The types namespace, defaults to `None`. + + + + +### method model_validate + +```python +obj: 'Any', *, +strict: 'bool | None' = None, +from_attributes: 'bool | None' = None, +context: 'Any | None' = None, +by_alias: 'bool | None' = None, +by_name: 'bool | None' = None +``` + +Validate a pydantic model instance. + +##### Arguments + +- **obj**: The object to validate. +- **strict**: Whether to enforce types strictly. +- **from_attributes**: Whether to extract data from object attributes. +- **context**: Additional context to pass to the validator. +- **by_alias**: Whether to use the field's alias when validating against the provided input data. +- **by_name**: Whether to use the field's name when validating against the provided input data. + + +##### Raises + +- **ValidationError**: If the object could not be validated. + + +### method model_validate_json + +```python +json_data: 'str | bytes | bytearray', *, +strict: 'bool | None' = None, +context: 'Any | None' = None, +by_alias: 'bool | None' = None, +by_name: 'bool | None' = None +``` + +!!! abstract "Usage Documentation" + [JSON Parsing](../concepts/json.md#json-parsing) + +Validate the given JSON data against the Pydantic model. + +##### Arguments + +- **json_data**: The JSON data to validate. +- **strict**: Whether to enforce types strictly. +- **context**: Extra variables to pass to the validator. +- **by_alias**: Whether to use the field's alias when validating against the provided input data. +- **by_name**: Whether to use the field's name when validating against the provided input data. + + +##### Raises + +- **ValidationError**: If `json_data` is not a JSON string or the object could not be validated. + + +### method model_validate_strings + +```python +obj: 'Any', *, +strict: 'bool | None' = None, +context: 'Any | None' = None, +by_alias: 'bool | None' = None, +by_name: 'bool | None' = None +``` + +Validate the given object with string data against the Pydantic model. + +##### Arguments + +- **obj**: The object containing string data to validate. +- **strict**: Whether to enforce types strictly. +- **context**: Extra variables to pass to the validator. +- **by_alias**: Whether to use the field's alias when validating against the provided input data. +- **by_name**: Whether to use the field's name when validating against the provided input data. + + + + +### method parse_file + +```python +path: 'str | Path', *, +content_type: 'str | None' = None, +encoding: 'str' = 'utf8', +proto: 'DeprecatedParseProtocol | None' = None, +allow_pickle: 'bool' = False +``` + + + +##### Arguments + +- **path**: +- **content_type**: +- **encoding**: +- **proto**: +- **allow_pickle**: + + + + +### method parse_obj + +```python +obj: 'Any' +``` + + + +##### Arguments + +- **obj**: + + + + +### method parse_raw + +```python +b: 'str | bytes', *, +content_type: 'str | None' = None, +encoding: 'str' = 'utf8', +proto: 'DeprecatedParseProtocol | None' = None, +allow_pickle: 'bool' = False +``` + + + +##### Arguments + +- **b**: +- **content_type**: +- **encoding**: +- **proto**: +- **allow_pickle**: + + + + +### method schema + +```python +by_alias: 'bool' = True, +ref_template: 'str' = '#/$defs/{model}' +``` + + + +##### Arguments + +- **by_alias**: +- **ref_template**: + + + + +### method schema_json + +```python +*, +by_alias: 'bool' = True, +ref_template: 'str' = '#/$defs/{model}', **dumps_kwargs: 'Any' +``` + + + +##### Arguments + +- **by_alias**: +- **ref_template**: +- **dumps_kwargs**: + + + + +### method update_forward_refs + +```python +**localns: 'Any' +``` + + + +##### Arguments + +- **localns**: + + + + +### method validate + +```python +value: 'Any' +``` + + + +##### Arguments + +- **value**: + + + + + + diff --git a/models/ref/python/automations/sendwebhook.mdx b/models/ref/python/automations/sendwebhook.mdx index f255e46601..1b1dbc37b2 100644 --- a/models/ref/python/automations/sendwebhook.mdx +++ b/models/ref/python/automations/sendwebhook.mdx @@ -1,44 +1,561 @@ --- title: SendWebhook -namespace: automations_namespace -python_object_type: class +kind: class +namespace: wandb.automations.actions --- + import { GitHubLink } from '/snippets/_includes/github-source-link.mdx'; - + + + +```python +*, +integration_id: typing.Annotated[str, Strict(strict=True)], +requestPayload: Optional[Annotated[dict[str, Any], Json, BeforeValidator(func=, json_schema_input_type=PydanticUndefined), PlainSerializer(func=, return_type=PydanticUndefined, when_used='always')]] = None, +action_type: Literal[GENERIC_WEBHOOK] = GENERIC_WEBHOOK +``` + +## Description -## class `SendWebhook` Defines an automation action that sends a webhook request. -### method `SendWebhook.__init__` + +## Args + +- **integration_id**: +- **requestPayload**: +- **action_type**: + + + + + + +## Methods + +### method construct ```python -__init__( - integration_id: 'str', - request_payload: 'Annotated | None' = None, - action_type: 'Literal[GENERIC_WEBHOOK]' = GENERIC_WEBHOOK -) → None +_fields_set: 'set[str] | None' = None, **values: 'Any' ``` -**Args:** - - - `integration_id` (str): The ID of the webhook integration that will be used to send the request. - - `request_payload` (Optional[Annotated]): The payload, possibly with template variables, to send in the webhook request. - - `action_type` (Literal[GENERIC_WEBHOOK]): -**Returns:** - An `SendWebhook` object. -### classmethod `SendWebhook.from_integration` +##### Arguments + +- **_fields_set**: +- **values**: + + + + +### method copy ```python -from_integration( - integration: 'WebhookIntegration', - payload: 'JsonEncoded[dict[str, Any]] | None' = None -) → Self +self, *, +include: 'AbstractSetIntStr | MappingIntStrAny | None' = None, +exclude: 'AbstractSetIntStr | MappingIntStrAny | None' = None, +update: 'Dict[str, Any] | None' = None, +deep: 'bool' = False +``` + +Returns a copy of the model. + +!!! warning "Deprecated" + This method is now deprecated; use `model_copy` instead. + +If you need `include` or `exclude`, use: + +```python {test="skip" lint="skip"} +data = self.model_dump(include=include, exclude=exclude, round_trip=True) +data = {**data, **(update or {})} +copied = self.model_validate(data) +``` + +##### Arguments + +- **include**: Optional set or mapping specifying which fields to include in the copied model. +- **exclude**: Optional set or mapping specifying which fields to exclude in the copied model. +- **update**: Optional dictionary of field-value pairs to override field values in the copied model. +- **deep**: If True, the values of fields that are Pydantic models will be deep-copied. + + + + +### method dict + +```python +self, *, +include: 'IncEx | None' = None, +exclude: 'IncEx | None' = None, +by_alias: 'bool' = False, +exclude_unset: 'bool' = False, +exclude_defaults: 'bool' = False, +exclude_none: 'bool' = False +``` + + + +##### Arguments + +- **include**: +- **exclude**: +- **by_alias**: +- **exclude_unset**: +- **exclude_defaults**: +- **exclude_none**: + + + + +### method from_integration + +```python +integration: 'WebhookIntegration', *, +payload: 'JsonEncoded[dict[str, Any]] | None' = None ``` Define a webhook action that sends to the given (webhook) integration. + +##### Arguments + +- **integration**: +- **payload**: + + + + +### method from_orm + +```python +obj: 'Any' +``` + + + +##### Arguments + +- **obj**: + + + + +### method json + +```python +self, *, +include: 'IncEx | None' = None, +exclude: 'IncEx | None' = None, +by_alias: 'bool' = False, +exclude_unset: 'bool' = False, +exclude_defaults: 'bool' = False, +exclude_none: 'bool' = False, +encoder: 'Callable[[Any], Any] | None' = PydanticUndefined, +models_as_dict: 'bool' = PydanticUndefined, **dumps_kwargs: 'Any' +``` + + + +##### Arguments + +- **include**: +- **exclude**: +- **by_alias**: +- **exclude_unset**: +- **exclude_defaults**: +- **exclude_none**: +- **encoder**: +- **models_as_dict**: +- **dumps_kwargs**: + + + + +### method model_construct + +```python +_fields_set: 'set[str] | None' = None, **values: 'Any' +``` + +Creates a new instance of the `Model` class with validated data. + +Creates a new model setting `__dict__` and `__pydantic_fields_set__` from trusted or pre-validated data. +Default values are respected, but no other validation is performed. + +!!! note + `model_construct()` generally respects the `model_config.extra` setting on the provided model. + That is, if `model_config.extra == 'allow'`, then all extra passed values are added to the model instance's `__dict__` + and `__pydantic_extra__` fields. If `model_config.extra == 'ignore'` (the default), then all extra passed values are ignored. + Because no validation is performed with a call to `model_construct()`, having `model_config.extra == 'forbid'` does not result in + an error if extra values are passed, but they will be ignored. + +##### Arguments + +- **_fields_set**: A set of field names that were originally explicitly set during instantiation. If provided, this is directly used for the [`model_fields_set`][pydantic.BaseModel.model_fields_set] attribute. Otherwise, the field names from the `values` argument will be used. +- **values**: Trusted or pre-validated data dictionary. + + + + +### method model_copy + +```python +self, *, +update: 'Mapping[str, Any] | None' = None, +deep: 'bool' = False +``` + +!!! abstract "Usage Documentation" + [`model_copy`](../concepts/serialization.md#model_copy) + +Returns a copy of the model. + +!!! note + The underlying instance's [`__dict__`][object.__dict__] attribute is copied. This + might have unexpected side effects if you store anything in it, on top of the model + fields (e.g. the value of [cached properties][functools.cached_property]). + +##### Arguments + +- **update**: Values to change/add in the new model. Note: the data is not validated before creating the new model. You should trust this data. +- **deep**: Set to `True` to make a deep copy of the model. + + + + +### method model_dump + +```python +self, *, +mode: 'str' = 'json', **kwargs: 'Any' +``` + +!!! abstract "Usage Documentation" + [`model_dump`](../concepts/serialization.md#modelmodel_dump) + +Generate a dictionary representation of the model, optionally specifying which fields to include or exclude. + +##### Arguments + +- **mode**: The mode in which `to_python` should run. If mode is 'json', the output will only contain JSON serializable types. If mode is 'python', the output may contain non-JSON-serializable Python objects. +- **kwargs**: + + + + +### method model_dump_json + +```python +self, *, +indent: 'int | None' = None, **kwargs: 'Any' +``` + +!!! abstract "Usage Documentation" + [`model_dump_json`](../concepts/serialization.md#modelmodel_dump_json) + +Generates a JSON representation of the model using Pydantic's `to_json` method. + +##### Arguments + +- **indent**: Indentation to use in the JSON output. If None is passed, the output will be compact. +- **kwargs**: + + + + +### method model_json_schema + +```python +by_alias: 'bool' = True, +ref_template: 'str' = '#/$defs/{model}', +schema_generator: 'type[GenerateJsonSchema]' = , +mode: 'JsonSchemaMode' = 'validation' +``` + +Generates a JSON schema for a model class. + +##### Arguments + +- **by_alias**: Whether to use attribute aliases or not. +- **ref_template**: The reference template. +- **schema_generator**: To override the logic used to generate the JSON schema, as a subclass of `GenerateJsonSchema` with your desired modifications +- **mode**: The mode in which to generate the schema. + + + + +### method model_parametrized_name + +```python +params: 'tuple[type[Any], ...]' +``` + +Compute the class name for parametrizations of generic classes. + +This method can be overridden to achieve a custom naming scheme for generic BaseModels. + +##### Arguments + +- **params**: Tuple of types of the class. Given a generic class `Model` with 2 type variables and a concrete model `Model[str, int]`, the value `(str, int)` would be passed to `params`. + + +##### Raises + +- **TypeError**: Raised when trying to generate concrete names for non-generic models. + + +### method model_post_init + +```python +self, +context: 'Any', / +``` + +Override this method to perform additional initialization after `__init__` and `model_construct`. +This is useful if you want to do some validation that requires the entire model to be initialized. + +##### Arguments + +- **context**: + + + + +### method model_rebuild + +```python +*, +force: 'bool' = False, +raise_errors: 'bool' = True, +_parent_namespace_depth: 'int' = 2, +_types_namespace: 'MappingNamespace | None' = None +``` + +Try to rebuild the pydantic-core schema for the model. + +This may be necessary when one of the annotations is a ForwardRef which could not be resolved during +the initial attempt to build the schema, and automatic rebuilding fails. + +##### Arguments + +- **force**: Whether to force the rebuilding of the model schema, defaults to `False`. +- **raise_errors**: Whether to raise errors, defaults to `True`. +- **_parent_namespace_depth**: The depth level of the parent namespace, defaults to 2. +- **_types_namespace**: The types namespace, defaults to `None`. + + + + +### method model_validate + +```python +obj: 'Any', *, +strict: 'bool | None' = None, +from_attributes: 'bool | None' = None, +context: 'Any | None' = None, +by_alias: 'bool | None' = None, +by_name: 'bool | None' = None +``` + +Validate a pydantic model instance. + +##### Arguments + +- **obj**: The object to validate. +- **strict**: Whether to enforce types strictly. +- **from_attributes**: Whether to extract data from object attributes. +- **context**: Additional context to pass to the validator. +- **by_alias**: Whether to use the field's alias when validating against the provided input data. +- **by_name**: Whether to use the field's name when validating against the provided input data. + + +##### Raises + +- **ValidationError**: If the object could not be validated. + + +### method model_validate_json + +```python +json_data: 'str | bytes | bytearray', *, +strict: 'bool | None' = None, +context: 'Any | None' = None, +by_alias: 'bool | None' = None, +by_name: 'bool | None' = None +``` + +!!! abstract "Usage Documentation" + [JSON Parsing](../concepts/json.md#json-parsing) + +Validate the given JSON data against the Pydantic model. + +##### Arguments + +- **json_data**: The JSON data to validate. +- **strict**: Whether to enforce types strictly. +- **context**: Extra variables to pass to the validator. +- **by_alias**: Whether to use the field's alias when validating against the provided input data. +- **by_name**: Whether to use the field's name when validating against the provided input data. + + +##### Raises + +- **ValidationError**: If `json_data` is not a JSON string or the object could not be validated. + + +### method model_validate_strings + +```python +obj: 'Any', *, +strict: 'bool | None' = None, +context: 'Any | None' = None, +by_alias: 'bool | None' = None, +by_name: 'bool | None' = None +``` + +Validate the given object with string data against the Pydantic model. + +##### Arguments + +- **obj**: The object containing string data to validate. +- **strict**: Whether to enforce types strictly. +- **context**: Extra variables to pass to the validator. +- **by_alias**: Whether to use the field's alias when validating against the provided input data. +- **by_name**: Whether to use the field's name when validating against the provided input data. + + + + +### method parse_file + +```python +path: 'str | Path', *, +content_type: 'str | None' = None, +encoding: 'str' = 'utf8', +proto: 'DeprecatedParseProtocol | None' = None, +allow_pickle: 'bool' = False +``` + + + +##### Arguments + +- **path**: +- **content_type**: +- **encoding**: +- **proto**: +- **allow_pickle**: + + + + +### method parse_obj + +```python +obj: 'Any' +``` + + + +##### Arguments + +- **obj**: + + + + +### method parse_raw + +```python +b: 'str | bytes', *, +content_type: 'str | None' = None, +encoding: 'str' = 'utf8', +proto: 'DeprecatedParseProtocol | None' = None, +allow_pickle: 'bool' = False +``` + + + +##### Arguments + +- **b**: +- **content_type**: +- **encoding**: +- **proto**: +- **allow_pickle**: + + + + +### method schema + +```python +by_alias: 'bool' = True, +ref_template: 'str' = '#/$defs/{model}' +``` + + + +##### Arguments + +- **by_alias**: +- **ref_template**: + + + + +### method schema_json + +```python +*, +by_alias: 'bool' = True, +ref_template: 'str' = '#/$defs/{model}', **dumps_kwargs: 'Any' +``` + + + +##### Arguments + +- **by_alias**: +- **ref_template**: +- **dumps_kwargs**: + + + + +### method update_forward_refs + +```python +**localns: 'Any' +``` + + + +##### Arguments + +- **localns**: + + + + +### method validate + +```python +value: 'Any' +``` + + + +##### Arguments + +- **value**: + + + + + + diff --git a/models/ref/python/custom-charts/bar.mdx b/models/ref/python/custom-charts/bar.mdx index 43ce28b9ad..42bc317521 100644 --- a/models/ref/python/custom-charts/bar.mdx +++ b/models/ref/python/custom-charts/bar.mdx @@ -1,49 +1,47 @@ --- title: bar() -namespace: python_sdk_custom_charts -python_object_type: function +kind: function +namespace: wandb.plot.bar --- -import { GitHubLink } from '/snippets/_includes/github-source-link.mdx'; - +import { GitHubLink } from '/snippets/_includes/github-source-link.mdx'; + -### function `bar` ```python -bar( - table: 'wandb.Table', - label: 'str', - value: 'str', - title: 'str' = '', - split_table: 'bool' = False -) → CustomChart +table: 'wandb.Table', +label: 'str', +value: 'str', +title: 'str' = '', +split_table: 'bool' = False ``` -Constructs a bar chart from a wandb.Table of data. +## Description + +Constructs a bar chart from a wandb.Table of data. + +## Args -**Args:** - - - `table`: A table containing the data for the bar chart. - - `label`: The name of the column to use for the labels of each bar. - - `value`: The name of the column to use for the values of each bar. - - `title`: The title of the bar chart. - - `split_table`: Whether the table should be split into a separate section in the W&B UI. If `True`, the table will be displayed in a section named "Custom Chart Tables". Default is `False`. +- **table**: A table containing the data for the bar chart. +- **label**: The name of the column to use for the labels of each bar. +- **value**: The name of the column to use for the values of each bar. +- **title**: The title of the bar chart. +- **split_table**: Whether the table should be split into a separate section in the W&B UI. If `True`, the table will be displayed in a section named "Custom Chart Tables". Default is `False`. +## Returns -**Returns:** - - - `CustomChart`: A custom chart object that can be logged to W&B. To log the chart, pass it to `wandb.log()`. +`CustomChart`: A custom chart object that can be logged to W&B. To log the chart, pass it to `wandb.log()`. -**Example:** - + +## Examples ```python import random @@ -64,12 +62,13 @@ table = wandb.Table(data=data, columns=["class", "accuracy"]) with wandb.init(project="bar_chart") as run: # Create a bar plot from the table bar_plot = wandb.plot.bar( - table=table, - label="class", - value="accuracy", - title="Object Classification Accuracy", + table=table, + label="class", + value="accuracy", + title="Object Classification Accuracy", ) # Log the bar chart to W&B run.log({"bar_plot": bar_plot}) -``` +``` + diff --git a/models/ref/python/custom-charts/confusion_matrix.mdx b/models/ref/python/custom-charts/confusion_matrix.mdx index bfa5103c30..c24a795da0 100644 --- a/models/ref/python/custom-charts/confusion_matrix.mdx +++ b/models/ref/python/custom-charts/confusion_matrix.mdx @@ -1,58 +1,56 @@ --- title: confusion_matrix() -namespace: python_sdk_custom_charts -python_object_type: function +kind: function +namespace: wandb.plot.confusion_matrix --- -import { GitHubLink } from '/snippets/_includes/github-source-link.mdx'; - +import { GitHubLink } from '/snippets/_includes/github-source-link.mdx'; + -### function `confusion_matrix` ```python -confusion_matrix( - probs: 'Sequence[Sequence[float]] | None' = None, - y_true: 'Sequence[T] | None' = None, - preds: 'Sequence[T] | None' = None, - class_names: 'Sequence[str] | None' = None, - title: 'str' = 'Confusion Matrix Curve', - split_table: 'bool' = False -) → CustomChart +probs: 'Sequence[Sequence[float]] | None' = None, +y_true: 'Sequence[T] | None' = None, +preds: 'Sequence[T] | None' = None, +class_names: 'Sequence[str] | None' = None, +title: 'str' = 'Confusion Matrix Curve', +split_table: 'bool' = False ``` -Constructs a confusion matrix from a sequence of probabilities or predictions. +## Description + +Constructs a confusion matrix from a sequence of probabilities or predictions. + +## Args -**Args:** - - - `probs`: A sequence of predicted probabilities for each class. The sequence shape should be (N, K) where N is the number of samples and K is the number of classes. If provided, `preds` should not be provided. - - `y_true`: A sequence of true labels. - - `preds`: A sequence of predicted class labels. If provided, `probs` should not be provided. - - `class_names`: Sequence of class names. If not provided, class names will be defined as "Class_1", "Class_2", etc. - - `title`: Title of the confusion matrix chart. - - `split_table`: Whether the table should be split into a separate section in the W&B UI. If `True`, the table will be displayed in a section named "Custom Chart Tables". Default is `False`. +- **probs**: A sequence of predicted probabilities for each class. The sequence shape should be (N, K) where N is the number of samples and K is the number of classes. If provided, `preds` should not be provided. +- **y_true**: A sequence of true labels. +- **preds**: A sequence of predicted class labels. If provided, `probs` should not be provided. +- **class_names**: Sequence of class names. If not provided, class names will be defined as "Class_1", "Class_2", etc. +- **title**: Title of the confusion matrix chart. +- **split_table**: Whether the table should be split into a separate section in the W&B UI. If `True`, the table will be displayed in a section named "Custom Chart Tables". Default is `False`. +## Returns -**Returns:** - - - `CustomChart`: A custom chart object that can be logged to W&B. To log the chart, pass it to `wandb.log()`. +`CustomChart`: A custom chart object that can be logged to W&B. To log the chart, pass it to `wandb.log()`. +## Raises -**Raises:** - - - `ValueError`: If both `probs` and `preds` are provided or if the number of predictions and true labels are not equal. If the number of unique predicted classes exceeds the number of class names or if the number of unique true labels exceeds the number of class names. - - `wandb.Error`: If numpy is not installed. +- **ValueError**: If both `probs` and `preds` are provided or if the number of predictions and true labels are not equal. If the number of unique predicted classes exceeds the number of class names or if the number of unique true labels exceeds the number of class names. +- **wandb.Error**: If numpy is not installed. +## Examples -**Examples:** - Logging a confusion matrix with random probabilities for wildlife classification: +Logging a confusion matrix with random probabilities for wildlife +classification: ```python import numpy as np @@ -75,17 +73,19 @@ wildlife_probs = np.exp(wildlife_probs) / np.sum( # Initialize W&B run and log confusion matrix with wandb.init(project="wildlife_classification") as run: confusion_matrix = wandb.plot.confusion_matrix( - probs=wildlife_probs, - y_true=wildlife_y_true, - class_names=wildlife_class_names, - title="Wildlife Classification Confusion Matrix", + probs=wildlife_probs, + y_true=wildlife_y_true, + class_names=wildlife_class_names, + title="Wildlife Classification Confusion Matrix", ) run.log({"wildlife_confusion_matrix": confusion_matrix}) -``` +``` -In this example, random probabilities are used to generate a confusion matrix. +In this example, random probabilities are used to generate a confusion +matrix. -Logging a confusion matrix with simulated model predictions and 85% accuracy: +Logging a confusion matrix with simulated model predictions and 85% +accuracy: ```python import numpy as np @@ -112,12 +112,14 @@ wildlife_preds = [ # Initialize W&B run and log confusion matrix with wandb.init(project="wildlife_classification") as run: confusion_matrix = wandb.plot.confusion_matrix( - preds=wildlife_preds, - y_true=wildlife_y_true, - class_names=wildlife_class_names, - title="Simulated Wildlife Classification Confusion Matrix", + preds=wildlife_preds, + y_true=wildlife_y_true, + class_names=wildlife_class_names, + title="Simulated Wildlife Classification Confusion Matrix", ) run.log({"wildlife_confusion_matrix": confusion_matrix}) -``` +``` + +In this example, predictions are simulated with 85% accuracy to generate a +confusion matrix. -In this example, predictions are simulated with 85% accuracy to generate a confusion matrix. diff --git a/models/ref/python/custom-charts/histogram.mdx b/models/ref/python/custom-charts/histogram.mdx index fca5a580f1..68a454e392 100644 --- a/models/ref/python/custom-charts/histogram.mdx +++ b/models/ref/python/custom-charts/histogram.mdx @@ -1,47 +1,45 @@ --- -title: histogram -namespace: python_sdk_custom_charts -python_object_type: function +title: histogram() +kind: function +namespace: wandb.plot.histogram --- -import { GitHubLink } from '/snippets/_includes/github-source-link.mdx'; - +import { GitHubLink } from '/snippets/_includes/github-source-link.mdx'; + -### function `histogram` ```python -histogram( - table: 'wandb.Table', - value: 'str', - title: 'str' = '', - split_table: 'bool' = False -) → CustomChart +table: 'wandb.Table', +value: 'str', +title: 'str' = '', +split_table: 'bool' = False ``` -Constructs a histogram chart from a W&B Table. +## Description + +Constructs a histogram chart from a W&B Table. + +## Args -**Args:** - - - `table`: The W&B Table containing the data for the histogram. - - `value`: The label for the bin axis (x-axis). - - `title`: The title of the histogram plot. - - `split_table`: Whether the table should be split into a separate section in the W&B UI. If `True`, the table will be displayed in a section named "Custom Chart Tables". Default is `False`. +- **table**: The W&B Table containing the data for the histogram. +- **value**: The label for the bin axis (x-axis). +- **title**: The title of the histogram plot. +- **split_table**: Whether the table should be split into a separate section in the W&B UI. If `True`, the table will be displayed in a section named "Custom Chart Tables". Default is `False`. +## Returns -**Returns:** - - - `CustomChart`: A custom chart object that can be logged to W&B. To log the chart, pass it to `wandb.log()`. +`CustomChart`: A custom chart object that can be logged to W&B. To log the chart, pass it to `wandb.log()`. -**Example:** - + +## Examples ```python import math @@ -67,4 +65,5 @@ histogram = wandb.plot.histogram( # Log the histogram plot to W&B with wandb.init(...) as run: run.log({"histogram-plot1": histogram}) -``` +``` + diff --git a/models/ref/python/custom-charts/line.mdx b/models/ref/python/custom-charts/line.mdx index 1338fa49e3..b381be8ce4 100644 --- a/models/ref/python/custom-charts/line.mdx +++ b/models/ref/python/custom-charts/line.mdx @@ -1,51 +1,49 @@ --- title: line() -namespace: python_sdk_custom_charts -python_object_type: function +kind: function +namespace: wandb.plot.line --- -import { GitHubLink } from '/snippets/_includes/github-source-link.mdx'; - +import { GitHubLink } from '/snippets/_includes/github-source-link.mdx'; + -### function `line` ```python -line( - table: 'wandb.Table', - x: 'str', - y: 'str', - stroke: 'str | None' = None, - title: 'str' = '', - split_table: 'bool' = False -) → CustomChart +table: 'wandb.Table', +x: 'str', +y: 'str', +stroke: 'str | None' = None, +title: 'str' = '', +split_table: 'bool' = False ``` -Constructs a customizable line chart. +## Description + +Constructs a customizable line chart. + +## Args -**Args:** - - - `table`: The table containing data for the chart. - - `x`: Column name for the x-axis values. - - `y`: Column name for the y-axis values. - - `stroke`: Column name to differentiate line strokes (e.g., for grouping lines). - - `title`: Title of the chart. - - `split_table`: Whether the table should be split into a separate section in the W&B UI. If `True`, the table will be displayed in a section named "Custom Chart Tables". Default is `False`. +- **table**: The table containing data for the chart. +- **x**: Column name for the x-axis values. +- **y**: Column name for the y-axis values. +- **stroke**: Column name to differentiate line strokes (e.g., for grouping lines). +- **title**: Title of the chart. +- **split_table**: Whether the table should be split into a separate section in the W&B UI. If `True`, the table will be displayed in a section named "Custom Chart Tables". Default is `False`. +## Returns -**Returns:** - - - `CustomChart`: A custom chart object that can be logged to W&B. To log the chart, pass it to `wandb.log()`. +`CustomChart`: A custom chart object that can be logged to W&B. To log the chart, pass it to `wandb.log()`. -**Example:** - + +## Examples ```python import math @@ -55,24 +53,25 @@ import wandb # Create multiple series of data with different patterns data = [] for i in range(100): - # Series 1: Sinusoidal pattern with random noise - data.append([i, math.sin(i / 10) + random.uniform(-0.1, 0.1), "series_1"]) - # Series 2: Cosine pattern with random noise - data.append([i, math.cos(i / 10) + random.uniform(-0.1, 0.1), "series_2"]) - # Series 3: Linear increase with random noise - data.append([i, i / 10 + random.uniform(-0.5, 0.5), "series_3"]) + # Series 1: Sinusoidal pattern with random noise + data.append([i, math.sin(i / 10) + random.uniform(-0.1, 0.1), "series_1"]) + # Series 2: Cosine pattern with random noise + data.append([i, math.cos(i / 10) + random.uniform(-0.1, 0.1), "series_2"]) + # Series 3: Linear increase with random noise + data.append([i, i / 10 + random.uniform(-0.5, 0.5), "series_3"]) # Define the columns for the table table = wandb.Table(data=data, columns=["step", "value", "series"]) # Initialize wandb run and log the line chart with wandb.init(project="line_chart_example") as run: - line_chart = wandb.plot.line( - table=table, - x="step", - y="value", - stroke="series", # Group by the "series" column - title="Multi-Series Line Plot", - ) - run.log({"line-chart": line_chart}) -``` + line_chart = wandb.plot.line( + table=table, + x="step", + y="value", + stroke="series", # Group by the "series" column + title="Multi-Series Line Plot", + ) + run.log({"line-chart": line_chart}) +``` + diff --git a/models/ref/python/custom-charts/line_series.mdx b/models/ref/python/custom-charts/line_series.mdx index 68220fd9e1..e4139055c9 100644 --- a/models/ref/python/custom-charts/line_series.mdx +++ b/models/ref/python/custom-charts/line_series.mdx @@ -1,51 +1,51 @@ --- title: line_series() -namespace: python_sdk_custom_charts -python_object_type: function +kind: function +namespace: wandb.plot.line_series --- -import { GitHubLink } from '/snippets/_includes/github-source-link.mdx'; - +import { GitHubLink } from '/snippets/_includes/github-source-link.mdx'; + -### function `line_series` ```python -line_series( - xs: 'Iterable[Iterable[Any]] | Iterable[Any]', - ys: 'Iterable[Iterable[Any]]', - keys: 'Iterable[str] | None' = None, - title: 'str' = '', - xname: 'str' = 'x', - split_table: 'bool' = False -) → CustomChart +xs: 'Iterable[Iterable[Any]] | Iterable[Any]', +ys: 'Iterable[Iterable[Any]]', +keys: 'Iterable[str] | None' = None, +title: 'str' = '', +xname: 'str' = 'x', +split_table: 'bool' = False ``` -Constructs a line series chart. +## Description + +Constructs a line series chart. + + +## Args +- **xs**: Sequence of x values. If a singular array is provided, all y values are plotted against that x array. If an array of arrays is provided, each y value is plotted against the corresponding x array. +- **ys**: Sequence of y values, where each iterable represents a separate line series. +- **keys**: Sequence of keys for labeling each line series. If not provided, keys will be automatically generated as "line_1", "line_2", etc. +- **title**: Title of the chart. +- **xname**: Label for the x-axis. +- **split_table**: Whether the table should be split into a separate section in the W&B UI. If `True`, the table will be displayed in a section named "Custom Chart Tables". Default is `False`. -**Args:** - - - `xs`: Sequence of x values. If a singular array is provided, all y values are plotted against that x array. If an array of arrays is provided, each y value is plotted against the corresponding x array. - - `ys`: Sequence of y values, where each iterable represents a separate line series. - - `keys`: Sequence of keys for labeling each line series. If not provided, keys will be automatically generated as "line_1", "line_2", etc. - - `title`: Title of the chart. - - `xname`: Label for the x-axis. - - `split_table`: Whether the table should be split into a separate section in the W&B UI. If `True`, the table will be displayed in a section named "Custom Chart Tables". Default is `False`. +## Returns +`CustomChart`: A custom chart object that can be logged to W&B. To log the chart, pass it to `wandb.log()`. -**Returns:** - - - `CustomChart`: A custom chart object that can be logged to W&B. To log the chart, pass it to `wandb.log()`. -**Examples:** - Logging a single x array where all y series are plotted against the same x values: +## Examples + +Logging a single x array where all y series are plotted against the same x values: ```python import wandb @@ -57,24 +57,26 @@ with wandb.init(project="line_series_example") as run: # Multiple y series to plot ys = [ - [i for i in range(10)], # y = x - [i**2 for i in range(10)], # y = x^2 - [i**3 for i in range(10)], # y = x^3 + [i for i in range(10)], # y = x + [i**2 for i in range(10)], # y = x^2 + [i**3 for i in range(10)], # y = x^3 ] # Generate and log the line series chart line_series_chart = wandb.plot.line_series( - xs, - ys, - title="title", - xname="step", + xs, + ys, + title="title", + xname="step", ) run.log({"line-series-single-x": line_series_chart}) -``` +``` -In this example, a single `xs` series (shared x-values) is used for all `ys` series. This results in each y-series being plotted against the same x-values (0-9). +In this example, a single `xs` series (shared x-values) is used for all +`ys` series. This results in each y-series being plotted against the +same x-values (0-9). -Logging multiple x arrays where each y series is plotted against its corresponding x array: +Logging multiple x arrays where each y series is plotted against its corresponding x array: ```python import wandb @@ -83,28 +85,30 @@ import wandb with wandb.init(project="line_series_example") as run: # Separate x values for each y series xs = [ - [i for i in range(10)], # x for first series - [2 * i for i in range(10)], # x for second series (stretched) - [3 * i for i in range(10)], # x for third series (stretched more) + [i for i in range(10)], # x for first series + [2 * i for i in range(10)], # x for second series (stretched) + [3 * i for i in range(10)], # x for third series (stretched more) ] # Corresponding y series ys = [ - [i for i in range(10)], # y = x - [i**2 for i in range(10)], # y = x^2 - [i**3 for i in range(10)], # y = x^3 + [i for i in range(10)], # y = x + [i**2 for i in range(10)], # y = x^2 + [i**3 for i in range(10)], # y = x^3 ] # Generate and log the line series chart line_series_chart = wandb.plot.line_series( - xs, ys, title="Multiple X Arrays Example", xname="Step" + xs, ys, title="Multiple X Arrays Example", xname="Step" ) run.log({"line-series-multiple-x": line_series_chart}) -``` +``` -In this example, each y series is plotted against its own unique x series. This allows for more flexibility when the x values are not uniform across the data series. +In this example, each y series is plotted against its own unique x series. +This allows for more flexibility when the x values are not uniform across +the data series. -Customizing line labels using `keys`: +Customizing line labels using `keys`: ```python import wandb @@ -113,9 +117,9 @@ import wandb with wandb.init(project="line_series_example") as run: xs = list(range(10)) # Single x array ys = [ - [i for i in range(10)], # y = x - [i**2 for i in range(10)], # y = x^2 - [i**3 for i in range(10)], # y = x^3 + [i for i in range(10)], # y = x + [i**2 for i in range(10)], # y = x^2 + [i**3 for i in range(10)], # y = x^3 ] # Custom labels for each line @@ -123,13 +127,16 @@ with wandb.init(project="line_series_example") as run: # Generate and log the line series chart line_series_chart = wandb.plot.line_series( - xs, - ys, - keys=keys, # Custom keys (line labels) - title="Custom Line Labels Example", - xname="Step", + xs, + ys, + keys=keys, # Custom keys (line labels) + title="Custom Line Labels Example", + xname="Step", ) run.log({"line-series-custom-keys": line_series_chart}) -``` +``` + +This example shows how to provide custom labels for the lines using +the `keys` argument. The keys will appear in the legend as "Linear", +"Quadratic", and "Cubic". -This example shows how to provide custom labels for the lines using the `keys` argument. The keys will appear in the legend as "Linear", "Quadratic", and "Cubic". diff --git a/models/ref/python/custom-charts/plot_table.mdx b/models/ref/python/custom-charts/plot_table.mdx index 41dd583194..869da556c3 100644 --- a/models/ref/python/custom-charts/plot_table.mdx +++ b/models/ref/python/custom-charts/plot_table.mdx @@ -1,57 +1,57 @@ --- title: plot_table() -namespace: python_sdk_custom_charts -python_object_type: function +kind: function +namespace: wandb.plot.custom_chart --- -import { GitHubLink } from '/snippets/_includes/github-source-link.mdx'; - +import { GitHubLink } from '/snippets/_includes/github-source-link.mdx'; + -### function `plot_table` ```python -plot_table( - vega_spec_name: 'str', - data_table: 'wandb.Table', - fields: 'dict[str, Any]', - string_fields: 'dict[str, Any] | None' = None, - split_table: 'bool' = False -) → CustomChart +vega_spec_name: 'str', +data_table: 'wandb.Table', +fields: 'dict[str, Any]', +string_fields: 'dict[str, Any] | None' = None, +split_table: 'bool' = False ``` -Creates a custom charts using a Vega-Lite specification and a `wandb.Table`. +## Description + +Creates a custom charts using a Vega-Lite specification and a `wandb.Table`. + +This function creates a custom chart based on a Vega-Lite specification and +a data table represented by a `wandb.Table` object. The specification needs +to be predefined and stored in the W&B backend. The function returns a custom +chart object that can be logged to W&B using `wandb.Run.log()`. -This function creates a custom chart based on a Vega-Lite specification and a data table represented by a `wandb.Table` object. The specification needs to be predefined and stored in the W&B backend. The function returns a custom chart object that can be logged to W&B using `wandb.Run.log()`. +## Args -**Args:** - - - `vega_spec_name`: The name or identifier of the Vega-Lite spec that defines the visualization structure. - - `data_table`: A `wandb.Table` object containing the data to be visualized. - - `fields`: A mapping between the fields in the Vega-Lite spec and the corresponding columns in the data table to be visualized. - - `string_fields`: A dictionary for providing values for any string constants required by the custom visualization. - - `split_table`: Whether the table should be split into a separate section in the W&B UI. If `True`, the table will be displayed in a section named "Custom Chart Tables". Default is `False`. +- **vega_spec_name**: The name or identifier of the Vega-Lite spec that defines the visualization structure. +- **data_table**: A `wandb.Table` object containing the data to be visualized. +- **fields**: A mapping between the fields in the Vega-Lite spec and the corresponding columns in the data table to be visualized. +- **string_fields**: A dictionary for providing values for any string constants required by the custom visualization. +- **split_table**: Whether the table should be split into a separate section in the W&B UI. If `True`, the table will be displayed in a section named "Custom Chart Tables". Default is `False`. +## Returns -**Returns:** - - - `CustomChart`: A custom chart object that can be logged to W&B. To log the chart, pass the chart object as argument to `wandb.Run.log()`. +`CustomChart`: A custom chart object that can be logged to W&B. To log the chart, pass the chart object as argument to `wandb.Run.log()`. +## Raises -**Raises:** - - - `wandb.Error`: If `data_table` is not a `wandb.Table` object. +- **wandb.Error**: If `data_table` is not a `wandb.Table` object. +## Examples -**Example:** - ```python +```python # Create a custom chart using a Vega-Lite spec and the data table. import wandb @@ -64,11 +64,12 @@ with wandb.init() as run: # Create a custom title with `string_fields`. my_custom_chart = wandb.plot_table( - vega_spec_name="wandb/line/v0", - data_table=table, - fields=fields, - string_fields={"title": "Title"}, + vega_spec_name="wandb/line/v0", + data_table=table, + fields=fields, + string_fields={"title": "Title"}, ) run.log({"custom_chart": my_custom_chart}) -``` +``` + diff --git a/models/ref/python/custom-charts/pr_curve.mdx b/models/ref/python/custom-charts/pr_curve.mdx index 1b1b209df8..a59a44c115 100644 --- a/models/ref/python/custom-charts/pr_curve.mdx +++ b/models/ref/python/custom-charts/pr_curve.mdx @@ -1,63 +1,61 @@ --- title: pr_curve() -namespace: python_sdk_custom_charts -python_object_type: function +kind: function +namespace: wandb.plot.pr_curve --- -import { GitHubLink } from '/snippets/_includes/github-source-link.mdx'; - +import { GitHubLink } from '/snippets/_includes/github-source-link.mdx'; + -### function `pr_curve` ```python -pr_curve( - y_true: 'Iterable[T] | None' = None, - y_probas: 'Iterable[numbers.Number] | None' = None, - labels: 'list[str] | None' = None, - classes_to_plot: 'list[T] | None' = None, - interp_size: 'int' = 21, - title: 'str' = 'Precision-Recall Curve', - split_table: 'bool' = False -) → CustomChart +y_true: 'Iterable[T] | None' = None, +y_probas: 'Iterable[numbers.Number] | None' = None, +labels: 'list[str] | None' = None, +classes_to_plot: 'list[T] | None' = None, +interp_size: 'int' = 21, +title: 'str' = 'Precision-Recall Curve', +split_table: 'bool' = False ``` -Constructs a Precision-Recall (PR) curve. - -The Precision-Recall curve is particularly useful for evaluating classifiers on imbalanced datasets. A high area under the PR curve signifies both high precision (a low false positive rate) and high recall (a low false negative rate). The curve provides insights into the balance between false positives and false negatives at various threshold levels, aiding in the assessment of a model's performance. +## Description +Constructs a Precision-Recall (PR) curve. +The Precision-Recall curve is particularly useful for evaluating classifiers +on imbalanced datasets. A high area under the PR curve signifies both high +precision (a low false positive rate) and high recall (a low false negative +rate). The curve provides insights into the balance between false positives +and false negatives at various threshold levels, aiding in the assessment of +a model's performance. -**Args:** - - - `y_true`: True binary labels. The shape should be (`num_samples`,). - - `y_probas`: Predicted scores or probabilities for each class. These can be probability estimates, confidence scores, or non-thresholded decision values. The shape should be (`num_samples`, `num_classes`). - - `labels`: Optional list of class names to replace numeric values in `y_true` for easier plot interpretation. For example, `labels = ['dog', 'cat', 'owl']` will replace 0 with 'dog', 1 with 'cat', and 2 with 'owl' in the plot. If not provided, numeric values from `y_true` will be used. - - `classes_to_plot`: Optional list of unique class values from y_true to be included in the plot. If not specified, all unique classes in y_true will be plotted. - - `interp_size`: Number of points to interpolate recall values. The recall values will be fixed to `interp_size` uniformly distributed points in the range [0, 1], and the precision will be interpolated accordingly. - - `title`: Title of the plot. Defaults to "Precision-Recall Curve". - - `split_table`: Whether the table should be split into a separate section in the W&B UI. If `True`, the table will be displayed in a section named "Custom Chart Tables". Default is `False`. +## Args -**Returns:** - - - `CustomChart`: A custom chart object that can be logged to W&B. To log the chart, pass it to `wandb.log()`. +- **y_true**: True binary labels. The shape should be (`num_samples`,). +- **y_probas**: Predicted scores or probabilities for each class. These can be probability estimates, confidence scores, or non-thresholded decision values. The shape should be (`num_samples`, `num_classes`). +- **labels**: Optional list of class names to replace numeric values in `y_true` for easier plot interpretation. For example, `labels = ['dog', 'cat', 'owl']` will replace 0 with 'dog', 1 with 'cat', and 2 with 'owl' in the plot. If not provided, numeric values from `y_true` will be used. +- **classes_to_plot**: Optional list of unique class values from y_true to be included in the plot. If not specified, all unique classes in y_true will be plotted. +- **interp_size**: Number of points to interpolate recall values. The recall values will be fixed to `interp_size` uniformly distributed points in the range [0, 1], and the precision will be interpolated accordingly. +- **title**: Title of the plot. Defaults to "Precision-Recall Curve". +- **split_table**: Whether the table should be split into a separate section in the W&B UI. If `True`, the table will be displayed in a section named "Custom Chart Tables". Default is `False`. +## Returns -**Raises:** - - - `wandb.Error`: If NumPy, pandas, or scikit-learn is not installed. +`CustomChart`: A custom chart object that can be logged to W&B. To log the chart, pass it to `wandb.log()`. +## Raises +- **wandb.Error**: If NumPy, pandas, or scikit-learn is not installed. -**Example:** - +## Examples ```python import wandb @@ -76,10 +74,11 @@ labels = ["not spam", "spam"] # Optional class names for readability with wandb.init(project="spam-detection") as run: pr_curve = wandb.plot.pr_curve( - y_true=y_true, - y_probas=y_probas, - labels=labels, - title="Precision-Recall Curve for Spam Detection", + y_true=y_true, + y_probas=y_probas, + labels=labels, + title="Precision-Recall Curve for Spam Detection", ) run.log({"pr-curve": pr_curve}) -``` +``` + diff --git a/models/ref/python/custom-charts/roc_curve.mdx b/models/ref/python/custom-charts/roc_curve.mdx index 8f0d24c81c..99e4ec5418 100644 --- a/models/ref/python/custom-charts/roc_curve.mdx +++ b/models/ref/python/custom-charts/roc_curve.mdx @@ -1,57 +1,54 @@ --- title: roc_curve() -namespace: python_sdk_custom_charts -python_object_type: function +kind: function +namespace: wandb.plot.roc_curve --- -import { GitHubLink } from '/snippets/_includes/github-source-link.mdx'; - +import { GitHubLink } from '/snippets/_includes/github-source-link.mdx'; + -### function `roc_curve` ```python -roc_curve( - y_true: 'Sequence[numbers.Number]', - y_probas: 'Sequence[Sequence[float]] | None' = None, - labels: 'list[str] | None' = None, - classes_to_plot: 'list[numbers.Number] | None' = None, - title: 'str' = 'ROC Curve', - split_table: 'bool' = False -) → CustomChart +y_true: 'Sequence[numbers.Number]', +y_probas: 'Sequence[Sequence[float]] | None' = None, +labels: 'list[str] | None' = None, +classes_to_plot: 'list[numbers.Number] | None' = None, +title: 'str' = 'ROC Curve', +split_table: 'bool' = False ``` -Constructs Receiver Operating Characteristic (ROC) curve chart. +## Description + +Constructs Receiver Operating Characteristic (ROC) curve chart. + +## Args -**Args:** - - - `y_true`: The true class labels (ground truth) for the target variable. Shape should be (num_samples,). - - `y_probas`: The predicted probabilities or decision scores for each class. Shape should be (num_samples, num_classes). - - `labels`: Human-readable labels corresponding to the class indices in `y_true`. For example, if `labels=['dog', 'cat']`, class 0 will be displayed as 'dog' and class 1 as 'cat' in the plot. If None, the raw class indices from `y_true` will be used. Default is None. - - `classes_to_plot`: A subset of unique class labels to include in the ROC curve. If None, all classes in `y_true` will be plotted. Default is None. - - `title`: Title of the ROC curve plot. Default is "ROC Curve". - - `split_table`: Whether the table should be split into a separate section in the W&B UI. If `True`, the table will be displayed in a section named "Custom Chart Tables". Default is `False`. +- **y_true**: The true class labels (ground truth) for the target variable. Shape should be (num_samples,). +- **y_probas**: The predicted probabilities or decision scores for each class. Shape should be (num_samples, num_classes). +- **labels**: Human-readable labels corresponding to the class indices in `y_true`. For example, if `labels=['dog', 'cat']`, class 0 will be displayed as 'dog' and class 1 as 'cat' in the plot. If None, the raw class indices from `y_true` will be used. Default is None. +- **classes_to_plot**: A subset of unique class labels to include in the ROC curve. If None, all classes in `y_true` will be plotted. Default is None. +- **title**: Title of the ROC curve plot. Default is "ROC Curve". +- **split_table**: Whether the table should be split into a separate section in the W&B UI. If `True`, the table will be displayed in a section named "Custom Chart Tables". Default is `False`. +## Returns -**Returns:** - - - `CustomChart`: A custom chart object that can be logged to W&B. To log the chart, pass it to `wandb.log()`. +`CustomChart`: A custom chart object that can be logged to W&B. To log the chart, pass it to `wandb.log()`. +## Raises -**Raises:** - - - `wandb.Error`: If numpy, pandas, or scikit-learn are not found. +- **wandb.Error**: If numpy, pandas, or scikit-learn are not found. +## Examples -**Example:** - ```python +```python import numpy as np import wandb @@ -75,11 +72,12 @@ classes_to_plot = [0, 1, 2] # Initialize a W&B run and log a ROC curve plot for disease classification with wandb.init(project="medical_diagnosis") as run: roc_plot = wandb.plot.roc_curve( - y_true=y_true, - y_probas=y_probas, - labels=disease_labels, - classes_to_plot=classes_to_plot, - title="ROC Curve for Disease Classification", + y_true=y_true, + y_probas=y_probas, + labels=disease_labels, + classes_to_plot=classes_to_plot, + title="ROC Curve for Disease Classification", ) run.log({"roc-curve": roc_plot}) -``` +``` + diff --git a/models/ref/python/custom-charts/scatter.mdx b/models/ref/python/custom-charts/scatter.mdx index eebcbd41cb..b08e5b4dc9 100644 --- a/models/ref/python/custom-charts/scatter.mdx +++ b/models/ref/python/custom-charts/scatter.mdx @@ -1,47 +1,49 @@ --- title: scatter() -namespace: python_sdk_custom_charts -python_object_type: function +kind: function +namespace: wandb.plot.scatter --- -import { GitHubLink } from '/snippets/_includes/github-source-link.mdx'; - +import { GitHubLink } from '/snippets/_includes/github-source-link.mdx'; + -### function `scatter` ```python -scatter( - table: 'wandb.Table', - x: 'str', - y: 'str', - title: 'str' = '', - split_table: 'bool' = False -) → CustomChart +table: 'wandb.Table', +x: 'str', +y: 'str', +title: 'str' = '', +split_table: 'bool' = False ``` -Constructs a scatter plot from a wandb.Table of data. +## Description + +Constructs a scatter plot from a wandb.Table of data. + + + +## Args +- **table**: The W&B Table containing the data to visualize. +- **x**: The name of the column used for the x-axis. +- **y**: The name of the column used for the y-axis. +- **title**: The title of the scatter chart. +- **split_table**: Whether the table should be split into a separate section in the W&B UI. If `True`, the table will be displayed in a section named "Custom Chart Tables". Default is `False`. -**Args:** - - - `table`: The W&B Table containing the data to visualize. - - `x`: The name of the column used for the x-axis. - - `y`: The name of the column used for the y-axis. - - `title`: The title of the scatter chart. - - `split_table`: Whether the table should be split into a separate section in the W&B UI. If `True`, the table will be displayed in a section named "Custom Chart Tables". Default is `False`. +## Returns +`CustomChart`: A custom chart object that can be logged to W&B. To log the chart, pass it to `wandb.log()`. -**Returns:** - - - `CustomChart`: A custom chart object that can be logged to W&B. To log the chart, pass it to `wandb.log()`. -**Example:** - ```python + +## Examples + +```python import math import random import wandb @@ -59,10 +61,11 @@ table = wandb.Table(data=data, columns=["altitude (m)", "temperature (°C)"]) with wandb.init(project="temperature-altitude-scatter") as run: # Create and log the scatter plot scatter_plot = wandb.plot.scatter( - table=table, - x="altitude (m)", - y="temperature (°C)", - title="Altitude vs Temperature", + table=table, + x="altitude (m)", + y="temperature (°C)", + title="Altitude vs Temperature", ) run.log({"altitude-temperature-scatter": scatter_plot}) -``` +``` + diff --git a/models/ref/python/data-types/audio.mdx b/models/ref/python/data-types/audio.mdx index 018146a0ba..435175e058 100644 --- a/models/ref/python/data-types/audio.mdx +++ b/models/ref/python/data-types/audio.mdx @@ -1,64 +1,172 @@ --- title: Audio -namespace: python_sdk_data_type -python_object_type: class +kind: class +namespace: wandb.sdk.data_types.audio --- + import { GitHubLink } from '/snippets/_includes/github-source-link.mdx'; - + + + + +```python +(data_or_path: 'str | pathlib.Path | list | np.ndarray', +sample_rate: 'int | None' = None, +caption: 'str | None' = None) +``` + +## Description + +W&B class for audio clips. + + + +## Args +- **data_or_path**: +- **sample_rate**: +- **caption**: -## class `Audio` -W&B class for audio clips. -### method `Audio.__init__` + + + +## Methods + +### method durations ```python -__init__( - data_or_path: 'str | pathlib.Path | list | np.ndarray', - sample_rate: 'int | None' = None, - caption: 'str | None' = None -) +(audio_list) ``` -Accept a path to an audio file or a numpy array of audio data. +Calculate the duration of the audio files. +##### Arguments +- **audio_list**: -**Args:** - - - `data_or_path`: A path to an audio file or a NumPy array of audio data. - - `sample_rate`: Sample rate, required when passing in raw NumPy array of audio data. - - `caption`: Caption to display with audio. +### method file_is_set + +```python +self +``` + + ---- -### classmethod `Audio.durations` + +### method init_from_json ```python -durations(audio_list) +json_obj: 'dict', +source_artifact: 'Artifact' ``` -Calculate the duration of the audio files. +Initialize a `WBValue` from a JSON blob based on the class that created it. + +Looks through all subclasses and tries to match the json obj with the class +which created it. It will then call that subclass' `from_json` method. +Importantly, this function will set the return object's `source_artifact` +attribute to the passed in source artifact. This is critical for artifact +bookkeeping. If you choose to create a wandb.Value via it's `from_json` method, +make sure to properly set this `artifact_source` to avoid data duplication. + +##### Arguments + +- **json_obj**: A JSON dictionary to deserialize. It must contain a `_type` key. This is used to lookup the correct subclass to use. +- **source_artifact**: An artifact which will hold any additional resources which were stored during the `to_json` function. ---- -### classmethod `Audio.sample_rates` +### method is_bound ```python -sample_rates(audio_list) +self ``` -Get sample rates of the audio files. ---- + + + + + +### method path_is_reference + +```python +path: 'str | pathlib.Path | None' +``` + + + +##### Arguments + +- **path**: + + + + +### method sample_rates + +```python +(audio_list) +``` + +Get sample rates of the audio files. + +##### Arguments + +- **audio_list**: + + + + +### method to_data_array + +```python +self +``` + +Convert the object to a list of primitives representing the underlying data. + + + + + +### method type_mapping + + + +Return a map from `_log_type` to subclass. Used to lookup correct types for deserialization. + + + + + +### method with_suffix + +```python +name: 'str', +filetype: 'str' = 'json' +``` + +Get the name with the appropriate suffix. + +##### Arguments + +- **name**: the name of the file +- **filetype**: the filetype to use. Defaults to "json". + + + + + diff --git a/models/ref/python/data-types/evaltable.mdx b/models/ref/python/data-types/evaltable.mdx index 7d750a9fec..ca04ed4d28 100644 --- a/models/ref/python/data-types/evaltable.mdx +++ b/models/ref/python/data-types/evaltable.mdx @@ -1,11 +1,312 @@ --- title: EvalTable -namespace: python_sdk_data_type -python_object_type: class +kind: class +namespace: wandb.sdk.data_types.eval_table --- + import { GitHubLink } from '/snippets/_includes/github-source-link.mdx'; - + + + + + +```python +columns: 'list[str | int] | None' = None, +data: 'list[Iterable[Any]] | np.ndarray | pd.DataFrame | None' = None, +rows: 'list[Iterable[Any]] | None' = None, +dataframe: 'pd.DataFrame | None' = None, +dtype: 'Any' = None, +optional: 'bool | list[bool]' = True, +allow_mixed_types: 'bool' = False, +log_mode: "Literal['IMMUTABLE']" = 'IMMUTABLE', *, +input_columns: 'list[str] | None' = None, +output_columns: 'list[str] | None' = None, +score_columns: 'list[str] | None' = None, +unsupported_media_mode: 'media_adapters.UnsupportedMediaMode' = 'stub' +``` + +## Description + +A Table subclass that routes run.log() to the new Eval Tables experience. + +When logged via run.log(), an EvalTable is logged as a Weave Eval via +weave.EvaluationLogger instead of being uploaded as a regular wandb Table +artifact. + +Note: EvalTable is a work-in-progress and is NOT yet officially released or +supported. + + + + +## Args + +- **columns**: +- **data**: +- **rows**: +- **dataframe**: +- **dtype**: +- **optional**: +- **allow_mixed_types**: +- **log_mode**: +- **input_columns**: +- **output_columns**: +- **score_columns**: +- **unsupported_media_mode**: + + + + + + +## Methods + +### method add_column + +```python +self, +name: 'str | int', +data: 'list[Any] | np.ndarray', +optional: 'bool' = False +``` + +Adds a column of data to the table. + +##### Arguments + +- **name**: (str) - the unique name of the column +- **data**: (list | np.array) - a column of homogeneous data +- **optional**: (bool) - if null-like values are permitted + + + + +### method add_computed_columns + +```python +(self, fn) +``` + +Adds one or more computed columns based on existing data. + +##### Arguments + +- **fn**: A function which accepts one or two parameters, ndx (int) and row (dict), which is expected to return a dict representing new columns for that row, keyed by the new column names. - `ndx` is an integer representing the index of the row. Only included if `include_ndx` is set to `True`. - `row` is a dictionary keyed by existing columns + + + + +### method add_data + +```python +self, *data: 'Any' +``` + +Adds a new row of data to the table. + +The maximum amount ofrows in a table is determined by +`wandb.Table.MAX_ARTIFACT_ROWS`. + +The length of the data should match the length of the table column. + +##### Arguments + +- **data**: + + + + +### method add_row + +```python +(self, *row) +``` + +Deprecated. Use `Table.add_data` method instead. + +##### Arguments + +- **row**: + + + + +### method captions + +```python +media_items: 'Sequence[Media]' +``` + + + +##### Arguments + +- **media_items**: + + + + +### method cast + +```python +(self, col_name, dtype, optional=False) +``` + +Casts a column to a specific data type. + +This can be one of the normal python classes, an internal W&B type, +or an example object, like an instance of wandb.Image or +wandb.Classes. + +##### Arguments + +- **col_name**: The name of the column to cast. +- **dtype**: The target dtype. +- **optional**: If the column should allow Nones. + + + + +### method file_is_set + +```python +self +``` + + + + + + + +### method get_column + +```python +(self, name, convert_to=None) +``` + +Retrieves a column from the table and optionally converts it to a NumPy object. + +##### Arguments + +- **name**: (str) - the name of the column +- **convert_to**: (str, optional) + + + + +### method get_dataframe + +```python +(self) +``` + +Returns a `pandas.DataFrame` of the table. + + + + + +### method get_index + +```python +(self) +``` + +Returns an array of row indexes for use in other tables to create links. + + + + + +### method init_from_json + +```python +json_obj: 'dict', +source_artifact: 'Artifact' +``` + +Initialize a `WBValue` from a JSON blob based on the class that created it. + +Looks through all subclasses and tries to match the json obj with the class +which created it. It will then call that subclass' `from_json` method. +Importantly, this function will set the return object's `source_artifact` +attribute to the passed in source artifact. This is critical for artifact +bookkeeping. If you choose to create a wandb.Value via it's `from_json` method, +make sure to properly set this `artifact_source` to avoid data duplication. + +##### Arguments + +- **json_obj**: A JSON dictionary to deserialize. It must contain a `_type` key. This is used to lookup the correct subclass to use. +- **source_artifact**: An artifact which will hold any additional resources which were stored during the `to_json` function. + + + + +### method is_bound + +```python +self +``` + + + + + + + +### method path_is_reference + +```python +path: 'str | pathlib.Path | None' +``` + + + +##### Arguments + +- **path**: + + + + +### method to_data_array + +```python +self +``` + +Convert the object to a list of primitives representing the underlying data. + + + + + +### method type_mapping + + + +Return a map from `_log_type` to subclass. Used to lookup correct types for deserialization. + + + + + +### method with_suffix + +```python +name: 'str', +filetype: 'str' = 'json' +``` + +Get the name with the appropriate suffix. + +##### Arguments + +- **name**: the name of the file +- **filetype**: the filetype to use. Defaults to "json". + diff --git a/models/ref/python/data-types/histogram.mdx b/models/ref/python/data-types/histogram.mdx index 329eba227e..f3a6c35ae9 100644 --- a/models/ref/python/data-types/histogram.mdx +++ b/models/ref/python/data-types/histogram.mdx @@ -1,67 +1,130 @@ --- title: Histogram -namespace: python_sdk_data_type -python_object_type: class +kind: class +namespace: wandb.sdk.data_types.histogram --- + import { GitHubLink } from '/snippets/_includes/github-source-link.mdx'; - + + + + + +```python +sequence: 'Sequence | None' = None, +np_histogram: 'NumpyHistogram | None' = None, +num_bins: 'int' = 64 +``` + +## Description + +W&B class for histograms. + +This object works just like numpy's histogram function +https://docs.scipy.org/doc/numpy/reference/generated/numpy.histogram.html + +Attributes: + bins ([float]): Edges of bins + histogram ([int]): Number of elements falling in each bin. +## Args -## class `Histogram` -W&B class for histograms. +- **sequence**: +- **np_histogram**: +- **num_bins**: -This object works just like numpy's histogram function https://docs.scipy.org/doc/numpy/reference/generated/numpy.histogram.html -**Attributes:** - - - `bins` ([float]): Edges of bins - - `histogram` ([int]): Number of elements falling in each bin. -### method `Histogram.__init__` + +## Methods + +### method from_json ```python -__init__( - sequence: 'Sequence | None' = None, - np_histogram: 'NumpyHistogram | None' = None, - num_bins: 'int' = 64 -) → None +json_obj: 'dict', +source_artifact: 'Artifact' ``` -Initialize a Histogram object. +Deserialize a `json_obj` into it's class representation. + +If additional resources were stored in the `run_or_artifact` artifact during the +`to_json` call, then those resources should be in the `source_artifact`. +##### Arguments +- **json_obj**: A JSON dictionary to deserialize source_artifact +- **source_artifact**: -**Args:** - sequence: Input data for histogram. np_histogram: Alternative input of a precomputed histogram. num_bins: Number of bins for the histogram. The default number of bins is 64. The maximum number of bins is 512. -**Examples:** - Generate histogram from a sequence. +### method init_from_json ```python -import wandb +json_obj: 'dict', +source_artifact: 'Artifact' +``` + +Initialize a `WBValue` from a JSON blob based on the class that created it. + +Looks through all subclasses and tries to match the json obj with the class +which created it. It will then call that subclass' `from_json` method. +Importantly, this function will set the return object's `source_artifact` +attribute to the passed in source artifact. This is critical for artifact +bookkeeping. If you choose to create a wandb.Value via it's `from_json` method, +make sure to properly set this `artifact_source` to avoid data duplication. -wandb.Histogram([1, 2, 3]) -``` +##### Arguments -Efficiently initialize from np.histogram. +- **json_obj**: A JSON dictionary to deserialize. It must contain a `_type` key. This is used to lookup the correct subclass to use. +- **source_artifact**: An artifact which will hold any additional resources which were stored during the `to_json` function. + + + + +### method to_data_array ```python -import numpy as np -import wandb +self +``` + +Convert the object to a list of primitives representing the underlying data. + + + + + +### method type_mapping + + + +Return a map from `_log_type` to subclass. Used to lookup correct types for deserialization. + + + + + +### method with_suffix + +```python +name: 'str', +filetype: 'str' = 'json' +``` + +Get the name with the appropriate suffix. + +##### Arguments + +- **name**: the name of the file +- **filetype**: the filetype to use. Defaults to "json". -hist = np.histogram(data) -wandb.Histogram(np_histogram=hist) -``` ---- diff --git a/models/ref/python/data-types/html.mdx b/models/ref/python/data-types/html.mdx index f28e8a10b5..ddf31b9f7d 100644 --- a/models/ref/python/data-types/html.mdx +++ b/models/ref/python/data-types/html.mdx @@ -1,58 +1,184 @@ --- title: Html -namespace: python_sdk_data_type -python_object_type: class +kind: class +namespace: wandb.sdk.data_types.html --- + import { GitHubLink } from '/snippets/_includes/github-source-link.mdx'; - + + + + +```python +data: 'str | pathlib.Path | TextIO', +inject: 'bool' = True, +data_is_not_path: 'bool' = False +``` + +## Description + +W&B class for logging HTML content to W&B. + + + +## Args + +- **data**: +- **inject**: +- **data_is_not_path**: + + + + + + +## Methods + +### method bind_to_run + +```python +self, +run: 'wandb.Run', +key: 'int | str', +step: 'int | str', +id_: 'int | str | None' = None, +ignore_copy_err: 'bool | None' = None +``` + +Bind this object to a particular Run. + +Calling this function is necessary so that we have somewhere specific to put the +file associated with this object, from which other Runs can refer to it. + +##### Arguments +- **run**: +- **key**: +- **step**: +- **id_**: +- **ignore_copy_err**: -## class `Html` -W&B class for logging HTML content to W&B. -### method `Html.__init__` + +### method captions ```python -__init__( - data: 'str | pathlib.Path | TextIO', - inject: 'bool' = True, - data_is_not_path: 'bool' = False -) → None +media_items: 'Sequence[Media]' ``` -Creates a W&B HTML object. +##### Arguments + +- **media_items**: -**Args:** - data: A string that is a path to a file with the extension ".html", or a string or IO object containing literal HTML. - - `inject`: Add a stylesheet to the HTML object. If set to False the HTML will pass through unchanged. - - `data_is_not_path`: If set to False, the data will be treated as a path to a file. -**Examples:** - It can be initialized by providing a path to a file: +### method file_is_set ```python -with wandb.init() as run: - run.log({"html": wandb.Html("./index.html")}) -``` +self +``` + + + + + -Alternatively, it can be initialized by providing literal HTML, in either a string or IO object: + +### method init_from_json ```python -with wandb.init() as run: - run.log({"html": wandb.Html("

Hello, world!

")}) -``` +json_obj: 'dict', +source_artifact: 'Artifact' +``` +Initialize a `WBValue` from a JSON blob based on the class that created it. + +Looks through all subclasses and tries to match the json obj with the class +which created it. It will then call that subclass' `from_json` method. +Importantly, this function will set the return object's `source_artifact` +attribute to the passed in source artifact. This is critical for artifact +bookkeeping. If you choose to create a wandb.Value via it's `from_json` method, +make sure to properly set this `artifact_source` to avoid data duplication. + +##### Arguments + +- **json_obj**: A JSON dictionary to deserialize. It must contain a `_type` key. This is used to lookup the correct subclass to use. +- **source_artifact**: An artifact which will hold any additional resources which were stored during the `to_json` function. + + + + +### method is_bound + +```python +self +``` + + + + + + + +### method path_is_reference + +```python +path: 'str | pathlib.Path | None' +``` + + + +##### Arguments + +- **path**: + + + + +### method to_data_array + +```python +self +``` + +Convert the object to a list of primitives representing the underlying data. + + + + + +### method type_mapping + + + +Return a map from `_log_type` to subclass. Used to lookup correct types for deserialization. + + + + + +### method with_suffix + +```python +name: 'str', +filetype: 'str' = 'json' +``` + +Get the name with the appropriate suffix. + +##### Arguments + +- **name**: the name of the file +- **filetype**: the filetype to use. Defaults to "json". ---- diff --git a/models/ref/python/data-types/image.mdx b/models/ref/python/data-types/image.mdx index 3729ff30b3..0dfcc0d43c 100644 --- a/models/ref/python/data-types/image.mdx +++ b/models/ref/python/data-types/image.mdx @@ -1,126 +1,160 @@ --- title: Image -namespace: python_sdk_data_type -python_object_type: class +kind: class +namespace: wandb.sdk.data_types.image --- + import { GitHubLink } from '/snippets/_includes/github-source-link.mdx'; - + + + + + +```python +data_or_path: 'ImageDataOrPathType', +mode: 'str | None' = None, +caption: 'str | None' = None, +grouping: 'int | None' = None, +classes: 'Classes | Sequence[dict] | None' = None, +boxes: 'dict[str, BoundingBoxes2D] | dict[str, dict] | None' = None, +masks: 'dict[str, ImageMask] | dict[str, dict] | None' = None, +file_type: 'str | None' = None, +normalize: 'bool' = True +``` + +## Description + +A class for logging images to W&B. + + + +## Args + +- **data_or_path**: +- **mode**: +- **caption**: +- **grouping**: +- **classes**: +- **boxes**: +- **masks**: +- **file_type**: +- **normalize**: + + +## Properties +### property image -## class `Image` -A class for logging images to W&B. -### method `Image.__init__` + + + +## Methods + +### method captions ```python -__init__( - data_or_path: 'ImageDataOrPathType', - mode: 'str | None' = None, - caption: 'str | None' = None, - grouping: 'int | None' = None, - classes: 'Classes | Sequence[dict] | None' = None, - boxes: 'dict[str, BoundingBoxes2D] | dict[str, dict] | None' = None, - masks: 'dict[str, ImageMask] | dict[str, dict] | None' = None, - file_type: 'str | None' = None, - normalize: 'bool' = True -) → None +media_items: 'Sequence[Media]' ``` -Initialize a `wandb.Image` object. -This class handles various image data formats and automatically normalizes pixel values to the range [0, 255] when needed, ensuring compatibility with the W&B backend. -* Data in range [0, 1] is multiplied by 255 and converted to uint8 * Data in range [-1, 1] is rescaled from [-1, 1] to [0, 255] by mapping - -1 to 0 and 1 to 255, then converted to uint8 * Data outside [-1, 1] but not in [0, 255] is clipped to [0, 255] and converted to uint8 (with a warning if values fall outside [0, 255]) * Data already in [0, 255] is converted to uint8 without modification +##### Arguments + +- **media_items**: + + +### method file_is_set + +```python +self +``` + -**Args:** - - - `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`. - - pytorch tensor should be in the format (channel, height, width) - - NumPy array should be in the format (height, width, channel) - - `mode`: The PIL mode for an image. Most common are "L", "RGB", "RGBA". - - `Full Pillow docs for more information https`: //pillow.readthedocs.io/en/stable/handbook/concepts.html#modes - - `caption`: Label for display of image. - - `grouping`: The grouping number for the image. - - `classes`: A list of class information for the image, used for labeling bounding boxes, and image masks. - - `boxes`: A dictionary containing bounding box information for the image. - - `see https`: //docs.wandb.ai/models/ref/python/data-types/boundingboxes2d - - `masks`: A dictionary containing mask information for the image. - - `see https`: //docs.wandb.ai/models/ref/python/data-types/imagemask - - `file_type`: The file type to save the image as. This parameter has no effect if `data_or_path` is a path to an image file. - - `normalize`: If `True`, normalize the image pixel values to fall within the range of [0, 255]. Normalize is only applied if `data_or_path` is a numpy array or pytorch tensor. -**Examples:** - Create a wandb.Image from a numpy array + + +### method init_from_json ```python -import numpy as np -import wandb +json_obj: 'dict', +source_artifact: 'Artifact' +``` -with wandb.init() as run: - examples = [] - for i in range(3): - pixels = np.random.randint(low=0, high=256, size=(100, 100, 3)) - image = wandb.Image(pixels, caption=f"random field {i}") - examples.append(image) - run.log({"examples": examples}) -``` +Initialize a `WBValue` from a JSON blob based on the class that created it. -Create a wandb.Image from a PILImage +Looks through all subclasses and tries to match the json obj with the class +which created it. It will then call that subclass' `from_json` method. +Importantly, this function will set the return object's `source_artifact` +attribute to the passed in source artifact. This is critical for artifact +bookkeeping. If you choose to create a wandb.Value via it's `from_json` method, +make sure to properly set this `artifact_source` to avoid data duplication. + +##### Arguments + +- **json_obj**: A JSON dictionary to deserialize. It must contain a `_type` key. This is used to lookup the correct subclass to use. +- **source_artifact**: An artifact which will hold any additional resources which were stored during the `to_json` function. + + + + +### method is_bound ```python -import numpy as np -from PIL import Image as PILImage -import wandb - -with wandb.init() as run: - examples = [] - for i in range(3): - pixels = np.random.randint( - low=0, high=256, size=(100, 100, 3), dtype=np.uint8 - ) - pil_image = PILImage.fromarray(pixels, mode="RGB") - image = wandb.Image(pil_image, caption=f"random field {i}") - examples.append(image) - run.log({"examples": examples}) -``` - -Log .jpg rather than .png (default) +self +``` + + + + + + + +### method path_is_reference ```python -import numpy as np -import wandb +path: 'str | pathlib.Path | None' +``` -with wandb.init() as run: - examples = [] - for i in range(3): - pixels = np.random.randint(low=0, high=256, size=(100, 100, 3)) - image = wandb.Image( - pixels, caption=f"random field {i}", file_type="jpg" - ) - examples.append(image) - run.log({"examples": examples}) -``` ---- +##### Arguments -### property Image.image +- **path**: +### method type_mapping ---- +Return a map from `_log_type` to subclass. Used to lookup correct types for deserialization. + + + + + +### method with_suffix + +```python +name: 'str', +filetype: 'str' = 'json' +``` + +Get the name with the appropriate suffix. + +##### Arguments + +- **name**: the name of the file +- **filetype**: the filetype to use. Defaults to "json". diff --git a/models/ref/python/data-types/molecule.mdx b/models/ref/python/data-types/molecule.mdx index 7de6135d08..d5cc8ad7a0 100644 --- a/models/ref/python/data-types/molecule.mdx +++ b/models/ref/python/data-types/molecule.mdx @@ -1,41 +1,243 @@ --- title: Molecule -namespace: python_sdk_data_type -python_object_type: class +kind: class +namespace: wandb.sdk.data_types.molecule --- + import { GitHubLink } from '/snippets/_includes/github-source-link.mdx'; - + + + + +```python +data_or_path: 'str | pathlib.Path | TextIO', +caption: 'str | None' = None, **kwargs: 'str' +``` + +## Description + +W&B class for 3D Molecular data. -## class `Molecule` -W&B class for 3D Molecular data. +## Args -### method `Molecule.__init__` +- **data_or_path**: +- **caption**: +- **kwargs**: + + + + + + +## Methods + +### method bind_to_run ```python -__init__( - data_or_path: 'str | pathlib.Path | TextIO', - caption: 'str | None' = None, - **kwargs: 'str' -) → None +self, +run: 'wandb.Run', +key: 'int | str', +step: 'int | str', +id_: 'int | str | None' = None, +ignore_copy_err: 'bool | None' = None ``` -Initialize a Molecule object. +Bind this object to a particular Run. +Calling this function is necessary so that we have somewhere specific to put the +file associated with this object, from which other Runs can refer to it. +##### Arguments -**Args:** - - - `data_or_path`: Molecule can be initialized from a file name or an io object. - - `caption`: Caption associated with the molecule for display. +- **run**: +- **key**: +- **step**: +- **id_**: +- **ignore_copy_err**: ---- +### method captions + +```python +media_items: 'Sequence[Media]' +``` + + + +##### Arguments + +- **media_items**: + + + + +### method file_is_set + +```python +self +``` + + + + + + + +### method from_json + +```python +json_obj: 'dict', +source_artifact: 'Artifact' +``` + +Likely will need to override for any more complicated media objects. + +##### Arguments + +- **json_obj**: +- **source_artifact**: + + + + +### method from_rdkit + +```python +data_or_path: 'RDKitDataType', +caption: 'str | None' = None, +convert_to_3d_and_optimize: 'bool' = True, +mmff_optimize_molecule_max_iterations: 'int' = 200 +``` + +Convert RDKit-supported file/object types to wandb.Molecule. + +##### Arguments + +- **data_or_path**: (string, rdkit.Chem.rdchem.Mol) Molecule can be initialized from a file name or an rdkit.Chem.rdchem.Mol object. +- **caption**: (string) Caption associated with the molecule for display. +- **convert_to_3d_and_optimize**: (bool) Convert to rdkit.Chem.rdchem.Mol with 3D coordinates. This is an expensive operation that may take a long time for complicated molecules. +- **mmff_optimize_molecule_max_iterations**: (int) Number of iterations to use in rdkit.Chem.AllChem.MMFFOptimizeMolecule + + + + +### method from_smiles + +```python +data: 'str', +caption: 'str | None' = None, +sanitize: 'bool' = True, +convert_to_3d_and_optimize: 'bool' = True, +mmff_optimize_molecule_max_iterations: 'int' = 200 +``` + +Convert SMILES string to wandb.Molecule. + +##### Arguments + +- **data**: SMILES string. +- **caption**: Caption associated with the molecule for display. +- **sanitize**: Check if the molecule is chemically reasonable by the RDKit's definition. +- **convert_to_3d_and_optimize**: Convert to rdkit.Chem.rdchem.Mol with 3D coordinates. This is a computationally intensive operation that may take a long time for complicated molecules. +- **mmff_optimize_molecule_max_iterations**: Number of iterations to use in rdkit.Chem.AllChem.MMFFOptimizeMolecule. + + + + +### method init_from_json + +```python +json_obj: 'dict', +source_artifact: 'Artifact' +``` + +Initialize a `WBValue` from a JSON blob based on the class that created it. + +Looks through all subclasses and tries to match the json obj with the class +which created it. It will then call that subclass' `from_json` method. +Importantly, this function will set the return object's `source_artifact` +attribute to the passed in source artifact. This is critical for artifact +bookkeeping. If you choose to create a wandb.Value via it's `from_json` method, +make sure to properly set this `artifact_source` to avoid data duplication. + +##### Arguments + +- **json_obj**: A JSON dictionary to deserialize. It must contain a `_type` key. This is used to lookup the correct subclass to use. +- **source_artifact**: An artifact which will hold any additional resources which were stored during the `to_json` function. + + + + +### method is_bound + +```python +self +``` + + + + + + + +### method path_is_reference + +```python +path: 'str | pathlib.Path | None' +``` + + + +##### Arguments + +- **path**: + + + + +### method to_data_array + +```python +self +``` + +Convert the object to a list of primitives representing the underlying data. + + + + + +### method type_mapping + + + +Return a map from `_log_type` to subclass. Used to lookup correct types for deserialization. + + + + + +### method with_suffix + +```python +name: 'str', +filetype: 'str' = 'json' +``` + +Get the name with the appropriate suffix. + +##### Arguments + +- **name**: the name of the file +- **filetype**: the filetype to use. Defaults to "json". + + diff --git a/models/ref/python/data-types/object3d.mdx b/models/ref/python/data-types/object3d.mdx index 5abbf63aff..facb30901c 100644 --- a/models/ref/python/data-types/object3d.mdx +++ b/models/ref/python/data-types/object3d.mdx @@ -1,52 +1,251 @@ --- title: Object3D -namespace: python_sdk_data_type -python_object_type: class +kind: class +namespace: wandb.sdk.data_types.object_3d --- + import { GitHubLink } from '/snippets/_includes/github-source-link.mdx'; - + + + + + +```python +data_or_path: 'np.ndarray | str | pathlib.Path | TextIO | dict', +caption: 'str | None' = None, **kwargs: 'str | FileFormat3D | None' +``` + +## Description + +W&B class for 3D point clouds. +## Args -## class `Object3D` -W&B class for 3D point clouds. +- **data_or_path**: +- **caption**: +- **kwargs**: -### method `Object3D.__init__` + + + + + +## Methods + +### method bind_to_run ```python -__init__( - data_or_path: 'np.ndarray | str | pathlib.Path | TextIO | dict', - caption: 'str | None' = None, - **kwargs: 'str | FileFormat3D | None' -) → None +self, +run: 'wandb.Run', +key: 'int | str', +step: 'int | str', +id_: 'int | str | None' = None, +ignore_copy_err: 'bool | None' = None ``` -Creates a W&B Object3D object. +Bind this object to a particular Run. +Calling this function is necessary so that we have somewhere specific to put the +file associated with this object, from which other Runs can refer to it. +##### Arguments -**Args:** - - - `data_or_path`: Object3D can be initialized from a file or a numpy array. - - `caption`: Caption associated with the object for display. +- **run**: +- **key**: +- **step**: +- **id_**: +- **ignore_copy_err**: -**Examples:** - The shape of the numpy array must be one of either -```text -[[x y z], ...] nx3 -[[x y z c], ...] nx4 where c is a category with supported range [1, 14] -[[x y z r g b], ...] nx6 where is rgb is color -``` +### method captions +```python +media_items: 'Sequence[Media]' +``` ---- +##### Arguments + +- **media_items**: + + + + +### method file_is_set + +```python +self +``` + + + + + + + +### method from_file + +```python +data_or_path: 'TextIO | str', +file_type: 'FileFormat3D | None' = None +``` + +Initializes Object3D from a file or stream. + +##### Arguments + +- **data_or_path**: A path to a file or a `TextIO` stream. +- **file_type**: Specifies the data format passed to `data_or_path`. Required when `data_or_path` is a `TextIO` stream. This parameter is ignored if a file path is provided. The type is taken from the file extension. + + + + +### method from_json + +```python +json_obj: 'dict', +source_artifact: 'Artifact' +``` + +Likely will need to override for any more complicated media objects. + +##### Arguments + +- **json_obj**: +- **source_artifact**: + + + + +### method from_numpy + +```python +data: 'np.ndarray' +``` + +Initializes Object3D from a numpy array. + +##### Arguments + +- **data**: Each entry in the array will represent one point in the point cloud. + + + + +### method from_point_cloud + +```python +points: 'Sequence[Point]', +boxes: 'Sequence[Box3D]', +vectors: 'Sequence[Vector3D] | None' = None, +point_cloud_type: 'PointCloudType' = 'lidar/beta' +``` + +Initializes Object3D from a python object. + +##### Arguments + +- **points**: The points in the point cloud. +- **boxes**: 3D bounding boxes for labeling the point cloud. Boxes are displayed in point cloud visualizations. +- **vectors**: Each vector is displayed in the point cloud visualization. Can be used to indicate directionality of bounding boxes. Defaults to None. +- **point_cloud_type**: At this time, only the "lidar/beta" type is supported. Defaults to "lidar/beta". + + + + +### method init_from_json + +```python +json_obj: 'dict', +source_artifact: 'Artifact' +``` + +Initialize a `WBValue` from a JSON blob based on the class that created it. + +Looks through all subclasses and tries to match the json obj with the class +which created it. It will then call that subclass' `from_json` method. +Importantly, this function will set the return object's `source_artifact` +attribute to the passed in source artifact. This is critical for artifact +bookkeeping. If you choose to create a wandb.Value via it's `from_json` method, +make sure to properly set this `artifact_source` to avoid data duplication. + +##### Arguments + +- **json_obj**: A JSON dictionary to deserialize. It must contain a `_type` key. This is used to lookup the correct subclass to use. +- **source_artifact**: An artifact which will hold any additional resources which were stored during the `to_json` function. + + + + +### method is_bound + +```python +self +``` + + + + + + + +### method path_is_reference + +```python +path: 'str | pathlib.Path | None' +``` + + + +##### Arguments + +- **path**: + + + + +### method to_data_array + +```python +self +``` + +Convert the object to a list of primitives representing the underlying data. + + + + + +### method type_mapping + + + +Return a map from `_log_type` to subclass. Used to lookup correct types for deserialization. + + + + + +### method with_suffix + +```python +name: 'str', +filetype: 'str' = 'json' +``` + +Get the name with the appropriate suffix. + +##### Arguments + +- **name**: the name of the file +- **filetype**: the filetype to use. Defaults to "json". + diff --git a/models/ref/python/data-types/plotly.mdx b/models/ref/python/data-types/plotly.mdx index 21ce43040c..34afd616f5 100644 --- a/models/ref/python/data-types/plotly.mdx +++ b/models/ref/python/data-types/plotly.mdx @@ -1,35 +1,197 @@ --- title: Plotly -namespace: python_sdk_data_type -python_object_type: class +kind: class +namespace: wandb.sdk.data_types.plotly --- + import { GitHubLink } from '/snippets/_includes/github-source-link.mdx'; - + + + + + +```python +(val: 'plotly.Figure | matplotlib.artist.Artist') +``` + +## Description + +W&B class for Plotly plots. + + + +## Args + +- **val**: + -## class `Plotly` -W&B class for Plotly plots. -### method `Plotly.__init__` +## Methods + +### method bind_to_run ```python -__init__(val: 'plotly.Figure | matplotlib.artist.Artist') +self, +run: 'wandb.Run', +key: 'int | str', +step: 'int | str', +id_: 'int | str | None' = None, +ignore_copy_err: 'bool | None' = None ``` -Initialize a Plotly object. +Bind this object to a particular Run. +Calling this function is necessary so that we have somewhere specific to put the +file associated with this object, from which other Runs can refer to it. +##### Arguments -**Args:** - - - `val`: Matplotlib or Plotly figure. +- **run**: +- **key**: +- **step**: +- **id_**: +- **ignore_copy_err**: + + + + +### method captions + +```python +media_items: 'Sequence[Media]' +``` + + + +##### Arguments + +- **media_items**: + + + + +### method file_is_set + +```python +self +``` + + + + + + + +### method from_json + +```python +json_obj: 'dict', +source_artifact: 'Artifact' +``` + +Likely will need to override for any more complicated media objects. + +##### Arguments + +- **json_obj**: +- **source_artifact**: + + + + +### method init_from_json + +```python +json_obj: 'dict', +source_artifact: 'Artifact' +``` + +Initialize a `WBValue` from a JSON blob based on the class that created it. + +Looks through all subclasses and tries to match the json obj with the class +which created it. It will then call that subclass' `from_json` method. +Importantly, this function will set the return object's `source_artifact` +attribute to the passed in source artifact. This is critical for artifact +bookkeeping. If you choose to create a wandb.Value via it's `from_json` method, +make sure to properly set this `artifact_source` to avoid data duplication. + +##### Arguments + +- **json_obj**: A JSON dictionary to deserialize. It must contain a `_type` key. This is used to lookup the correct subclass to use. +- **source_artifact**: An artifact which will hold any additional resources which were stored during the `to_json` function. + + + + +### method is_bound + +```python +self +``` + + + + + + + +### method path_is_reference + +```python +path: 'str | pathlib.Path | None' +``` + + + +##### Arguments + +- **path**: + + + + +### method to_data_array + +```python +self +``` + +Convert the object to a list of primitives representing the underlying data. + + + + + +### method type_mapping + + + +Return a map from `_log_type` to subclass. Used to lookup correct types for deserialization. + + + + + +### method with_suffix + +```python +name: 'str', +filetype: 'str' = 'json' +``` + +Get the name with the appropriate suffix. + +##### Arguments + +- **name**: the name of the file +- **filetype**: the filetype to use. Defaults to "json". ---- diff --git a/models/ref/python/data-types/table.mdx b/models/ref/python/data-types/table.mdx index b3bcbfa624..d1cd09940a 100644 --- a/models/ref/python/data-types/table.mdx +++ b/models/ref/python/data-types/table.mdx @@ -1,180 +1,297 @@ --- title: Table -namespace: python_sdk_data_type -python_object_type: class +kind: class +namespace: wandb.sdk.data_types.table --- + import { GitHubLink } from '/snippets/_includes/github-source-link.mdx'; - + + + + +```python +(columns=None, data=None, rows=None, dataframe=None, dtype=None, optional=True, allow_mixed_types=False, +log_mode: "Literal['IMMUTABLE', 'MUTABLE', 'INCREMENTAL'] | None" = 'IMMUTABLE') +``` + +## Description + +The Table class used to display and analyze tabular data. + +Unlike traditional spreadsheets, Tables support numerous types of data: +scalar values, strings, numpy arrays, and most subclasses of `wandb.data_types.Media`. +This means you can embed `Images`, `Video`, `Audio`, and other sorts of rich, annotated media +directly in Tables, alongside other traditional scalar values. + +This class is the primary class used to generate W&B Tables +https://docs.wandb.ai/models/tables + + + +## Args + +- **columns**: +- **data**: +- **rows**: +- **dataframe**: +- **dtype**: +- **optional**: +- **allow_mixed_types**: +- **log_mode**: -## class `Table` -The Table class used to display and analyze tabular data. -Unlike traditional spreadsheets, Tables support numerous types of data: scalar values, strings, numpy arrays, and most subclasses of `wandb.data_types.Media`. This means you can embed `Images`, `Video`, `Audio`, and other sorts of rich, annotated media directly in Tables, alongside other traditional scalar values. -This class is the primary class used to generate W&B Tables https://docs.wandb.ai/models/tables -### method `Table.__init__` +## Methods + +### method add_column ```python -__init__( - columns=None, - data=None, - rows=None, - dataframe=None, - dtype=None, - optional=True, - allow_mixed_types=False, - log_mode: "Literal['IMMUTABLE', 'MUTABLE', 'INCREMENTAL'] | None" = 'IMMUTABLE' -) +(self, name, data, optional=False) ``` -Initializes a Table object. +Adds a column of data to the table. -The rows is available for legacy reasons and should not be used. The Table class uses data to mimic the Pandas API. +##### Arguments +- **name**: (str) - the unique name of the column +- **data**: (list | np.array) - a column of homogeneous data +- **optional**: (bool) - if null-like values are permitted -**Args:** - - - `columns`: (List[str]) Names of the columns in the table. Defaults to ["Input", "Output", "Expected"]. - - `data`: (List[List[any]]) 2D row-oriented array of values. - - `dataframe`: (pandas.DataFrame) DataFrame object used to create the table. When set, `data` and `columns` arguments are ignored. - - `rows`: (List[List[any]]) 2D row-oriented array of values. - - `optional`: (Union[bool,List[bool]]) Determines if `None` values are allowed. Default to True - - If a singular bool value, then the optionality is enforced for all columns specified at construction time - - If a list of bool values, then the optionality is applied to each column - should be the same length as `columns` applies to all columns. A list of bool values applies to each respective column. - - `allow_mixed_types`: (bool) Determines if columns are allowed to have mixed types (disables type validation). Defaults to False - - `log_mode`: Optional[str] Controls how the Table is logged when mutations occur. Options: - - "IMMUTABLE" (default): Table can only be logged once; subsequent logging attempts after the table has been mutated will be no-ops. - - "MUTABLE": Table can be re-logged after mutations, creating a new artifact version each time it's logged. - - "INCREMENTAL": Table data is logged incrementally, with each log creating a new artifact entry containing the new data since the last log. +### method add_computed_columns +```python +(self, fn) +``` + +Adds one or more computed columns based on existing data. + +##### Arguments + +- **fn**: A function which accepts one or two parameters, ndx (int) and row (dict), which is expected to return a dict representing new columns for that row, keyed by the new column names. - `ndx` is an integer representing the index of the row. Only included if `include_ndx` is set to `True`. - `row` is a dictionary keyed by existing columns ---- -### method `Table.add_column` + + +### method add_data ```python -add_column(name, data, optional=False) +(self, *data) ``` -Adds a column of data to the table. +Adds a new row of data to the table. +The maximum amount ofrows in a table is determined by +`wandb.Table.MAX_ARTIFACT_ROWS`. +The length of the data should match the length of the table column. -**Args:** - - - `name`: (str) - the unique name of the column - - `data`: (list | np.array) - a column of homogeneous data - - `optional`: (bool) - if null-like values are permitted +##### Arguments + +- **data**: ---- -### method `Table.add_computed_columns` + + +### method add_row ```python -add_computed_columns(fn) +(self, *row) ``` -Adds one or more computed columns based on existing data. +Deprecated. Use `Table.add_data` method instead. +##### Arguments +- **row**: -**Args:** - - - `fn`: A function which accepts one or two parameters, ndx (int) and row (dict), which is expected to return a dict representing new columns for that row, keyed by the new column names. - - `ndx` is an integer representing the index of the row. Only included if `include_ndx` is set to `True`. - - `row` is a dictionary keyed by existing columns ---- -### method `Table.add_data` + +### method captions ```python -add_data(*data) +media_items: 'Sequence[Media]' ``` -Adds a new row of data to the table. -The maximum amount ofrows in a table is determined by `wandb.Table.MAX_ARTIFACT_ROWS`. -The length of the data should match the length of the table column. +##### Arguments + +- **media_items**: + ---- -### method `Table.add_row` + +### method cast ```python -add_row(*row) +(self, col_name, dtype, optional=False) ``` -Deprecated. Use `Table.add_data` method instead. +Casts a column to a specific data type. ---- +This can be one of the normal python classes, an internal W&B type, +or an example object, like an instance of wandb.Image or +wandb.Classes. + +##### Arguments +- **col_name**: The name of the column to cast. +- **dtype**: The target dtype. +- **optional**: If the column should allow Nones. -### method `Table.cast` + + + +### method file_is_set ```python -cast(col_name, dtype, optional=False) +self ``` -Casts a column to a specific data type. -This can be one of the normal python classes, an internal W&B type, or an example object, like an instance of wandb.Image or wandb.Classes. -**Args:** - - - `col_name` (str): The name of the column to cast. - - `dtype` (class, wandb.wandb_sdk.interface._dtypes.Type, any): The target dtype. - - `optional` (bool): If the column should allow Nones. ---- +### method get_column + +```python +(self, name, convert_to=None) +``` -### method `Table.get_column` +Retrieves a column from the table and optionally converts it to a NumPy object. + +##### Arguments + +- **name**: (str) - the name of the column +- **convert_to**: (str, optional) + + + + +### method get_dataframe ```python -get_column(name, convert_to=None) +(self) ``` -Retrieves a column from the table and optionally converts it to a NumPy object. +Returns a `pandas.DataFrame` of the table. -**Args:** - - - `name`: (str) - the name of the column - - `convert_to`: (str, optional) - - "numpy": will convert the underlying data to numpy object ---- -### method `Table.get_dataframe` +### method get_index ```python -get_dataframe() +(self) ``` -Returns a `pandas.DataFrame` of the table. +Returns an array of row indexes for use in other tables to create links. + + ---- -### method `Table.get_index` + +### method init_from_json ```python -get_index() +json_obj: 'dict', +source_artifact: 'Artifact' ``` -Returns an array of row indexes for use in other tables to create links. +Initialize a `WBValue` from a JSON blob based on the class that created it. + +Looks through all subclasses and tries to match the json obj with the class +which created it. It will then call that subclass' `from_json` method. +Importantly, this function will set the return object's `source_artifact` +attribute to the passed in source artifact. This is critical for artifact +bookkeeping. If you choose to create a wandb.Value via it's `from_json` method, +make sure to properly set this `artifact_source` to avoid data duplication. + +##### Arguments + +- **json_obj**: A JSON dictionary to deserialize. It must contain a `_type` key. This is used to lookup the correct subclass to use. +- **source_artifact**: An artifact which will hold any additional resources which were stored during the `to_json` function. + + + + +### method is_bound + +```python +self +``` + + + + + + + +### method path_is_reference + +```python +path: 'str | pathlib.Path | None' +``` + + + +##### Arguments + +- **path**: + + + + +### method to_data_array + +```python +self +``` + +Convert the object to a list of primitives representing the underlying data. + + + + + +### method type_mapping + + + +Return a map from `_log_type` to subclass. Used to lookup correct types for deserialization. + + + + + +### method with_suffix + +```python +name: 'str', +filetype: 'str' = 'json' +``` + +Get the name with the appropriate suffix. + +##### Arguments + +- **name**: the name of the file +- **filetype**: the filetype to use. Defaults to "json". + + + + ---- diff --git a/models/ref/python/data-types/video.mdx b/models/ref/python/data-types/video.mdx index 7e6ccf5c2f..bf9b82634f 100644 --- a/models/ref/python/data-types/video.mdx +++ b/models/ref/python/data-types/video.mdx @@ -1,61 +1,203 @@ --- title: Video -namespace: python_sdk_data_type -python_object_type: class +kind: class +namespace: wandb.sdk.data_types.video --- + import { GitHubLink } from '/snippets/_includes/github-source-link.mdx'; - + + + + + +```python +(data_or_path: 'str | pathlib.Path | np.ndarray | TextIO | BytesIO', +caption: 'str | None' = None, +fps: 'int | None' = None, +format: "Literal['gif', 'mp4', 'webm', 'ogg'] | None" = None) +``` + +## Description + +A class for logging videos to W&B. + + + +## Args + +- **data_or_path**: +- **caption**: +- **fps**: +- **format**: -## class `Video` -A class for logging videos to W&B. -### method `Video.__init__` + +## Methods + +### method bind_to_run ```python -__init__( - data_or_path: 'str | pathlib.Path | np.ndarray | TextIO | BytesIO', - caption: 'str | None' = None, - fps: 'int | None' = None, - format: "Literal['gif', 'mp4', 'webm', 'ogg'] | None" = None -) +self, +run: 'wandb.Run', +key: 'int | str', +step: 'int | str', +id_: 'int | str | None' = None, +ignore_copy_err: 'bool | None' = None ``` -Initialize a W&B Video object. +Bind this object to a particular Run. + +Calling this function is necessary so that we have somewhere specific to put the +file associated with this object, from which other Runs can refer to it. +##### Arguments +- **run**: +- **key**: +- **step**: +- **id_**: +- **ignore_copy_err**: -**Args:** - - - `data_or_path`: Video can be initialized with a path to a file or an io object. Video can be initialized with a numpy tensor. The numpy tensor must be either 4 dimensional or 5 dimensional. The dimensions should be (number of frames, channel, height, width) or (batch, number of frames, channel, height, width) The format parameter must be specified with the format argument when initializing with a numpy array or io object. - - `caption`: Caption associated with the video for display. - - `fps`: The frame rate to use when encoding raw video frames. Default value is 4. This parameter has no effect when data_or_path is a string, or bytes. - - `format`: Format of video, necessary if initializing with a numpy array or io object. This parameter will be used to determine the format to use when encoding the video data. Accepted values are "gif", "mp4", "webm", or "ogg". If no value is provided, the default format will be "gif". -**Examples:** - Log a numpy array as a video +### method captions ```python -import numpy as np -import wandb +media_items: 'Sequence[Media]' +``` -with wandb.init() as run: - # axes are (number of frames, channel, height, width) - frames = np.random.randint( - low=0, high=256, size=(10, 3, 100, 100), dtype=np.uint8 - ) - run.log({"video": wandb.Video(frames, format="mp4", fps=4)}) -``` +##### Arguments + +- **media_items**: + + + + +### method file_is_set + +```python +self +``` + + + + + + + +### method from_json + +```python +json_obj: 'dict', +source_artifact: 'Artifact' +``` + +Likely will need to override for any more complicated media objects. + +##### Arguments + +- **json_obj**: +- **source_artifact**: + + + + +### method init_from_json + +```python +json_obj: 'dict', +source_artifact: 'Artifact' +``` + +Initialize a `WBValue` from a JSON blob based on the class that created it. + +Looks through all subclasses and tries to match the json obj with the class +which created it. It will then call that subclass' `from_json` method. +Importantly, this function will set the return object's `source_artifact` +attribute to the passed in source artifact. This is critical for artifact +bookkeeping. If you choose to create a wandb.Value via it's `from_json` method, +make sure to properly set this `artifact_source` to avoid data duplication. + +##### Arguments + +- **json_obj**: A JSON dictionary to deserialize. It must contain a `_type` key. This is used to lookup the correct subclass to use. +- **source_artifact**: An artifact which will hold any additional resources which were stored during the `to_json` function. + + + + +### method is_bound + +```python +self +``` + + + + + + + +### method path_is_reference + +```python +path: 'str | pathlib.Path | None' +``` + + + +##### Arguments + +- **path**: + + + + +### method to_data_array + +```python +self +``` + +Convert the object to a list of primitives representing the underlying data. + + + + + +### method type_mapping + + + +Return a map from `_log_type` to subclass. Used to lookup correct types for deserialization. + + + + + +### method with_suffix + +```python +name: 'str', +filetype: 'str' = 'json' +``` + +Get the name with the appropriate suffix. + +##### Arguments + +- **name**: the name of the file +- **filetype**: the filetype to use. Defaults to "json". + ---- diff --git a/models/ref/python/experiments/artifact.mdx b/models/ref/python/experiments/artifact.mdx index ccd9545b45..6e9977fa83 100644 --- a/models/ref/python/experiments/artifact.mdx +++ b/models/ref/python/experiments/artifact.mdx @@ -1,1126 +1,801 @@ --- title: Artifact -namespace: python_sdk_actions -python_object_type: class +kind: class +namespace: wandb.sdk.artifacts.artifact --- -import { GitHubLink } from '/snippets/_includes/github-source-link.mdx'; - - - +import { GitHubLink } from '/snippets/_includes/github-source-link.mdx'; -## class `Artifact` -Flexible and lightweight building block for dataset and model versioning. + -Construct an empty W&B Artifact. Populate an artifacts contents with methods that begin with `add`. Once the artifact has all the desired files, you can call `run.log_artifact()` to log it. -### method `Artifact.__init__` ```python -__init__( - name: 'str', - type: 'str', - description: 'str | None' = None, - metadata: 'dict[str, Any] | None' = None, - incremental: 'bool' = False, - use_as: 'str | None' = None, - storage_region: 'str | None' = None -) → None +name: 'str', +type: 'str', +description: 'str | None' = None, +metadata: 'dict[str, Any] | None' = None, +incremental: 'bool' = False, +use_as: 'str | None' = None, +storage_region: 'str | None' = None ``` -**Args:** - - - `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. - - `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-`. - - `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. - - `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. - - `incremental`: Use `Artifact.new_draft()` method instead to modify an existing artifact. - - `use_as`: Deprecated. - - - -**Returns:** - An `Artifact` object. - - - - - - - ---- +## Description -### property Artifact.aliases +Flexible and lightweight building block for dataset and model versioning. -List of one or more semantically-friendly references or +Construct an empty W&B Artifact. Populate an artifacts contents with methods that +begin with `add`. Once the artifact has all the desired files, you can call +`run.log_artifact()` to log it. -identifying "nicknames" assigned to an artifact version. -Aliases are mutable references that you can programmatically reference. Change an artifact's alias with the W&B App UI or programmatically. See [Create new artifact versions](https://docs.wandb.ai/models/artifacts/create-a-new-artifact-version) for more information. +## Args +- **name**: 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. +- **type**: 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-`. +- **description**: 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. +- **metadata**: Additional information about an artifact. Specify metadata as a dictionary of key-value pairs. You can specify no more than 100 total keys. +- **incremental**: Use `Artifact.new_draft()` method instead to modify an existing artifact. +- **use_as**: Deprecated. +- **storage_region**: -**Returns:** - - `list[str]`: The aliases property value. ---- -### property Artifact.collection -The collection this artifact is retrieved from. -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. +## Properties -The collection that an artifact originates from is known as the source sequence. +### property id +The artifact's ID. +### property entity -**Returns:** - - `ArtifactCollection`: The collection property value. ---- +The name of the entity that the artifact collection belongs to. -### property Artifact.commit_hash +If the artifact is a link, the entity will be the entity of the linked artifact. -The hash returned when this artifact was committed. +### property project +The name of the project that the artifact collection belongs to. +If the artifact is a link, the project will be the project of the linked artifact. -**Returns:** - - `str`: The commit_hash property value. ---- +### property name -### property Artifact.created_at +The artifact name and version of the artifact. -Timestamp when the artifact was created. +A string with the format `{collection}:{alias}`. If fetched before an artifact is +logged/saved, the name won't contain the alias. +If the artifact is a link, the name will be the name of the linked artifact. +### property qualified_name +The entity/project/name of the artifact. -**Returns:** - - `str`: The created_at property value. ---- +If the artifact is a link, the qualified name will be the qualified name of the +linked artifact path. -### property Artifact.description +### property version -A description of the artifact. +The artifact's version. +A string with the format `v{number}`. +If this is a link artifact, the version will be from the linked collection. +### property collection -**Returns:** - - `str | None`: The description property value. ---- +The collection this artifact is retrieved from. -### property Artifact.digest +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. -The logical digest of the artifact. +The collection that an artifact originates from is known as +the source sequence. -The digest is the checksum of the artifact's contents. If an artifact has the same digest as the current `latest` version, then `log_artifact` is a no-op. +### property source_entity +The name of the entity of the source artifact. +### property source_project -**Returns:** - - `str`: The digest property value. ---- +The name of the project of the source artifact. +### property source_name -### property Artifact.entity +The artifact name and version of the source artifact. -The name of the entity that the artifact collection belongs to. +A string with the format `{source_collection}:{alias}`. Before the artifact +is saved, contains only the name since the version is not yet known. -If the artifact is a link, the entity will be the entity of the linked artifact. +### property source_qualified_name +The source_entity/source_project/source_name of the source artifact. +### property source_version -**Returns:** - - `str`: The entity property value. ---- +The source artifact's version. -### property Artifact.file_count +A string with the format `v{number}`. -The number of files (including references). +### property source_collection +The artifact's source collection. +The source collection is the collection that the artifact was logged from. -**Returns:** - - `int`: The file_count property value. ---- +### property is_link -### property Artifact.history_step +Boolean flag indicating if the artifact is a link artifact. -The nearest step which logged history metrics for this artifact's source run. +True: The artifact is a link artifact to a source artifact. +False: The artifact is a source artifact. +### property linked_artifacts +Returns a list of all the linked artifacts of a source artifact. -**Examples:** - ```python -run = artifact.logged_by() -if run and (artifact.history_step is not None): - history = run.sample_history( - min_step=artifact.history_step, - max_step=artifact.history_step + 1, - keys=["my_metric"], - ) -``` +If this artifact is a link artifact (`artifact.is_link == True`), +it will return an empty list. +Limited to 500 results. +### property source_artifact -**Returns:** - - `int | None`: The history_step property value. ---- +Returns the source artifact, which is the original logged artifact. -### property Artifact.id +If this artifact is a source artifact (`artifact.is_link == False`), +it will return itself. -The artifact's ID. +### property type +The artifact's type. Common types include `dataset` or `model`. +### property url -**Returns:** - - `str | None`: The id property value. ---- +Constructs the URL of the artifact. +### property description -### property Artifact.is_link +A description of the artifact. -Boolean flag indicating if the artifact is a link artifact. +### property metadata -True: The artifact is a link artifact to a source artifact. False: The artifact is a source artifact. +User-defined artifact metadata. +Structured data associated with the artifact. +### property ttl -**Returns:** - - `bool`: The is_link property value. ---- +The time-to-live (TTL) policy of an artifact. -### property Artifact.linked_artifacts +Artifacts are deleted shortly after a TTL policy's duration passes. +If set to `None`, the artifact deactivates TTL policies and will be not +scheduled for deletion, even if there is a team default TTL. +An artifact inherits a TTL policy from +the team default if the team administrator defines a default +TTL and there is no custom policy set on an artifact. -Returns a list of all the linked artifacts of a source artifact. +### property aliases -If this artifact is a link artifact (`artifact.is_link == True`), it will return an empty list. +List of one or more semantically-friendly references or -Limited to 500 results. +identifying "nicknames" assigned to an artifact version. +Aliases are mutable references that you can programmatically reference. +Change an artifact's alias with the W&B App UI or programmatically. +See [Create new artifact versions](https://docs.wandb.ai/models/artifacts/create-a-new-artifact-version) +for more information. +### property tags -**Returns:** - - `list[Artifact]`: The linked_artifacts property value. ---- +List of one or more tags assigned to this artifact version. -### property Artifact.manifest +### property use_as -The artifact's manifest. +Deprecated. -The manifest lists all of its contents, and can't be changed once the artifact has been logged. +### property state +The status of the artifact. One of: "PENDING", "COMMITTED", or "DELETED". +### property manifest -**Returns:** - - `ArtifactManifest`: The manifest property value. ---- +The artifact's manifest. -### property Artifact.metadata +The manifest lists all of its contents, and can't be changed once the artifact +has been logged. -User-defined artifact metadata. +### property digest -Structured data associated with the artifact. +The logical digest of the artifact. +The digest is the checksum of the artifact's contents. If an artifact has the +same digest as the current `latest` version, then `log_artifact` is a no-op. +### property size -**Returns:** - - `dict`: The metadata property value. ---- +The total size of the artifact in bytes. -### property Artifact.name +Includes any references tracked by this artifact. -The artifact name and version of the artifact. +### property commit_hash -A string with the format `{collection}:{alias}`. If fetched before an artifact is logged/saved, the name won't contain the alias. If the artifact is a link, the name will be the name of the linked artifact. +The hash returned when this artifact was committed. +### property file_count +The number of files (including references). -**Returns:** - - `str`: The name property value. ---- +### property created_at -### property Artifact.project +Timestamp when the artifact was created. -The name of the project that the artifact collection belongs to. +### property updated_at -If the artifact is a link, the project will be the project of the linked artifact. +The time when the artifact was last updated. +### property history_step +The nearest step which logged history metrics for this artifact's source run. -**Returns:** - - `str`: The project property value. ---- - -### property Artifact.qualified_name - -The entity/project/name of the artifact. - -If the artifact is a link, the qualified name will be the qualified name of the linked artifact path. - - - -**Returns:** - - `str`: The qualified_name property value. ---- - -### property Artifact.size - -The total size of the artifact in bytes. - -Includes any references tracked by this artifact. - - - -**Returns:** - - `int`: The size property value. ---- - -### property Artifact.source_artifact - -Returns the source artifact, which is the original logged artifact. - -If this artifact is a source artifact (`artifact.is_link == False`), it will return itself. - - - -**Returns:** - - `Artifact`: The source_artifact property value. ---- - -### property Artifact.source_collection - -The artifact's source collection. - -The source collection is the collection that the artifact was logged from. - - - -**Returns:** - - `ArtifactCollection`: The source_collection property value. ---- -### property Artifact.source_entity -The name of the entity of the source artifact. - - - -**Returns:** - - `str`: The source_entity property value. ---- - -### property Artifact.source_name - -The artifact name and version of the source artifact. - -A string with the format `{source_collection}:{alias}`. Before the artifact is saved, contains only the name since the version is not yet known. - - - -**Returns:** - - `str`: The source_name property value. ---- - -### property Artifact.source_project - -The name of the project of the source artifact. - - - -**Returns:** - - `str`: The source_project property value. ---- - -### property Artifact.source_qualified_name - -The source_entity/source_project/source_name of the source artifact. - - - -**Returns:** - - `str`: The source_qualified_name property value. ---- - -### property Artifact.source_version - -The source artifact's version. - -A string with the format `v{number}`. - - - -**Returns:** - - `str`: The source_version property value. ---- - -### property Artifact.state - -The status of the artifact. One of: "PENDING", "COMMITTED", or "DELETED". - - - -**Returns:** - - `str`: The state property value. ---- - -### property Artifact.tags - -List of one or more tags assigned to this artifact version. - - - -**Returns:** - - `list[str]`: The tags property value. ---- - -### property Artifact.ttl - -The time-to-live (TTL) policy of an artifact. - -Artifacts are deleted shortly after a TTL policy's duration passes. If set to `None`, the artifact deactivates TTL policies and will be not scheduled for deletion, even if there is a team default TTL. An artifact inherits a TTL policy from the team default if the team administrator defines a default TTL and there is no custom policy set on an artifact. - - - -**Raises:** - - - `ArtifactNotLoggedError`: Unable to fetch inherited TTL if the artifact has not been logged or saved. - - - -**Returns:** - - `timedelta | None`: The ttl property value. ---- - -### property Artifact.type - -The artifact's type. Common types include `dataset` or `model`. - - - -**Returns:** - - `str`: The type property value. ---- +## Methods -### property Artifact.updated_at - -The time when the artifact was last updated. - - - -**Returns:** - - `str`: The updated_at property value. ---- - -### property Artifact.url - -Constructs the URL of the artifact. - - - -**Returns:** - - - `str`: The URL of the artifact. - - - -**Returns:** - - `str`: The url property value. ---- - -### property Artifact.use_as - -Deprecated. - - - -**Returns:** - - `str | None`: The use_as property value. ---- - -### property Artifact.version - -The artifact's version. - -A string with the format `v{number}`. If this is a link artifact, the version will be from the linked collection. - - - - - -**Returns:** - - `str`: The version property value. ---- - -### method `Artifact.add` +### method add ```python -add( - obj: 'WBValue', - name: 'StrPath', - overwrite: 'bool' = False -) → ArtifactManifestEntry +self, +obj: 'WBValue', +name: 'StrPath', +overwrite: 'bool' = False ``` -Add wandb.WBValue `obj` to the artifact. - - - -**Args:** - - - `obj`: The object to add. Currently support one of Bokeh, JoinedTable, PartitionedTable, Table, Classes, ImageMask, BoundingBoxes2D, Audio, Image, Video, Html, Object3D - - `name`: The path within the artifact to add the object. - - `overwrite`: If True, overwrite existing objects with the same file path if applicable. +Add wandb.WBValue `obj` to the artifact. +##### Arguments +- **obj**: The object to add. Currently support one of Bokeh, JoinedTable, PartitionedTable, Table, Classes, ImageMask, BoundingBoxes2D, Audio, Image, Video, Html, Object3D +- **name**: The path within the artifact to add the object. +- **overwrite**: If True, overwrite existing objects with the same file path if applicable. -**Returns:** - The added manifest entry +##### Raises +- **ArtifactFinalizedError**: You cannot make changes to the current artifact version because it is finalized. Log a new artifact version instead. -**Raises:** - - - `ArtifactFinalizedError`: You cannot make changes to the current artifact version because it is finalized. Log a new artifact version instead. ---- - -### method `Artifact.add_dir` +### method add_dir ```python -add_dir( - local_path: 'str', - name: 'str | None' = None, - skip_cache: 'bool | None' = False, - policy: "Literal['mutable', 'immutable'] | None" = 'mutable', - merge: 'bool' = False -) → None +self, +local_path: 'str', +name: 'str | None' = None, +skip_cache: 'bool | None' = False, +policy: "Literal['mutable', 'immutable'] | None" = 'mutable', +merge: 'bool' = False ``` -Add a local directory to the artifact. +Add a local directory to the artifact. +##### Arguments +- **local_path**: The path of the local directory. +- **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. +- **skip_cache**: If set to `True`, W&B will not copy/move files to the cache while uploading +- **policy**: By default, "mutable". +- **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. -**Args:** - - - `local_path`: The path of the local directory. - - `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. - - `skip_cache`: If set to `True`, W&B will not copy/move files to the cache while uploading - - `policy`: By default, "mutable". - - mutable: Create a temporary copy of the file to prevent corruption during upload. - - immutable: Disable protection, rely on the user not to delete or change the file. - - `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. +##### Raises +- **ArtifactFinalizedError**: You cannot make changes to the current artifact version because it is finalized. Log a new artifact version instead. +- **ValueError**: Policy must be "mutable" or "immutable" -**Raises:** - - - `ArtifactFinalizedError`: You cannot make changes to the current artifact version because it is finalized. Log a new artifact version instead. - - `ValueError`: Policy must be "mutable" or "immutable" - ---- -### method `Artifact.add_file` +### method add_file ```python -add_file( - local_path: 'str', - name: 'str | None' = None, - is_tmp: 'bool | None' = False, - skip_cache: 'bool | None' = False, - policy: "Literal['mutable', 'immutable'] | None" = 'mutable', - overwrite: 'bool' = False -) → ArtifactManifestEntry +self, +local_path: 'str', +name: 'str | None' = None, +is_tmp: 'bool | None' = False, +skip_cache: 'bool | None' = False, +policy: "Literal['mutable', 'immutable'] | None" = 'mutable', +overwrite: 'bool' = False ``` -Add a local file to the artifact. +Add a local file to the artifact. +##### Arguments +- **local_path**: The path to the file being added. +- **name**: The path within the artifact to use for the file being added. Defaults to the basename of the file. +- **is_tmp**: If true, then the file is renamed deterministically to avoid collisions. +- **skip_cache**: If `True`, do not copy files to the cache after uploading. +- **policy**: By default, set to "mutable". If set to "mutable", create a temporary copy of the file to prevent corruption during upload. If set to "immutable", disable protection and rely on the user not to delete or change the file. +- **overwrite**: If `True`, overwrite the file if it already exists. -**Args:** - - - `local_path`: The path to the file being added. - - `name`: The path within the artifact to use for the file being added. Defaults to the basename of the file. - - `is_tmp`: If true, then the file is renamed deterministically to avoid collisions. - - `skip_cache`: If `True`, do not copy files to the cache after uploading. - - `policy`: By default, set to "mutable". If set to "mutable", create a temporary copy of the file to prevent corruption during upload. If set to "immutable", disable protection and rely on the user not to delete or change the file. - - `overwrite`: If `True`, overwrite the file if it already exists. +##### Raises +- **ArtifactFinalizedError**: You cannot make changes to the current artifact version because it is finalized. Log a new artifact version instead. +- **ValueError**: Policy must be "mutable" or "immutable" -**Returns:** - The added manifest entry. - - -**Raises:** - - - `ArtifactFinalizedError`: You cannot make changes to the current artifact version because it is finalized. Log a new artifact version instead. - - `ValueError`: Policy must be "mutable" or "immutable" - ---- - -### method `Artifact.add_reference` +### method add_reference ```python -add_reference( - uri: 'ArtifactManifestEntry | str', - name: 'StrPath | None' = None, - checksum: 'bool' = True, - max_objects: 'int | None' = None -) → Sequence[ArtifactManifestEntry] +self, +uri: 'ArtifactManifestEntry | str', +name: 'StrPath | None' = None, +checksum: 'bool' = True, +max_objects: 'int | None' = None ``` -Add a reference denoted by a URI to the artifact. - -Unlike files or directories that you add to an artifact, references are not uploaded to W&B. For more information, see [Track external files](https://docs.wandb.ai/models/artifacts/track-external-files). - -By default, the following schemes are supported: +Add a reference denoted by a URI to the artifact. +Unlike files or directories that you add to an artifact, references are not +uploaded to W&B. For more information, +see [Track external files](https://docs.wandb.ai/models/artifacts/track-external-files). -- http(s): The size and digest of the file will be inferred by the `Content-Length` and the `ETag` response headers returned by the server. -- s3: The checksum and size are pulled from the object metadata. If bucket versioning is enabled, then the version ID is also tracked. -- gs: The checksum and size are pulled from the object metadata. If bucket versioning is enabled, then the version ID is also tracked. -- https, domain matching `*.blob.core.windows.net` -- Azure: The checksum and size are be pulled from the blob metadata. If storage account versioning is enabled, then the version ID is also tracked. -- file: The checksum and size are pulled from the file system. This scheme is useful if you have an NFS share or other externally mounted volume containing files you wish to track but not necessarily upload. +By default, the following schemes are supported: -For any other scheme, the digest is just a hash of the URI and the size is left blank. +- http(s): The size and digest of the file will be inferred by the + `Content-Length` and the `ETag` response headers returned by the server. +- s3: The checksum and size are pulled from the object metadata. + If bucket versioning is enabled, then the version ID is also tracked. +- gs: The checksum and size are pulled from the object metadata. If bucket + versioning is enabled, then the version ID is also tracked. +- https, domain matching `*.blob.core.windows.net` +- Azure: The checksum and size are be pulled from the blob metadata. + If storage account versioning is enabled, then the version ID is + also tracked. +- file: The checksum and size are pulled from the file system. This scheme + is useful if you have an NFS share or other externally mounted volume + containing files you wish to track but not necessarily upload. +For any other scheme, the digest is just a hash of the URI and the size is left +blank. +##### Arguments -**Args:** - - - `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. - - `name`: The path within the artifact to place the contents of this reference. - - `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. - - `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. +- **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. +- **name**: The path within the artifact to place the contents of this reference. +- **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. +- **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. +##### Raises -**Returns:** - The added manifest entries. +- **ArtifactFinalizedError**: You cannot make changes to the current artifact version because it is finalized. Log a new artifact version instead. - -**Raises:** - - - `ArtifactFinalizedError`: You cannot make changes to the current artifact version because it is finalized. Log a new artifact version instead. - ---- - -### method `Artifact.checkout` +### method checkout ```python -checkout(root: 'str | None' = None) → str +self, +root: 'str | None' = None ``` -Replace the specified root directory with the contents of the artifact. - -WARNING: This will delete all files in `root` that are not included in the artifact. - - +Replace the specified root directory with the contents of the artifact. -**Args:** - - - `root`: The directory to replace with this artifact's files. +WARNING: This will delete all files in `root` that are not included in the +artifact. +##### Arguments +- **root**: The directory to replace with this artifact's files. -**Returns:** - The path of the checked out contents. +##### Raises +- **ArtifactNotLoggedError**: If the artifact is not logged. -**Raises:** - - - `ArtifactNotLoggedError`: If the artifact is not logged. ---- - -### method `Artifact.delete` +### method delete ```python -delete(delete_aliases: 'bool' = False) → None +self, +delete_aliases: 'bool' = False ``` -Delete an artifact and its files. +Delete an artifact and its files. -If called on a linked artifact, only the link is deleted, and the source artifact is unaffected. +If called on a linked artifact, only the link is deleted, and the +source artifact is unaffected. -Use `Artifact.unlink()` instead of `Artifact.delete()` to remove a link between a source artifact and a collection. +Use `Artifact.unlink()` instead of `Artifact.delete()` to remove a +link between a source artifact and a collection. +##### Arguments +- **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. -**Args:** - - - `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. +##### Raises +- **ArtifactNotLoggedError**: If the artifact is not logged. -**Raises:** - - - `ArtifactNotLoggedError`: If the artifact is not logged. - ---- -### method `Artifact.download` +### method download ```python -download( - root: 'StrPath | None' = None, - allow_missing_references: 'bool' = False, - skip_cache: 'bool | None' = None, - path_prefix: 'StrPath | None' = None, - multipart: 'bool | None' = None -) → FilePathStr +self, +root: 'StrPath | None' = None, +allow_missing_references: 'bool' = False, +skip_cache: 'bool | None' = None, +path_prefix: 'StrPath | None' = None, +multipart: 'bool | None' = None ``` -Download the contents of the artifact to the specified root directory. - -Existing files located within `root` are not modified. Explicitly delete `root` before you call `download` if you want the contents of `root` to exactly match the artifact. - - +Download the contents of the artifact to the specified root directory. -**Args:** - - - `root`: The directory W&B stores the artifact's files. - - `allow_missing_references`: If set to `True`, any invalid reference paths will be ignored while downloading referenced files. - - `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. - - `path_prefix`: If specified, only files with a path that starts with the given prefix will be downloaded. Uses unix format (forward slashes). - - `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. +Existing files located within `root` are not modified. Explicitly delete `root` +before you call `download` if you want the contents of `root` to exactly match +the artifact. +##### Arguments +- **root**: The directory W&B stores the artifact's files. +- **allow_missing_references**: If set to `True`, any invalid reference paths will be ignored while downloading referenced files. +- **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. +- **path_prefix**: If specified, only files with a path that starts with the given prefix will be downloaded. Uses unix format (forward slashes). +- **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. -**Returns:** - The path to the downloaded contents. +##### Raises +- **ArtifactNotLoggedError**: If the artifact is not logged. -**Raises:** - - - `ArtifactNotLoggedError`: If the artifact is not logged. ---- - -### method `Artifact.file` +### method file ```python -file(root: 'str | None' = None) → StrPath +self, +root: 'str | None' = None ``` -Download a single file artifact to the directory you specify with `root`. - - +Download a single file artifact to the directory you specify with `root`. -**Args:** - - - `root`: The root directory to store the file. Defaults to `./artifacts/self.name/`. +##### Arguments +- **root**: The root directory to store the file. Defaults to `./artifacts/self.name/`. -**Returns:** - The full path of the downloaded file. +##### Raises +- **ArtifactNotLoggedError**: If the artifact is not logged. +- **ValueError**: If the artifact contains more than one file. -**Raises:** - - - `ArtifactNotLoggedError`: If the artifact is not logged. - - `ValueError`: If the artifact contains more than one file. - ---- - -### method `Artifact.files` +### method files ```python -files( - names: 'list[str] | None' = None, - per_page: 'int' = 50, - start: 'str | None' = None -) → ArtifactFiles +self, +names: 'list[str] | None' = None, +per_page: 'int' = 50, +start: 'str | None' = None ``` -Iterate over all files stored in this artifact. - +Iterate over all files stored in this artifact. +##### Arguments -**Args:** - - - `names`: The filename paths relative to the root of the artifact you wish to list. - - `per_page`: The number of files to return per request. - - `start`: Pagination cursor for resuming a past query, captured from a previous paginator's `.cursor` attribute. +- **names**: The filename paths relative to the root of the artifact you wish to list. +- **per_page**: The number of files to return per request. +- **start**: Pagination cursor for resuming a past query, captured from a previous paginator's `.cursor` attribute. +##### Raises -**Returns:** - An iterator containing `File` objects. +- **ArtifactNotLoggedError**: If the artifact is not logged. - -**Raises:** - - - `ArtifactNotLoggedError`: If the artifact is not logged. - ---- - -### method `Artifact.finalize` +### method finalize ```python -finalize() → None +self ``` -Finalize the artifact version. +Finalize the artifact version. -You cannot modify an artifact version once it is finalized because the artifact is logged as a specific artifact version. Create a new artifact version to log more data to an artifact. An artifact is automatically finalized when you log the artifact with `log_artifact`. +You cannot modify an artifact version once it is finalized because the artifact +is logged as a specific artifact version. Create a new artifact version +to log more data to an artifact. An artifact is automatically finalized +when you log the artifact with `log_artifact`. ---- -### method `Artifact.get` -```python -get(name: 'str') → WBValue | None -``` -Get the WBValue object located at the artifact relative `name`. +### method get +```python +self, +name: 'str' +``` -**Args:** - - - `name`: The artifact relative name to retrieve. - +Get the WBValue object located at the artifact relative `name`. +##### Arguments -**Returns:** - W&B object that can be logged with `run.log()` and visualized in the W&B UI. +- **name**: The artifact relative name to retrieve. +##### Raises -**Raises:** - - - `ArtifactNotLoggedError`: if the artifact isn't logged or the run is offline. +- **ArtifactNotLoggedError**: if the artifact isn't logged or the run is offline. ---- -### method `Artifact.get_added_local_path_name` +### method get_added_local_path_name ```python -get_added_local_path_name(local_path: 'str') → str | None +self, +local_path: 'str' ``` -Get the artifact relative name of a file added by a local filesystem path. +Get the artifact relative name of a file added by a local filesystem path. +##### Arguments +- **local_path**: The local path to resolve into an artifact relative name. -**Args:** - - - `local_path`: The local path to resolve into an artifact relative name. -**Returns:** - The artifact relative name. - ---- - -### method `Artifact.get_entry` +### method get_entry ```python -get_entry(name: 'StrPath') → ArtifactManifestEntry +self, +name: 'StrPath' ``` -Get the entry with the given name. +Get the entry with the given name. +##### Arguments +- **name**: The artifact relative name to get -**Args:** - - - `name`: The artifact relative name to get +##### Raises +- **ArtifactNotLoggedError**: if the artifact isn't logged or the run is offline. +- **KeyError**: if the artifact doesn't contain an entry with the given name. -**Returns:** - A `W&B` object. +### method get_path +```python +self, +name: 'StrPath' +``` -**Raises:** - - - `ArtifactNotLoggedError`: if the artifact isn't logged or the run is offline. - - `KeyError`: if the artifact doesn't contain an entry with the given name. +Deprecated. Use `get_entry(name)`. ---- +##### Arguments -### method `Artifact.get_path` +- **name**: -```python -get_path(name: 'StrPath') → ArtifactManifestEntry -``` -Deprecated. Use `get_entry(name)`. ---- -### method `Artifact.is_draft` +### method is_draft ```python -is_draft() → bool +self ``` -Check if artifact is not saved. +Check if artifact is not saved. -**Returns:** - Boolean. `False` if artifact is saved. `True` if artifact is not saved. ---- -### method `Artifact.json_encode` +### method json_encode ```python -json_encode() → dict[str, Any] +self ``` -Returns the artifact encoded to the JSON format. +Returns the artifact encoded to the JSON format. -**Returns:** - A `dict` with `string` keys representing attributes of the artifact. ---- -### method `Artifact.link` +### method link ```python -link(target_path: 'str', aliases: 'Iterable[str] | None' = None) → Artifact +self, +target_path: 'str', +aliases: 'Iterable[str] | None' = None ``` -Link this artifact to a collection. - - - -**Args:** - - - `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}`. - - `aliases`: Add one or more aliases to the linked artifact. The "latest" alias is automatically applied to the most recent artifact you link. +Link this artifact to a collection. +##### Arguments +- **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}`. +- **aliases**: Add one or more aliases to the linked artifact. The "latest" alias is automatically applied to the most recent artifact you link. -**Raises:** - - - `ArtifactNotLoggedError`: If the artifact is not logged. +##### Raises +- **ArtifactNotLoggedError**: If the artifact is not logged. -**Returns:** - The linked artifact. ---- - -### method `Artifact.logged_by` +### method logged_by ```python -logged_by() → Run | None +self ``` -Get the W&B run that originally logged the artifact. +Get the W&B run that originally logged the artifact. -**Returns:** - The name of the W&B run that originally logged the artifact. +##### Raises +- **ArtifactNotLoggedError**: If the artifact is not logged. -**Raises:** - - - `ArtifactNotLoggedError`: If the artifact is not logged. - ---- - -### method `Artifact.new_draft` +### method new_draft ```python -new_draft() → Artifact +self ``` -Create a new draft artifact with the same content as this committed artifact. - -Modifying an existing artifact creates a new artifact version known as an "incremental artifact". The artifact returned can be extended or modified and logged as a new version. +Create a new draft artifact with the same content as this committed artifact. +Modifying an existing artifact creates a new artifact version known +as an "incremental artifact". The artifact returned can be extended or +modified and logged as a new version. -**Returns:** - An `Artifact` object. +##### Raises +- **ArtifactNotLoggedError**: If the artifact is not logged. -**Raises:** - - - `ArtifactNotLoggedError`: If the artifact is not logged. - ---- -### method `Artifact.new_file` +### method new_file ```python -new_file( - name: 'str', - mode: 'str' = 'x', - encoding: 'str | None' = None -) → Generator[IO] +self, +name: 'str', +mode: 'str' = 'x', +encoding: 'str | None' = None ``` -Open a new temporary file and add it to the artifact. +Open a new temporary file and add it to the artifact. +##### Arguments +- **name**: The name of the new file to add to the artifact. +- **mode**: The file access mode to use to open the new file. +- **encoding**: The encoding used to open the new file. -**Args:** - - - `name`: The name of the new file to add to the artifact. - - `mode`: The file access mode to use to open the new file. - - `encoding`: The encoding used to open the new file. +##### Raises +- **ArtifactFinalizedError**: You cannot make changes to the current artifact version because it is finalized. Log a new artifact version instead. -**Returns:** - A new file object that can be written to. Upon closing, the file is automatically added to the artifact. - - -**Raises:** - - - `ArtifactFinalizedError`: You cannot make changes to the current artifact version because it is finalized. Log a new artifact version instead. - ---- - -### method `Artifact.remove` +### method remove ```python -remove(item: 'StrPath | ArtifactManifestEntry') → None +self, +item: 'StrPath | ArtifactManifestEntry' ``` -Remove an item from the artifact. +Remove an item from the artifact. +##### Arguments +- **item**: The item to remove. Can be a specific manifest entry or the name of an artifact-relative path. If the item matches a directory all items in that directory will be removed. -**Args:** - - - `item`: The item to remove. Can be a specific manifest entry or the name of an artifact-relative path. If the item matches a directory all items in that directory will be removed. +##### Raises +- **ArtifactFinalizedError**: You cannot make changes to the current artifact version because it is finalized. Log a new artifact version instead. +- **FileNotFoundError**: If the item isn't found in the artifact. -**Raises:** - - - `ArtifactFinalizedError`: You cannot make changes to the current artifact version because it is finalized. Log a new artifact version instead. - - `FileNotFoundError`: If the item isn't found in the artifact. - ---- -### method `Artifact.save` +### method save ```python -save( - project: 'str | None' = None, - settings: 'wandb.Settings | None' = None -) → None +self, +project: 'str | None' = None, +settings: 'wandb.Settings | None' = None ``` -Persist any changes made to the artifact. +Persist any changes made to the artifact. -If currently in a run, that run will log this artifact. If not currently in a run, a run of type "auto" is created to track this artifact. +If currently in a run, that run will log this artifact. If not currently in a +run, a run of type "auto" is created to track this artifact. +##### Arguments + +- **project**: A project to use for the artifact in the case that a run is not already in context. +- **settings**: A settings object to use when initializing an automatic run. Most commonly used in testing harness. -**Args:** - - - `project`: A project to use for the artifact in the case that a run is not already in context. - - `settings`: A settings object to use when initializing an automatic run. Most commonly used in testing harness. ---- -### method `Artifact.unlink` +### method unlink ```python -unlink() → None +self ``` -Unlink this artifact if it is a linked member of an artifact collection. +Unlink this artifact if it is a linked member of an artifact collection. -**Raises:** - - - `ArtifactNotLoggedError`: If the artifact is not logged. - - `ValueError`: If the artifact is not linked to any collection. +##### Raises ---- +- **ArtifactNotLoggedError**: If the artifact is not logged. +- **ValueError**: If the artifact is not linked to any collection. -### method `Artifact.used_by` + +### method used_by ```python -used_by() → list[Run] +self ``` -Get a list of the runs that have used this artifact and its linked artifacts. - +Get a list of the runs that have used this artifact and its linked artifacts. -**Returns:** - A list of `Run` objects. +##### Raises +- **ArtifactNotLoggedError**: If the artifact is not logged. -**Raises:** - - - `ArtifactNotLoggedError`: If the artifact is not logged. - ---- -### method `Artifact.verify` +### method verify ```python -verify(root: 'str | None' = None) → None +self, +root: 'str | None' = None ``` -Verify that the contents of an artifact match the manifest. +Verify that the contents of an artifact match the manifest. -All files in the directory are checksummed and the checksums are then cross-referenced against the artifact's manifest. References are not verified. +All files in the directory are checksummed and the checksums are then +cross-referenced against the artifact's manifest. References are not verified. +##### Arguments +- **root**: The directory to verify. If None artifact will be downloaded to './artifacts/self.name/'. -**Args:** - - - `root`: The directory to verify. If None artifact will be downloaded to './artifacts/self.name/'. +##### Raises +- **ArtifactNotLoggedError**: If the artifact is not logged. +- **ValueError**: If the verification fails. -**Raises:** - - - `ArtifactNotLoggedError`: If the artifact is not logged. - - `ValueError`: If the verification fails. ---- - -### method `Artifact.wait` +### method wait ```python -wait(timeout: 'int | None' = None) → Artifact +self, +timeout: 'int | None' = None ``` -If needed, wait for this artifact to finish logging. +If needed, wait for this artifact to finish logging. + +##### Arguments +- **timeout**: The time, in seconds, to wait. -**Args:** - - - `timeout`: The time, in seconds, to wait. -**Returns:** - An `Artifact` object. diff --git a/models/ref/python/experiments/run.mdx b/models/ref/python/experiments/run.mdx index 69ac8cd393..f90cb600ac 100644 --- a/models/ref/python/experiments/run.mdx +++ b/models/ref/python/experiments/run.mdx @@ -1,37 +1,66 @@ --- title: Run -namespace: python_sdk_actions -python_object_type: class +kind: class +namespace: wandb.sdk.wandb_run --- + import { GitHubLink } from '/snippets/_includes/github-source-link.mdx'; - + + + + +```python +settings: 'Settings', +config: 'dict[str, Any] | None' = None, +sweep_config: 'dict[str, Any] | None' = None, +launch_config: 'dict[str, Any] | None' = None +``` + +## Description +A unit of computation logged by W&B. Typically, this is an ML experiment. +Call [`wandb.init()`](https://docs.wandb.ai/models/ref/python/functions/init) to create a +new run. `wandb.init()` starts a new run and returns a `wandb.Run` object. +Each run is associated with a unique ID (run ID). W&B recommends using +a context (`with` statement) manager to automatically finish the run. -## class `Run` -A unit of computation logged by W&B. Typically, this is an ML experiment. +For distributed training experiments, you can either track each process +separately using one run per process or track all processes to a single run. +See [Log distributed training experiments](https://docs.wandb.ai/models/track/log/distributed-training) +for more information. -Call [`wandb.init()`](https://docs.wandb.ai/models/ref/python/functions/init) to create a new run. `wandb.init()` starts a new run and returns a `wandb.Run` object. Each run is associated with a unique ID (run ID). W&B recommends using a context (`with` statement) manager to automatically finish the run. +You can log data to a run with `wandb.Run.log()`. Anything you log using +`wandb.Run.log()` is sent to that run. See +[Create an experiment](https://docs.wandb.ai/models/track/create-an-experiment) or +[`wandb.init`](https://docs.wandb.ai/models/ref/python/functions/init) API reference page +or more information. -For distributed training experiments, you can either track each process separately using one run per process or track all processes to a single run. See [Log distributed training experiments](https://docs.wandb.ai/models/track/log/distributed-training) for more information. +There is a another `Run` object in the +[`wandb.apis.public`](https://docs.wandb.ai/models/ref/python/public-api/api) +namespace. Use this object is to interact with runs that have already been +created. -You can log data to a run with `wandb.Run.log()`. Anything you log using `wandb.Run.log()` is sent to that run. See [Create an experiment](https://docs.wandb.ai/models/track/create-an-experiment) or [`wandb.init`](https://docs.wandb.ai/models/ref/python/functions/init) API reference page or more information. +Attributes: + summary: (Summary) A summary of the run, which is a dictionary-like + object. For more information, see + [Log summary metrics](https://docs.wandb.ai/models/track/log/log-summary). -There is a another `Run` object in the [`wandb.apis.public`](https://docs.wandb.ai/models/ref/python/public-api/api) namespace. Use this object is to interact with runs that have already been created. +## Args -**Attributes:** - - - `summary`: (Summary) A summary of the run, which is a dictionary-like object. For more information, see - - `[Log summary metrics](https`: //docs.wandb.ai/models/track/log/log-summary). +- **settings**: +- **config**: +- **sweep_config**: +- **launch_config**: +## Examples -**Examples:** - Create a run with `wandb.init()`: +Create a run with `wandb.init()`: ```python import wandb @@ -40,575 +69,455 @@ import wandb # Use context manager (`with` statement) to automatically finish the run with wandb.init(entity="entity", project="project") as run: run.log({"accuracy": acc, "loss": loss}) -``` - - -### property Run.config - -Config object associated with this run. - - - -**Returns:** - - `wandb_config.Config`: The config property value. ---- - -### property Run.config_static - -Static config object associated with this run. - - - -**Returns:** - - `wandb_config.ConfigStatic`: The config_static property value. ---- - -### property Run.dir - -The directory where files associated with the run are saved. - - - -**Returns:** - - `str`: The dir property value. ---- - -### property Run.disabled - -True if the run is disabled, False otherwise. - - - -**Returns:** - - `bool`: The disabled property value. ---- - -### property Run.entity - -The name of the W&B entity associated with the run. - -Entity can be a username or the name of a team or organization. - - - -**Returns:** - - `str`: The entity property value. ---- - -### property Run.group - -Returns the name of the group associated with this run. - -Grouping runs together allows related experiments to be organized and visualized collectively in the W&B UI. This is especially useful for scenarios such as distributed training or cross-validation, where multiple runs should be viewed and managed as a unified experiment. - -In shared mode, where all processes share the same run object, setting a group is usually unnecessary, since there is only one run and no grouping is required. - - - -**Returns:** - - `str`: The group property value. ---- - -### property Run.id - -Identifier for this run. - - - -**Returns:** - - `str`: The id property value. ---- - -### property Run.job_type - -Name of the job type associated with the run. - -View a run's job type in the run's Overview page in the W&B App. - -You can use this to categorize runs by their job type, such as "training", "evaluation", or "inference". This is useful for organizing and filtering runs in the W&B UI, especially when you have multiple runs with different job types in the same project. For more information, see [Organize runs](https://docs.wandb.ai/models/runs#organize-runs). - - - -**Returns:** - - `str`: The job_type property value. ---- - -### property Run.name - -Display name of the run. +``` -Display names are not guaranteed to be unique and may be descriptive. By default, they are randomly generated. +## Properties -**Returns:** - - `str | None`: The name property value. ---- +### property settings -### property Run.notes +A frozen copy of run's Settings object. -Notes associated with the run, if there are any. +### property dir -Notes can be a multiline string and can also use markdown and latex equations inside `$$`, like `$x + 3$`. +The directory where files associated with the run are saved. +### property config +Config object associated with this run. -**Returns:** - - `str | None`: The notes property value. ---- +### property config_static -### property Run.offline +Static config object associated with this run. -True if the run is offline, False otherwise. +### property name +Display name of the run. +Display names are not guaranteed to be unique and may be descriptive. +By default, they are randomly generated. -**Returns:** - - `bool`: The offline property value. ---- +### property notes -### property Run.path +Notes associated with the run, if there are any. -Path to the run. +Notes can be a multiline string and can also use markdown and latex +equations inside `$$`, like `$x + 3$`. -Run paths include entity, project, and run ID, in the format `entity/project/run_id`. +### property tags +Tags associated with the run, if there are any. +### property id -**Returns:** - - `str`: The path property value. ---- +Identifier for this run. -### property Run.project +### property sweep_id -Name of the W&B project associated with the run. +Identifier for the sweep associated with the run, if there is one. +### property path +Path to the run. -**Returns:** - - `str`: The project property value. ---- +Run paths include entity, project, and run ID, in the format +`entity/project/run_id`. -### property Run.project_url +### property start_time -URL of the W&B project associated with the run, if there is one. +Unix timestamp (in seconds) of when the run started. -Offline runs do not have a project URL. +### property resumed +True if the run was resumed, False otherwise. +### property step -**Returns:** - - `str | None`: The project_url property value. ---- +The W&B step of the next `log()` call. -### property Run.resumed +Raises an error in mode="shared" runs. -True if the run was resumed, False otherwise. +### property offline +True if the run is offline, False otherwise. +### property disabled -**Returns:** - - `bool`: The resumed property value. ---- +True if the run is disabled, False otherwise. -### property Run.settings +### property group -A frozen copy of run's Settings object. +Returns the name of the group associated with this run. +Grouping runs together allows related experiments to be organized and +visualized collectively in the W&B UI. This is especially useful for +scenarios such as distributed training or cross-validation, where +multiple runs should be viewed and managed as a unified experiment. +In shared mode, where all processes share the same run object, +setting a group is usually unnecessary, since there is only one +run and no grouping is required. -**Returns:** - - `Settings`: The settings property value. ---- +### property job_type -### property Run.start_time +Name of the job type associated with the run. -Unix timestamp (in seconds) of when the run started. +View a run's job type in the run's Overview page in the W&B App. +You can use this to categorize runs by their job type, such as +"training", "evaluation", or "inference". This is useful for organizing +and filtering runs in the W&B UI, especially when you have multiple +runs with different job types in the same project. For more +information, see [Organize runs](https://docs.wandb.ai/models/runs#organize-runs). +### property project -**Returns:** - - `float`: The start_time property value. ---- +Name of the W&B project associated with the run. +### property project_url -### property Run.step +URL of the W&B project associated with the run, if there is one. -The W&B step of the next `log()` call. +Offline runs do not have a project URL. -Raises an error in mode="shared" runs. +### property sweep_url +URL of the sweep associated with the run, if there is one. +Offline runs do not have a sweep URL. -**Returns:** - - `int`: The step property value. ---- +### property url -### property Run.sweep_id +The url for the W&B run, if there is one. -Identifier for the sweep associated with the run, if there is one. +Offline runs will not have a url. +### property entity +The name of the W&B entity associated with the run. -**Returns:** - - `str | None`: The sweep_id property value. ---- +Entity can be a username or the name of a team or organization. -### property Run.sweep_url -URL of the sweep associated with the run, if there is one. -Offline runs do not have a sweep URL. +## Methods +### method alert +```python +self, +title: 'str', +text: 'str', +level: 'str | AlertLevel | None' = None, +wait_duration: 'int | float | timedelta | None' = None +``` -**Returns:** - - `str | None`: The sweep_url property value. ---- - -### property Run.tags - -Tags associated with the run, if there are any. - - - -**Returns:** - - `tuple | None`: The tags property value. ---- - -### property Run.url - -The url for the W&B run, if there is one. - -Offline runs will not have a url. +Create an alert with the given title and text. +##### Arguments +- **title**: The title of the alert, must be less than 64 characters long. +- **text**: The text body of the alert. +- **level**: The alert level to use, either: `INFO`, `WARN`, or `ERROR`. +- **wait_duration**: The time to wait (in seconds) before sending another alert with this title. -**Returns:** - - `str | None`: The url property value. ---- -### method `Run.alert` +### method define_metric ```python -alert( - title: 'str', - text: 'str', - level: 'str | AlertLevel | None' = None, - wait_duration: 'int | float | timedelta | None' = None -) → None +self, +name: 'str', +step_metric: 'str | wandb_metric.Metric | None' = None, +step_sync: 'bool | None' = None, +hidden: 'bool | None' = None, +summary: 'str | None' = None, +goal: 'str | None' = None, +overwrite: 'bool | None' = None ``` -Create an alert with the given title and text. +Customize metrics logged with `wandb.Run.log()`. +##### Arguments + +- **name**: The name of the metric to customize. +- **step_metric**: The name of another metric to serve as the X-axis for this metric in automatically generated charts. +- **step_sync**: Automatically insert the last value of step_metric into `wandb.Run.log()` if it is not provided explicitly. Defaults to True if step_metric is specified. +- **hidden**: Hide this metric from automatic plots. +- **summary**: Specify aggregate metrics added to summary. Supported aggregations include "min", "max", "mean", "last", "first", "best", "copy" and "none". "none" prevents a summary from being generated. "best" is used together with the goal parameter, "best" is deprecated and should not be used, use "min" or "max" instead. "copy" is deprecated and should not be used. +- **goal**: Specify how to interpret the "best" summary type. Supported options are "minimize" and "maximize". "goal" is deprecated and should not be used, use "min" or "max" instead. +- **overwrite**: If false, then this call is merged with previous `define_metric` calls for the same metric by using their values for any unspecified parameters. If true, then unspecified parameters overwrite values specified by previous calls. -**Args:** - - - `title`: The title of the alert, must be less than 64 characters long. - - `text`: The text body of the alert. - - `level`: The alert level to use, either: `INFO`, `WARN`, or `ERROR`. - - `wait_duration`: The time to wait (in seconds) before sending another alert with this title. ---- -### method `Run.define_metric` +### method display ```python -define_metric( - name: 'str', - step_metric: 'str | wandb_metric.Metric | None' = None, - step_sync: 'bool | None' = None, - hidden: 'bool | None' = None, - summary: 'str | None' = None, - goal: 'str | None' = None, - overwrite: 'bool | None' = None -) → wandb_metric.Metric +self, +height: 'int' = 420, +hidden: 'bool' = False ``` -Customize metrics logged with `wandb.Run.log()`. +Display this run in Jupyter. +##### Arguments +- **height**: +- **hidden**: -**Args:** - - - `name`: The name of the metric to customize. - - `step_metric`: The name of another metric to serve as the X-axis for this metric in automatically generated charts. - - `step_sync`: Automatically insert the last value of step_metric into `wandb.Run.log()` if it is not provided explicitly. Defaults to True if step_metric is specified. - - `hidden`: Hide this metric from automatic plots. - - `summary`: Specify aggregate metrics added to summary. Supported aggregations include "min", "max", "mean", "last", "first", "best", "copy" and "none". "none" prevents a summary from being generated. "best" is used together with the goal parameter, "best" is deprecated and should not be used, use "min" or "max" instead. "copy" is deprecated and should not be used. - - `goal`: Specify how to interpret the "best" summary type. Supported options are "minimize" and "maximize". "goal" is deprecated and should not be used, use "min" or "max" instead. - - `overwrite`: If false, then this call is merged with previous `define_metric` calls for the same metric by using their values for any unspecified parameters. If true, then unspecified parameters overwrite values specified by previous calls. -**Returns:** - An object that represents this call but can otherwise be discarded. - ---- - -### method `Run.display` +### method finish ```python -display(height: 'int' = 420, hidden: 'bool' = False) → bool +self, +exit_code: 'int | None' = None, +quiet: 'bool | None' = None ``` -Display this run in Jupyter. +Finish a run and upload any remaining data. ---- - -### method `Run.finish` - -```python -finish(exit_code: 'int | None' = None, quiet: 'bool | None' = None) → None -``` +Marks the completion of a W&B run and ensures all data is synced to the server. +The run's final state is determined by its exit conditions and sync status. -Finish a run and upload any remaining data. +Run States: +- Running: Active run that is logging data and/or sending heartbeats. +- Crashed: Run that stopped sending heartbeats unexpectedly. +- Finished: Run completed successfully (`exit_code=0`) with all data synced. +- Failed: Run completed with errors (`exit_code!=0`). +- Killed: Run was forcibly stopped before it could finish. -Marks the completion of a W&B run and ensures all data is synced to the server. The run's final state is determined by its exit conditions and sync status. +##### Arguments -Run States: -- Running: Active run that is logging data and/or sending heartbeats. -- Crashed: Run that stopped sending heartbeats unexpectedly. -- Finished: Run completed successfully (`exit_code=0`) with all data synced. -- Failed: Run completed with errors (`exit_code!=0`). -- Killed: Run was forcibly stopped before it could finish. +- **exit_code**: Integer indicating the run's exit status. Use 0 for success, any other value marks the run as failed. +- **quiet**: Deprecated. Configure logging verbosity using `wandb.Settings(quiet=...)`. -**Args:** - - - `exit_code`: Integer indicating the run's exit status. Use 0 for success, any other value marks the run as failed. - - `quiet`: Deprecated. Configure logging verbosity using `wandb.Settings(quiet=...)`. ---- - -### method `Run.finish_artifact` +### method finish_artifact ```python -finish_artifact( - artifact_or_path: 'Artifact | str', - name: 'str | None' = None, - type: 'str | None' = None, - aliases: 'list[str] | None' = None, - distributed_id: 'str | None' = None -) → Artifact +self, +artifact_or_path: 'Artifact | str', +name: 'str | None' = None, +type: 'str | None' = None, +aliases: 'list[str] | None' = None, +distributed_id: 'str | None' = None ``` -Finishes a non-finalized artifact as output of a run. - -Subsequent "upserts" with the same distributed ID will result in a new version. - - +Finishes a non-finalized artifact as output of a run. -**Args:** - - - `artifact_or_path`: A path to the contents of this artifact, can be in the following forms: - - `/local/directory` - - `/local/directory/file.txt` - - `s3://bucket/path` You can also pass an Artifact object created by calling `wandb.Artifact`. - - `name`: An artifact name. May be prefixed with entity/project. Valid names can be in the following forms: - - name:version - - name:alias - - digest This will default to the basename of the path prepended with the current run id if not specified. - - `type`: The type of artifact to log, examples include `dataset`, `model` - - `aliases`: Aliases to apply to this artifact, defaults to `["latest"]` - - `distributed_id`: Unique string that all distributed jobs share. If None, defaults to the run's group name. +Subsequent "upserts" with the same distributed ID will result in a new version. +##### Arguments - -**Returns:** - An `Artifact` object. - ---- +- **artifact_or_path**: A path to the contents of this artifact, +- **name**: An artifact name. May be prefixed with entity/project. +- **type**: The type of artifact to log, examples include `dataset`, `model` +- **aliases**: Aliases to apply to this artifact, defaults to `["latest"]` +- **distributed_id**: Unique string that all distributed jobs share. If None, defaults to the run's group name. -### method `Run.link_artifact` +### method link_artifact ```python -link_artifact( - artifact: 'Artifact', - target_path: 'str', - aliases: 'list[str] | None' = None -) → Artifact +self, +artifact: 'Artifact', +target_path: 'str', +aliases: 'list[str] | None' = None ``` -Link the artifact to a collection. +Link the artifact to a collection. -The term “link” refers to pointers that connect where W&B stores the artifact and where the artifact is accessible in the registry. W&B does not duplicate artifacts when you link an artifact to a collection. +The term “link” refers to pointers that connect where W&B stores the +artifact and where the artifact is accessible in the registry. W&B +does not duplicate artifacts when you link an artifact to a collection. -View linked artifacts in the Registry UI for the specified collection. +View linked artifacts in the Registry UI for the specified collection. +##### Arguments +- **artifact**: The artifact object to link to the collection. +- **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}`. +- **aliases**: Add one or more aliases to the linked artifact. The "latest" alias is automatically applied to the most recent artifact you link. -**Args:** - - - `artifact`: The artifact object to link to the collection. - - `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}`. - - `aliases`: Add one or more aliases to the linked artifact. The "latest" alias is automatically applied to the most recent artifact you link. -**Returns:** - The linked artifact. - ---- - -### method `Run.link_model` +### method link_model ```python -link_model( - path: 'StrPath', - registered_model_name: 'str', - name: 'str | None' = None, - aliases: 'list[str] | None' = None -) → Artifact | None +self, +path: 'StrPath', +registered_model_name: 'str', +name: 'str | None' = None, +aliases: 'list[str] | None' = None ``` -Log a model artifact version and link it to a registered model in the model registry. +Log a model artifact version and link it to a registered model in the model registry. -Linked model versions are visible in the UI for the specified registered model. +Linked model versions are visible in the UI for the specified registered model. -This method will: -- Check if 'name' model artifact has been logged. If so, use the artifact version that matches the files located at 'path' or log a new version. Otherwise log files under 'path' as a new model artifact, 'name' of type 'model'. -- Check if registered model with name 'registered_model_name' exists in the 'model-registry' project. If not, create a new registered model with name 'registered_model_name'. -- Link version of model artifact 'name' to registered model, 'registered_model_name'. -- Attach aliases from 'aliases' list to the newly linked model artifact version. +This method will: +- Check if 'name' model artifact has been logged. If so, use the artifact version that matches the files +located at 'path' or log a new version. Otherwise log files under 'path' as a new model artifact, 'name' +of type 'model'. +- Check if registered model with name 'registered_model_name' exists in the 'model-registry' project. +If not, create a new registered model with name 'registered_model_name'. +- Link version of model artifact 'name' to registered model, 'registered_model_name'. +- Attach aliases from 'aliases' list to the newly linked model artifact version. +##### Arguments +- **path**: (str) A path to the contents of this model, can be in the +- **registered_model_name**: The name of the registered model that the model is to be linked to. A registered model is a collection of model versions linked to the model registry, typically representing a team's specific ML Task. The entity that this registered model belongs to will be derived from the run. +- **name**: The name of the model artifact that files in 'path' will be logged to. This will default to the basename of the path prepended with the current run id if not specified. +- **aliases**: Aliases that will only be applied on this linked artifact inside the registered model. The alias "latest" will always be applied to the latest version of an artifact that is linked. -**Args:** - - - `path`: (str) A path to the contents of this model, can be in the following forms: - - `/local/directory` - - `/local/directory/file.txt` - - `s3://bucket/path` - - `registered_model_name`: The name of the registered model that the model is to be linked to. A registered model is a collection of model versions linked to the model registry, typically representing a team's specific ML Task. The entity that this registered model belongs to will be derived from the run. - - `name`: The name of the model artifact that files in 'path' will be logged to. This will default to the basename of the path prepended with the current run id if not specified. - - `aliases`: Aliases that will only be applied on this linked artifact inside the registered model. The alias "latest" will always be applied to the latest version of an artifact that is linked. +##### Raises +- **AssertionError**: If registered_model_name is a path or if model artifact 'name' is of a type that does not contain the substring 'model'. +- **ValueError**: If name has invalid special characters. -**Raises:** - - - `AssertionError`: If registered_model_name is a path or if model artifact 'name' is of a type that does not contain the substring 'model'. - - `ValueError`: If name has invalid special characters. - - -**Returns:** - The linked artifact if linking was successful, otherwise `None`. - ---- - -### method `Run.log` +### method log ```python -log( - data: 'dict[str, Any]', - step: 'int | None' = None, - commit: 'bool | None' = None -) → None +self, +data: 'dict[str, Any]', +step: 'int | None' = None, +commit: 'bool | None' = None ``` -Upload run data. +Upload run data. -Use `log` to log data from runs, such as scalars, images, video, histograms, plots, and tables. See [Log objects and media](https://docs.wandb.ai/models/track/log) for code snippets, best practices, and more. +Use `log` to log data from runs, such as scalars, images, video, +histograms, plots, and tables. See [Log objects and media](https://docs.wandb.ai/models/track/log) for +code snippets, best practices, and more. -Basic usage: +Basic usage: ```python import wandb with wandb.init() as run: - run.log({"train-loss": 0.5, "accuracy": 0.9}) -``` + run.log({"train-loss": 0.5, "accuracy": 0.9}) +``` -The previous code snippet saves the loss and accuracy to the run's history and updates the summary values for these metrics. +The previous code snippet saves the loss and accuracy to the run's +history and updates the summary values for these metrics. -Visualize logged data in a workspace at [wandb.ai](https://wandb.ai), or locally on a [self-hosted instance](https://docs.wandb.ai/platform/hosting) of the W&B app, or export data to visualize and explore locally, such as in a Jupyter notebook, with the [Public API](https://docs.wandb.ai/models/track/public-api-guide). +Visualize logged data in a workspace at [wandb.ai](https://wandb.ai), +or locally on a [self-hosted instance](https://docs.wandb.ai/platform/hosting) +of the W&B app, or export data to visualize and explore locally, such as in a +Jupyter notebook, with the [Public API](https://docs.wandb.ai/models/track/public-api-guide). -Logged values don't have to be scalars. You can log any [W&B supported Data Type](https://docs.wandb.ai/models/ref/python/data-types) such as images, audio, video, and more. For example, you can use `wandb.Table` to log structured data. See [Log tables, visualize and query data](https://docs.wandb.ai/models/tables/tables-walkthrough) tutorial for more details. +Logged values don't have to be scalars. You can log any +[W&B supported Data Type](https://docs.wandb.ai/models/ref/python/data-types) +such as images, audio, video, and more. For example, you can use +`wandb.Table` to log structured data. See +[Log tables, visualize and query data](https://docs.wandb.ai/models/tables/tables-walkthrough) +tutorial for more details. -W&B organizes metrics with a forward slash (`/`) in their name into sections named using the text before the final slash. For example, the following results in two sections named "train" and "validate": +W&B organizes metrics with a forward slash (`/`) in their name +into sections named using the text before the final slash. For example, +the following results in two sections named "train" and "validate": ```python with wandb.init() as run: - # Log metrics in the "train" section. - run.log( - { - "train/accuracy": 0.9, - "train/loss": 30, - "validate/accuracy": 0.8, - "validate/loss": 20, - } - ) -``` + # Log metrics in the "train" section. + run.log( + { + "train/accuracy": 0.9, + "train/loss": 30, + "validate/accuracy": 0.8, + "validate/loss": 20, + } + ) +``` -Only one level of nesting is supported; `run.log({"a/b/c": 1})` produces a section named "a". +Only one level of nesting is supported; `run.log({"a/b/c": 1})` +produces a section named "a". -`run.log()` is not intended to be called more than a few times per second. For optimal performance, limit your logging to once every N iterations, or collect data over multiple iterations and log it in a single step. +`run.log()` is not intended to be called more than a few times per second. +For optimal performance, limit your logging to once every N iterations, +or collect data over multiple iterations and log it in a single step. -By default, each call to `log` creates a new "step". The step must always increase, and it is not possible to log to a previous step. You can use any metric as the X axis in charts. See [Custom log axes](https://docs.wandb.ai/models/track/log/customize-logging-axes) for more details. +By default, each call to `log` creates a new "step". +The step must always increase, and it is not possible to log +to a previous step. You can use any metric as the X axis in charts. +See [Custom log axes](https://docs.wandb.ai/models/track/log/customize-logging-axes) +for more details. -In many cases, it is better to treat the W&B step like you'd treat a timestamp rather than a training step. +In many cases, it is better to treat the W&B step like +you'd treat a timestamp rather than a training step. ```python with wandb.init() as run: - # Example: log an "epoch" metric for use as an X axis. - run.log({"epoch": 40, "train-loss": 0.5}) -``` + # Example: log an "epoch" metric for use as an X axis. + run.log({"epoch": 40, "train-loss": 0.5}) +``` -It is possible to use multiple `wandb.Run.log()` invocations to log to the same step with the `step` and `commit` parameters. The following are all equivalent: +It is possible to use multiple `wandb.Run.log()` invocations to log to +the same step with the `step` and `commit` parameters. +The following are all equivalent: ```python with wandb.init() as run: - # Normal usage: - run.log({"train-loss": 0.5, "accuracy": 0.8}) - run.log({"train-loss": 0.4, "accuracy": 0.9}) + # Normal usage: + run.log({"train-loss": 0.5, "accuracy": 0.8}) + run.log({"train-loss": 0.4, "accuracy": 0.9}) + + # Implicit step without auto-incrementing: + run.log({"train-loss": 0.5}, commit=False) + run.log({"accuracy": 0.8}) + run.log({"train-loss": 0.4}, commit=False) + run.log({"accuracy": 0.9}) + + # Explicit step: + run.log({"train-loss": 0.5}, step=current_step) + run.log({"accuracy": 0.8}, step=current_step) + current_step += 1 + run.log({"train-loss": 0.4}, step=current_step) + run.log({"accuracy": 0.9}, step=current_step, commit=True) +``` - # Implicit step without auto-incrementing: - run.log({"train-loss": 0.5}, commit=False) - run.log({"accuracy": 0.8}) - run.log({"train-loss": 0.4}, commit=False) - run.log({"accuracy": 0.9}) +##### Arguments - # Explicit step: - run.log({"train-loss": 0.5}, step=current_step) - run.log({"accuracy": 0.8}, step=current_step) - current_step += 1 - run.log({"train-loss": 0.4}, step=current_step) - run.log({"accuracy": 0.9}, step=current_step, commit=True) -``` +- **data**: A `dict` with `str` keys and values that are serializable +- **step**: The step number to log. If `None`, then an implicit auto-incrementing step is used. See the notes in the description. +- **commit**: If true, finalize and upload the step. If false, then accumulate data for the step. See the notes in the description. If `step` is `None`, then the default is `commit=True`; otherwise, the default is `commit=False`. +##### Raises -**Args:** - - - `data`: A `dict` with `str` keys and values that are serializable - - `Python objects including`: `int`, `float` and `string`; any of the `wandb.data_types`; lists, tuples and NumPy arrays of serializable Python objects; other `dict`s of this structure. - - `step`: The step number to log. If `None`, then an implicit auto-incrementing step is used. See the notes in the description. - - `commit`: If true, finalize and upload the step. If false, then accumulate data for the step. See the notes in the description. If `step` is `None`, then the default is `commit=True`; otherwise, the default is `commit=False`. +- **wandb.Error**: If called before `wandb.init()`. +- **ValueError**: If invalid data is passed. +##### Examples -**Examples:** - For more and more detailed examples, see [our guides to logging](https://docs.wandb.ai/models/track/log). +For more and more detailed examples, see +[our guides to logging](https://docs.wandb.ai/models/track/log). -Basic usage +Basic usage ```python import wandb with wandb.init() as run: run.log({"train-loss": 0.5, "accuracy": 0.9 -``` +``` -Incremental logging +Incremental logging ```python import wandb @@ -617,9 +526,9 @@ with wandb.init() as run: run.log({"loss": 0.2}, commit=False) # Somewhere else when I'm ready to report this step: run.log({"accuracy": 0.8}) -``` +``` -Histogram +Histogram ```python import numpy as np @@ -629,9 +538,9 @@ import wandb gradients = np.random.randn(100, 100) with wandb.init() as run: run.log({"gradients": wandb.Histogram(gradients)}) -``` +``` -Image from NumPy +Image from NumPy ```python import numpy as np @@ -640,13 +549,13 @@ import wandb with wandb.init() as run: examples = [] for i in range(3): - pixels = np.random.randint(low=0, high=256, size=(100, 100, 3)) - image = wandb.Image(pixels, caption=f"random field {i}") - examples.append(image) + pixels = np.random.randint(low=0, high=256, size=(100, 100, 3)) + image = wandb.Image(pixels, caption=f"random field {i}") + examples.append(image) run.log({"examples": examples}) -``` +``` -Image from PIL +Image from PIL ```python import numpy as np @@ -656,19 +565,19 @@ import wandb with wandb.init() as run: examples = [] for i in range(3): - pixels = np.random.randint( - low=0, - high=256, - size=(100, 100, 3), - dtype=np.uint8, - ) - pil_image = PILImage.fromarray(pixels, mode="RGB") - image = wandb.Image(pil_image, caption=f"random field {i}") - examples.append(image) + pixels = np.random.randint( + low=0, + high=256, + size=(100, 100, 3), + dtype=np.uint8, + ) + pil_image = PILImage.fromarray(pixels, mode="RGB") + image = wandb.Image(pil_image, caption=f"random field {i}") + examples.append(image) run.log({"examples": examples}) -``` +``` -Video from NumPy +Video from NumPy ```python import numpy as np @@ -677,15 +586,15 @@ import wandb with wandb.init() as run: # axes are (time, channel, height, width) frames = np.random.randint( - low=0, - high=256, - size=(10, 3, 100, 100), - dtype=np.uint8, + low=0, + high=256, + size=(10, 3, 100, 100), + dtype=np.uint8, ) run.log({"video": wandb.Video(frames, fps=4)}) -``` +``` -Matplotlib plot +Matplotlib plot ```python from matplotlib import pyplot as plt @@ -698,416 +607,315 @@ with wandb.init() as run: y = x * x ax.plot(x, y) # plot y = x^2 run.log({"chart": fig}) -``` +``` -PR Curve +PR Curve ```python import wandb with wandb.init() as run: run.log({"pr": wandb.plot.pr_curve(y_test, y_probas, labels)}) -``` +``` -3D Object +3D Object ```python import wandb with wandb.init() as run: run.log( - { - "generated_samples": [ - wandb.Object3D(open("sample.obj")), - wandb.Object3D(open("sample.gltf")), - wandb.Object3D(open("sample.glb")), - ] - } + { + "generated_samples": [ + wandb.Object3D(open("sample.obj")), + wandb.Object3D(open("sample.gltf")), + wandb.Object3D(open("sample.glb")), + ] + } ) -``` - - - -**Raises:** - - - `wandb.Error`: If called before `wandb.init()`. - - `ValueError`: If invalid data is passed. - ---- +``` -### method `Run.log_artifact` +### method log_artifact ```python -log_artifact( - artifact_or_path: 'Artifact | StrPath', - name: 'str | None' = None, - type: 'str | None' = None, - aliases: 'list[str] | None' = None, - tags: 'list[str] | None' = None -) → Artifact +self, +artifact_or_path: 'Artifact | StrPath', +name: 'str | None' = None, +type: 'str | None' = None, +aliases: 'list[str] | None' = None, +tags: 'list[str] | None' = None ``` -Declare an artifact as an output of a run. +Declare an artifact as an output of a run. +##### Arguments +- **artifact_or_path**: (str or Artifact) A path to the contents of this artifact, +- **name**: (str, optional) An artifact name. Valid names can be in the following forms: +- **type**: (str) The type of artifact to log, examples include `dataset`, `model` +- **aliases**: (list, optional) Aliases to apply to this artifact, defaults to `["latest"]` +- **tags**: (list, optional) Tags to apply to this artifact, if any. -**Args:** - - - `artifact_or_path`: (str or Artifact) A path to the contents of this artifact, can be in the following forms: - - `/local/directory` - - `/local/directory/file.txt` - - `s3://bucket/path` You can also pass an Artifact object created by calling `wandb.Artifact`. - - `name`: (str, optional) An artifact name. Valid names can be in the following forms: - - name:version - - name:alias - - digest This will default to the basename of the path prepended with the current run id if not specified. - - `type`: (str) The type of artifact to log, examples include `dataset`, `model` - - `aliases`: (list, optional) Aliases to apply to this artifact, defaults to `["latest"]` - - `tags`: (list, optional) Tags to apply to this artifact, if any. -**Returns:** - An `Artifact` object. - ---- - -### method `Run.log_code` +### method log_code ```python -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]' = -) → Artifact | None +self, +root: 'str | None' = '.', +name: 'str | None' = None, +include_fn: 'Callable[[str, str], bool] | Callable[[str], bool]' = _is_py_requirements_or_dockerfile, +exclude_fn: 'Callable[[str, str], bool] | Callable[[str], bool]' = exclude_wandb_fn ``` -Save the current state of your code to a W&B Artifact. +Save the current state of your code to a W&B Artifact. -By default, it walks the current directory and logs all files that end with `.py`. +By default, it walks the current directory and logs all files that end with `.py`. +##### Arguments +- **root**: The relative (to `os.getcwd()`) or absolute path to recursively find code from. +- **name**: (str, optional) The name of our code artifact. By default, we'll name the artifact `source-$PROJECT_ID-$ENTRYPOINT_RELPATH`. There may be scenarios where you want many runs to share the same artifact. Specifying name allows you to achieve that. +- **include_fn**: A callable that accepts a file path and (optionally) root path and returns True when it should be included and False otherwise. This +- **exclude_fn**: A callable that accepts a file path and (optionally) root path and returns `True` when it should be excluded and `False` otherwise. This defaults to a function that excludes all files within `/.wandb/` and `/wandb/` directories. -**Args:** - - - `root`: The relative (to `os.getcwd()`) or absolute path to recursively find code from. - - `name`: (str, optional) The name of our code artifact. By default, we'll name the artifact `source-$PROJECT_ID-$ENTRYPOINT_RELPATH`. There may be scenarios where you want many runs to share the same artifact. Specifying name allows you to achieve that. - - `include_fn`: A callable that accepts a file path and (optionally) root path and returns True when it should be included and False otherwise. This - - `defaults to `lambda path, root`: path.endswith(".py")`. - - `exclude_fn`: A callable that accepts a file path and (optionally) root path and returns `True` when it should be excluded and `False` otherwise. This defaults to a function that excludes all files within `/.wandb/` and `/wandb/` directories. -**Examples:** - Basic usage +##### Examples + +Basic usage ```python import wandb with wandb.init() as run: run.log_code() -``` +``` -Advanced usage +Advanced usage ```python import wandb with wandb.init() as run: run.log_code( - root="../", - include_fn=lambda path: path.endswith(".py") or path.endswith(".ipynb"), - exclude_fn=lambda path, root: os.path.relpath(path, root).startswith( - "cache/" - ), + root="../", + include_fn=lambda path: path.endswith(".py") or path.endswith(".ipynb"), + exclude_fn=lambda path, root: os.path.relpath(path, root).startswith( + "cache/" + ), ) -``` - - - -**Returns:** - An `Artifact` object if code was logged - ---- +``` -### method `Run.log_model` +### method log_model ```python -log_model( - path: 'StrPath', - name: 'str | None' = None, - aliases: 'list[str] | None' = None -) → None +self, +path: 'StrPath', +name: 'str | None' = None, +aliases: 'list[str] | None' = None ``` -Logs a model artifact containing the contents inside the 'path' to a run and marks it as an output to this run. - -The name of model artifact can only contain alphanumeric characters, underscores, and hyphens. +Logs a model artifact containing the contents inside the 'path' to a run and marks it as an output to this run. +The name of model artifact can only contain alphanumeric characters, +underscores, and hyphens. +##### Arguments -**Args:** - - - `path`: (str) A path to the contents of this model, can be in the following forms: - - `/local/directory` - - `/local/directory/file.txt` - - `s3://bucket/path` - - `name`: A name to assign to the model artifact that the file contents will be added to. This will default to the basename of the path prepended with the current run id if not specified. - - `aliases`: Aliases to apply to the created model artifact, defaults to `["latest"]` +- **path**: (str) A path to the contents of this model, +- **name**: A name to assign to the model artifact that the file contents will be added to. This will default to the basename of the path prepended with the current run id if not specified. +- **aliases**: Aliases to apply to the created model artifact, defaults to `["latest"]` +##### Raises -**Raises:** - - - `ValueError`: If name has invalid special characters. +- **ValueError**: If name has invalid special characters. +### method mark_preempting -**Returns:** - None +```python +self +``` ---- +Mark this run as preempting. -### method `Run.mark_preempting` +Also tells the internal process to immediately report this to server. -```python -mark_preempting() → None -``` -Mark this run as preempting. -Also tells the internal process to immediately report this to server. ---- -### method `Run.pin_config_keys` +### method pin_config_keys ```python -pin_config_keys(keys: 'Sequence[str]' = ()) → None +self, +keys: 'Sequence[str]' = () ``` -Pin config keys to display in the References section on Run Overview. +Pin config keys to display in the References section on Run Overview. -Pinned keys appear prominently above Notes on the Run Overview page. String values are rendered as markdown; non-strings are rendered as plain text. Calling this again replaces the previously pinned list. +Pinned keys appear prominently above Notes on the Run Overview page. +String values are rendered as markdown; non-strings are rendered as +plain text. Calling this again replaces the previously pinned list. +##### Arguments +- **keys**: Config key names to pin, matching keys set via ``run.config``. These are exact key strings (dots and slashes are treated literally, not as path separators). Order is preserved and determines display order. -**Args:** - - - `keys`: Config key names to pin, matching keys set via ``run.config``. These are exact key strings (dots and slashes are treated literally, not as path separators). Order is preserved and determines display order. ---- -### method `Run.restore` +### method restore ```python -restore( - name: 'str', - run_path: 'str | None' = None, - replace: 'bool' = False, - root: 'str | None' = None -) → None | TextIO +self, +name: 'str', +run_path: 'str | None' = None, +replace: 'bool' = False, +root: 'str | None' = None ``` -Download the specified file from cloud storage. +Download the specified file from cloud storage. -File is placed into the current directory or run directory. By default, will only download the file if it doesn't already exist. +File is placed into the current directory or run directory. +By default, will only download the file if it doesn't already exist. +##### Arguments +- **name**: The name of the file. +- **run_path**: Optional path to a run to pull files from, i.e. `username/project_name/run_id` if wandb.init has not been called, this is required. +- **replace**: Whether to download the file even if it already exists locally +- **root**: The directory to download the file to. Defaults to the current directory or the run directory if wandb.init was called. -**Args:** - - - `name`: The name of the file. - - `run_path`: Optional path to a run to pull files from, i.e. `username/project_name/run_id` if wandb.init has not been called, this is required. - - `replace`: Whether to download the file even if it already exists locally - - `root`: The directory to download the file to. Defaults to the current directory or the run directory if wandb.init was called. +##### Raises +- **CommError**: If W&B can't connect to the W&B backend. +- **ValueError**: If the file is not found or can't find run_path. -**Returns:** - None if it can't find the file, otherwise a file object open for reading. - - -**Raises:** - - - `CommError`: If W&B can't connect to the W&B backend. - - `ValueError`: If the file is not found or can't find run_path. - ---- - -### method `Run.save` +### method save ```python -save( - glob_str: 'str | os.PathLike', - base_path: 'str | os.PathLike | None' = None, - policy: 'PolicyName' = 'live' -) → bool | list[str] +self, +glob_str: 'str | os.PathLike', +base_path: 'str | os.PathLike | None' = None, +policy: 'PolicyName' = 'live' ``` -Sync one or more files to W&B. - -Relative paths are relative to the current working directory. +Sync one or more files to W&B. -A Unix glob, such as "myfiles/*", is expanded at the time `save` is called regardless of the `policy`. In particular, new files are not picked up automatically. +Relative paths are relative to the current working directory. -A `base_path` may be provided to control the directory structure of uploaded files. It should be a prefix of `glob_str`, and the directory structure beneath it is preserved. +A Unix glob, such as "myfiles/*", is expanded at the time `save` is +called regardless of the `policy`. In particular, new files are not +picked up automatically. -When given an absolute path or glob and no `base_path`, one directory level is preserved as in the example above. +A `base_path` may be provided to control the directory structure of +uploaded files. It should be a prefix of `glob_str`, and the directory +structure beneath it is preserved. -Files are automatically deduplicated: calling `save()` multiple times on the same file without modifications will not re-upload it. +When given an absolute path or glob and no `base_path`, one +directory level is preserved as in the example above. +Files are automatically deduplicated: calling `save()` multiple times +on the same file without modifications will not re-upload it. +##### Arguments -**Args:** - - - `glob_str`: A relative or absolute path or Unix glob. - - `base_path`: A path to use to infer a directory structure; see examples. - - `policy`: One of `live`, `now`, or `end`. - - live: upload the file as it changes, overwriting the previous version - - now: upload the file once now - - end: upload file when the run ends +- **glob_str**: A relative or absolute path or Unix glob. +- **base_path**: A path to use to infer a directory structure; see examples. +- **policy**: One of `live`, `now`, or `end`. -**Returns:** - Paths to the symlinks created for the matched files. -For historical reasons, this may return a boolean in legacy code. +### method status ```python -import wandb - -run = wandb.init() - -run.save("these/are/myfiles/*") -# => Saves files in a "these/are/myfiles/" folder in the run. - -run.save("these/are/myfiles/*", base_path="these") -# => Saves files in an "are/myfiles/" folder in the run. +self +``` -run.save("/Users/username/Documents/run123/*.txt") -# => Saves files in a "run123/" folder in the run. See note below. +Get sync info from the internal backend, about the current run's sync status. -run.save("/Users/username/Documents/run123/*.txt", base_path="/Users") -# => Saves files in a "username/Documents/run123/" folder in the run. -run.save("files/*/saveme.txt") -# => Saves each "saveme.txt" file in an appropriate subdirectory -# of "files/". -# Explicitly finish the run since a context manager is not used. -run.finish() -``` ---- -### method `Run.status` +### method unwatch ```python -status() → RunStatus +self, +models: 'torch.nn.Module | Sequence[torch.nn.Module] | None' = None ``` -Get sync info from the internal backend, about the current run's sync status. - ---- +Remove pytorch model topology, gradient and parameter hooks. +##### Arguments -### method `Run.unwatch` +- **models**: Optional list of pytorch models that have had watch called on them. -```python -unwatch( - models: 'torch.nn.Module | Sequence[torch.nn.Module] | None' = None -) → None -``` -Remove pytorch model topology, gradient and parameter hooks. - -**Args:** - - - `models`: Optional list of pytorch models that have had watch called on them. - ---- - -### method `Run.upsert_artifact` +### method upsert_artifact ```python -upsert_artifact( - artifact_or_path: 'Artifact | str', - name: 'str | None' = None, - type: 'str | None' = None, - aliases: 'list[str] | None' = None, - distributed_id: 'str | None' = None -) → Artifact +self, +artifact_or_path: 'Artifact | str', +name: 'str | None' = None, +type: 'str | None' = None, +aliases: 'list[str] | None' = None, +distributed_id: 'str | None' = None ``` -Declare (or append to) a non-finalized artifact as output of a run. - -Note that you must call run.finish_artifact() to finalize the artifact. This is useful when distributed jobs need to all contribute to the same artifact. - +Declare (or append to) a non-finalized artifact as output of a run. +Note that you must call run.finish_artifact() to finalize the artifact. +This is useful when distributed jobs need to all contribute to the same artifact. -**Args:** - - - `artifact_or_path`: A path to the contents of this artifact, can be in the following forms: - - `/local/directory` - - `/local/directory/file.txt` - - `s3://bucket/path` - - `name`: An artifact name. May be prefixed with "entity/project". Defaults to the basename of the path prepended with the current run ID if not specified. Valid names can be in the following forms: - - name:version - - name:alias - - digest - - `type`: The type of artifact to log. Common examples include `dataset`, `model`. - - `aliases`: Aliases to apply to this artifact, defaults to `["latest"]`. - - `distributed_id`: Unique string that all distributed jobs share. If None, defaults to the run's group name. +##### Arguments +- **artifact_or_path**: A path to the contents of this artifact, +- **name**: An artifact name. May be prefixed with "entity/project". Defaults to the basename of the path prepended with the current run ID +- **type**: The type of artifact to log. Common examples include `dataset`, `model`. +- **aliases**: Aliases to apply to this artifact, defaults to `["latest"]`. +- **distributed_id**: Unique string that all distributed jobs share. If None, defaults to the run's group name. -**Returns:** - An `Artifact` object. ---- -### method `Run.use_artifact` +### method use_artifact ```python -use_artifact( - artifact_or_name: 'str | Artifact', - type: 'str | None' = None, - aliases: 'list[str] | None' = None, - use_as: 'str | None' = None -) → Artifact +self, +artifact_or_name: 'str | Artifact', +type: 'str | None' = None, +aliases: 'list[str] | None' = None, +use_as: 'str | None' = None ``` -Declare an artifact as an input to a run. - -Call `download` or `file` on the returned object to get the contents locally. - +Declare an artifact as an input to a run. +Call `download` or `file` on the returned object to get the contents locally. -**Args:** - - - `artifact_or_name`: The name of the artifact to use. May be prefixed with the name of the project the artifact was logged to ("entity" or "entity/project"). If no entity is specified in the name, the Run or API setting's entity is used. Valid names can be in the following forms - - name:version - - name:alias - - `type`: The type of artifact to use. - - `aliases`: Aliases to apply to this artifact - - `use_as`: This argument is deprecated and does nothing. +##### Arguments +- **artifact_or_name**: The name of the artifact to use. May be prefixed with the name of the project the artifact was logged to ("entity" or "entity/project"). If no entity is specified in the name, the Run or API setting's entity is used. Valid names can be in the following forms +- **type**: The type of artifact to use. +- **aliases**: Aliases to apply to this artifact +- **use_as**: This argument is deprecated and does nothing. -**Returns:** - An `Artifact` object. +##### Examples -**Examples:** - ```python +```python import wandb run = wandb.init(project="") @@ -1130,90 +938,80 @@ artifact_d = run.use_artifact( # Explicitly finish the run since a context manager is not used. run.finish() -``` - ---- +``` -### method `Run.use_model` +### method use_model ```python -use_model(name: 'str') → FilePathStr +self, +name: 'str' ``` -Download the files logged in a model artifact 'name'. - - +Download the files logged in a model artifact 'name'. -**Args:** - - - `name`: A model artifact name. 'name' must match the name of an existing logged model artifact. May be prefixed with `entity/project/`. Valid names can be in the following forms - - model_artifact_name:version - - model_artifact_name:alias +##### Arguments +- **name**: A model artifact name. 'name' must match the name of an existing logged model artifact. May be prefixed with `entity/project/`. Valid names can be in the following forms -**Returns:** - - - `path` (str): Path to downloaded model artifact file(s). +##### Raises +- **AssertionError**: If model artifact 'name' is of a type that does not contain the substring 'model'. -**Raises:** - - - `AssertionError`: If model artifact 'name' is of a type that does not contain the substring 'model'. - ---- - -### method `Run.watch` +### method watch ```python -watch( - models: 'torch.nn.Module | Sequence[torch.nn.Module]', - criterion: 'torch.F | None' = None, - log: "Literal['gradients', 'parameters', 'all'] | None" = 'gradients', - log_freq: 'int' = 1000, - idx: 'int | None' = None, - log_graph: 'bool' = False -) → None +self, +models: 'torch.nn.Module | Sequence[torch.nn.Module]', +criterion: 'torch.F | None' = None, +log: "Literal['gradients', 'parameters', 'all'] | None" = 'gradients', +log_freq: 'int' = 1000, +idx: 'int | None' = None, +log_graph: 'bool' = False ``` -Hook into given PyTorch model to monitor gradients and the model's computational graph. +Hook into given PyTorch model to monitor gradients and the model's computational graph. -This function can track parameters, gradients, or both during training. +This function can track parameters, gradients, or both during training. +##### Arguments +- **models**: A single model or a sequence of models to be monitored. +- **criterion**: The loss function being optimized (optional). +- **log**: Specifies whether to log "gradients", "parameters", or "all". Set to None to disable logging. (default="gradients"). +- **log_freq**: Frequency (in batches) to log gradients and parameters. (default=1000) +- **idx**: Index used when tracking multiple models with `wandb.watch`. (default=None) +- **log_graph**: Whether to log the model's computational graph. (default=False) -**Args:** - - - `models`: A single model or a sequence of models to be monitored. - - `criterion`: The loss function being optimized (optional). - - `log`: Specifies whether to log "gradients", "parameters", or "all". Set to None to disable logging. (default="gradients"). - - `log_freq`: Frequency (in batches) to log gradients and parameters. (default=1000) - - `idx`: Index used when tracking multiple models with `wandb.watch`. (default=None) - - `log_graph`: Whether to log the model's computational graph. (default=False) +##### Raises +- **ValueError**: If `wandb.init()` has not been called or if any of the models are not instances of `torch.nn.Module`. -**Raises:** - ValueError: If `wandb.init()` has not been called or if any of the models are not instances of `torch.nn.Module`. ---- - -### method `Run.write_logs` +### method write_logs ```python -write_logs(text: 'str') → None +self, +text: 'str' ``` -Write text to the run's Logs tab. +Write text to the run's Logs tab. + +Use `write_logs` to directly write text to the Logs tab instead of +relying on automatic stdout/stderr capture. Calls after the run has +finished are silently ignored. + +Consider using the `capture_loggers` setting which integrates with +Python's `logging` module. + +##### Arguments + +- **text**: The text to write. A trailing newline is added if not present. -Use `write_logs` to directly write text to the Logs tab instead of relying on automatic stdout/stderr capture. Calls after the run has finished are silently ignored. -Consider using the `capture_loggers` setting which integrates with Python's `logging` module. -**Args:** - - - `text`: The text to write. A trailing newline is added if not present. diff --git a/models/ref/python/experiments/settings.mdx b/models/ref/python/experiments/settings.mdx index ab61527340..97561e8c9b 100644 --- a/models/ref/python/experiments/settings.mdx +++ b/models/ref/python/experiments/settings.mdx @@ -1,15 +1,176 @@ --- title: Settings -namespace: python_sdk_actions -python_object_type: class +kind: class +namespace: wandb.sdk.wandb_settings --- + import { GitHubLink } from '/snippets/_includes/github-source-link.mdx'; - + + + + +```python +*, +allow_media_symlink: bool = False, +allow_offline_artifacts: bool = True, +allow_val_change: bool = False, +anonymous: object = object(), +api_key: str | None = None, +azure_account_url_to_access_key: dict[str, str] | None = None, +app_url_override: str | None = None, +base_url: str = 'https://api.wandb.ai', +code_dir: str | None = None, +config_paths: collections.abc.Sequence[str] | None = None, +console: Literal['auto', 'off', 'wrap', 'redirect', 'wrap_raw', 'wrap_emu'] = 'auto', +console_multipart: bool = False, +console_chunk_max_bytes: int = 0, +console_chunk_max_seconds: int = 0, +capture_loggers: dict[str, str] | None = None, +credentials_file: str = , +disable_code: bool = False, +disable_git: bool = False, +disable_git_fork_point: bool = True, +disable_job_creation: bool = True, +docker: str | None = None, +email: str | None = None, +entity: str | None = None, +organization: str | None = None, +force: bool = False, +fork_from: wandb.sdk.lib.run_moment.RunMoment | None = None, +git_commit: str | None = None, +git_remote: str = 'origin', +git_remote_url: str | None = None, +git_root: str | None = None, +heartbeat_seconds: int = 30, +host: str | None = None, +http_proxy: str | None = None, +https_proxy: str | None = None, +identity_token_file: str | None = None, +ignore_globs: collections.abc.Sequence[str] = (), +init_timeout: float = 90.0, +finish_timeout: float = 0.0, +finish_timeout_raises: bool = False, +insecure_disable_ssl: bool = False, +job_name: str | None = None, +job_source: Optional[Literal['repo', 'artifact', 'image']] = None, +label_disable: bool = False, +launch: bool = False, +launch_config_path: str | None = None, +login_timeout: float | None = None, +mode: Literal['online', 'offline', 'shared', 'disabled', 'dryrun', 'run'] = 'online', +notebook_name: str | None = None, +program: str | None = None, +program_abspath: str | None = None, +program_relpath: str | None = None, +project: str | None = None, +quiet: bool = False, +reinit: Union[Literal['default', 'return_previous', 'finish_previous', 'create_new'], bool] = 'default', +relogin: bool = False, +resume: Optional[Literal['allow', 'must', 'never', 'auto']] = None, +resume_from: wandb.sdk.lib.run_moment.RunMoment | None = None, +resumed: bool = False, +root_dir: str = , +run_group: str | None = None, +run_id: str | None = None, +run_job_type: str | None = None, +run_name: str | None = None, +run_notes: str | None = None, +run_tags: tuple[str, ...] | None = None, +sagemaker_disable: bool = False, +save_code: bool | None = None, +settings_system: str | None = None, +stop_fn: collections.abc.Callable[[], None] | None = None, +max_end_of_run_history_metrics: int = 10, +max_end_of_run_summary_metrics: int = 10, +show_colors: bool | None = None, +show_emoji: bool | None = None, +show_errors: bool = True, +show_info: bool = True, +show_warnings: bool = True, +silent: bool = False, +start_method: str | None = None, +stop_on_fatal_error: bool = False, +strict: bool | None = None, +summary_timeout: int = 60, +summary_warnings: int = 5, +sweep_id: str | None = None, +sweep_param_path: str | None = None, +symlink: bool = , +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, +x_disable_stats: bool = False, +x_disable_viewer: bool = False, +x_disable_machine_info: bool = False, +x_executable: str | None = None, +x_extra_http_headers: dict[str, str] | None = None, +x_file_stream_max_bytes: int | None = None, +x_file_stream_max_line_bytes: int | None = None, +x_file_stream_transmit_interval: float | None = None, +x_file_stream_retry_max: int | None = None, +x_file_stream_retry_wait_min_seconds: float | None = None, +x_file_stream_retry_wait_max_seconds: float | None = None, +x_file_stream_timeout_seconds: float | None = None, +x_file_transfer_retry_max: int | None = None, +x_file_transfer_retry_wait_min_seconds: float | None = None, +x_file_transfer_retry_wait_max_seconds: float | None = None, +x_file_transfer_timeout_seconds: float | None = None, +x_files_dir: str | None = None, +x_flow_control_custom: bool | None = None, +x_flow_control_disabled: bool | None = None, +x_graphql_retry_max: int | None = None, +x_graphql_retry_wait_min_seconds: float | None = None, +x_graphql_retry_wait_max_seconds: float | None = None, +x_graphql_timeout_seconds: float | None = None, +x_internal_check_process: float = 8.0, +x_jupyter_name: str | None = None, +x_jupyter_path: str | None = None, +x_jupyter_root: str | None = None, +x_label: str | None = None, +x_live_policy_rate_limit: int | None = None, +x_live_policy_wait_time: int | None = None, +x_log_level: int = 20, +x_network_buffer: int | None = None, +x_primary: bool = True, +x_proxies: dict[str, str] | None = None, +x_runqueue_item_id: str | None = None, +x_save_requirements: bool = True, +x_server_side_derived_summary: bool = False, +x_server_side_expand_glob_metrics: bool = True, +x_service_transport: str | None = None, +x_service_wait: float = 30.0, +x_skip_transaction_log: bool = False, +x_start_time: float | None = None, +x_stats_pid: int = 16446, +x_stats_sampling_interval: float = 15.0, +x_stats_neuron_monitor_config_path: str | None = None, +x_stats_dcgm_exporter: str | None = None, +x_stats_open_metrics_endpoints: dict[str, str] | None = None, +x_stats_open_metrics_filters: dict[str, dict[str, str]] | collections.abc.Sequence[str] | None = None, +x_stats_open_metrics_http_headers: dict[str, str] | None = None, +x_stats_disk_paths: collections.abc.Sequence[str] | None = ('/',), +x_stats_cpu_count: int | None = None, +x_stats_cpu_logical_count: int | None = None, +x_stats_gpu_count: int | None = None, +x_stats_gpu_type: str | None = None, +x_stats_gpu_device_ids: collections.abc.Sequence[int] | None = None, +x_stats_buffer_size: int = 0, +x_stats_coreweave_metadata_base_url: str = 'http://169.254.169.254', +x_stats_coreweave_metadata_endpoint: str = '/api/v2/cloud-init/meta-data', +x_stats_track_process_tree: bool = False, +x_stats_no_cgroup: bool = False, +x_sync: bool = False, +x_sync_dir_suffix: str = '', +x_update_finish_state: bool = True +``` +## Description -## class `Settings` Settings for the W&B SDK. This class manages configuration settings for the W&B SDK, @@ -28,669 +189,846 @@ The settings are organized into three categories: the environment. -### method `Settings.__init__` + +## Args + +- **allow_media_symlink**: +- **allow_offline_artifacts**: +- **allow_val_change**: +- **anonymous**: +- **api_key**: +- **azure_account_url_to_access_key**: +- **app_url_override**: +- **base_url**: +- **code_dir**: +- **config_paths**: +- **console**: +- **console_multipart**: +- **console_chunk_max_bytes**: +- **console_chunk_max_seconds**: +- **capture_loggers**: +- **credentials_file**: +- **disable_code**: +- **disable_git**: +- **disable_git_fork_point**: +- **disable_job_creation**: +- **docker**: +- **email**: +- **entity**: +- **organization**: +- **force**: +- **fork_from**: +- **git_commit**: +- **git_remote**: +- **git_remote_url**: +- **git_root**: +- **heartbeat_seconds**: +- **host**: +- **http_proxy**: +- **https_proxy**: +- **identity_token_file**: +- **ignore_globs**: +- **init_timeout**: +- **finish_timeout**: +- **finish_timeout_raises**: +- **insecure_disable_ssl**: +- **job_name**: +- **job_source**: +- **label_disable**: +- **launch**: +- **launch_config_path**: +- **login_timeout**: +- **mode**: +- **notebook_name**: +- **program**: +- **program_abspath**: +- **program_relpath**: +- **project**: +- **quiet**: +- **reinit**: +- **relogin**: +- **resume**: +- **resume_from**: +- **resumed**: +- **root_dir**: +- **run_group**: +- **run_id**: +- **run_job_type**: +- **run_name**: +- **run_notes**: +- **run_tags**: +- **sagemaker_disable**: +- **save_code**: +- **settings_system**: +- **stop_fn**: +- **max_end_of_run_history_metrics**: +- **max_end_of_run_summary_metrics**: +- **show_colors**: +- **show_emoji**: +- **show_errors**: +- **show_info**: +- **show_warnings**: +- **silent**: +- **start_method**: +- **stop_on_fatal_error**: +- **strict**: +- **summary_timeout**: +- **summary_warnings**: +- **sweep_id**: +- **sweep_param_path**: +- **symlink**: +- **sync_tensorboard**: +- **table_raise_on_max_row_limit_exceeded**: +- **use_dot_wandb**: +- **username**: +- **x_cli_only_mode**: +- **x_disable_meta**: +- **x_disable_stats**: +- **x_disable_viewer**: +- **x_disable_machine_info**: +- **x_executable**: +- **x_extra_http_headers**: +- **x_file_stream_max_bytes**: +- **x_file_stream_max_line_bytes**: +- **x_file_stream_transmit_interval**: +- **x_file_stream_retry_max**: +- **x_file_stream_retry_wait_min_seconds**: +- **x_file_stream_retry_wait_max_seconds**: +- **x_file_stream_timeout_seconds**: +- **x_file_transfer_retry_max**: +- **x_file_transfer_retry_wait_min_seconds**: +- **x_file_transfer_retry_wait_max_seconds**: +- **x_file_transfer_timeout_seconds**: +- **x_files_dir**: +- **x_flow_control_custom**: +- **x_flow_control_disabled**: +- **x_graphql_retry_max**: +- **x_graphql_retry_wait_min_seconds**: +- **x_graphql_retry_wait_max_seconds**: +- **x_graphql_timeout_seconds**: +- **x_internal_check_process**: +- **x_jupyter_name**: +- **x_jupyter_path**: +- **x_jupyter_root**: +- **x_label**: +- **x_live_policy_rate_limit**: +- **x_live_policy_wait_time**: +- **x_log_level**: +- **x_network_buffer**: +- **x_primary**: +- **x_proxies**: +- **x_runqueue_item_id**: +- **x_save_requirements**: +- **x_server_side_derived_summary**: +- **x_server_side_expand_glob_metrics**: +- **x_service_transport**: +- **x_service_wait**: +- **x_skip_transaction_log**: +- **x_start_time**: +- **x_stats_pid**: +- **x_stats_sampling_interval**: +- **x_stats_neuron_monitor_config_path**: +- **x_stats_dcgm_exporter**: +- **x_stats_open_metrics_endpoints**: +- **x_stats_open_metrics_filters**: +- **x_stats_open_metrics_http_headers**: +- **x_stats_disk_paths**: +- **x_stats_cpu_count**: +- **x_stats_cpu_logical_count**: +- **x_stats_gpu_count**: +- **x_stats_gpu_type**: +- **x_stats_gpu_device_ids**: +- **x_stats_buffer_size**: +- **x_stats_coreweave_metadata_base_url**: +- **x_stats_coreweave_metadata_endpoint**: +- **x_stats_track_process_tree**: +- **x_stats_no_cgroup**: +- **x_sync**: +- **x_sync_dir_suffix**: +- **x_update_finish_state**: + + + + +## Properties + +### property app_url + +The URL for the W&B UI, usually https://wandb.ai. + +This is different from `base_url` (like https://api.wandb.ai) which +is used to access W&B APIs programmatically. + +### property colab_url + +The URL to the Colab notebook, if running in Colab. + +### property deployment + + + +### property files_dir + +Absolute path to the local directory where the run's files are stored. + +### property is_local + + + +### property log_dir + +The directory for storing log files. + +### property log_internal + +The path to the file to use for internal logs. + +### property log_symlink_internal + +The path to the symlink to the internal log file of the most recent run. + +### property log_symlink_user + +The path to the symlink to the user-process log file of the most recent run. + +### property log_user + +The path to the file to use for user-process logs. + +### property project_url + +The W&B URL where the project can be viewed. + +### property resume_fname + +The path to the resume file. + +### property run_mode + +The mode of the run. Can be either "run" or "offline-run". + +### property run_url + +The W&B URL where the run can be viewed. + +### property settings_workspace + +The path to the workspace settings file. + +### property sweep_url + +The W&B URL where the sweep can be viewed. + +### property sync_dir + +The directory for storing the run's files. + +### property sync_file + +Path to the append-only binary transaction log file. + +### property sync_symlink_latest + +Path to the symlink to the most recent run's transaction log file. + +### property timespec + +The time specification for the run. + +### property wandb_dir + +Full path to the wandb directory. + + + +## Methods + +### method construct ```python -__init__( - allow_media_symlink: 'bool' = False, - allow_offline_artifacts: 'bool' = True, - allow_val_change: 'bool' = False, - anonymous: 'object' = , - api_key: 'str | None' = None, - azure_account_url_to_access_key: 'dict[str, str] | None' = None, - app_url_override: 'str | None' = None, - base_url: 'str' = 'https://api.wandb.ai', - code_dir: 'str | None' = None, - config_paths: 'collections.abc.Sequence[str] | None' = None, - console: 'Literal['auto', 'off', 'wrap', 'redirect', 'wrap_raw', 'wrap_emu']' = 'auto', - console_multipart: 'bool' = False, - console_chunk_max_bytes: 'int' = 0, - console_chunk_max_seconds: 'int' = 0, - capture_loggers: 'dict[str, str] | None' = None, - credentials_file: 'str' = None, - disable_code: 'bool' = False, - disable_git: 'bool' = False, - disable_git_fork_point: 'bool' = True, - disable_job_creation: 'bool' = True, - docker: 'str | None' = None, - email: 'str | None' = None, - entity: 'str | None' = None, - organization: 'str | None' = None, - force: 'bool' = False, - fork_from: 'wandb.sdk.lib.run_moment.RunMoment | None' = None, - git_commit: 'str | None' = None, - git_remote: 'str' = 'origin', - git_remote_url: 'str | None' = None, - git_root: 'str | None' = None, - heartbeat_seconds: 'int' = 30, - host: 'str | None' = None, - http_proxy: 'str | None' = None, - https_proxy: 'str | None' = None, - identity_token_file: 'str | None' = None, - ignore_globs: 'Sequence' = (), - init_timeout: 'float' = 90.0, - finish_timeout: 'float' = 0.0, - finish_timeout_raises: 'bool' = False, - insecure_disable_ssl: 'bool' = False, - job_name: 'str | None' = None, - job_source: 'Literal['repo', 'artifact', 'image'] | None' = None, - label_disable: 'bool' = False, - launch: 'bool' = False, - launch_config_path: 'str | None' = None, - login_timeout: 'float | None' = None, - mode: 'Literal['online', 'offline', 'shared', 'disabled', 'dryrun', 'run']' = 'online', - notebook_name: 'str | None' = None, - program: 'str | None' = None, - program_abspath: 'str | None' = None, - program_relpath: 'str | None' = None, - project: 'str | None' = None, - quiet: 'bool' = False, - reinit: 'Literal['default', 'return_previous', 'finish_previous', 'create_new'] | bool' = 'default', - relogin: 'bool' = False, - resume: 'Literal['allow', 'must', 'never', 'auto'] | None' = None, - resume_from: 'wandb.sdk.lib.run_moment.RunMoment | None' = None, - resumed: 'bool' = False, - root_dir: 'str' = None, - run_group: 'str | None' = None, - run_id: 'str | None' = None, - run_job_type: 'str | None' = None, - run_name: 'str | None' = None, - run_notes: 'str | None' = None, - run_tags: 'tuple[str, ...] | None' = None, - sagemaker_disable: 'bool' = False, - save_code: 'bool | None' = None, - settings_system: 'str | None' = None, - stop_fn: 'collections.abc.Callable[[], None] | None' = None, - max_end_of_run_history_metrics: 'int' = 10, - max_end_of_run_summary_metrics: 'int' = 10, - show_colors: 'bool | None' = None, - show_emoji: 'bool | None' = None, - show_errors: 'bool' = True, - show_info: 'bool' = True, - show_warnings: 'bool' = True, - silent: 'bool' = False, - start_method: 'str | None' = None, - stop_on_fatal_error: 'bool' = False, - strict: 'bool | None' = None, - summary_timeout: 'int' = 60, - summary_warnings: 'int' = 5, - sweep_id: 'str | None' = None, - sweep_param_path: 'str | None' = None, - 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, - x_disable_stats: 'bool' = False, - x_disable_viewer: 'bool' = False, - x_disable_machine_info: 'bool' = False, - x_executable: 'str | None' = None, - x_extra_http_headers: 'dict[str, str] | None' = None, - x_file_stream_max_bytes: 'int | None' = None, - x_file_stream_max_line_bytes: 'int | None' = None, - x_file_stream_transmit_interval: 'float | None' = None, - x_file_stream_retry_max: 'int | None' = None, - x_file_stream_retry_wait_min_seconds: 'float | None' = None, - x_file_stream_retry_wait_max_seconds: 'float | None' = None, - x_file_stream_timeout_seconds: 'float | None' = None, - x_file_transfer_retry_max: 'int | None' = None, - x_file_transfer_retry_wait_min_seconds: 'float | None' = None, - x_file_transfer_retry_wait_max_seconds: 'float | None' = None, - x_file_transfer_timeout_seconds: 'float | None' = None, - x_files_dir: 'str | None' = None, - x_flow_control_custom: 'bool | None' = None, - x_flow_control_disabled: 'bool | None' = None, - x_graphql_retry_max: 'int | None' = None, - x_graphql_retry_wait_min_seconds: 'float | None' = None, - x_graphql_retry_wait_max_seconds: 'float | None' = None, - x_graphql_timeout_seconds: 'float | None' = None, - x_internal_check_process: 'float' = 8.0, - x_jupyter_name: 'str | None' = None, - x_jupyter_path: 'str | None' = None, - x_jupyter_root: 'str | None' = None, - x_label: 'str | None' = None, - x_live_policy_rate_limit: 'int | None' = None, - x_live_policy_wait_time: 'int | None' = None, - x_log_level: 'int' = 20, - x_network_buffer: 'int | None' = None, - x_primary: 'bool' = True, - x_proxies: 'dict[str, str] | None' = None, - x_runqueue_item_id: 'str | None' = None, - x_save_requirements: 'bool' = True, - x_server_side_derived_summary: 'bool' = False, - x_server_side_expand_glob_metrics: 'bool' = True, - x_service_transport: 'str | None' = None, - x_service_wait: 'float' = 30.0, - x_skip_transaction_log: 'bool' = False, - x_start_time: 'float | None' = None, - x_stats_pid: 'int' = 28097, - x_stats_sampling_interval: 'float' = 15.0, - x_stats_neuron_monitor_config_path: 'str | None' = None, - x_stats_dcgm_exporter: 'str | None' = None, - x_stats_open_metrics_endpoints: 'dict[str, str] | None' = None, - x_stats_open_metrics_filters: 'dict[str, dict[str, str]] | collections.abc.Sequence[str] | None' = None, - x_stats_open_metrics_http_headers: 'dict[str, str] | None' = None, - x_stats_disk_paths: 'collections.abc.Sequence[str] | None' = ('/',), - x_stats_cpu_count: 'int | None' = None, - x_stats_cpu_logical_count: 'int | None' = None, - x_stats_gpu_count: 'int | None' = None, - x_stats_gpu_type: 'str | None' = None, - x_stats_gpu_device_ids: 'collections.abc.Sequence[int] | None' = None, - x_stats_buffer_size: 'int' = 0, - x_stats_coreweave_metadata_base_url: 'str' = 'http://169.254.169.254', - x_stats_coreweave_metadata_endpoint: 'str' = '/api/v2/cloud-init/meta-data', - x_stats_track_process_tree: 'bool' = False, - x_stats_no_cgroup: 'bool' = False, - x_sync: 'bool' = False, - x_sync_dir_suffix: 'str' = '', - x_update_finish_state: 'bool' = True -) → None +_fields_set: 'set[str] | None' = None, **values: 'Any' ``` -**Args:** - - - `allow_media_symlink` (bool): Whether to symlink media files to the run directory. - If true, media files will be symlinked or hardlinked to the - run directory instead of copied. This may result in faster - logging and reduced disk usage. However, deleting or modifying - the original files before upload to the W&B server will be - reflected in the uploaded data. - - `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` (object): Deprecated and will be removed. - - `api_key` (str | None): The W&B API key. - - `azure_account_url_to_access_key` (dict[str, str] | None): Mapping of Azure account URLs to their corresponding access keys for Azure integration. - - `app_url_override` (str | None): Override for the 'app' URL for the W&B UI. - The `app_url` is normally computed based on `base_url`, but this can be - used to set it explicitly. - WANDB_APP_URL is the corresponding environment variable. - - `base_url` (str): The URL of the W&B backend for data synchronization. - - `code_dir` (str | None): Directory containing the code to be tracked by W&B. - - `config_paths` (collections.abc.Sequence[str] | None): Paths to files to load configuration from into the `Config` object. - - `console` (Literal['auto', 'off', 'wrap', 'redirect', 'wrap_raw', 'wrap_emu']): The type of console capture to be applied. - Possible values are: - - "auto" - Automatically selects the console capture method based on the - system environment and settings. - - "off" - Disables console capture. - - "redirect" - Redirects low-level file descriptors for capturing output. - - "wrap" - Overrides the write methods of sys.stdout/sys.stderr. Will be - mapped to either "wrap_raw" or "wrap_emu" based on the state of the system. - - "wrap_raw" - Same as "wrap" but captures raw output directly instead of - through an emulator. Derived from the `wrap` setting and should not be set manually. - - "wrap_emu" - Same as "wrap" but captures output through an emulator. - Derived from the `wrap` setting and should not be set manually. - - `console_multipart` (bool): Enable multipart console logging. - When True, the SDK writes console output to timestamped files - under the `logs/` directory instead of a single `output.log`. - Each part is uploaded as soon as it is closed, giving users live - access to logs while the run is active. Rollover cadence is - controlled by `console_chunk_max_bytes` and/or `console_chunk_max_seconds`. - If both limits are `0`, all logs are uploaded once at run finish. - Note: Uploaded chunks are immutable; terminal control sequences - that modify previous lines (e.g., progress bars using carriage returns) - only affect the current chunk. - - `console_chunk_max_bytes` (int): Size-based rollover threshold for multipart console logs, in bytes. - Starts a new console log file when the current part reaches this - size. Has an effect only when `console_multipart` is `True`. - Can be combined with `console_chunk_max_seconds`; whichever limit is - hit first triggers the rollover. A value of `0` disables the - size-based limit. - - `console_chunk_max_seconds` (int): Time-based rollover threshold for multipart console logs, in seconds. - Starts a new console log file after this many seconds have elapsed - since the current part began. Requires `console_multipart` to be - `True`. May be used with `console_chunk_max_bytes`; the first limit - reached closes the part. A value of `0` disables the time-based - limit. - - `capture_loggers` (dict[str, str] | None): Names of Python loggers to capture into the run's Logs tab. - A mapping of logger name to minimum log level. When set, wandb installs a - logging.Handler on each named logger and removes it when the run finishes. - Log records emitted by those loggers are published as console output to the - run, similar to stdout/stderr capture. - Log records are formatted the same as `logging.basicConfig()`, like - `INFO:my_module:Some message.` This is not currently customizable. - To capture all logs, pass the name of the root logger, which is 'root'. - This is independent of the `console` setting: both can be active - simultaneously. - Example: - ```python - wandb.init( - settings=wandb.Settings( - console="off", - capture_loggers={ - "my_app": "INFO", - "my_app.training": "ERROR", - }, - ), - ) - ``` - - `credentials_file` (str): Path to file for writing temporary access tokens. - - `disable_code` (bool): Whether to disable capturing the code. - - `disable_git` (bool): Whether to disable capturing the git state. - - `disable_git_fork_point` (bool): Whether to disable inferring fork point from remote branches - When set to True, the SDK will use the latest commit from the upstream - branch, if one is set. Otherwise skip generating the diff patch. - When set to False, the SDK will try to use the latest commit from the upstream branch, - if one is set. - Otherwise, it will find the closest commit from all remote branches. - This may impact performance for repos with many upstream branches. - - `disable_job_creation` (bool): Whether to disable the creation of a job artifact for W&B Launch. - - `docker` (str | None): The Docker image used to execute the script. - - `email` (str | None): The email address of the user. - - `entity` (str | None): The W&B entity, such as a user or a team. - - `organization` (str | None): The W&B organization. - - `force` (bool): Whether to pass the `force` flag to `wandb.login()`. - - `fork_from` (wandb.sdk.lib.run_moment.RunMoment | None): Specifies a point in a previous execution of a run to fork from. - The point is defined by the run ID, a metric, and its value. - Currently, only the metric '_step' is supported. - - `git_commit` (str | None): The git commit hash to associate with the run. - - `git_remote` (str): The git remote to associate with the run. - - `git_remote_url` (str | None): The URL of the git remote repository. - - `git_root` (str | None): Root directory of the git repository. - - - `host` (str | None): Hostname of the machine running the script. - - `http_proxy` (str | None): Custom proxy servers for http requests to W&B. - - `https_proxy` (str | None): Custom proxy servers for https requests to W&B. - - `identity_token_file` (str | None): Path to file containing an identity token (JWT) for authentication. - - `ignore_globs` (Sequence): Unix glob patterns relative to `files_dir` specifying files to exclude from upload. - - `init_timeout` (float): Time in seconds to wait for the `wandb.init` call to complete before timing out. - - `finish_timeout` (float): Time in seconds to wait for data to upload at the end of a run. - Setting this can limit costs caused by slow uploads to W&B at the end of a - run, with the trade-off that the run will be marked crashed and may be - missing some data. The default is for `run.finish()` to block until all - data finishes uploading. - If this is set to a number greater than zero, W&B gives up on uploading a - run's data after this many seconds at the end of a run, unblocking your - script. After some time, the run becomes Crashed or Failed in the UI. Any - unuploaded data is still stored on disk and can be uploaded with `wandb - sync`. - Use the `finish_timeout_raises` setting to raise an error in addition to - printing a warning message. - Runs shut down by `wandb.teardown()` (which automatically runs at the end - of a script in an atexit hook) will also respect this setting. - - `finish_timeout_raises` (bool): Whether to raise a TimeoutError if finish_timeout expires. - Using this together with the `finish_timeout` setting causes `run.finish()` - to raise a TimeoutError after a timeout in addition to printing a message. - Note that `run.finish()` is called implicitly when using a Run as a context - manager: - with wandb.init() as run: - ... # run.finish() executes at the end of the `with` block - This does not cause `wandb.teardown()` to raise an error (since it runs - at the end of a script anyway). - - `insecure_disable_ssl` (bool): Whether to insecurely disable SSL verification. - - `job_name` (str | None): Name of the Launch job running the script. - - `job_source` (Optional[Literal['repo', 'artifact', 'image']]): Source type for Launch. - - `label_disable` (bool): Whether to disable automatic labeling features. - - - `launch_config_path` (str | None): Path to the launch configuration file. - - `login_timeout` (float | None): Time in seconds to wait for login operations before timing out. - - `mode` (Literal['online', 'offline', 'shared', 'disabled', 'dryrun', 'run']): The operating mode for W&B logging and synchronization. - - `notebook_name` (str | None): Name of the notebook if running in a Jupyter-like environment. - - `program` (str | None): Path to the script that created the run, if available. - - `program_abspath` (str | None): The absolute path from the root repository directory to the script that - created the run. - Root repository directory is defined as the directory containing the - .git directory, if it exists. Otherwise, it's the current working directory. - - `program_relpath` (str | None): The relative path to the script that created the run. - - `project` (str | None): The W&B project ID. - - `quiet` (bool): Flag to suppress non-essential output. - - `reinit` (Union[Literal['default', 'return_previous', 'finish_previous', 'create_new'], bool]): What to do when `wandb.init()` is called while a run is active. - Options: - - "default": Use "finish_previous" in notebooks and "return_previous" - otherwise. - - "return_previous": Return the most recently created run - that is not yet finished. This does not update `wandb.run`; see - the "create_new" option. - - "finish_previous": Finish all active runs, then return a new run. - - "create_new": Create a new run without modifying other active runs. - Does not update `wandb.run` and top-level functions like `wandb.log`. - Because of this, some older integrations that rely on the global run - will not work. - Can also be a boolean, but this is deprecated. False is the same as - "return_previous", and True is the same as "finish_previous". - - `relogin` (bool): Flag to force a new login attempt. - - `resume` (Optional[Literal['allow', 'must', 'never', 'auto']]): Specifies the resume behavior for the run. - Options: - - "must": Resumes from an existing run with the same ID. If no such run exists, - it will result in failure. - - "allow": Attempts to resume from an existing run with the same ID. If none is - found, a new run will be created. - - "never": Always starts a new run. If a run with the same ID already exists, - it will result in failure. - - "auto": Automatically resumes from the most recent failed run on the same - machine. - - `resume_from` (wandb.sdk.lib.run_moment.RunMoment | None): Specifies a point in a previous execution of a run to resume from. - The point is defined by the run ID, a metric, and its value. - Currently, only the metric '_step' is supported. - - - `root_dir` (str): The root directory to use as the base for all run-related paths. - In particular, this is used to derive the wandb directory and the run directory. - - `run_group` (str | None): Group identifier for related runs. - Used for grouping runs in the UI. - - `run_id` (str | None): The ID of the run. - - `run_job_type` (str | None): Type of job being run (e.g., training, evaluation). - - `run_name` (str | None): Human-readable name for the run. - - `run_notes` (str | None): Additional notes or description for the run. - - `run_tags` (tuple[str, ...] | None): Tags to associate with the run for organization and filtering. - - `sagemaker_disable` (bool): Flag to disable SageMaker-specific functionality. - - `save_code` (bool | None): Whether to save the code associated with the run. - - `settings_system` (str | None): Path to the system-wide settings file. - - `stop_fn` (collections.abc.Callable[[], None] | None): A callback to execute to stop the run. - A run can be stopped through the web UI, or after a fatal error - (if configured via a setting). - By default, to stop a run, W&B sends a SIGINT to the main thread. - Set this callback to override this behavior, like to use a different - signal or to take some other action before interrupting. - The callback runs in a separate thread. It runs soon after a stop is - requested, but not immediately. - - `max_end_of_run_history_metrics` (int): Maximum number of history sparklines to display at the end of a run. - - `max_end_of_run_summary_metrics` (int): Maximum number of summary metrics to display at the end of a run. - - - - `show_errors` (bool): Whether to display error messages. - - `show_info` (bool): Whether to display informational messages. - - `show_warnings` (bool): Whether to display warning messages. - - `silent` (bool): Flag to suppress all output. - - - `stop_on_fatal_error` (bool): Whether to stop the run after a fatal error. - After W&B hits an unrecoverable error while uploading data, it prints - a message and stops uploading, but still allows logging more data. - This is usually desirable: your training metrics get stored on disk - and can be recovered using `wandb sync`, even if they aren't uploaded. - This is not useful if your files get deleted after training. - In that case, setting this to True will stop the run after a fatal error, - as if the stop button was pressed in the web UI. - - `strict` (bool | None): Whether to enable strict mode for validation and error checking. - - `summary_timeout` (int): Time in seconds to wait for summary operations before timing out. - - - `sweep_id` (str | None): Identifier of the sweep this run belongs to. - - `sweep_param_path` (str | None): Path to the sweep parameters configuration. - - `symlink` (bool): Whether to use symlinks (True by default except on Windows). - - `sync_tensorboard` (bool | None): 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` (bool | None): 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` (str | None): Username. - - - `x_disable_meta` (bool): Flag to disable the collection of system metadata. - - `x_disable_stats` (bool): Flag to disable the collection of system metrics. +##### Arguments - - `x_extra_http_headers` (dict[str, str] | None): Additional headers to add to all outgoing HTTP requests. +- **_fields_set**: +- **values**: +### method copy +```python +self, *, +include: 'AbstractSetIntStr | MappingIntStrAny | None' = None, +exclude: 'AbstractSetIntStr | MappingIntStrAny | None' = None, +update: 'Dict[str, Any] | None' = None, +deep: 'bool' = False +``` +Returns a copy of the model. +!!! warning "Deprecated" + This method is now deprecated; use `model_copy` instead. +If you need `include` or `exclude`, use: +```python {test="skip" lint="skip"} +data = self.model_dump(include=include, exclude=exclude, round_trip=True) +data = {**data, **(update or {})} +copied = self.model_validate(data) +``` +##### Arguments +- **include**: Optional set or mapping specifying which fields to include in the copied model. +- **exclude**: Optional set or mapping specifying which fields to exclude in the copied model. +- **update**: Optional dictionary of field-value pairs to override field values in the copied model. +- **deep**: If True, the values of fields that are Pydantic models will be deep-copied. +### method dict +```python +self, *, +include: 'IncEx | None' = None, +exclude: 'IncEx | None' = None, +by_alias: 'bool' = False, +exclude_unset: 'bool' = False, +exclude_defaults: 'bool' = False, +exclude_none: 'bool' = False +``` +##### Arguments +- **include**: +- **exclude**: +- **by_alias**: +- **exclude_unset**: +- **exclude_defaults**: +- **exclude_none**: - - `x_label` (str | None): Label to assign to system metrics and console logs collected for the run. - This is used to group data by on the frontend and can be used to distinguish data - from different processes in a distributed training job. +### method from_orm +```python +obj: 'Any' +``` - - `x_primary` (bool): Determines whether to save internal wandb files and metadata. - In a distributed setting, this is useful for avoiding file overwrites - from secondary processes when only system metrics and logs are needed, - as the primary process handles the main logging. - - `x_save_requirements` (bool): Flag to save the requirements file. - - `x_server_side_derived_summary` (bool): Flag to delegate automatic computation of summary from history to the server. - This does not disable user-provided summary updates. +##### Arguments +- **obj**: - - `x_service_wait` (float): Time in seconds to wait for the wandb-core internal service to start. - - `x_skip_transaction_log` (bool): Whether to skip saving the run events to the transaction log. - This is only relevant for online runs. Can be used to reduce the amount of - data written to disk. - Should be used with caution, as it removes the gurantees about - recoverability. - - `x_stats_sampling_interval` (float): Sampling interval for the system monitor in seconds. - - `x_stats_dcgm_exporter` (str | None): Endpoint to extract Nvidia DCGM metrics from. - Options: - - Extract DCGM-related metrics from a query to the Prometheus `/api/v1/query` endpoint. - It is a common practice to aggregate metrics reported by the instances of the DCGM Exporter - running on different nodes in a cluster using Prometheus. - - TODO: Parse metrics directly from the `/metrics` endpoint of the DCGM Exporter. - Examples: - - `http://localhost:9400/api/v1/query?query=DCGM_FI_DEV_GPU_TEMP{node="l1337", cluster="globular"}`. +### method json - - `x_stats_open_metrics_endpoints` (dict[str, str] | None): OpenMetrics `/metrics` endpoints to monitor for system metrics. - - `x_stats_open_metrics_filters` (dict[str, dict[str, str]] | collections.abc.Sequence[str] | None): Filter to apply to metrics collected from OpenMetrics `/metrics` endpoints. - Supports two formats: - - `{"metric regex pattern, including endpoint name as prefix": {"label": "label value regex pattern"}}` - - `("metric regex pattern 1", "metric regex pattern 2", ...)` - - `x_stats_open_metrics_http_headers` (dict[str, str] | None): HTTP headers to add to OpenMetrics requests. - - `x_stats_disk_paths` (collections.abc.Sequence[str] | None): System paths to monitor for disk usage. - - `x_stats_cpu_count` (int | None): System CPU count. - If set, overrides the auto-detected value in the run metadata. - - `x_stats_cpu_logical_count` (int | None): Logical CPU count. - If set, overrides the auto-detected value in the run metadata. - - `x_stats_gpu_count` (int | None): GPU device count. - If set, overrides the auto-detected value in the run metadata. - - `x_stats_gpu_type` (str | None): GPU device type. - If set, overrides the auto-detected value in the run metadata. - - `x_stats_gpu_device_ids` (collections.abc.Sequence[int] | None): GPU device indices to monitor. - If not set, the system monitor captures metrics for all GPUs. - Assumes 0-based indexing matching CUDA/ROCm device enumeration. +```python +self, *, +include: 'IncEx | None' = None, +exclude: 'IncEx | None' = None, +by_alias: 'bool' = False, +exclude_unset: 'bool' = False, +exclude_defaults: 'bool' = False, +exclude_none: 'bool' = False, +encoder: 'Callable[[Any], Any] | None' = PydanticUndefined, +models_as_dict: 'bool' = PydanticUndefined, **dumps_kwargs: 'Any' +``` - - `x_stats_track_process_tree` (bool): Monitor the entire process tree for resource usage, starting from `x_stats_pid`. - When `True`, the system monitor aggregates the RSS, CPU%, and thread count - from the process with PID `x_stats_pid` and all of its descendants. - This can have a performance overhead and is disabled by default. - - `x_stats_no_cgroup` (bool): Disable cgroup v2 CPU and memory limits for system metric percentages. +##### Arguments - - `x_sync_dir_suffix` (str): Suffix to add to the run's directory name (sync_dir). - This is set in wandb.init() to avoid naming conflicts. - If set, it is joined to the default name with a dash. - - `x_update_finish_state` (bool): Flag to indicate whether this process can update the run's final state on the server. - Set to False in distributed training when only the main process should determine the final state. +- **include**: +- **exclude**: +- **by_alias**: +- **exclude_unset**: +- **exclude_defaults**: +- **exclude_none**: +- **encoder**: +- **models_as_dict**: +- **dumps_kwargs**: -**Returns:** - An `Settings` object. +### method model_construct +```python +_fields_set: 'set[str] | None' = None, **values: 'Any' +``` +Creates a new instance of the `Model` class with validated data. +Creates a new model setting `__dict__` and `__pydantic_fields_set__` from trusted or pre-validated data. +Default values are respected, but no other validation is performed. +!!! note + `model_construct()` generally respects the `model_config.extra` setting on the provided model. + That is, if `model_config.extra == 'allow'`, then all extra passed values are added to the model instance's `__dict__` + and `__pydantic_extra__` fields. If `model_config.extra == 'ignore'` (the default), then all extra passed values are ignored. + Because no validation is performed with a call to `model_construct()`, having `model_config.extra == 'forbid'` does not result in + an error if extra values are passed, but they will be ignored. +##### Arguments +- **_fields_set**: A set of field names that were originally explicitly set during instantiation. If provided, this is directly used for the [`model_fields_set`][pydantic.BaseModel.model_fields_set] attribute. Otherwise, the field names from the `values` argument will be used. +- **values**: Trusted or pre-validated data dictionary. +### method model_copy +```python +self, *, +update: 'Mapping[str, Any] | None' = None, +deep: 'bool' = False +``` +!!! abstract "Usage Documentation" + [`model_copy`](../concepts/serialization.md#model_copy) +Returns a copy of the model. +!!! note + The underlying instance's [`__dict__`][object.__dict__] attribute is copied. This + might have unexpected side effects if you store anything in it, on top of the model + fields (e.g. the value of [cached properties][functools.cached_property]). +##### Arguments +- **update**: Values to change/add in the new model. Note: the data is not validated before creating the new model. You should trust this data. +- **deep**: Set to `True` to make a deep copy of the model. +### method model_dump +```python +self, *, +mode: "Literal['json', 'python'] | str" = 'python', +include: 'IncEx | None' = None, +exclude: 'IncEx | None' = None, +context: 'Any | None' = None, +by_alias: 'bool | None' = None, +exclude_unset: 'bool' = False, +exclude_defaults: 'bool' = False, +exclude_none: 'bool' = False, +round_trip: 'bool' = False, +warnings: "bool | Literal['none', 'warn', 'error']" = True, +fallback: 'Callable[[Any], Any] | None' = None, +serialize_as_any: 'bool' = False +``` +!!! abstract "Usage Documentation" + [`model_dump`](../concepts/serialization.md#modelmodel_dump) +Generate a dictionary representation of the model, optionally specifying which fields to include or exclude. +##### Arguments +- **mode**: The mode in which `to_python` should run. If mode is 'json', the output will only contain JSON serializable types. If mode is 'python', the output may contain non-JSON-serializable Python objects. +- **include**: A set of fields to include in the output. +- **exclude**: A set of fields to exclude from the output. +- **context**: Additional context to pass to the serializer. +- **by_alias**: Whether to use the field's alias in the dictionary key if defined. +- **exclude_unset**: Whether to exclude fields that have not been explicitly set. +- **exclude_defaults**: Whether to exclude fields that are set to their default value. +- **exclude_none**: Whether to exclude fields that have a value of `None`. +- **round_trip**: If True, dumped values should be valid as input for non-idempotent types such as Json[T]. +- **warnings**: How to handle serialization errors. False/"none" ignores them, True/"warn" logs errors, "error" raises a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError]. +- **fallback**: A function to call when an unknown value is encountered. If not provided, a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError] error is raised. +- **serialize_as_any**: Whether to serialize fields with duck-typing serialization behavior. +### method model_dump_json +```python +self, *, +indent: 'int | None' = None, +include: 'IncEx | None' = None, +exclude: 'IncEx | None' = None, +context: 'Any | None' = None, +by_alias: 'bool | None' = None, +exclude_unset: 'bool' = False, +exclude_defaults: 'bool' = False, +exclude_none: 'bool' = False, +round_trip: 'bool' = False, +warnings: "bool | Literal['none', 'warn', 'error']" = True, +fallback: 'Callable[[Any], Any] | None' = None, +serialize_as_any: 'bool' = False +``` +!!! abstract "Usage Documentation" + [`model_dump_json`](../concepts/serialization.md#modelmodel_dump_json) -### property `Settings.app_url` +Generates a JSON representation of the model using Pydantic's `to_json` method. -The URL for the W&B UI, usually https://wandb.ai. +##### Arguments -This is different from `base_url` (like https://api.wandb.ai) which -is used to access W&B APIs programmatically. +- **indent**: Indentation to use in the JSON output. If None is passed, the output will be compact. +- **include**: Field(s) to include in the JSON output. +- **exclude**: Field(s) to exclude from the JSON output. +- **context**: Additional context to pass to the serializer. +- **by_alias**: Whether to serialize using field aliases. +- **exclude_unset**: Whether to exclude fields that have not been explicitly set. +- **exclude_defaults**: Whether to exclude fields that are set to their default value. +- **exclude_none**: Whether to exclude fields that have a value of `None`. +- **round_trip**: If True, dumped values should be valid as input for non-idempotent types such as Json[T]. +- **warnings**: How to handle serialization errors. False/"none" ignores them, True/"warn" logs errors, "error" raises a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError]. +- **fallback**: A function to call when an unknown value is encountered. If not provided, a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError] error is raised. +- **serialize_as_any**: Whether to serialize fields with duck-typing serialization behavior. -**Returns:** - - `str`: The app_url property value. -### property `Settings.colab_url` -The URL to the Colab notebook, if running in Colab. -**Returns:** - - `str | None`: The colab_url property value. +### method model_json_schema -### property `Settings.deployment` +```python +by_alias: 'bool' = True, +ref_template: 'str' = '#/$defs/{model}', +schema_generator: 'type[GenerateJsonSchema]' = , +mode: 'JsonSchemaMode' = 'validation' +``` -### property `Settings.files_dir` +Generates a JSON schema for a model class. -Absolute path to the local directory where the run's files are stored. +##### Arguments -**Returns:** - - `str`: The files_dir property value. +- **by_alias**: Whether to use attribute aliases or not. +- **ref_template**: The reference template. +- **schema_generator**: To override the logic used to generate the JSON schema, as a subclass of `GenerateJsonSchema` with your desired modifications +- **mode**: The mode in which to generate the schema. -### property `Settings.is_local` -### property `Settings.log_dir` -The directory for storing log files. -**Returns:** - - `str`: The log_dir property value. +### method model_parametrized_name -### property `Settings.log_internal` +```python +params: 'tuple[type[Any], ...]' +``` -The path to the file to use for internal logs. +Compute the class name for parametrizations of generic classes. -**Returns:** - - `str`: The log_internal property value. +This method can be overridden to achieve a custom naming scheme for generic BaseModels. -### property `Settings.log_symlink_internal` +##### Arguments -The path to the symlink to the internal log file of the most recent run. +- **params**: Tuple of types of the class. Given a generic class `Model` with 2 type variables and a concrete model `Model[str, int]`, the value `(str, int)` would be passed to `params`. -**Returns:** - - `str`: The log_symlink_internal property value. -### property `Settings.log_symlink_user` +##### Raises -The path to the symlink to the user-process log file of the most recent run. +- **TypeError**: Raised when trying to generate concrete names for non-generic models. -**Returns:** - - `str`: The log_symlink_user property value. -### property `Settings.log_user` +### method model_post_init -The path to the file to use for user-process logs. +```python +self, +context: 'Any', / +``` -**Returns:** - - `str`: The log_user property value. +Override this method to perform additional initialization after `__init__` and `model_construct`. +This is useful if you want to do some validation that requires the entire model to be initialized. -### property `Settings.project_url` +##### Arguments -The W&B URL where the project can be viewed. +- **context**: -**Returns:** - - `str`: The project_url property value. -### property `Settings.resume_fname` -The path to the resume file. -**Returns:** - - `str`: The resume_fname property value. +### method model_rebuild -### property `Settings.run_mode` +```python +*, +force: 'bool' = False, +raise_errors: 'bool' = True, +_parent_namespace_depth: 'int' = 2, +_types_namespace: 'MappingNamespace | None' = None +``` -The mode of the run. Can be either "run" or "offline-run". +Try to rebuild the pydantic-core schema for the model. -**Returns:** - - `Literal['run', 'offline-run']`: The run_mode property value. +This may be necessary when one of the annotations is a ForwardRef which could not be resolved during +the initial attempt to build the schema, and automatic rebuilding fails. -### property `Settings.run_url` +##### Arguments -The W&B URL where the run can be viewed. +- **force**: Whether to force the rebuilding of the model schema, defaults to `False`. +- **raise_errors**: Whether to raise errors, defaults to `True`. +- **_parent_namespace_depth**: The depth level of the parent namespace, defaults to 2. +- **_types_namespace**: The types namespace, defaults to `None`. -**Returns:** - - `str`: The run_url property value. -### property `Settings.settings_workspace` -The path to the workspace settings file. -**Returns:** - - `str`: The settings_workspace property value. +### method model_validate -### property `Settings.sweep_url` +```python +obj: 'Any', *, +strict: 'bool | None' = None, +from_attributes: 'bool | None' = None, +context: 'Any | None' = None, +by_alias: 'bool | None' = None, +by_name: 'bool | None' = None +``` -The W&B URL where the sweep can be viewed. +Validate a pydantic model instance. -**Returns:** - - `str`: The sweep_url property value. +##### Arguments -### property `Settings.sync_dir` +- **obj**: The object to validate. +- **strict**: Whether to enforce types strictly. +- **from_attributes**: Whether to extract data from object attributes. +- **context**: Additional context to pass to the validator. +- **by_alias**: Whether to use the field's alias when validating against the provided input data. +- **by_name**: Whether to use the field's name when validating against the provided input data. -The directory for storing the run's files. -**Returns:** - - `str`: The sync_dir property value. +##### Raises -### property `Settings.sync_file` +- **ValidationError**: If the object could not be validated. -Path to the append-only binary transaction log file. -**Returns:** - - `str`: The sync_file property value. +### method model_validate_json -### property `Settings.sync_symlink_latest` +```python +json_data: 'str | bytes | bytearray', *, +strict: 'bool | None' = None, +context: 'Any | None' = None, +by_alias: 'bool | None' = None, +by_name: 'bool | None' = None +``` -Path to the symlink to the most recent run's transaction log file. +!!! abstract "Usage Documentation" + [JSON Parsing](../concepts/json.md#json-parsing) -**Returns:** - - `str`: The sync_symlink_latest property value. +Validate the given JSON data against the Pydantic model. -### property `Settings.timespec` +##### Arguments -The time specification for the run. +- **json_data**: The JSON data to validate. +- **strict**: Whether to enforce types strictly. +- **context**: Extra variables to pass to the validator. +- **by_alias**: Whether to use the field's alias when validating against the provided input data. +- **by_name**: Whether to use the field's name when validating against the provided input data. -**Returns:** - - `str`: The timespec property value. -### property `Settings.wandb_dir` +##### Raises + +- **ValidationError**: If `json_data` is not a JSON string or the object could not be validated. + + +### method model_validate_strings + +```python +obj: 'Any', *, +strict: 'bool | None' = None, +context: 'Any | None' = None, +by_alias: 'bool | None' = None, +by_name: 'bool | None' = None +``` + +Validate the given object with string data against the Pydantic model. + +##### Arguments + +- **obj**: The object containing string data to validate. +- **strict**: Whether to enforce types strictly. +- **context**: Extra variables to pass to the validator. +- **by_alias**: Whether to use the field's alias when validating against the provided input data. +- **by_name**: Whether to use the field's name when validating against the provided input data. + + + + +### method parse_file + +```python +path: 'str | Path', *, +content_type: 'str | None' = None, +encoding: 'str' = 'utf8', +proto: 'DeprecatedParseProtocol | None' = None, +allow_pickle: 'bool' = False +``` + + + +##### Arguments + +- **path**: +- **content_type**: +- **encoding**: +- **proto**: +- **allow_pickle**: + + + + +### method parse_obj + +```python +obj: 'Any' +``` + + + +##### Arguments + +- **obj**: + + + + +### method parse_raw + +```python +b: 'str | bytes', *, +content_type: 'str | None' = None, +encoding: 'str' = 'utf8', +proto: 'DeprecatedParseProtocol | None' = None, +allow_pickle: 'bool' = False +``` + + + +##### Arguments + +- **b**: +- **content_type**: +- **encoding**: +- **proto**: +- **allow_pickle**: + + + + +### method schema + +```python +by_alias: 'bool' = True, +ref_template: 'str' = '#/$defs/{model}' +``` + + + +##### Arguments + +- **by_alias**: +- **ref_template**: + + + + +### method schema_json + +```python +*, +by_alias: 'bool' = True, +ref_template: 'str' = '#/$defs/{model}', **dumps_kwargs: 'Any' +``` + + + +##### Arguments + +- **by_alias**: +- **ref_template**: +- **dumps_kwargs**: + + + + +### method update_forward_refs + +```python +**localns: 'Any' +``` + + + +##### Arguments + +- **localns**: + + + + +### method validate + +```python +value: 'Any' +``` + + + +##### Arguments + +- **value**: + + + + +### method validate_anonymous + +```python +value: 'object' +``` + + + +##### Arguments + +- **value**: + + + + +### method validate_x_extra_http_headers + +```python +(value) +``` + + + +##### Arguments + +- **value**: + + + + +### method validate_x_stats_coreweave_metadata_base_url + +```python +(value) +``` -Full path to the wandb directory. -**Returns:** - - `str`: The wandb_dir property value. +##### Arguments +- **value**: diff --git a/models/ref/python/functions/controller.mdx b/models/ref/python/functions/controller.mdx index a8b13dad5b..2ed6cb88c0 100644 --- a/models/ref/python/functions/controller.mdx +++ b/models/ref/python/functions/controller.mdx @@ -1,31 +1,42 @@ --- title: controller() -namespace: python_sdk_actions -python_object_type: function +kind: function +namespace: wandb.sdk.wandb_sweep --- -import { GitHubLink } from '/snippets/_includes/github-source-link.mdx'; - +import { GitHubLink } from '/snippets/_includes/github-source-link.mdx'; + -### function `controller` ```python -controller( - sweep_id_or_config: 'str | dict | None' = None, - entity: 'str | None' = None, - project: 'str | None' = None -) → _WandbController +sweep_id_or_config: 'str | dict | None' = None, +entity: 'str | None' = None, +project: 'str | None' = None ``` -Public sweep controller constructor. +## Description + +Public sweep controller constructor. + + + +## Args + +- **sweep_id_or_config**: +- **entity**: +- **project**: -**Examples:** - ```python + + + +## Examples + +```python import wandb tuner = wandb.controller(...) @@ -33,4 +44,5 @@ print(tuner.sweep_config) print(tuner.sweep_id) tuner.configure_search(...) tuner.configure_stopping(...) -``` +``` + diff --git a/models/ref/python/functions/finish.mdx b/models/ref/python/functions/finish.mdx index e1170e77f4..8f99ec1690 100644 --- a/models/ref/python/functions/finish.mdx +++ b/models/ref/python/functions/finish.mdx @@ -1,34 +1,47 @@ --- title: finish() -namespace: python_sdk_actions -python_object_type: function +kind: function +namespace: wandb.sdk.wandb_run --- -import { GitHubLink } from '/snippets/_includes/github-source-link.mdx'; - +import { GitHubLink } from '/snippets/_includes/github-source-link.mdx'; + -### function `finish` ```python -finish(exit_code: 'int | None' = None, quiet: 'bool | None' = None) → None +exit_code: 'int | None' = None, +quiet: 'bool | None' = None ``` -Finish a run and upload any remaining data. +## Description + +Finish a run and upload any remaining data. + +Marks the completion of a W&B run and ensures all data is synced to the server. +The run's final state is determined by its exit conditions and sync status. + +Run States: +- Running: Active run that is logging data and/or sending heartbeats. +- Crashed: Run that stopped sending heartbeats unexpectedly. +- Finished: Run completed successfully (`exit_code=0`) with all data synced. +- Failed: Run completed with errors (`exit_code!=0`). + + + +## Args + +- **exit_code**: Integer indicating the run's exit status. Use 0 for success, any other value marks the run as failed. +- **quiet**: Deprecated. Configure logging verbosity using `wandb.Settings(quiet=...)`. + + +## Returns + +None -Marks the completion of a W&B run and ensures all data is synced to the server. The run's final state is determined by its exit conditions and sync status. -Run States: -- Running: Active run that is logging data and/or sending heartbeats. -- Crashed: Run that stopped sending heartbeats unexpectedly. -- Finished: Run completed successfully (`exit_code=0`) with all data synced. -- Failed: Run completed with errors (`exit_code!=0`). -**Args:** - - - `exit_code`: Integer indicating the run's exit status. Use 0 for success, any other value marks the run as failed. - - `quiet`: Deprecated. Configure logging verbosity using `wandb.Settings(quiet=...)`. diff --git a/models/ref/python/functions/init.mdx b/models/ref/python/functions/init.mdx index b484b65434..6393100a3d 100644 --- a/models/ref/python/functions/init.mdx +++ b/models/ref/python/functions/init.mdx @@ -1,117 +1,112 @@ --- title: init() -namespace: python_sdk_actions -python_object_type: function +kind: function +namespace: wandb.sdk.wandb_init --- -import { GitHubLink } from '/snippets/_includes/github-source-link.mdx'; - +import { GitHubLink } from '/snippets/_includes/github-source-link.mdx'; + -### function `init` ```python -init( - entity: 'str | None' = None, - project: 'str | None' = None, - dir: 'StrPath | None' = None, - id: 'str | None' = None, - name: 'str | None' = None, - notes: 'str | None' = None, - tags: 'Sequence[str] | None' = None, - config: 'dict[str, Any] | str | None' = None, - config_exclude_keys: 'list[str] | None' = None, - config_include_keys: 'list[str] | None' = None, - allow_val_change: 'bool | None' = None, - group: 'str | None' = None, - job_type: 'str | None' = None, - mode: "Literal['online', 'offline', 'disabled', 'shared'] | None" = None, - force: 'bool | 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, - fork_from: 'str | None' = None, - save_code: 'bool | None' = None, - tensorboard: 'bool | None' = None, - sync_tensorboard: 'bool | None' = None, - monitor_gym: 'bool | None' = None, - settings: 'Settings | dict[str, Any] | None' = None, - anonymous: 'DoNotSet' = -) → Run +entity: 'str | None' = None, +project: 'str | None' = None, +dir: 'StrPath | None' = None, +id: 'str | None' = None, +name: 'str | None' = None, +notes: 'str | None' = None, +tags: 'Sequence[str] | None' = None, +config: 'dict[str, Any] | str | None' = None, +config_exclude_keys: 'list[str] | None' = None, +config_include_keys: 'list[str] | None' = None, +allow_val_change: 'bool | None' = None, +group: 'str | None' = None, +job_type: 'str | None' = None, +mode: "Literal['online', 'offline', 'disabled', 'shared'] | None" = None, +force: 'bool | 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, +fork_from: 'str | None' = None, +save_code: 'bool | None' = None, +tensorboard: 'bool | None' = None, +sync_tensorboard: 'bool | None' = None, +monitor_gym: 'bool | None' = None, +settings: 'Settings | dict[str, Any] | None' = None, +anonymous: 'DoNotSet' = DoNotSet ``` -Start a new run to track and log to W&B. +## Description + +Start a new run to track and log to W&B. -In an ML training pipeline, you could add `wandb.init()` to the beginning of your training script as well as your evaluation script, and each piece would be tracked as a run in W&B. +In an ML training pipeline, you could add `wandb.init()` to the beginning of +your training script as well as your evaluation script, and each piece would +be tracked as a run in W&B. -`wandb.init()` spawns a new background process to log data to a run, and it also syncs data to https://wandb.ai by default, so you can see your results in real-time. When you're done logging data, call `run.finish()` to end the run, or use the run as a context manager to call it automatically: +`wandb.init()` spawns a new background process to log data to a run, and it +also syncs data to https://wandb.ai by default, so you can see your results +in real-time. When you're done logging data, call `run.finish()` to +end the run, or use the run as a context manager to call it automatically: - with wandb.init() as run: ... # run.finish() executes at the end of the block + with wandb.init() as run: + ... # run.finish() executes at the end of the block -If you don't call `run.finish()`, the run will end when your script exits. +If you don't call `run.finish()`, the run will end when your script exits. -Run IDs must not contain any of the following special characters `/ \ # ? % :` +Run IDs must not contain any of the following special characters `/ \ # ? % :` -**Args:** - - - `entity`: The username or team name the runs are logged to. The entity must already exist, so ensure you create your account or team in the UI before starting to log runs. If not specified, the run will default your default entity. To change the default entity, go to your settings and update the "Default location to create new projects" under "Default team". - - `project`: The name of the project under which this run will be logged. If not specified, we use a heuristic to infer the project name based on the system, such as checking the git root or the current program file. If we can't infer the project name, the project will default to `"uncategorized"`. - - `dir`: The absolute path to the directory where experiment logs and metadata files are stored. If not specified, this defaults to the `./wandb` directory. Note that this does not affect the location where artifacts are stored when calling `download()`. - - `id`: A unique identifier for this run, used for resuming. It must be unique within the project and cannot be reused once a run is deleted. For a short descriptive name, use the `name` field, or for saving hyperparameters to compare across runs, use `config`. - - `name`: A short display name for this run, which appears in the UI to help you identify it. By default, we generate a random two-word name allowing easy cross-reference runs from table to charts. Keeping these run names brief enhances readability in chart legends and tables. For saving hyperparameters, we recommend using the `config` field. - - `notes`: A detailed description of the run, similar to a commit message in Git. Use this argument to capture any context or details that may help you recall the purpose or setup of this run in the future. - - `tags`: A list of tags to label this run in the UI. Tags are helpful for organizing runs or adding temporary identifiers like "baseline" or "production." You can easily add, remove tags, or filter by tags in the UI. If resuming a run, the tags provided here will replace any existing tags. To add tags to a resumed run without overwriting the current tags, use `run.tags += ("new_tag",)` after calling `run = wandb.init()`. - - `config`: Sets `wandb.config`, a dictionary-like object for storing input parameters to your run, such as model hyperparameters or data preprocessing settings. The config appears in the UI in an overview page, allowing you to group, filter, and sort runs based on these parameters. Keys should not contain periods (`.`), and values should be smaller than 10 MB. If a dictionary, `argparse.Namespace`, or `absl.flags.FLAGS` is provided, the key-value pairs will be loaded directly into `wandb.config`. If a string is provided, it is interpreted as a path to a YAML file, from which configuration values will be loaded into `wandb.config`. - - `config_exclude_keys`: A list of specific keys to exclude from `wandb.config`. - - `config_include_keys`: A list of specific keys to include in `wandb.config`. - - `allow_val_change`: Controls whether config values can be modified after their initial set. By default, an exception is raised if a config value is overwritten. For tracking variables that change during training, such as a learning rate, consider using `wandb.log()` instead. By default, this is `False` in scripts and `True` in Notebook environments. - - `group`: Specify a group name to organize individual runs as part of a larger experiment. This is useful for cases like cross-validation or running multiple jobs that train and evaluate a model on different test sets. Grouping allows you to manage related runs collectively in the UI, making it easy to toggle and review results as a unified experiment. - - `job_type`: Specify the type of run, especially helpful when organizing runs within a group as part of a larger experiment. For example, in a group, you might label runs with job types such as "train" and "eval". Defining job types enables you to easily filter and group similar runs in the UI, facilitating direct comparisons. - - `mode`: Specifies how run data is managed, with the following options: - - `"online"` (default): Enables live syncing with W&B when a network connection is available, with real-time updates to visualizations. - - `"offline"`: Suitable for air-gapped or offline environments; data is saved locally and can be synced later. Ensure the run folder is preserved to enable future syncing. - - `"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. - - `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. - - `"never"`: If a run with the specified `id` exists, an error will be raised. If no such run is found, a new run will be created. - - `"must"`: If a run with the specified `id` exists, it will resume from the last step. If no run is found, an error will be raised. - - `"auto"`: Automatically resumes the previous run if it crashed on this machine; otherwise, starts a new run. - - `True`: Deprecated. Use `"auto"` instead. - - `False`: Deprecated. Use the default behavior (leaving `resume` unset) to always start a new run. If `resume` is set, `fork_from` and `resume_from` cannot be used. When `resume` is unset, the system will always start a new run. - - `resume_from`: Specifies a moment in a previous run to resume a run from, using the format `{run_id}?_step={step}`. This allows users to truncate the history logged to a run at an intermediate step and resume logging from that step. The target run must be in the same project. If an `id` argument is also provided, the `resume_from` argument will take precedence. `resume`, `resume_from` and `fork_from` cannot be used together, only one of them can be used at a time. Note that this feature is in beta and may change in the future. - - `fork_from`: Specifies a point in a previous run from which to fork a new run, using the format `{id}?_step={step}`. This creates a new run that resumes logging from the specified step in the target run’s history. The target run must be part of the current project. If an `id` argument is also provided, it must be different from the `fork_from` argument, an error will be raised if they are the same. `resume`, `resume_from` and `fork_from` cannot be used together, only one of them can be used at a time. Note that this feature is in beta and may change in the future. - - `save_code`: Enables saving the main script or notebook to W&B, aiding in experiment reproducibility and allowing code comparisons across runs in the UI. By default, this is disabled, but you can change the default to enable on your settings page. - - `tensorboard`: Deprecated. Use `sync_tensorboard` instead. - - `sync_tensorboard`: Enables automatic syncing of W&B logs from TensorBoard or TensorBoardX, saving relevant event files for viewing in the W&B UI. - - `monitor_gym`: Enables automatic logging of videos of the environment when using OpenAI Gym. - - `settings`: Specifies a dictionary or `wandb.Settings` object with advanced settings for the run. +## Args +- **entity**: The username or team name the runs are logged to. The entity must already exist, so ensure you create your account or team in the UI before starting to log runs. If not specified, the run will default your default entity. To change the default entity, go to your settings and update the "Default location to create new projects" under "Default team". +- **project**: The name of the project under which this run will be logged. If not specified, we use a heuristic to infer the project name based on the system, such as checking the git root or the current program file. If we can't infer the project name, the project will default to `"uncategorized"`. +- **dir**: The absolute path to the directory where experiment logs and metadata files are stored. If not specified, this defaults to the `./wandb` directory. Note that this does not affect the location where artifacts are stored when calling `download()`. +- **id**: A unique identifier for this run, used for resuming. It must be unique within the project and cannot be reused once a run is deleted. For a short descriptive name, use the `name` field, or for saving hyperparameters to compare across runs, use `config`. +- **name**: A short display name for this run, which appears in the UI to help you identify it. By default, we generate a random two-word name allowing easy cross-reference runs from table to charts. Keeping these run names brief enhances readability in chart legends and tables. For saving hyperparameters, we recommend using the `config` field. +- **notes**: A detailed description of the run, similar to a commit message in Git. Use this argument to capture any context or details that may help you recall the purpose or setup of this run in the future. +- **tags**: A list of tags to label this run in the UI. Tags are helpful for organizing runs or adding temporary identifiers like "baseline" or "production." You can easily add, remove tags, or filter by tags in the UI. If resuming a run, the tags provided here will replace any existing tags. To add tags to a resumed run without overwriting the current tags, use `run.tags += ("new_tag",)` after calling `run = wandb.init()`. +- **config**: Sets `wandb.config`, a dictionary-like object for storing input parameters to your run, such as model hyperparameters or data preprocessing settings. The config appears in the UI in an overview page, allowing you to group, filter, and sort runs based on these parameters. Keys should not contain periods (`.`), and values should be smaller than 10 MB. If a dictionary, `argparse.Namespace`, or `absl.flags.FLAGS` is provided, the key-value pairs will be loaded directly into `wandb.config`. If a string is provided, it is interpreted as a path to a YAML file, from which configuration values will be loaded into `wandb.config`. +- **config_exclude_keys**: A list of specific keys to exclude from `wandb.config`. +- **config_include_keys**: A list of specific keys to include in `wandb.config`. +- **allow_val_change**: Controls whether config values can be modified after their initial set. By default, an exception is raised if a config value is overwritten. For tracking variables that change during training, such as a learning rate, consider using `wandb.log()` instead. By default, this is `False` in scripts and `True` in Notebook environments. +- **group**: Specify a group name to organize individual runs as part of a larger experiment. This is useful for cases like cross-validation or running multiple jobs that train and evaluate a model on different test sets. Grouping allows you to manage related runs collectively in the UI, making it easy to toggle and review results as a unified experiment. +- **job_type**: Specify the type of run, especially helpful when organizing runs within a group as part of a larger experiment. For example, in a group, you might label runs with job types such as "train" and "eval". Defining job types enables you to easily filter and group similar runs in the UI, facilitating direct comparisons. +- **mode**: Specifies how run data is managed, with the following options: +- **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. +- **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`. +- **resume_from**: Specifies a moment in a previous run to resume a run from, using the format `{run_id}?_step={step}`. This allows users to truncate the history logged to a run at an intermediate step and resume logging from that step. The target run must be in the same project. If an `id` argument is also provided, the `resume_from` argument will take precedence. `resume`, `resume_from` and `fork_from` cannot be used together, only one of them can be used at a time. Note that this feature is in beta and may change in the future. +- **fork_from**: Specifies a point in a previous run from which to fork a new run, using the format `{id}?_step={step}`. This creates a new run that resumes logging from the specified step in the target run’s history. The target run must be part of the current project. If an `id` argument is also provided, it must be different from the `fork_from` argument, an error will be raised if they are the same. `resume`, `resume_from` and `fork_from` cannot be used together, only one of them can be used at a time. Note that this feature is in beta and may change in the future. +- **save_code**: Enables saving the main script or notebook to W&B, aiding in experiment reproducibility and allowing code comparisons across runs in the UI. By default, this is disabled, but you can change the default to enable on your settings page. +- **tensorboard**: Deprecated. Use `sync_tensorboard` instead. +- **sync_tensorboard**: Enables automatic syncing of W&B logs from TensorBoard or TensorBoardX, saving relevant event files for viewing in the W&B UI. +- **monitor_gym**: Enables automatic logging of videos of the environment when using OpenAI Gym. +- **settings**: Specifies a dictionary or `wandb.Settings` object with advanced settings for the run. +- **anonymous**: -**Returns:** - A `Run` object. +## Returns +A `Run` object. +## Raises -**Raises:** - - - `Error`: If some unknown or internal error happened during the run initialization. - - `AuthenticationError`: If the user failed to provide valid credentials. - - `CommError`: If there was a problem communicating with the WandB server. - - `UsageError`: If the user provided invalid arguments. - - `KeyboardInterrupt`: If user interrupts the run. +- **Error**: If some unknown or internal error happened during the run initialization. +- **AuthenticationError**: If the user failed to provide valid credentials. +- **CommError**: If there was a problem communicating with the WandB server. +- **UsageError**: If the user provided invalid arguments. +- **KeyboardInterrupt**: If user interrupts the run. +## Examples -**Examples:** - `wandb.init()` returns a `Run` object. Use the run object to log data, save artifacts, and manage the run lifecycle. +`wandb.init()` returns a `Run` object. Use the run object to log data, +save artifacts, and manage the run lifecycle. ```python import wandb @@ -122,4 +117,5 @@ with wandb.init(config=config) as run: acc = 0.95 # Example accuracy loss = 0.05 # Example loss run.log({"accuracy": acc, "loss": loss}) -``` +``` + diff --git a/models/ref/python/functions/login.mdx b/models/ref/python/functions/login.mdx index d6ec15f834..3c6dffd6f3 100644 --- a/models/ref/python/functions/login.mdx +++ b/models/ref/python/functions/login.mdx @@ -1,69 +1,78 @@ --- title: login() -namespace: python_sdk_actions -python_object_type: function +kind: function +namespace: wandb.sdk.wandb_login --- -import { GitHubLink } from '/snippets/_includes/github-source-link.mdx'; - +import { GitHubLink } from '/snippets/_includes/github-source-link.mdx'; + -### function `login` ```python -login( - 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, - anonymous: 'DoNotSet' = -) → bool +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, +anonymous: 'DoNotSet' = DoNotSet ``` -Log into W&B. +## Description + +Log into W&B. + +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. -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. +If none of the above is true, then this gets the API key from the first of: -This updates global credentials for the session (affecting all wandb usage in the current Python process after this call) and possibly the .netrc file. +- 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) -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: +## Args +- **key**: The API key to use. +- **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. +- **anonymous**: -- 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) +## Returns +`bool`: If `key` is configured. -**Args:** - - - `key`: The API key to use. - - `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. +## Raises +- **AuthenticationError**: If `api_key` fails verification with the server. +- **UsageError**: If `api_key` cannot be configured and no tty. -**Returns:** - - - `bool`: If `key` is configured. -**Raises:** - - - `AuthenticationError`: If `api_key` fails verification with the server. - - `UsageError`: If `api_key` cannot be configured and no tty. diff --git a/models/ref/python/functions/restore.mdx b/models/ref/python/functions/restore.mdx index cd99d0d333..cf0d335369 100644 --- a/models/ref/python/functions/restore.mdx +++ b/models/ref/python/functions/restore.mdx @@ -1,47 +1,49 @@ --- title: restore() -namespace: python_sdk_actions -python_object_type: function +kind: function +namespace: wandb.sdk.wandb_run --- -import { GitHubLink } from '/snippets/_includes/github-source-link.mdx'; - +import { GitHubLink } from '/snippets/_includes/github-source-link.mdx'; + -### function `restore` ```python -restore( - name: 'str', - run_path: 'str | None' = None, - replace: 'bool' = False, - root: 'str | None' = None -) → None | TextIO +name: 'str', +run_path: 'str | None' = None, +replace: 'bool' = False, +root: 'str | None' = None ``` -Download the specified file from cloud storage. +## Description + +Download the specified file from cloud storage. + +File is placed into the current directory or run directory. +By default, will only download the file if it doesn't already exist. + + + +## Args -File is placed into the current directory or run directory. By default, will only download the file if it doesn't already exist. +- **name**: The name of the file. +- **run_path**: Optional path to a run to pull files from, i.e. `username/project_name/run_id` if wandb.init has not been called, this is required. +- **replace**: Whether to download the file even if it already exists locally +- **root**: The directory to download the file to. Defaults to the current directory or the run directory if wandb.init was called. +## Returns -**Args:** - - - `name`: The name of the file. - - `run_path`: Optional path to a run to pull files from, i.e. `username/project_name/run_id` if wandb.init has not been called, this is required. - - `replace`: Whether to download the file even if it already exists locally - - `root`: The directory to download the file to. Defaults to the current directory or the run directory if wandb.init was called. +None if it can't find the file, otherwise a file object open for reading. +## Raises +- **CommError**: If W&B can't connect to the W&B backend. +- **ValueError**: If the file is not found or can't find run_path. -**Returns:** - None if it can't find the file, otherwise a file object open for reading. -**Raises:** - - - `CommError`: If W&B can't connect to the W&B backend. - - `ValueError`: If the file is not found or can't find run_path. diff --git a/models/ref/python/functions/setup.mdx b/models/ref/python/functions/setup.mdx index dd0008441f..bebb632a53 100644 --- a/models/ref/python/functions/setup.mdx +++ b/models/ref/python/functions/setup.mdx @@ -1,41 +1,49 @@ --- title: setup() -namespace: python_sdk_actions -python_object_type: function +kind: function +namespace: wandb.sdk.wandb_setup --- -import { GitHubLink } from '/snippets/_includes/github-source-link.mdx'; - +import { GitHubLink } from '/snippets/_includes/github-source-link.mdx'; + -### function `setup` ```python -setup(settings: 'Settings | None' = None) → _WandbSetup +settings: 'Settings | None' = None ``` -Prepares W&B for use in the current process and its children. +## Description + +Prepares W&B for use in the current process and its children. + +You can usually ignore this as it is implicitly called by `wandb.init()`. + +When using wandb in multiple processes, calling `wandb.setup()` +in the parent process before starting child processes may improve +performance and resource utilization. + +Note that `wandb.setup()` modifies `os.environ`, and it is important +that child processes inherit the modified environment variables. -You can usually ignore this as it is implicitly called by `wandb.init()`. +See also `wandb.teardown()`. -When using wandb in multiple processes, calling `wandb.setup()` in the parent process before starting child processes may improve performance and resource utilization. -Note that `wandb.setup()` modifies `os.environ`, and it is important that child processes inherit the modified environment variables. -See also `wandb.teardown()`. +## Args +- **settings**: Configuration settings to apply globally. These can be overridden by subsequent `wandb.init()` calls. -**Args:** - - - `settings`: Configuration settings to apply globally. These can be overridden by subsequent `wandb.init()` calls. -**Example:** - ```python + +## Examples + +```python import multiprocessing import wandb @@ -43,8 +51,8 @@ import wandb def run_experiment(params): with wandb.init(config=params): - # Run experiment - pass + # Run experiment + pass if __name__ == "__main__": @@ -53,21 +61,22 @@ if __name__ == "__main__": # Define experiment parameters experiment_params = [ - {"learning_rate": 0.01, "epochs": 10}, - {"learning_rate": 0.001, "epochs": 20}, + {"learning_rate": 0.01, "epochs": 10}, + {"learning_rate": 0.001, "epochs": 20}, ] # Start multiple processes, each running a separate experiment processes = [] for params in experiment_params: - p = multiprocessing.Process(target=run_experiment, args=(params,)) - p.start() - processes.append(p) + p = multiprocessing.Process(target=run_experiment, args=(params,)) + p.start() + processes.append(p) # Wait for all processes to complete for p in processes: - p.join() + p.join() # Optional: Explicitly shut down the backend wandb.teardown() -``` +``` + diff --git a/models/ref/python/functions/sweep.mdx b/models/ref/python/functions/sweep.mdx index fb9341891b..c154f02580 100644 --- a/models/ref/python/functions/sweep.mdx +++ b/models/ref/python/functions/sweep.mdx @@ -1,45 +1,52 @@ --- title: sweep() -namespace: python_sdk_actions -python_object_type: function +kind: function +namespace: wandb.sdk.wandb_sweep --- -import { GitHubLink } from '/snippets/_includes/github-source-link.mdx'; - +import { GitHubLink } from '/snippets/_includes/github-source-link.mdx'; + -### function `sweep` ```python -sweep( - sweep: 'dict | Callable', - entity: 'str | None' = None, - project: 'str | None' = None, - prior_runs: 'list[str] | None' = None -) → str +sweep: 'dict | Callable', +entity: 'str | None' = None, +project: 'str | None' = None, +prior_runs: 'list[str] | None' = None ``` -Initialize a hyperparameter sweep. +## Description + +Initialize a hyperparameter sweep. + +Search for hyperparameters that optimizes a cost function +of a machine learning model by testing various combinations. + +Make note the unique identifier, `sweep_id`, that is returned. +At a later step provide the `sweep_id` to a sweep agent. + +See [Sweep configuration structure](https://docs.wandb.ai/models/sweeps/define-sweep-configuration) +for information on how to define your sweep. + + + +## Args + +- **sweep**: The configuration of a hyperparameter search. (or configuration generator). If you provide a callable, ensure that the callable does not take arguments and that it returns a dictionary that conforms to the W&B sweep config spec. +- **entity**: The username or team name where you want to send W&B runs created by the sweep to. Ensure that the entity you specify already exists. If you don't specify an entity, the run will be sent to your default entity, which is usually your username. +- **project**: The name of the project where W&B runs created from the sweep are sent to. If the project is not specified, the run is sent to a project labeled 'Uncategorized'. +- **prior_runs**: The run IDs of existing runs to add to this sweep. -Search for hyperparameters that optimizes a cost function of a machine learning model by testing various combinations. -Make note the unique identifier, `sweep_id`, that is returned. At a later step provide the `sweep_id` to a sweep agent. +## Returns -See [Sweep configuration structure](https://docs.wandb.ai/models/sweeps/define-sweep-configuration) for information on how to define your sweep. +`str`: A unique identifier for the sweep. -**Args:** - - - `sweep`: The configuration of a hyperparameter search. (or configuration generator). If you provide a callable, ensure that the callable does not take arguments and that it returns a dictionary that conforms to the W&B sweep config spec. - - `entity`: The username or team name where you want to send W&B runs created by the sweep to. Ensure that the entity you specify already exists. If you don't specify an entity, the run will be sent to your default entity, which is usually your username. - - `project`: The name of the project where W&B runs created from the sweep are sent to. If the project is not specified, the run is sent to a project labeled 'Uncategorized'. - - `prior_runs`: The run IDs of existing runs to add to this sweep. -**Returns:** - - - `str`: A unique identifier for the sweep. diff --git a/models/ref/python/functions/teardown.mdx b/models/ref/python/functions/teardown.mdx index e996be6fe7..180becfa0d 100644 --- a/models/ref/python/functions/teardown.mdx +++ b/models/ref/python/functions/teardown.mdx @@ -1,23 +1,44 @@ --- title: teardown() -namespace: python_sdk_actions -python_object_type: function +kind: function +namespace: wandb.sdk.wandb_setup --- -import { GitHubLink } from '/snippets/_includes/github-source-link.mdx'; - +import { GitHubLink } from '/snippets/_includes/github-source-link.mdx'; + -### function `teardown` ```python -teardown(exit_code: 'int | None' = None) → None +exit_code: 'int | None' = None ``` -Waits for W&B to finish and frees resources. +## Description + +Waits for W&B to finish and frees resources. + +Completes any runs that were not explicitly finished +using `run.finish()` and waits for all data to be uploaded. + +It is recommended to call this at the end of a session +that used `wandb.setup()`. It is invoked automatically +in an `atexit` hook, but this is not reliable in certain setups +such as when using Python's `multiprocessing` module. + + + +## Args + +- **exit_code**: + + +## Returns + +None + + + -Completes any runs that were not explicitly finished using `run.finish()` and waits for all data to be uploaded. -It is recommended to call this at the end of a session that used `wandb.setup()`. It is invoked automatically in an `atexit` hook, but this is not reliable in certain setups such as when using Python's `multiprocessing` module. diff --git a/models/ref/python/public-api/agentruns.mdx b/models/ref/python/public-api/agentruns.mdx index c5fd164c25..9fed19b5a7 100644 --- a/models/ref/python/public-api/agentruns.mdx +++ b/models/ref/python/public-api/agentruns.mdx @@ -1,11 +1,96 @@ --- title: AgentRuns -namespace: public_apis_namespace -python_object_type: class +kind: class +namespace: wandb.apis.public.runs --- + import { GitHubLink } from '/snippets/_includes/github-source-link.mdx'; - + + + + + +```python +service_api: 'ServiceApi', +entity: 'str', +project: 'str', +sweep_id: 'str', +agent_key: 'str', *, +total_runs: 'int', +order: 'str' = '+created_at', +per_page: 'int' = 50 +``` + +## Description + +A lazy iterator of `Run` objects for a single sweep agent. + + + + + +## Args + +- **service_api**: +- **entity**: +- **project**: +- **sweep_id**: +- **agent_key**: +- **total_runs**: +- **order**: +- **per_page**: + + + + +## Properties + +### property more + +Whether there are more pages to be fetched. + +### property cursor + +The start cursor to use for the next fetched page. + + + +## Methods + +### method convert_objects + +```python +self +``` + +Convert the current GraphQL page into :class:`Run` instances for this agent. + + + + + +### method next + +```python +self +``` + +Return the next item from the iterator. When exhausted, raise StopIteration + + + + + +### method update_variables + +```python +self +``` + +Map paginator state to GetAgentRuns variables (after/first, not cursor/perPage). + + diff --git a/models/ref/python/public-api/api.mdx b/models/ref/python/public-api/api.mdx index 7b24933ea9..c76d322c76 100644 --- a/models/ref/python/public-api/api.mdx +++ b/models/ref/python/public-api/api.mdx @@ -1,121 +1,89 @@ --- title: Api -namespace: public_apis_namespace -python_object_type: class +kind: class +namespace: wandb.apis.public.api --- -import { GitHubLink } from '/snippets/_includes/github-source-link.mdx'; - - - - - -## class `Api` -Used for querying the W&B server. +import { GitHubLink } from '/snippets/_includes/github-source-link.mdx'; + -**Examples:** - ```python -import wandb -wandb.Api() -``` - -### method `Api.__init__` ```python -__init__( - overrides: 'dict[str, Any] | None' = None, - timeout: 'int | None' = None, - api_key: 'str | None' = None -) → None +overrides: 'dict[str, Any] | None' = None, +timeout: 'int | None' = None, +api_key: 'str | None' = None ``` -Initialize the API. - +## Description +Used for querying the W&B server. -**Args:** - - - `overrides`: You can set `base_url` if you are - - `using a W&B server other than `https`: //api.wandb.ai`. You can also set defaults for `entity`, `project`, and `run`. - - `timeout`: HTTP timeout in seconds for API requests. If not specified, the default timeout will be used. - - `api_key`: API key to use for authentication. If not provided, the API key from the current environment or configuration will be used. Prompts for an API key if none is provided or configured in the environment. ---- - -### property Api.default_entity +## Args -Returns the default W&B entity. +- **overrides**: +- **timeout**: +- **api_key**: +## Examples -**Returns:** - - `str | None`: The default_entity property value. ---- - -### property Api.user_agent - -Returns W&B public user agent. - - +```python +import wandb -**Returns:** - - `str`: The user_agent property value. ---- +wandb.Api() +``` -### property Api.viewer +## Properties -Returns the viewer object. +### property user_agent +Returns W&B public user agent. +### property default_entity -**Raises:** - - - `ValueError`: If viewer data is not able to be fetched from W&B. - - `WandbApiFailedError`: If an error occurs while making the GraphQL request. +Returns the default W&B entity. +### property viewer +Returns the viewer object. -**Returns:** - - `User`: The viewer property value. ---- +## Methods -### method `Api.artifact` +### method artifact ```python -artifact(name: 'str', type: 'str | None' = None) +(self, +name: 'str', +type: 'str | None' = None) ``` -Returns a single artifact. - - - -**Args:** - - - `name`: The artifact's name. The name of an artifact resembles a filepath that consists, at a minimum, the name of the project the artifact was logged to, the name of the artifact, and the artifact's version or alias. Optionally append the entity that logged the artifact as a prefix followed by a forward slash. If no entity is specified in the name, the Run or API setting's entity is used. - - `type`: The type of artifact to fetch. +Returns a single artifact. +##### Arguments +- **name**: The artifact's name. The name of an artifact resembles a filepath that consists, at a minimum, the name of the project the artifact was logged to, the name of the artifact, and the artifact's version or alias. Optionally append the entity that logged the artifact as a prefix followed by a forward slash. If no entity is specified in the name, the Run or API setting's entity is used. +- **type**: The type of artifact to fetch. -**Returns:** - An `Artifact` object. +##### Raises +- **ValueError**: If the artifact name is not specified. +- **ValueError**: If the artifact type is specified but does not match the type of the fetched artifact. -**Raises:** - - - `ValueError`: If the artifact name is not specified. - - `ValueError`: If the artifact type is specified but does not match the type of the fetched artifact. +##### Examples - -**Examples:** - In the following code snippets "entity", "project", "artifact", "version", and "alias" are placeholders for your W&B entity, name of the project the artifact is in, the name of the artifact, and artifact's version, respectively. +In the following code snippets "entity", "project", "artifact", +"version", and "alias" are placeholders for your W&B entity, name +of the project the artifact is in, the name of the artifact, +and artifact's version, respectively. ```python import wandb @@ -131,42 +99,38 @@ wandb.Api().artifact(name="entity/project/artifact:alias") # Specify the entity, project, artifact's name, and a specific artifact version wandb.Api().artifact(name="entity/project/artifact:version") -``` - - - -**Note:** - -> This method is intended for external use only. Do not call `api.artifact()` within the wandb repository code. +``` ---- +Note: +This method is intended for external use only. Do not call `api.artifact()` within the wandb repository code. -### method `Api.artifact_collection` +### method artifact_collection ```python -artifact_collection(type_name: 'str', name: 'str') → ArtifactCollection +self, +type_name: 'str', +name: 'str' ``` -Returns a single artifact collection by type. +Returns a single artifact collection by type. -You can use the returned `ArtifactCollection` object to retrieve information about specific artifacts in that collection, and more. +You can use the returned `ArtifactCollection` object to retrieve +information about specific artifacts in that collection, and more. +##### Arguments +- **type_name**: The type of artifact collection to fetch. +- **name**: An artifact collection name. Optionally append the entity that logged the artifact as a prefix followed by a forward slash. -**Args:** - - - `type_name`: The type of artifact collection to fetch. - - `name`: An artifact collection name. Optionally append the entity that logged the artifact as a prefix followed by a forward slash. -**Returns:** - An `ArtifactCollection` object. +##### Examples - - -**Examples:** - In the proceeding code snippet "type", "entity", "project", and "artifact_name" are placeholders for the collection type, your W&B entity, name of the project the artifact is in, and the name of the artifact, respectively. +In the proceeding code snippet "type", "entity", "project", and +"artifact_name" are placeholders for the collection type, your W&B +entity, name of the project the artifact is in, and the name of +the artifact, respectively. ```python import wandb @@ -180,208 +144,187 @@ artifact_example = collections.artifacts()[0] # Download the contents of the artifact to the specified root directory. artifact_example.download() -``` - ---- +``` -### method `Api.artifact_collection_exists` +### method artifact_collection_exists ```python -artifact_collection_exists(name: 'str', type: 'str') → bool +self, +name: 'str', +type: 'str' ``` -Whether an artifact collection exists within a specified project and entity. - - +Whether an artifact collection exists within a specified project and entity. -**Args:** - - - `name`: An artifact collection name. Optionally append the entity that logged the artifact as a prefix followed by a forward slash. If entity or project is not specified, infer the collection from the override params if they exist. Otherwise, entity is pulled from the user settings and project will default to "uncategorized". - - `type`: The type of artifact collection. +##### Arguments +- **name**: An artifact collection name. Optionally append the entity that logged the artifact as a prefix followed by a forward slash. If entity or project is not specified, infer the collection from the override params if they exist. Otherwise, entity is pulled from the user settings and project will default to "uncategorized". +- **type**: The type of artifact collection. -**Returns:** - True if the artifact collection exists, False otherwise. +##### Examples -**Examples:** - In the proceeding code snippet "type", and "collection_name" refer to the type of the artifact collection and the name of the collection, respectively. +In the proceeding code snippet "type", and "collection_name" refer to the type +of the artifact collection and the name of the collection, respectively. ```python import wandb wandb.Api.artifact_collection_exists(type="type", name="collection_name") -``` - ---- +``` -### method `Api.artifact_collections` +### method artifact_collections ```python -artifact_collections( - project_name: 'str', - type_name: 'str', - order: 'str | None' = None, - per_page: 'int' = 50, - start: 'str | None' = None -) → ArtifactCollections +self, +project_name: 'str', +type_name: 'str', +order: 'str | None' = None, +per_page: 'int' = 50, +start: 'str | None' = None ``` -Returns a collection of matching artifact collections. +Returns a collection of matching artifact collections. +##### Arguments +- **project_name**: The name of the project to filter on. +- **type_name**: The name of the artifact type to filter on. +- **order**: Optional string to specify the order of the results. If prefixed with '+', sorts ascending (default). If prefixed with '-', sorts descending. +- **per_page**: Sets the page size for query pagination. Usually there is no reason to change this. +- **start**: Pagination cursor for resuming a past query, captured from a previous paginator's `.cursor` attribute. -**Args:** - - - `project_name`: The name of the project to filter on. - - `type_name`: The name of the artifact type to filter on. - - `order`: Optional string to specify the order of the results. If prefixed with '+', sorts ascending (default). If prefixed with '-', sorts descending. - - `per_page`: Sets the page size for query pagination. Usually there is no reason to change this. - - `start`: Pagination cursor for resuming a past query, captured from a previous paginator's `.cursor` attribute. -**Returns:** - An iterable `ArtifactCollections` object. - ---- - -### method `Api.artifact_exists` +### method artifact_exists ```python -artifact_exists(name: 'str', type: 'str | None' = None) → bool +self, +name: 'str', +type: 'str | None' = None ``` -Whether an artifact version exists within the specified project and entity. - +Whether an artifact version exists within the specified project and entity. +##### Arguments -**Args:** - - - `name`: The name of artifact. Add the artifact's entity and project as a prefix. Append the version or the alias of the artifact with a colon. If the entity or project is not specified, W&B uses override parameters if populated. Otherwise, the entity is pulled from the user settings and the project is set to "Uncategorized". - - `type`: The type of artifact. +- **name**: The name of artifact. Add the artifact's entity and project as a prefix. Append the version or the alias of the artifact with a colon. If the entity or project is not specified, W&B uses override parameters if populated. Otherwise, the entity is pulled from the user settings and the project is set to "Uncategorized". +- **type**: The type of artifact. -**Returns:** - True if the artifact version exists, False otherwise. +##### Examples - -**Examples:** - In the proceeding code snippets "entity", "project", "artifact", "version", and "alias" are placeholders for your W&B entity, name of the project the artifact is in, the name of the artifact, and artifact's version, respectively. +In the proceeding code snippets "entity", "project", "artifact", +"version", and "alias" are placeholders for your W&B entity, name of +the project the artifact is in, the name of the artifact, and +artifact's version, respectively. ```python import wandb wandb.Api().artifact_exists("entity/project/artifact:version") wandb.Api().artifact_exists("entity/project/artifact:alias") -``` - ---- +``` -### method `Api.artifact_type` +### method artifact_type ```python -artifact_type(type_name: 'str', project: 'str | None' = None) → ArtifactType +self, +type_name: 'str', +project: 'str | None' = None ``` -Returns the matching `ArtifactType`. - +Returns the matching `ArtifactType`. +##### Arguments -**Args:** - - - `type_name`: The name of the artifact type to retrieve. - - `project`: If given, a project name or path to filter on. +- **type_name**: The name of the artifact type to retrieve. +- **project**: If given, a project name or path to filter on. -**Returns:** - An `ArtifactType` object. - ---- -### method `Api.artifact_types` +### method artifact_types ```python -artifact_types( - project: 'str | None' = None, - start: 'str | None' = None -) → ArtifactTypes +self, +project: 'str | None' = None, +start: 'str | None' = None ``` -Returns a collection of matching artifact types. +Returns a collection of matching artifact types. +##### Arguments +- **project**: The project name or path to filter on. +- **start**: Pagination cursor for resuming a past query, captured from a previous paginator's `.cursor` attribute. -**Args:** - - - `project`: The project name or path to filter on. - - `start`: Pagination cursor for resuming a past query, captured from a previous paginator's `.cursor` attribute. -**Returns:** - An iterable `ArtifactTypes` object. - ---- - -### method `Api.artifact_versions` +### method artifact_versions ```python -artifact_versions(type_name, name, per_page=50) +(self, type_name, name, per_page=50) ``` -Deprecated. Use `Api.artifacts(type_name, name)` method instead. +Deprecated. Use `Api.artifacts(type_name, name)` method instead. ---- +##### Arguments + +- **type_name**: +- **name**: +- **per_page**: -### method `Api.artifacts` -```python -artifacts( - type_name: 'str', - name: 'str', - order: 'str | None' = None, - per_page: 'int' = 50, - tags: 'list[str] | None' = None, - start: 'str | None' = None -) → Artifacts -``` -Return an `Artifacts` collection. +### method artifacts +```python +self, +type_name: 'str', +name: 'str', +order: 'str | None' = None, +per_page: 'int' = 50, +tags: 'list[str] | None' = None, +start: 'str | None' = None +``` -**Args:** - - - `type_name`: The type of artifacts to fetch. - - `name`: The artifact's collection name. Optionally append the entity that logged the artifact as a prefix followed by a forward slash. - - `order`: Optional string to specify the order of the results. If prefixed with '+', sorts ascending (default). If prefixed with '-', sorts descending. - - `per_page`: Sets the page size for query pagination. Usually there is no reason to change this. - - `tags`: Only return artifacts with all of these tags. - - `start`: Pagination cursor for resuming a past query, captured from a previous paginator's `.cursor` attribute. +Return an `Artifacts` collection. +##### Arguments +- **type_name**: The type of artifacts to fetch. +- **name**: The artifact's collection name. Optionally append the entity that logged the artifact as a prefix followed by a forward slash. +- **order**: Optional string to specify the order of the results. If prefixed with '+', sorts ascending (default). If prefixed with '-', sorts descending. +- **per_page**: Sets the page size for query pagination. Usually there is no reason to change this. +- **tags**: Only return artifacts with all of these tags. +- **start**: Pagination cursor for resuming a past query, captured from a previous paginator's `.cursor` attribute. -**Returns:** - An iterable `Artifacts` object. -**Examples:** - In the proceeding code snippet, "type", "entity", "project", and "artifact_name" are placeholders for the artifact type, W&B entity, name of the project the artifact was logged to, and the name of the artifact, respectively. +##### Examples + +In the proceeding code snippet, "type", "entity", "project", and +"artifact_name" are placeholders for the artifact type, W&B entity, +name of the project the artifact was logged to, +and the name of the artifact, respectively. ```python import wandb wandb.Api().artifacts(type_name="type", name="entity/project/artifact_name") -``` +``` -Pause iteration and resume later from the same position by saving the paginator's `.cursor` and passing it as `start=`: +Pause iteration and resume later from the same position by saving +the paginator's `.cursor` and passing it as `start=`: ```python from itertools import islice @@ -408,126 +351,105 @@ remaining_artifacts = api.artifacts( per_page=page_size, start=saved_cursor, ) -``` - ---- +``` -### method `Api.automation` +### method automation ```python -automation(name: 'str', entity: 'str | None' = None) → Automation +self, +name: 'str', *, +entity: 'str | None' = None ``` -Returns the only Automation matching the parameters. - +Returns the only Automation matching the parameters. +##### Arguments -**Args:** - - - `name`: The name of the automation to fetch. - - `entity`: The entity to fetch the automation for. +- **name**: The name of the automation to fetch. +- **entity**: The entity to fetch the automation for. +##### Raises -**Raises:** - - - `ValueError`: If zero or multiple Automations match the search criteria. +- **ValueError**: If zero or multiple Automations match the search criteria. +##### Examples -**Examples:** - Get an existing automation named "my-automation": +Get an existing automation named "my-automation": ```python import wandb api = wandb.Api() automation = api.automation(name="my-automation") -``` +``` -Get an existing automation named "other-automation", from the entity "my-team": +Get an existing automation named "other-automation", from the entity "my-team": ```python automation = api.automation(name="other-automation", entity="my-team") -``` - ---- +``` -### method `Api.automations` +### method automations ```python -automations( - entity: 'str | None' = None, - name: 'str | None' = None, - per_page: 'int' = 50, - start: 'str | None' = None -) → Iterator[Automation] +self, +entity: 'str | None' = None, *, +name: 'str | None' = None, +per_page: 'int' = 50, +start: 'str | None' = None ``` -Returns an iterator over all Automations that match the given parameters. - -If no parameters are provided, the returned iterator will contain all Automations that the user has access to. +Returns an iterator over all Automations that match the given parameters. +If no parameters are provided, the returned iterator will contain all +Automations that the user has access to. +##### Arguments -**Args:** - - - `entity`: The entity to fetch the automations for. - - `name`: The name of the automation to fetch. - - `per_page`: The number of automations to fetch per page. Defaults to 50. Usually there is no reason to change this. - - `start`: Pagination cursor for resuming a past query, captured from a previous paginator's `.cursor` attribute. +- **entity**: The entity to fetch the automations for. +- **name**: The name of the automation to fetch. +- **per_page**: The number of automations to fetch per page. Defaults to 50. Usually there is no reason to change this. +- **start**: Pagination cursor for resuming a past query, captured from a previous paginator's `.cursor` attribute. -**Returns:** - A list of automations. +##### Examples - -**Examples:** - Fetch all existing automations for the entity "my-team": +Fetch all existing automations for the entity "my-team": ```python import wandb api = wandb.Api() automations = api.automations(entity="my-team") -``` - ---- +``` -### method `Api.create_automation` +### method create_automation ```python -create_automation( - obj: 'NewAutomation', - fetch_existing: 'bool' = False, - **kwargs: 'Unpack[WriteAutomationsKwargs]' -) → Automation +self, +obj: 'NewAutomation', *, +fetch_existing: 'bool' = False, **kwargs: 'Unpack[WriteAutomationsKwargs]' ``` -Create a new Automation. - +Create a new Automation. +##### Arguments -**Args:** - obj: The automation to create. fetch_existing: If True, and a conflicting automation already exists, attempt to fetch the existing automation instead of raising an error. **kwargs: Any additional values to assign to the automation before creating it. If given, these will override any values that may already be set on the automation: - - `name`: The name of the automation. - - `description`: The description of the automation. - - `enabled`: Whether the automation is enabled. - - `scope`: The scope of the automation. - - `event`: The event that triggers the automation. - - `action`: The action that is triggered by the automation. +- **obj**: The automation to create. +- **fetch_existing**: If True, and a conflicting automation already exists, attempt to fetch the existing automation instead of raising an error. +- **kwargs**: -**Returns:** - The saved Automation. +##### Examples - -**Examples:** - Create a new automation named "my-automation" that sends a Slack notification when a run within a specific project logs a metric exceeding a custom threshold: +Create a new automation named "my-automation" that sends a Slack notification +when a run within a specific project logs a metric exceeding a custom threshold: ```python import wandb @@ -541,152 +463,129 @@ project = api.project("my-project", entity="my-team") slack_hook = next(api.slack_integrations(entity="my-team")) event = OnRunMetric( - scope=project, - filter=RunEvent.metric("custom-metric") > 10, + scope=project, + filter=RunEvent.metric("custom-metric") > 10, ) action = SendNotification.from_integration(slack_hook) automation = api.create_automation( - event >> action, - name="my-automation", - description="Send a Slack message whenever 'custom-metric' exceeds 10.", + event >> action, + name="my-automation", + description="Send a Slack message whenever 'custom-metric' exceeds 10.", ) -``` - ---- +``` -### method `Api.create_custom_chart` +### method create_custom_chart ```python -create_custom_chart( - entity: 'str', - name: 'str', - display_name: 'str', - spec_type: "Literal['vega2']", - access: "Literal['private', 'public']", - spec: 'str | dict' -) → str +self, +entity: 'str', +name: 'str', +display_name: 'str', +spec_type: "Literal['vega2']", +access: "Literal['private', 'public']", +spec: 'str | dict' ``` -Create a custom chart preset and return its id. - - - -**Args:** - - - `entity`: The entity (user or team) that owns the chart - - `name`: Unique identifier for the chart preset - - `display_name`: Human-readable name shown in the UI - - `spec_type`: Type of specification. Must be "vega2" for Vega-Lite v2 specifications. - - `access`: Access level for the chart: - - "private": Chart is only accessible to the entity that created it - - "public": Chart is publicly accessible - - `spec`: The Vega/Vega-Lite specification as a dictionary or JSON string +Create a custom chart preset and return its id. +##### Arguments +- **entity**: The entity (user or team) that owns the chart +- **name**: Unique identifier for the chart preset +- **display_name**: Human-readable name shown in the UI +- **spec_type**: Type of specification. Must be "vega2" for Vega-Lite v2 specifications. +- **access**: Access level for the chart: +- **spec**: The Vega/Vega-Lite specification as a dictionary or JSON string -**Returns:** - The ID of the created chart preset in the format "entity/name" +##### Raises +- **wandb.Error**: If chart creation fails +- **UnsupportedError**: If the server doesn't support custom charts -**Raises:** - - - `wandb.Error`: If chart creation fails - - `UnsupportedError`: If the server doesn't support custom charts +##### Examples - -**Example:** - ```python +```python import wandb api = wandb.Api() # Define a simple bar chart specification vega_spec = { - "$schema": "https://vega.github.io/schema/vega-lite/v6.json", - "mark": "bar", - "data": {"name": "wandb"}, - "encoding": { - "x": {"field": "${field:x}", "type": "ordinal"}, - "y": {"field": "${field:y}", "type": "quantitative"}, - }, + "$schema": "https://vega.github.io/schema/vega-lite/v6.json", + "mark": "bar", + "data": {"name": "wandb"}, + "encoding": { + "x": {"field": "${field:x}", "type": "ordinal"}, + "y": {"field": "${field:y}", "type": "quantitative"}, + }, } # Create the custom chart chart_id = api.create_custom_chart( - entity="my-team", - name="my-bar-chart", - display_name="My Custom Bar Chart", - spec_type="vega2", - access="private", - spec=vega_spec, + entity="my-team", + name="my-bar-chart", + display_name="My Custom Bar Chart", + spec_type="vega2", + access="private", + spec=vega_spec, ) # Use with wandb.plot_table() chart = wandb.plot_table( - vega_spec_name=chart_id, - data_table=my_table, - fields={"x": "category", "y": "value"}, + vega_spec_name=chart_id, + data_table=my_table, + fields={"x": "category", "y": "value"}, ) - ``` - ---- + ``` -### method `Api.create_project` +### method create_project ```python -create_project(name: 'str', entity: 'str') → None +self, +name: 'str', +entity: 'str' ``` -Create a new project. +Create a new project. +##### Arguments + +- **name**: The name of the new project. +- **entity**: The entity of the new project. -**Args:** - - - `name`: The name of the new project. - - `entity`: The entity of the new project. ---- -### method `Api.create_registry` +### method create_registry ```python -create_registry( - name: 'str', - visibility: "Literal['organization', 'restricted']", - organization: 'str | None' = None, - description: 'str | None' = None, - artifact_types: 'list[str] | None' = None -) → Registry +self, +name: 'str', +visibility: "Literal['organization', 'restricted']", +organization: 'str | None' = None, +description: 'str | None' = None, +artifact_types: 'list[str] | None' = None ``` -Create a new registry. - +Create a new registry. +##### Arguments -**Args:** - - - `name`: The name of the registry. Name must be unique within the organization. - - `visibility`: The visibility of the registry. - - `organization`: Anyone in the organization can view this registry. You can edit their roles later from the settings in the UI. - - `restricted`: Only invited members via the UI can access this registry. Public sharing is disabled. - - `organization`: The organization of the registry. If no organization is set in the settings, the organization will be fetched from the entity if the entity only belongs to one organization. - - `description`: The description of the registry. - - `artifact_types`: The accepted artifact types of the registry. A type is no - - `more than 128 characters and do not include characters `/` or ``: `. If not specified, all types are accepted. Allowed types added to the registry cannot be removed later. +- **name**: The name of the registry. Name must be unique within the organization. +- **visibility**: The visibility of the registry. +- **organization**: The organization of the registry. If no organization is set in the settings, the organization will be fetched from the entity if the entity only belongs to one organization. +- **description**: The description of the registry. +- **artifact_types**: The accepted artifact types of the registry. A type is no -**Returns:** - A registry object. +##### Examples - -**Examples:** - ```python +```python import wandb api = wandb.Api() @@ -697,180 +596,143 @@ registry = api.create_registry( description="This is a test registry", artifact_types=["model"], ) -``` - ---- +``` -### method `Api.create_run` +### method create_run ```python -create_run( - run_id: 'str | None' = None, - project: 'str | None' = None, - entity: 'str | None' = None -) → public.Run +self, *, +run_id: 'str | None' = None, +project: 'str | None' = None, +entity: 'str | None' = None ``` -Create a new run. - - +Create a new run. -**Args:** - - - `run_id`: The ID to assign to the run. If not specified, W&B creates a random ID. - - `project`: The project where to log the run to. If no project is specified, log the run to a project called "Uncategorized". - - `entity`: The entity that owns the project. If no entity is specified, log the run to the default entity. +##### Arguments +- **run_id**: The ID to assign to the run. If not specified, W&B creates a random ID. +- **project**: The project where to log the run to. If no project is specified, log the run to a project called "Uncategorized". +- **entity**: The entity that owns the project. If no entity is specified, log the run to the default entity. -**Returns:** - The newly created `Run`. ---- -### method `Api.create_run_queue` +### method create_run_queue ```python -create_run_queue( - name: 'str', - type: 'public.RunQueueResourceType', - entity: 'str | None' = None, - prioritization_mode: 'public.RunQueuePrioritizationMode | None' = None, - config: 'dict | None' = None, - template_variables: 'dict | None' = None -) → public.RunQueue +self, +name: 'str', +type: 'public.RunQueueResourceType', +entity: 'str | None' = None, +prioritization_mode: 'public.RunQueuePrioritizationMode | None' = None, +config: 'dict | None' = None, +template_variables: 'dict | None' = None ``` -Create a new run queue in W&B Launch. - - - -**Args:** - - - `name`: Name of the queue to create - - `type`: Type of resource to be used for the queue. One of "local-container", "local-process", "kubernetes","sagemaker", or "gcp-vertex". - - `entity`: Name of the entity to create the queue. If `None`, use the configured or default entity. - - `prioritization_mode`: Version of prioritization to use. Either "V0" or `None`. - - `config`: Default resource configuration to be used for the queue. Use handlebars (eg. `{{var}}`) to specify template variables. - - `template_variables`: A dictionary of template variable schemas to use with the config. +Create a new run queue in W&B Launch. +##### Arguments +- **name**: Name of the queue to create +- **type**: Type of resource to be used for the queue. One of "local-container", "local-process", "kubernetes","sagemaker", or "gcp-vertex". +- **entity**: Name of the entity to create the queue. If `None`, use the configured or default entity. +- **prioritization_mode**: Version of prioritization to use. Either "V0" or `None`. +- **config**: Default resource configuration to be used for the queue. Use handlebars (eg. `{{var}}`) to specify template variables. +- **template_variables**: A dictionary of template variable schemas to use with the config. -**Returns:** - The newly created `RunQueue`. -**Raises:** - `ValueError` if any of the parameters are invalid `wandb.Error` on wandb API errors - ---- - -### method `Api.create_team` +### method create_team ```python -create_team(team: 'str', admin_username: 'str | None' = None) → Team +self, +team: 'str', +admin_username: 'str | None' = None ``` -Create a new team. +Create a new team. +##### Arguments +- **team**: The name of the team +- **admin_username**: Username of the admin user of the team. Defaults to the current user. -**Args:** - - - `team`: The name of the team - - `admin_username`: Username of the admin user of the team. Defaults to the current user. -**Returns:** - A `Team` object. - ---- - -### method `Api.create_user` +### method create_user ```python -create_user(email: 'str', admin: 'bool | None' = False) → User +self, +email: 'str', +admin: 'bool | None' = False ``` -Create a new user. +Create a new user. +##### Arguments +- **email**: The email address of the user. +- **admin**: Set user as a global instance administrator. -**Args:** - - - `email`: The email address of the user. - - `admin`: Set user as a global instance administrator. -**Returns:** - A `User` object. - ---- - -### method `Api.delete_automation` +### method delete_automation ```python -delete_automation(obj: 'Automation | str') → Literal[True] +self, +obj: 'Automation | str' ``` -Delete an automation. - +Delete an automation. +##### Arguments -**Args:** - - - `obj`: The automation to delete, or its ID. +- **obj**: The automation to delete, or its ID. -**Returns:** - True if the automation was deleted successfully. ---- - -### method `Api.flush` +### method flush ```python -flush() +(self) ``` -Flush the local cache. - -The api object keeps a local cache of runs, so if the state of the run may change while executing your script you must clear the local cache with `api.flush()` to get the latest values associated with the run. - ---- +Flush the local cache. -### method `Api.from_path` +The api object keeps a local cache of runs, so if the state of the run +may change while executing your script you must clear the local cache +with `api.flush()` to get the latest values associated with the run. -```python -from_path(path: 'str') -``` -Return a run, sweep, project or report from a path. -**Args:** - - - `path`: The path to the project, run, sweep or report +### method from_path +```python +(self, +path: 'str') +``` +Return a run, sweep, project or report from a path. -**Returns:** - A `Project`, `Run`, `Sweep`, or `BetaReport` instance. +##### Arguments +- **path**: The path to the project, run, sweep or report -**Raises:** - `wandb.Error` if path is invalid or the object doesn't exist. +##### Examples -**Examples:** - In the proceeding code snippets "project", "team", "run_id", "sweep_id", and "report_name" are placeholders for the project, team, run ID, sweep ID, and the name of a specific report, respectively. +In the proceeding code snippets "project", "team", "run_id", "sweep_id", +and "report_name" are placeholders for the project, team, run ID, +sweep ID, and the name of a specific report, respectively. ```python import wandb @@ -882,210 +744,188 @@ team_project = api.from_path("team/project") run = api.from_path("team/project/runs/run_id") sweep = api.from_path("team/project/sweeps/sweep_id") report = api.from_path("team/project/reports/report_name") -``` - ---- +``` -### method `Api.integrations` +### method integrations ```python -integrations( - entity: 'str | None' = None, - per_page: 'int' = 50, - start: 'str | None' = None -) → Iterator[Integration] +self, +entity: 'str | None' = None, *, +per_page: 'int' = 50, +start: 'str | None' = None ``` -Return an iterator of all integrations for an entity. +Return an iterator of all integrations for an entity. +##### Arguments +- **entity**: The entity (e.g. team name) for which to fetch integrations. If not provided, the user's default entity will be used. +- **per_page**: Number of integrations to fetch per page. Defaults to 50. Usually there is no reason to change this. +- **start**: -**Args:** - - - `entity`: The entity (e.g. team name) for which to fetch integrations. If not provided, the user's default entity will be used. - - `per_page`: Number of integrations to fetch per page. Defaults to 50. Usually there is no reason to change this. -**Yields:** - - - `Iterator[SlackIntegration | WebhookIntegration]`: An iterator of any supported integrations. - ---- - -### method `Api.job` +### method job ```python -job(name: 'str | None', path: 'str | None' = None) → public.Job +self, +name: 'str | None', +path: 'str | None' = None ``` -Return a `Job` object. +Return a `Job` object. +##### Arguments +- **name**: The name of the job. +- **path**: The root path to download the job artifact. -**Args:** - - - `name`: The name of the job. - - `path`: The root path to download the job artifact. -**Returns:** - A `Job` object. - ---- - -### method `Api.list_jobs` +### method list_jobs ```python -list_jobs(entity: 'str', project: 'str') → list[dict[str, Any]] +self, +entity: 'str', +project: 'str' ``` -Return a list of jobs, if any, for the given entity and project. +Return a list of jobs, if any, for the given entity and project. +##### Arguments +- **entity**: The entity for the listed jobs. +- **project**: The project for the listed jobs. -**Args:** - - - `entity`: The entity for the listed jobs. - - `project`: The project for the listed jobs. -**Returns:** - A list of matching jobs. - ---- - -### method `Api.project` +### method project ```python -project(name: 'str', entity: 'str | None' = None) → public.Project +self, +name: 'str', +entity: 'str | None' = None ``` -Return the `Project` with the given name (and entity, if given). - +Return the `Project` with the given name (and entity, if given). +##### Arguments -**Args:** - - - `name`: The project name. - - `entity`: Name of the entity requested. If None, will fall back to the default entity passed to `Api`. If no default entity, will raise a `ValueError`. +- **name**: The project name. +- **entity**: Name of the entity requested. If None, will fall back to the default entity passed to `Api`. If no default entity, will raise a `ValueError`. -**Returns:** - A `Project` object. ---- - -### method `Api.projects` +### method projects ```python -projects(entity: 'str | None' = None, per_page: 'int' = 200) → public.Projects +self, +entity: 'str | None' = None, +per_page: 'int' = 200 ``` -Get projects for a given entity. +Get projects for a given entity. +##### Arguments +- **entity**: Name of the entity requested. If None, will fall back to the default entity passed to `Api`. If no default entity, will raise a `ValueError`. +- **per_page**: Sets the page size for query pagination. Usually there is no reason to change this. -**Args:** - - - `entity`: Name of the entity requested. If None, will fall back to the default entity passed to `Api`. If no default entity, will raise a `ValueError`. - - `per_page`: Sets the page size for query pagination. Usually there is no reason to change this. -**Returns:** - A `Projects` object which is an iterable collection of `Project`objects. - ---- - -### method `Api.queued_run` +### method queued_run ```python -queued_run( - entity: 'str', - project: 'str', - queue_name: 'str', - run_queue_item_id: 'str', - project_queue=None, - priority=None -) +(self, +entity: 'str', +project: 'str', +queue_name: 'str', +run_queue_item_id: 'str', project_queue=None, priority=None) ``` -Return a single queued run based on the path. +Return a single queued run based on the path. -Parses paths of the form `entity/project/queue_id/run_queue_item_id`. +Parses paths of the form `entity/project/queue_id/run_queue_item_id`. ---- +##### Arguments -### method `Api.registries` +- **entity**: +- **project**: +- **queue_name**: +- **run_queue_item_id**: +- **project_queue**: +- **priority**: -```python -registries( - organization: 'str | None' = None, - filter: 'dict[str, Any] | None' = None, - order: 'str | None' = None, - per_page: 'int' = 100, - start: 'str | None' = None -) → Registries -``` -Returns a lazy iterator of `Registry` objects. -Use the iterator to search and filter registries, collections, or artifact versions across your organization's registry. +### method registries +```python +self, +organization: 'str | None' = None, +filter: 'dict[str, Any] | None' = None, +order: 'str | None' = None, +per_page: 'int' = 100, +start: 'str | None' = None +``` -**Args:** - - - `organization`: The organization of the registry to fetch. If not specified, use the organization specified in the user's settings. - - `filter`: Optional MongoDB-style filter to apply to each object in the lazy registry iterator. Fields available to filter for registries are `name`, `description`, `created_at`, `updated_at`. Fields available to filter for collections are `name`, `tag`, `description`, `created_at`, `updated_at` Fields available to filter for versions are `tag`, `alias`, `created_at`, `updated_at`, `metadata` - - `order`: Optional string to specify the order of the results. If prefixed with '+', sorts ascending (default). If prefixed with '-', sorts descending. - - `per_page`: Sets the page size for query pagination. - - `start`: Pagination cursor for resuming a past query, captured from a previous paginator's `.cursor` attribute. +Returns a lazy iterator of `Registry` objects. +Use the iterator to search and filter registries, collections, +or artifact versions across your organization's registry. +##### Arguments -**Returns:** - A lazy iterator of `Registry` objects. +- **organization**: The organization of the registry to fetch. If not specified, use the organization specified in the user's settings. +- **filter**: Optional MongoDB-style filter to apply to each object in the lazy registry iterator. Fields available to filter for registries are `name`, `description`, `created_at`, `updated_at`. Fields available to filter for collections are `name`, `tag`, `description`, `created_at`, `updated_at` Fields available to filter for versions are `tag`, `alias`, `created_at`, `updated_at`, `metadata` +- **order**: Optional string to specify the order of the results. If prefixed with '+', sorts ascending (default). If prefixed with '-', sorts descending. +- **per_page**: Sets the page size for query pagination. +- **start**: Pagination cursor for resuming a past query, captured from a previous paginator's `.cursor` attribute. -**Examples:** - Find all registries with the names that contain "model" + +##### Examples + +Find all registries with the names that contain "model" ```python import wandb api = wandb.Api() # specify an org if your entity belongs to multiple orgs api.registries(filter={"name": {"$regex": "model"}}) -``` +``` -Find all collections in the registries with the name "my_collection" and the tag "my_tag" +Find all collections in the registries with the name "my_collection" and the tag "my_tag" ```python api.registries().collections(filter={"name": "my_collection", "tag": "my_tag"}) -``` +``` -Find all artifact versions in the registries with a collection name that contains "my_collection" and a version that has the alias "best" +Find all artifact versions in the registries with a collection name that contains "my_collection" and a version that has the alias "best" ```python api.registries().collections( filter={"name": {"$regex": "my_collection"}} ).versions(filter={"alias": "best"}) -``` +``` -Find all artifact versions in the registries that contain "model" and have the tag "prod" or alias "best" +Find all artifact versions in the registries that contain "model" and have the tag "prod" or alias "best" ```python api.registries(filter={"name": {"$regex": "model"}}).versions( filter={"$or": [{"tag": "prod"}, {"alias": "best"}]} ) -``` +``` -Pause iteration and resume later from the same position by saving the paginator's `.cursor` and passing it as `start=`: +Pause iteration and resume later from the same position by saving +the paginator's `.cursor` and passing it as `start=`: ```python from itertools import islice @@ -1103,34 +943,29 @@ saved_cursor = registries.cursor # Later (e.g. in a new process), resume iteration from the saved cursor. remaining_registries = api.registries(per_page=page_size, start=saved_cursor) -``` - ---- +``` -### method `Api.registry` +### method registry ```python -registry(name: 'str', organization: 'str | None' = None) → Registry +self, +name: 'str', +organization: 'str | None' = None ``` -Return a registry given a registry name. - +Return a registry given a registry name. +##### Arguments -**Args:** - - - `name`: The name of the registry. This is without the `wandb-registry-` prefix. - - `organization`: The organization of the registry. If no organization is set in the settings, the organization will be fetched from the entity if the entity only belongs to one organization. +- **name**: The name of the registry. This is without the `wandb-registry-` prefix. +- **organization**: The organization of the registry. If no organization is set in the settings, the organization will be fetched from the entity if the entity only belongs to one organization. -**Returns:** - A registry object. +##### Examples - -**Examples:** - Fetch and update a registry +Fetch and update a registry ```python import wandb @@ -1139,169 +974,154 @@ api = wandb.Api() registry = api.registry(name="my-registry", organization="my-org") registry.description = "This is an updated description" registry.save() -``` - ---- +``` -### method `Api.reports` +### method reports ```python -reports( - path: 'str' = '', - name: 'str | None' = None, - per_page: 'int' = 50 -) → public.Reports +self, +path: 'str' = '', +name: 'str | None' = None, +per_page: 'int' = 50 ``` -Get reports for a given project path. +Get reports for a given project path. -Note: `wandb.Api.reports()` API is in beta and will likely change in future releases. +Note: `wandb.Api.reports()` API is in beta and will likely change in +future releases. +##### Arguments +- **path**: The path to the project the report resides in. Specify the entity that created the project as a prefix followed by a forward slash. +- **name**: Name of the report requested. +- **per_page**: Sets the page size for query pagination. Usually there is no reason to change this. -**Args:** - - - `path`: The path to the project the report resides in. Specify the entity that created the project as a prefix followed by a forward slash. - - `name`: Name of the report requested. - - `per_page`: Sets the page size for query pagination. Usually there is no reason to change this. -**Returns:** - A `Reports` object which is an iterable collection of `BetaReport` objects. +##### Examples - - -**Examples:** - ```python +```python import wandb wandb.Api.reports("entity/project") -``` - ---- +``` -### method `Api.run` +### method run ```python -run(path='') +(self, path='') ``` -Return a single run by parsing path in the form `entity/project/run_id`. +Return a single run by parsing path in the form `entity/project/run_id`. +##### Arguments +- **path**: Path to run in the form `entity/project/run_id`. If `api.entity` is set, this can be in the form `project/run_id` and if `api.project` is set this can just be the run_id. -**Args:** - - - `path`: Path to run in the form `entity/project/run_id`. If `api.entity` is set, this can be in the form `project/run_id` and if `api.project` is set this can just be the run_id. -**Returns:** - A `Run` object. - ---- - -### method `Api.run_queue` +### method run_queue ```python -run_queue(entity: 'str', name: 'str') +(self, +entity: 'str', +name: 'str') ``` -Return the named `RunQueue` for entity. - -See `Api.create_run_queue` for more information on how to create a run queue. +Return the named `RunQueue` for entity. ---- - -### method `Api.runs` +See `Api.create_run_queue` for more information on how to create a run queue. -```python -runs( - path: 'str | None' = None, - filters: 'dict[str, Any] | None' = None, - order: 'str' = '+created_at', - per_page: 'int' = 50, - include_sweeps: 'bool' = False, - lazy: 'bool' = True -) -``` +##### Arguments -Returns a `Runs` object, which lazily iterates over `Run` objects. +- **entity**: +- **name**: -Fields you can filter by include: -- `createdAt`: The timestamp when the run was created. (in ISO 8601 format, e.g. "2023-01-01T12:00:00Z") -- `displayName`: The human-readable display name of the run. (e.g. "eager-fox-1") -- `duration`: The total runtime of the run in seconds. -- `group`: The group name used to organize related runs together. -- `host`: The hostname where the run was executed. -- `jobType`: The type of job or purpose of the run. -- `name`: The unique identifier of the run. (e.g. "a1b2cdef") -- `state`: The current state of the run. -- `tags`: The tags associated with the run. -- `username`: The username of the user who initiated the run -Additionally, you can filter by items in the run config or summary metrics. Such as `config.experiment_name`, `summary_metrics.loss`, etc. -For more complex filtering, you can use MongoDB query operators. For details, see: https://docs.mongodb.com/manual/reference/operator/query The following operations are supported: -- `$and` -- `$or` -- `$nor` -- `$eq` -- `$ne` -- `$gt` -- `$gte` -- `$lt` -- `$lte` -- `$in` -- `$nin` -- `$exists` -- `$regex` +### method runs +```python +(self, +path: 'str | None' = None, +filters: 'dict[str, Any] | None' = None, +order: 'str' = '+created_at', +per_page: 'int' = 50, +include_sweeps: 'bool' = False, +lazy: 'bool' = True) +``` +Returns a `Runs` object, which lazily iterates over `Run` objects. +Fields you can filter by include: +- `createdAt`: The timestamp when the run was created. (in ISO 8601 format, e.g. "2023-01-01T12:00:00Z") +- `displayName`: The human-readable display name of the run. (e.g. "eager-fox-1") +- `duration`: The total runtime of the run in seconds. +- `group`: The group name used to organize related runs together. +- `host`: The hostname where the run was executed. +- `jobType`: The type of job or purpose of the run. +- `name`: The unique identifier of the run. (e.g. "a1b2cdef") +- `state`: The current state of the run. +- `tags`: The tags associated with the run. +- `username`: The username of the user who initiated the run +Additionally, you can filter by items in the run config or summary metrics. +Such as `config.experiment_name`, `summary_metrics.loss`, etc. +For more complex filtering, you can use MongoDB query operators. +For details, see: https://docs.mongodb.com/manual/reference/operator/query +The following operations are supported: +- `$and` +- `$or` +- `$nor` +- `$eq` +- `$ne` +- `$gt` +- `$gte` +- `$lt` +- `$lte` +- `$in` +- `$nin` +- `$exists` +- `$regex` -**Args:** - - - `path`: (str) path to project, should be in the form: "entity/project" - - `filters`: (dict) queries for specific runs using the MongoDB query language. You can filter by run properties such as config.key, summary_metrics.key, state, entity, createdAt, etc. - - `For example`: `{"config.experiment_name": "foo"}` would find runs with a config entry of experiment name set to "foo" - - `order`: (str) Order can be `created_at`, `heartbeat_at`, `config.*.value`, or `summary_metrics.*`. If you prepend order with a + order is ascending (default). If you prepend order with a - order is descending. The default order is run.created_at from oldest to newest. - - `per_page`: (int) Sets the page size for query pagination. - - `include_sweeps`: (bool) Whether to eagerly fetch the sweep object in each run result. - - `lazy`: (bool) Whether to use lazy loading for faster performance. When True (default), only essential run metadata is loaded initially. Heavy fields like config, summaryMetrics, and systemMetrics are loaded on-demand when accessed. Set to False for full data upfront. +##### Arguments +- **path**: (str) path to project, should be in the form: "entity/project" +- **filters**: (dict) queries for specific runs using the MongoDB query language. You can filter by run properties such as config.key, summary_metrics.key, state, entity, createdAt, etc. +- **order**: (str) Order can be `created_at`, `heartbeat_at`, `config.*.value`, or `summary_metrics.*`. If you prepend order with a + order is ascending (default). If you prepend order with a - order is descending. The default order is run.created_at from oldest to newest. +- **per_page**: (int) Sets the page size for query pagination. +- **include_sweeps**: (bool) Whether to eagerly fetch the sweep object in each run result. +- **lazy**: (bool) Whether to use lazy loading for faster performance. When True (default), only essential run metadata is loaded initially. Heavy fields like config, summaryMetrics, and systemMetrics are loaded on-demand when accessed. Set to False for full data upfront. -**Returns:** - A `Runs` object, which is an iterable collection of `Run` objects. +##### Examples -**Examples:** - ```python +```python import wandb from wandb.apis.public import Api # Find runs in project where config.experiment_name has been set to "foo" Api.runs(path="my_entity/project", filters={"config.experiment_name": "foo"}) -``` +``` ```python # Find runs in project where config.experiment_name has been set to "foo" or "bar" Api.runs( path="my_entity/project", filters={ - "$or": [ - {"config.experiment_name": "foo"}, - {"config.experiment_name": "bar"}, - ] + "$or": [ + {"config.experiment_name": "foo"}, + {"config.experiment_name": "bar"}, + ] }, ) -``` +``` ```python # Find runs in project where config.experiment_name matches a regex @@ -1310,7 +1130,7 @@ Api.runs( path="my_entity/project", filters={"config.experiment_name": {"$regex": "b.*"}}, ) -``` +``` ```python # Find runs in project where the run name matches a regex @@ -1318,53 +1138,45 @@ Api.runs( Api.runs( path="my_entity/project", filters={"display_name": {"$regex": "^foo.*"}} ) -``` +``` ```python # Find runs in project sorted by ascending loss Api.runs(path="my_entity/project", order="+summary_metrics.loss") -``` - ---- +``` -### method `Api.slack_integrations` +### method slack_integrations ```python -slack_integrations( - entity: 'str | None' = None, - per_page: 'int' = 50, - start: 'str | None' = None -) → Iterator[SlackIntegration] +self, *, +entity: 'str | None' = None, +per_page: 'int' = 50, +start: 'str | None' = None ``` -Returns an iterator of Slack integrations for an entity. +Returns an iterator of Slack integrations for an entity. +##### Arguments +- **entity**: The entity (e.g. team name) for which to fetch integrations. If not provided, the user's default entity will be used. +- **per_page**: Number of integrations to fetch per page. Defaults to 50. Usually there is no reason to change this. +- **start**: -**Args:** - - - `entity`: The entity (e.g. team name) for which to fetch integrations. If not provided, the user's default entity will be used. - - `per_page`: Number of integrations to fetch per page. Defaults to 50. Usually there is no reason to change this. -**Yields:** - - - `Iterator[SlackIntegration]`: An iterator of Slack integrations. +##### Examples - - -**Examples:** - Get all registered Slack integrations for the team "my-team": +Get all registered Slack integrations for the team "my-team": ```python import wandb api = wandb.Api() slack_integrations = api.slack_integrations(entity="my-team") -``` +``` -Find only Slack integrations that post to channel names starting with "team-alerts-": +Find only Slack integrations that post to channel names starting with "team-alerts-": ```python slack_integrations = api.slack_integrations(entity="my-team") @@ -1373,95 +1185,79 @@ team_alert_integrations = [ for ig in slack_integrations if ig.channel_name.startswith("team-alerts-") ] -``` - ---- +``` -### method `Api.sweep` +### method sweep ```python -sweep(path='') +(self, path='') ``` -Return a sweep by parsing path in the form `entity/project/sweep_id`. - +Return a sweep by parsing path in the form `entity/project/sweep_id`. +##### Arguments -**Args:** - - - `path`: Path to sweep in the form entity/project/sweep_id. If `api.entity` is set, this can be in the form project/sweep_id and if `api.project` is set this can just be the sweep_id. +- **path**: Path to sweep in the form entity/project/sweep_id. If `api.entity` is set, this can be in the form project/sweep_id and if `api.project` is set this can just be the sweep_id. -**Returns:** - A `Sweep` object. ---- - -### method `Api.sync_tensorboard` +### method sync_tensorboard ```python -sync_tensorboard(root_dir, run_id=None, project=None, entity=None) +(self, root_dir, run_id=None, project=None, entity=None) ``` -Sync a local directory containing tfevent files to wandb. +Sync a local directory containing tfevent files to wandb. ---- +##### Arguments -### method `Api.team` +- **root_dir**: +- **run_id**: +- **project**: +- **entity**: -```python -team(team: 'str') → Team -``` -Return the matching `Team` with the given name. +### method team -**Args:** - - - `team`: The name of the team. +```python +self, +team: 'str' +``` +Return the matching `Team` with the given name. +##### Arguments -**Returns:** - A `Team` object. +- **team**: The name of the team. ---- -### method `Api.update_automation` -```python -update_automation( - obj: 'Automation', - create_missing: 'bool' = False, - **kwargs: 'Unpack[WriteAutomationsKwargs]' -) → Automation -``` -Update an existing automation. +### method update_automation +```python +self, +obj: 'Automation', *, +create_missing: 'bool' = False, **kwargs: 'Unpack[WriteAutomationsKwargs]' +``` +Update an existing automation. -**Args:** - - - `obj`: The automation to update. Must be an existing automation. create_missing (bool): If True, and the automation does not exist, create it. **kwargs: Any additional values to assign to the automation before updating it. If given, these will override any values that may already be set on the automation: - - `name`: The name of the automation. - - `description`: The description of the automation. - - `enabled`: Whether the automation is enabled. - - `scope`: The scope of the automation. - - `event`: The event that triggers the automation. - - `action`: The action that is triggered by the automation. +##### Arguments +- **obj**: The automation to update. Must be an existing automation. +- **create_missing**: If True, and the automation does not exist, create it. +- **kwargs**: -**Returns:** - The updated automation. +##### Examples -**Examples:** - Disable and edit the description of an existing automation ("my-automation"): +Disable and edit the description of an existing automation ("my-automation"): ```python import wandb @@ -1473,9 +1269,9 @@ automation.enabled = False automation.description = "Kept for reference, but no longer used." updated_automation = api.update_automation(automation) -``` +``` -OR +OR ```python import wandb @@ -1489,134 +1285,106 @@ updated_automation = api.update_automation( enabled=False, description="Kept for reference, but no longer used.", ) -``` - ---- +``` -### method `Api.upsert_run_queue` +### method upsert_run_queue ```python -upsert_run_queue( - name: 'str', - resource_config: 'dict', - resource_type: 'public.RunQueueResourceType', - entity: 'str | None' = None, - template_variables: 'dict | None' = None, - external_links: 'dict | None' = None, - prioritization_mode: 'public.RunQueuePrioritizationMode | None' = None -) +(self, +name: 'str', +resource_config: 'dict', +resource_type: 'public.RunQueueResourceType', +entity: 'str | None' = None, +template_variables: 'dict | None' = None, +external_links: 'dict | None' = None, +prioritization_mode: 'public.RunQueuePrioritizationMode | None' = None) ``` -Upsert a run queue in W&B Launch. - - - -**Args:** - - - `name`: Name of the queue to create - - `entity`: Optional name of the entity to create the queue. If `None`, use the configured or default entity. - - `resource_config`: Optional default resource configuration to be used for the queue. Use handlebars (eg. `{{var}}`) to specify template variables. - - `resource_type`: Type of resource to be used for the queue. One of "local-container", "local-process", "kubernetes", "sagemaker", or "gcp-vertex". - - `template_variables`: A dictionary of template variable schemas to be used with the config. - - `external_links`: Optional dictionary of external links to be used with the queue. - - `prioritization_mode`: Optional version of prioritization to use. Either "V0" or None - +Upsert a run queue in W&B Launch. +##### Arguments -**Returns:** - The upserted `RunQueue`. +- **name**: Name of the queue to create +- **resource_config**: Optional default resource configuration to be used for the queue. Use handlebars (eg. `{{var}}`) to specify template variables. +- **resource_type**: Type of resource to be used for the queue. One of "local-container", "local-process", "kubernetes", "sagemaker", or "gcp-vertex". +- **entity**: Optional name of the entity to create the queue. If `None`, use the configured or default entity. +- **template_variables**: A dictionary of template variable schemas to be used with the config. +- **external_links**: Optional dictionary of external links to be used with the queue. +- **prioritization_mode**: Optional version of prioritization to use. Either "V0" or None -**Raises:** - ValueError if any of the parameters are invalid wandb.Error on wandb API errors ---- - -### method `Api.user` +### method user ```python -user(username_or_email: 'str') → User | None +self, +username_or_email: 'str' ``` -Return a user from a username or email address. +Return a user from a username or email address. -This function only works for local administrators. Use `api.viewer` to get your own user object. +This function only works for local administrators. Use `api.viewer` + to get your own user object. +##### Arguments +- **username_or_email**: The username or email address of the user. -**Args:** - - - `username_or_email`: The username or email address of the user. -**Returns:** - A `User` object or None if a user is not found. - ---- - -### method `Api.users` +### method users ```python -users(username_or_email: 'str') → list[User] +self, +username_or_email: 'str' ``` -Return all users from a partial username or email address query. - -This function only works for local administrators. Use `api.viewer` to get your own user object. - +Return all users from a partial username or email address query. +This function only works for local administrators. Use `api.viewer` + to get your own user object. -**Args:** - - - `username_or_email`: The prefix or suffix of the user you want to find. +##### Arguments +- **username_or_email**: The prefix or suffix of the user you want to find. -**Returns:** - An array of `User` objects. ---- -### method `Api.webhook_integrations` +### method webhook_integrations ```python -webhook_integrations( - entity: 'str | None' = None, - per_page: 'int' = 50, - start: 'str | None' = None -) → Iterator[WebhookIntegration] +self, +entity: 'str | None' = None, *, +per_page: 'int' = 50, +start: 'str | None' = None ``` -Returns an iterator of webhook integrations for an entity. - +Returns an iterator of webhook integrations for an entity. +##### Arguments -**Args:** - - - `entity`: The entity (e.g. team name) for which to fetch integrations. If not provided, the user's default entity will be used. - - `per_page`: Number of integrations to fetch per page. Defaults to 50. Usually there is no reason to change this. +- **entity**: The entity (e.g. team name) for which to fetch integrations. If not provided, the user's default entity will be used. +- **per_page**: Number of integrations to fetch per page. Defaults to 50. Usually there is no reason to change this. +- **start**: -**Yields:** - - - `Iterator[WebhookIntegration]`: An iterator of webhook integrations. +##### Examples - -**Examples:** - Get all registered webhook integrations for the team "my-team": +Get all registered webhook integrations for the team "my-team": ```python import wandb api = wandb.Api() webhook_integrations = api.webhook_integrations(entity="my-team") -``` +``` -Find only webhook integrations that post requests to "https://my-fake-url.com": +Find only webhook integrations that post requests to "https://my-fake-url.com": ```python webhook_integrations = api.webhook_integrations(entity="my-team") @@ -1625,5 +1393,7 @@ my_webhooks = [ for ig in webhook_integrations if ig.url_endpoint.startswith("https://my-fake-url.com") ] -``` +``` + + diff --git a/models/ref/python/public-api/artifactcollection.mdx b/models/ref/python/public-api/artifactcollection.mdx index 4cae465f76..47d6c65e7e 100644 --- a/models/ref/python/public-api/artifactcollection.mdx +++ b/models/ref/python/public-api/artifactcollection.mdx @@ -1,182 +1,160 @@ --- title: ArtifactCollection -namespace: public_apis_namespace -python_object_type: class +kind: class +namespace: wandb.apis.public.artifacts --- -import { GitHubLink } from '/snippets/_includes/github-source-link.mdx'; - - - - - -## class `ArtifactCollection` -An artifact collection that represents a group of related artifacts. +import { GitHubLink } from '/snippets/_includes/github-source-link.mdx'; + -**Args:** - - - `service_api`: Interface to the wandb-core service that performs W&B API calls for this collection. - - `entity`: The entity (user or team) that owns the project. - - `project`: The name of the project to query for artifact collections. - - `name`: The name of the artifact collection. - - `type`: The type of the artifact collection (e.g., "dataset", "model"). - - `organization`: Optional organization name if applicable. - - `attrs`: Optional mapping of attributes to initialize the artifact collection. If not provided, the object will load its attributes from W&B upon initialization. -### property ArtifactCollection.aliases +```python +(service_api: 'ServiceApi', +entity: 'str', +project: 'str', +name: 'str', +type: 'str', +organization: 'str | None' = None, +attrs: 'ArtifactCollectionFragment | None' = None) +``` -The aliases for all artifact versions contained in this collection. +## Description +An artifact collection that represents a group of related artifacts. -**Returns:** - - `list[str]`: The aliases property value. ---- -### property ArtifactCollection.created_at +## Args -The creation date of the artifact collection. +- **service_api**: Interface to the wandb-core service that performs W&B API calls for this collection. +- **entity**: The entity (user or team) that owns the project. +- **project**: The name of the project to query for artifact collections. +- **name**: The name of the artifact collection. +- **type**: The type of the artifact collection (e.g., "dataset", "model"). +- **organization**: Optional organization name if applicable. +- **attrs**: Optional mapping of attributes to initialize the artifact collection. If not provided, the object will load its attributes from W&B upon initialization. -**Returns:** - - `str`: The created_at property value. ---- -### property ArtifactCollection.description +## Properties -A description of the artifact collection. +### property id +The unique identifier of the artifact collection. +### property entity -**Returns:** - - `str | None`: The description property value. ---- +The entity (user or team) that owns the project. -### property ArtifactCollection.entity +### property project -The entity (user or team) that owns the project. +The project that contains the artifact collection. +### property aliases +The aliases for all artifact versions contained in this collection. -**Returns:** - - `str`: The entity property value. ---- +### property created_at -### property ArtifactCollection.id +The creation date of the artifact collection. -The unique identifier of the artifact collection. +### property updated_at +The date at which the artifact collection was last updated. +### property description -**Returns:** - - `str`: The id property value. ---- +A description of the artifact collection. -### property ArtifactCollection.name +### property tags -The name of the artifact collection. +The tags associated with the artifact collection. +### property name +The name of the artifact collection. -**Returns:** - - `str`: The name property value. ---- +### property type -### property ArtifactCollection.project +Returns the type of the artifact collection. -The project that contains the artifact collection. +## Methods -**Returns:** - - `str`: The project property value. ---- +### method artifacts -### property ArtifactCollection.tags +```python +self, +per_page: 'int' = 50, +start: 'str | None' = None +``` -The tags associated with the artifact collection. +Get all artifacts in the collection. +##### Arguments +- **per_page**: The number of artifacts to fetch per page. +- **start**: Pagination cursor for resuming a past query, captured from a previous paginator's `.cursor` attribute. -**Returns:** - - `list[str]`: The tags property value. ---- -### property ArtifactCollection.type -Returns the type of the artifact collection. ---- +### method change_type -### property ArtifactCollection.updated_at +```python +self, +new_type: 'str' +``` -The date at which the artifact collection was last updated. +Deprecated, change type directly with `save` instead. +##### Arguments +- **new_type**: -**Returns:** - - `str | None`: The updated_at property value. ---- -### method `ArtifactCollection.artifacts` +### method delete ```python -artifacts(per_page: 'int' = 50, start: 'str | None' = None) → Artifacts +self ``` -Get all artifacts in the collection. +Delete the entire artifact collection. -**Args:** - - - `per_page`: The number of artifacts to fetch per page. - - `start`: Pagination cursor for resuming a past query, captured from a previous paginator's `.cursor` attribute. ---- -### method `ArtifactCollection.change_type` +### method is_sequence ```python -change_type(new_type: 'str') → None +self ``` -Deprecated, change type directly with `save` instead. - ---- +Return whether the artifact collection is a sequence. -### method `ArtifactCollection.delete` -```python -delete() → None -``` -Delete the entire artifact collection. ---- -### method `ArtifactCollection.is_sequence` +### method save ```python -is_sequence() → bool +self ``` -Return whether the artifact collection is a sequence. +Persist any changes made to the artifact collection. + ---- -### method `ArtifactCollection.save` -```python -save() → None -``` -Persist any changes made to the artifact collection. diff --git a/models/ref/python/public-api/artifactcollections.mdx b/models/ref/python/public-api/artifactcollections.mdx index 36f6a0f53c..60d54dd3eb 100644 --- a/models/ref/python/public-api/artifactcollections.mdx +++ b/models/ref/python/public-api/artifactcollections.mdx @@ -1,44 +1,82 @@ --- title: ArtifactCollections -namespace: public_apis_namespace -python_object_type: class +kind: class +namespace: wandb.apis.public.artifacts --- + import { GitHubLink } from '/snippets/_includes/github-source-link.mdx'; - + -## class `ArtifactCollections` -Artifact collections of a specific type in a project. +```python +(service_api: 'ServiceApi', +entity: 'str', +project: 'str', +type_name: 'str', +filters: 'Mapping[str, Any] | None' = None, +order: 'str | None' = None, +per_page: 'int' = 50, +start: 'str | None' = None) +``` +## Description +Artifact collections of a specific type in a project. -**Args:** - - - `service_api`: Interface to the wandb-core service that performs W&B API calls for this collection. - - `entity`: The entity (user or team) that owns the project. - - `project`: The name of the project to query for artifact collections. - - `type_name`: The name of the artifact type for which to fetch collections. - - `filters`: Optional mapping of filters to apply to the query. - - `order`: Optional string to specify the order of the results. If prefixed with '+', sorts ascending (default). If prefixed with '-', sorts descending. - - `per_page`: The number of artifact collections to fetch per page. Default is 50. -### property ArtifactCollections.cursor +## Args -An opaque cursor that marks the start of the next page to fetch. +- **service_api**: Interface to the wandb-core service that performs W&B API calls for this collection. +- **entity**: The entity (user or team) that owns the project. +- **project**: The name of the project to query for artifact collections. +- **type_name**: The name of the artifact type for which to fetch collections. +- **filters**: Optional mapping of filters to apply to the query. +- **order**: Optional string to specify the order of the results. If prefixed with '+', sorts ascending (default). If prefixed with '-', sorts descending. +- **per_page**: The number of artifact collections to fetch per page. Default is 50. +- **start**: -This value may be saved and passed as `start=` to a later paginated query to resume iteration from where this paginator left off. -**Returns:** - - `str | None`: The cursor property value. ---- -### property ArtifactCollections.more + +## Methods + +### method convert_objects + +```python +self +``` + +Convert the last fetched response data into the iterated objects. + + + + + +### method next + +```python +self +``` + +Return the next item from the iterator. When exhausted, raise StopIteration + + + + + +### method update_variables + +```python +self +``` + +Update the query variables for the next page fetch. diff --git a/models/ref/python/public-api/artifactfiles.mdx b/models/ref/python/public-api/artifactfiles.mdx index 5c30acb541..3614fd462b 100644 --- a/models/ref/python/public-api/artifactfiles.mdx +++ b/models/ref/python/public-api/artifactfiles.mdx @@ -1,47 +1,88 @@ --- title: ArtifactFiles -namespace: public_apis_namespace -python_object_type: class +kind: class +namespace: wandb.apis.public.artifacts --- + import { GitHubLink } from '/snippets/_includes/github-source-link.mdx'; - + -## class `ArtifactFiles` -A paginator for files in an artifact. +```python +(service_api: 'ServiceApi', +artifact: 'Artifact', +names: 'Sequence[str] | None' = None, +per_page: 'int' = 50, +start: 'str | None' = None) +``` +## Description -### property ArtifactFiles.cursor +A paginator for files in an artifact. -An opaque cursor that marks the start of the next page to fetch. -This value may be saved and passed as `start=` to a later paginated query to resume iteration from where this paginator left off. -**Returns:** - - `str | None`: The cursor property value. ---- +## Args -### property ArtifactFiles.more +- **service_api**: +- **artifact**: +- **names**: +- **per_page**: +- **start**: +## Properties ---- +### property path + +Returns the path of the artifact. + + + +## Methods + +### method convert_objects + +```python +self +``` + +Convert the last fetched response data into the iterated objects. + + + + + +### method next + +```python +self +``` + +Return the next item from the iterator. When exhausted, raise StopIteration + + + + + +### method update_variables + +```python +self +``` -### property ArtifactFiles.path +Update the query variables for the next page fetch. -Returns the path of the artifact. -**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 65ac375420..0a545bc702 100644 --- a/models/ref/python/public-api/artifacts.mdx +++ b/models/ref/python/public-api/artifacts.mdx @@ -1,54 +1,80 @@ --- title: Artifacts -namespace: public_apis_namespace -python_object_type: class +kind: class +namespace: wandb.apis.public.artifacts --- + import { GitHubLink } from '/snippets/_includes/github-source-link.mdx'; - + -## class `Artifacts` -An iterable collection of artifact versions associated with a project. +```python +(service_api: 'ServiceApi', +entity: 'str', +project: 'str', +collection_name: 'str', +type: 'str', +filters: 'Mapping[str, Any] | None' = None, +order: 'str | None' = None, +per_page: 'int' = 50, +tags: 'str | list[str] | None' = None, +start: 'str | None' = None) +``` -Optionally pass in filters to narrow down the results based on specific criteria. +## Description +An iterable collection of artifact versions associated with a project. +Optionally pass in filters to narrow down the results based on specific criteria. -**Args:** - - - `service_api`: Interface to the wandb-core service that performs W&B API calls for these artifact versions. - - `entity`: The entity (user or team) that owns the project. - - `project`: The name of the project to query for artifacts. - - `collection_name`: The name of the artifact collection to query. - - `type`: The type of the artifacts to query. Common examples include "dataset" or "model". - - `filters`: Optional mapping of filters to apply to the query. - - `order`: Optional string to specify the order of the results. If prefixed with '+', sorts ascending (default). If prefixed with '-', sorts descending. - - `per_page`: The number of artifact versions to fetch per page. Default is 50. - - `tags`: Optional string or list of strings to filter artifacts by tags. -### property Artifacts.cursor +## Args -An opaque cursor that marks the start of the next page to fetch. +- **service_api**: Interface to the wandb-core service that performs W&B API calls for these artifact versions. +- **entity**: The entity (user or team) that owns the project. +- **project**: The name of the project to query for artifacts. +- **collection_name**: The name of the artifact collection to query. +- **type**: The type of the artifacts to query. Common examples include "dataset" or "model". +- **filters**: Optional mapping of filters to apply to the query. +- **order**: Optional string to specify the order of the results. If prefixed with '+', sorts ascending (default). If prefixed with '-', sorts descending. +- **per_page**: The number of artifact versions to fetch per page. Default is 50. +- **tags**: Optional string or list of strings to filter artifacts by tags. +- **start**: -This value may be saved and passed as `start=` to a later paginated query to resume iteration from where this paginator left off. -**Returns:** - - `str | None`: The cursor property value. ---- -### property Artifacts.more +## Methods + +### method next + +```python +self +``` + +Return the next item from the iterator. When exhausted, raise StopIteration + + + + + +### method update_variables + +```python +self +``` + +Update the query variables for the next page fetch. ---- diff --git a/models/ref/python/public-api/artifacttype.mdx b/models/ref/python/public-api/artifacttype.mdx index 782adae6b6..f541105869 100644 --- a/models/ref/python/public-api/artifacttype.mdx +++ b/models/ref/python/public-api/artifacttype.mdx @@ -1,88 +1,92 @@ --- title: ArtifactType -namespace: public_apis_namespace -python_object_type: class +kind: class +namespace: wandb.apis.public.artifacts --- + import { GitHubLink } from '/snippets/_includes/github-source-link.mdx'; - + + +```python +(service_api: 'ServiceApi', +entity: 'str', +project: 'str', +type_name: 'str', +attrs: 'ArtifactTypeFragment | None' = None) +``` -## class `ArtifactType` -An artifact object that satisfies query based on the specified type. +## Description +An artifact object that satisfies query based on the specified type. -**Args:** - - - `service_api`: Interface to the wandb-core service that performs W&B API calls for this artifact type. - - `entity`: The entity (user or team) that owns the project. - - `project`: The name of the project to query for artifact types. - - `type_name`: The name of the artifact type. - - `attrs`: Optional attributes to initialize the ArtifactType. If omitted, the object will load its attributes from W&B upon initialization. +## Args -### property ArtifactType.id +- **service_api**: Interface to the wandb-core service that performs W&B API calls for this artifact type. +- **entity**: The entity (user or team) that owns the project. +- **project**: The name of the project to query for artifact types. +- **type_name**: The name of the artifact type. +- **attrs**: Optional attributes to initialize the ArtifactType. If omitted, the object will load its attributes from W&B upon initialization. -The unique identifier of the artifact type. -**Returns:** - - `str`: The id property value. ---- +## Properties -### property ArtifactType.name +### property id -The name of the artifact type. +The unique identifier of the artifact type. +### property name +The name of the artifact type. -**Returns:** - - `str`: The name property value. ---- +## Methods -### method `ArtifactType.collection` +### method collection ```python -collection(name: 'str') → ArtifactCollection +self, +name: 'str' ``` -Get a specific artifact collection by name. +Get a specific artifact collection by name. +##### Arguments + +- **name**: The name of the artifact collection to retrieve. -**Args:** - - - `name` (str): The name of the artifact collection to retrieve. ---- -### method `ArtifactType.collections` +### method collections ```python -collections( - filters: 'Mapping[str, Any] | None' = None, - order: 'str | None' = None, - per_page: 'int' = 50, - start: 'str | None' = None -) → ArtifactCollections +self, +filters: 'Mapping[str, Any] | None' = None, +order: 'str | None' = None, +per_page: 'int' = 50, +start: 'str | None' = None ``` -Get all artifact collections associated with this artifact type. +Get all artifact collections associated with this artifact type. + +##### Arguments + +- **filters**: Optional mapping of filters to apply to the query. +- **order**: Optional string to specify the order of the results. If prefixed with '+', sorts ascending (default). If prefixed with '-', sorts descending. The default order is the collection ID in descending order. +- **per_page**: The number of artifact collections to fetch per page. Default is 50. +- **start**: Pagination cursor for resuming a past query, captured from a previous paginator's `.cursor` attribute. + -**Args:** - - - `filters` (dict): Optional mapping of filters to apply to the query. - - `order` (str): Optional string to specify the order of the results. If prefixed with '+', sorts ascending (default). If prefixed with '-', sorts descending. The default order is the collection ID in descending order. - - `per_page` (int): The number of artifact collections to fetch per page. Default is 50. - - `start`: Pagination cursor for resuming a past query, captured from a previous paginator's `.cursor` attribute. ---- diff --git a/models/ref/python/public-api/artifacttypes.mdx b/models/ref/python/public-api/artifacttypes.mdx index 506f4120a9..e23503acbd 100644 --- a/models/ref/python/public-api/artifacttypes.mdx +++ b/models/ref/python/public-api/artifacttypes.mdx @@ -1,32 +1,78 @@ --- title: ArtifactTypes -namespace: public_apis_namespace -python_object_type: class +kind: class +namespace: wandb.apis.public.artifacts --- + import { GitHubLink } from '/snippets/_includes/github-source-link.mdx'; - + -## class `ArtifactTypes` -An lazy iterator of `ArtifactType` objects for a specific project. +```python +(service_api: 'ServiceApi', +entity: 'str', +project: 'str', +per_page: 'int' = 50, +start: 'str | None' = None) +``` +## Description -### property ArtifactTypes.cursor +An lazy iterator of `ArtifactType` objects for a specific project. -An opaque cursor that marks the start of the next page to fetch. -This value may be saved and passed as `start=` to a later paginated query to resume iteration from where this paginator left off. -**Returns:** - - `str | None`: The cursor property value. ---- +## Args + +- **service_api**: +- **entity**: +- **project**: +- **per_page**: +- **start**: + + + + + + +## Methods + +### method convert_objects + +```python +self +``` + +Convert the last fetched response data into the iterated objects. + + + + + +### method next + +```python +self +``` + +Return the next item from the iterator. When exhausted, raise StopIteration + + + + + +### method update_variables + +```python +self +``` -### property ArtifactTypes.more +Update the query variables for the next page fetch. diff --git a/models/ref/python/public-api/automations.mdx b/models/ref/python/public-api/automations.mdx index 48d098277b..63a6ec3b30 100644 --- a/models/ref/python/public-api/automations.mdx +++ b/models/ref/python/public-api/automations.mdx @@ -1,11 +1,88 @@ --- title: Automations -namespace: public_apis_namespace -python_object_type: class +kind: class +namespace: wandb.apis.public.automations --- + import { GitHubLink } from '/snippets/_includes/github-source-link.mdx'; - + + + + + +```python +(service_api: 'ServiceApi', +variables: 'Mapping[str, Any]', +per_page: 'int' = 50, *, +start: 'str | None' = None, +_query: 'str', +omit_variables: 'Iterable[str] | None' = None, +omit_fragments: 'Iterable[str] | None' = None, +omit_fields: 'Iterable[str] | None' = None, +rename_fields: 'Mapping[str, str] | None' = None) +``` + +## Description + +A lazy iterator of `Automation` objects. + + + + + +## Args + +- **service_api**: +- **variables**: +- **per_page**: +- **start**: +- **_query**: +- **omit_variables**: +- **omit_fragments**: +- **omit_fields**: +- **rename_fields**: + + + + + + +## Methods + +### method convert_objects + +```python +self +``` + +Convert the last fetched response data into the iterated objects. + + + + + +### method next + +```python +self +``` + +Return the next item from the iterator. When exhausted, raise StopIteration + + + + + +### method update_variables + +```python +self +``` + +Update the query variables for the next page fetch. + + diff --git a/models/ref/python/public-api/betareport.mdx b/models/ref/python/public-api/betareport.mdx index 23d4341d03..b6c2d48f89 100644 --- a/models/ref/python/public-api/betareport.mdx +++ b/models/ref/python/public-api/betareport.mdx @@ -1,151 +1,138 @@ --- title: BetaReport -namespace: public_apis_namespace -python_object_type: class +kind: class +namespace: wandb.apis.public.reports --- -import { GitHubLink } from '/snippets/_includes/github-source-link.mdx'; - - - - - -## class `BetaReport` -BetaReport is a class associated with reports created in W&B. - -Provides access to report attributes (name, description, user, spec, timestamps) and methods for retrieving associated runs, sections, and for rendering the report as HTML. +import { GitHubLink } from '/snippets/_includes/github-source-link.mdx'; + -**Attributes:** - - - `id` (string): Unique identifier of the report. - - `display_name` (string): Human-readable display name of the report. - - `name` (string): The name of the report. Use `display_name` for a more user-friendly name. - - `description` (string): Description of the report. - - `user` (User): Dictionary containing user info (username, email) who created the report. - - `spec` (dict): The spec of the report. - - `url` (string): The URL of the report. - - `updated_at` (string): Timestamp of last update. - - `created_at` (string): Timestamp when the report was created. -### method `BetaReport.__init__` ```python -__init__( - service_api: 'ServiceApi', - attrs: 'dict', - entity: 'str | None' = None, - project: 'str | None' = None -) +(service_api: 'ServiceApi', +attrs: 'dict', +entity: 'str | None' = None, +project: 'str | None' = None) ``` +## Description +BetaReport is a class associated with reports created in W&B. +Provides access to report attributes (name, description, user, spec, +timestamps) and methods for retrieving associated runs, +sections, and for rendering the report as HTML. +Attributes: + id (string): Unique identifier of the report. + display_name (string): Human-readable display name of the report. + name (string): The name of the report. Use `display_name` for a more user-friendly name. + description (string): Description of the report. + user (User): Dictionary containing user info (username, email) who + created the report. + spec (dict): The spec of the report. + url (string): The URL of the report. + updated_at (string): Timestamp of last update. + created_at (string): Timestamp when the report was created. ---- -### property BetaReport.created_at +## Args +- **service_api**: +- **attrs**: +- **entity**: +- **project**: ---- +## Properties -### property BetaReport.description +### property spec +### property sections +Get the panel sections (groups) from the report. ---- +### property id -### property BetaReport.display_name +### property name ---- +### property display_name -### property BetaReport.id +### property description ---- +### property user -### property BetaReport.name +### property updated_at ---- +### property created_at -### property BetaReport.sections -Get the panel sections (groups) from the report. - ---- -### property BetaReport.spec +### property url ---- - -### property BetaReport.updated_at - - - - - ---- - -### property BetaReport.url - - +## Methods +### method runs +```python +self, +section: 'dict[str, Any]', +per_page: 'int' = 50, +only_selected: 'bool' = True +``` ---- +Get runs associated with a section of the report. -### property BetaReport.user +##### Arguments +- **section**: +- **per_page**: +- **only_selected**: +### method to_html +```python +self, +height: 'int' = 1024, +hidden: 'bool' = False +``` ---- +Generate HTML containing an iframe displaying this report. -### method `BetaReport.runs` +##### Arguments -```python -runs( - section: 'dict[str, Any]', - per_page: 'int' = 50, - only_selected: 'bool' = True -) → public.Runs -``` +- **height**: +- **hidden**: -Get runs associated with a section of the report. ---- -### method `BetaReport.to_html` -```python -to_html(height: 'int' = 1024, hidden: 'bool' = False) → str -``` -Generate HTML containing an iframe displaying this report. diff --git a/models/ref/python/public-api/downloadhistoryresult.mdx b/models/ref/python/public-api/downloadhistoryresult.mdx index 386e9ad89f..bb7b87510a 100644 --- a/models/ref/python/public-api/downloadhistoryresult.mdx +++ b/models/ref/python/public-api/downloadhistoryresult.mdx @@ -1,35 +1,40 @@ --- title: DownloadHistoryResult -namespace: public_apis_namespace -python_object_type: class +kind: class +namespace: wandb.apis.public.runhistory.downloads --- + import { GitHubLink } from '/snippets/_includes/github-source-link.mdx'; - + -## class `DownloadHistoryResult` -Result of downloading a run's history exports. +```python +paths: 'list[pathlib.Path]', +contains_live_data: 'bool', +errors: 'dict[pathlib.Path, str] | None' = None +``` +## Description +Result of downloading a run's history exports. -**Attributes:** - - - `paths`: The paths to the downloaded history files. - - `errors`: A dictionary mapping file paths to error messages for files that failed to download. None if all downloads succeeded. - - `contains_live_data`: Whether the run contains live data, not yet exported to parquet files. +Attributes: + paths: The paths to the downloaded history files. + errors: A dictionary mapping file paths to error messages for files that + failed to download. None if all downloads succeeded. + contains_live_data: Whether the run contains live data, + not yet exported to parquet files. -### method `DownloadHistoryResult.__init__` -```python -__init__( - paths: 'list[pathlib.Path]', - contains_live_data: 'bool', - errors: 'dict[pathlib.Path, str] | None' = None -) → None -``` + +## Args + +- **paths**: +- **contains_live_data**: +- **errors**: diff --git a/models/ref/python/public-api/file.mdx b/models/ref/python/public-api/file.mdx index a7b53a048a..7c5e362607 100644 --- a/models/ref/python/public-api/file.mdx +++ b/models/ref/python/public-api/file.mdx @@ -1,104 +1,103 @@ --- title: File -namespace: public_apis_namespace -python_object_type: class +kind: class +namespace: wandb.apis.public.files --- + import { GitHubLink } from '/snippets/_includes/github-source-link.mdx'; - + -## class `File` -File saved to W&B. +```python +(service_api: 'ServiceApi', +attrs: 'dict[str, Any]', +run: 'Run | None' = None) +``` -Represents a single file stored in W&B. Includes access to file metadata. Files are associated with a specific run and can include text files, model weights, datasets, visualizations, and other artifacts. You can download the file, delete the file, and access file properties. +## Description -Specify one or more attributes in a dictionary to fine a specific file logged to a specific run. You can search using the following keys: +File saved to W&B. +Represents a single file stored in W&B. Includes access to file metadata. +Files are associated with a specific run and +can include text files, model weights, datasets, visualizations, and other +artifacts. You can download the file, delete the file, and access file +properties. -- id (str): The ID of the run that contains the file -- name (str): Name of the file -- url (str): path to file -- direct_url (str): path to file in the bucket -- sizeBytes (int): size of file in bytes -- md5 (str): md5 of file -- mimetype (str): mimetype of file -- updated_at (str): timestamp of last update -- path_uri (str): path to file in the bucket, currently only available for S3 objects and reference files +Specify one or more attributes in a dictionary to fine a specific +file logged to a specific run. You can search using the following keys: +- id (str): The ID of the run that contains the file +- name (str): Name of the file +- url (str): path to file +- direct_url (str): path to file in the bucket +- sizeBytes (int): size of file in bytes +- md5 (str): md5 of file +- mimetype (str): mimetype of file +- updated_at (str): timestamp of last update +- path_uri (str): path to file in the bucket, currently only available for S3 objects and reference files -**Args:** - - - `service_api`: The service API instance to use for querying W&B. - - `attrs` (dict): A dictionary of attributes that define the file - - `run`: The run object that contains the file +## Args -### property File.path_uri +- **service_api**: The service API instance to use for querying W&B. +- **attrs**: A dictionary of attributes that define the file +- **run**: The run object that contains the file -Returns the URI path to the file in the storage bucket. -**Returns:** - - - `str`: The S3 URI (e.g., 's3://bucket/path/to/file') if the file is stored in S3, the direct URL if it's a reference file, or an empty string if unavailable. +## Properties +### property size +Returns the size of the file in bytes. -**Returns:** - - `str`: The path_uri property value. ---- +### property path_uri -### property File.size +Returns the URI path to the file in the storage bucket. -Returns the size of the file in bytes. +## Methods +### method delete +```python +self +``` -**Returns:** - - `int`: The size property value. ---- +Delete the file from the W&B server. -### method `File.delete` -```python -delete() → None -``` -Delete the file from the W&B server. ---- -### method `File.download` +### method download ```python -download( - root: 'str' = '.', - replace: 'bool' = False, - exist_ok: 'bool' = False, - api: 'Api | None' = None -) → io.TextIOWrapper +self, +root: 'str' = '.', +replace: 'bool' = False, +exist_ok: 'bool' = False, +api: 'Api | None' = None ``` -Downloads a file previously saved by a run from the wandb server. +Downloads a file previously saved by a run from the wandb server. + +##### Arguments +- **root**: Local directory to save the file. Defaults to the current working directory ("."). +- **replace**: If `True`, download will overwrite a local file if it exists. Defaults to `False`. +- **exist_ok**: If `True`, will not raise ValueError if file already exists and will not re-download unless replace=True. Defaults to `False`. +- **api**: If specified, the `Api` instance used to download the file. -**Args:** - - - `root`: Local directory to save the file. Defaults to the current working directory ("."). - - `replace`: If `True`, download will overwrite a local file if it exists. Defaults to `False`. - - `exist_ok`: If `True`, will not raise ValueError if file already exists and will not re-download unless replace=True. Defaults to `False`. - - `api`: If specified, the `Api` instance used to download the file. -**Raises:** - `ValueError` if file already exists, `replace=False` and `exist_ok=False`. diff --git a/models/ref/python/public-api/files.mdx b/models/ref/python/public-api/files.mdx index 6c795a1755..a4ea9c5a40 100644 --- a/models/ref/python/public-api/files.mdx +++ b/models/ref/python/public-api/files.mdx @@ -1,24 +1,47 @@ --- title: Files -namespace: public_apis_namespace -python_object_type: class +kind: class +namespace: wandb.apis.public.files --- + import { GitHubLink } from '/snippets/_includes/github-source-link.mdx'; - + + + + +```python +(service_api: 'ServiceApi', +run: 'Run', +names: 'list[str] | None' = None, +per_page: 'int' = 50, +upload: 'bool' = False, +pattern: 'str | None' = None) +``` +## Description +A lazy iterator over a collection of `File` objects. -## class `Files` -A lazy iterator over a collection of `File` objects. +Access and manage files uploaded to W&B during a run. Handles pagination +automatically when iterating through large collections of files. -Access and manage files uploaded to W&B during a run. Handles pagination automatically when iterating through large collections of files. +## Args -**Example:** - ```python +- **service_api**: +- **run**: +- **names**: +- **per_page**: +- **upload**: +- **pattern**: + + +## Examples + +```python from wandb.apis.public.files import Files from wandb.apis.public.api import Api @@ -30,53 +53,29 @@ files = run.files() # Iterate over files for file in files: - print(file.name) - print(file.url) - print(file.size) - - # Download the file - file.download(root="download_directory", replace=True) -``` + print(file.name) + print(file.url) + print(file.size) -### method `Files.__init__` - -```python -__init__( - service_api: 'ServiceApi', - run: 'Run', - names: 'list[str] | None' = None, - per_page: 'int' = 50, - upload: 'bool' = False, - pattern: 'str | None' = None -) + # Download the file + file.download(root="download_directory", replace=True) ``` -Initialize a lazy iterator over a collection of `File` objects. - -Files are retrieved in pages from the W&B server as needed. - - -**Args:** - - - `service_api`: The service API instance to use for querying W&B. - - `run`: The run object that contains the files - - `names` (list, optional): A list of file names to filter the files - - `per_page` (int, optional): The number of files to fetch per page - - `upload` (bool, optional): If `True`, fetch the upload URL for each file - - `pattern` (str, optional): Pattern to match when returning files from W&B This pattern uses mySQL's LIKE syntax, so matching all files that end with .json would be "%.json". If both names and pattern are provided, a ValueError will be raised. +## Methods ---- - +### method next -### property Files.length +```python +self +``` +Return the next item from the iterator. When exhausted, raise StopIteration ---- diff --git a/models/ref/python/public-api/incompleterunhistoryerror.mdx b/models/ref/python/public-api/incompleterunhistoryerror.mdx index dc6125b1c3..ec8b02c1b1 100644 --- a/models/ref/python/public-api/incompleterunhistoryerror.mdx +++ b/models/ref/python/public-api/incompleterunhistoryerror.mdx @@ -1,19 +1,55 @@ --- title: IncompleteRunHistoryError -namespace: public_apis_namespace -python_object_type: class +kind: class +namespace: wandb.apis.public.runhistory.downloads --- + import { GitHubLink } from '/snippets/_includes/github-source-link.mdx'; - + + + + + + + +## Description + +Raised when run history has incomplete history. + +Incomplete history occurs when some data has not been exported to +parquet files yet, typically because the run is still ongoing. + + + + + + + + + +## Methods + +### method add_note + + + +Exception.add_note(note) -- +add a note to the exception + + + + + +### method with_traceback + +Exception.with_traceback(tb) -- +set self.__traceback__ to tb and return self. -## class `IncompleteRunHistoryError` -Raised when run history has incomplete history. -Incomplete history occurs when some data has not been exported to parquet files yet, typically because the run is still ongoing. diff --git a/models/ref/python/public-api/member.mdx b/models/ref/python/public-api/member.mdx index 6d67eb3895..b924c40da3 100644 --- a/models/ref/python/public-api/member.mdx +++ b/models/ref/python/public-api/member.mdx @@ -1,50 +1,52 @@ --- title: Member -namespace: public_apis_namespace -python_object_type: class +kind: class +namespace: wandb.apis.public.teams --- -import { GitHubLink } from '/snippets/_includes/github-source-link.mdx'; - - +import { GitHubLink } from '/snippets/_includes/github-source-link.mdx'; + -## class `Member` -A member of a team. -### method `Member.__init__` ```python -__init__(service_api: 'ServiceApi', team: 'str', attrs: 'Mapping[str, Any]') +(service_api: 'ServiceApi', +team: 'str', +attrs: 'Mapping[str, Any]') ``` -**Args:** - - - `service_api`: The service API instance to use for querying W&B. - - `team` (str): The name of the team this member belongs to - - `attrs` (dict): The member attributes +## Description +A member of a team. +## Args +- **service_api**: The service API instance to use for querying W&B. +- **team**: The name of the team this member belongs to +- **attrs**: The member attributes ---- -### method `Member.delete` + +## Methods + +### method delete ```python -delete() +(self) ``` -Remove a member from a team. +Remove a member from a team. + + + -**Returns:** - Boolean indicating success diff --git a/models/ref/python/public-api/project.mdx b/models/ref/python/public-api/project.mdx index 35bf22e099..9f35e66459 100644 --- a/models/ref/python/public-api/project.mdx +++ b/models/ref/python/public-api/project.mdx @@ -1,146 +1,113 @@ --- title: Project -namespace: public_apis_namespace -python_object_type: class +kind: class +namespace: wandb.apis.public.projects --- -import { GitHubLink } from '/snippets/_includes/github-source-link.mdx'; - - +import { GitHubLink } from '/snippets/_includes/github-source-link.mdx'; + -## class `Project` -A project is a namespace for runs. -### method `Project.__init__` ```python -__init__( - service_api: 'ServiceApi', - entity: 'str', - project: 'str', - attrs: 'Mapping[str, Any]' -) → Project +service_api: 'ServiceApi', +entity: 'str', +project: 'str', +attrs: 'Mapping[str, Any]' ``` -**Args:** - - - `service_api`: Interface to the wandb-core service that performs W&B API calls for this project. - - `name` (str): The name of the project. - - `entity` (str): The entity name that owns the project. - - -A single project associated with an entity. +## Description +A project is a namespace for runs. -**Args:** - - - `service_api`: The service API used to query W&B. - - `entity`: The entity which owns the project. - - `project`: The name of the project to query. - - `attrs`: The attributes of the project. - - ---- -### property Project.id +## Args +- **service_api**: Interface to the wandb-core service that performs W&B API calls for this project. +- **entity**: The entity name that owns the project. +- **project**: +- **attrs**: ---- +## Properties -### property Project.owner +### property owner -Returns the project owner as a User object. +Returns the project owner as a User object. +### property path +Returns the path of the project. The path is a list containing the +entity and project name. -**Raises:** - - - `ValueError`: when no user information is found for the project. +### property url +Returns the URL of the project. +### property id -**Returns:** - - `public.User`: The owner property value. ---- -### property Project.path -Returns the path of the project. The path is a list containing the entity and project name. +## Methods -**Returns:** - - `list[str]`: The path property value. ---- +### method artifacts_types -### property Project.url +```python +self, +per_page: 'int' = 50 +``` -Returns the URL of the project. +Returns all artifact types associated with this project. +##### Arguments +- **per_page**: -**Returns:** - - `str`: The url property value. ---- -### method `Project.artifacts_types` +### method collections ```python -artifacts_types(per_page: 'int' = 50) → public.ArtifactTypes +self, +filters: 'Mapping[str, Any] | None' = None, +order: 'str | None' = None, +per_page: 'int' = 50 ``` -Returns all artifact types associated with this project. - ---- - -### method `Project.collections` - -```python -collections( - filters: 'Mapping[str, Any] | None' = None, - order: 'str | None' = None, - per_page: 'int' = 50 -) → public.ProjectArtifactCollections -``` +Returns all artifact collections associated with this project. -Returns all artifact collections associated with this project. +##### Arguments +- **filters**: Optional mapping of filters to apply to the query. +- **order**: Optional string to specify the order of the results. If you prepend order with a + order is ascending (default). If you prepend order with a - order is descending. +- **per_page**: The number of artifact collections to fetch per page. Default is 50. -**Args:** - - - `filters`: Optional mapping of filters to apply to the query. - - `order`: Optional string to specify the order of the results. If you prepend order with a + order is ascending (default). If you prepend order with a - order is descending. - - `per_page`: The number of artifact collections to fetch per page. Default is 50. ---- -### method `Project.sweeps` +### method sweeps ```python -sweeps(per_page: 'int' = 50) → Sweeps +self, +per_page: 'int' = 50 ``` -Return a paginated collection of sweeps in this project. +Return a paginated collection of sweeps in this project. +##### Arguments +- **per_page**: The number of sweeps to fetch per request to the API. -**Args:** - - - `per_page`: The number of sweeps to fetch per request to the API. -**Returns:** - A `Sweeps` object, which is an iterable collection of `Sweep` objects. ---- diff --git a/models/ref/python/public-api/projectartifactcollections.mdx b/models/ref/python/public-api/projectartifactcollections.mdx index 5482ebd941..a0520912dd 100644 --- a/models/ref/python/public-api/projectartifactcollections.mdx +++ b/models/ref/python/public-api/projectartifactcollections.mdx @@ -1,43 +1,80 @@ --- title: ProjectArtifactCollections -namespace: public_apis_namespace -python_object_type: class +kind: class +namespace: wandb.apis.public.artifacts --- + import { GitHubLink } from '/snippets/_includes/github-source-link.mdx'; - + -## class `ProjectArtifactCollections` -Artifact collections in a project. +```python +(service_api: 'ServiceApi', +entity: 'str', +project: 'str', +filters: 'Mapping[str, Any] | None' = None, +order: 'str | None' = None, +per_page: 'int' = 50, +start: 'str | None' = None) +``` +## Description +Artifact collections in a project. -**Args:** - - - `service_api`: Interface to the wandb-core service that performs W&B API calls for this collection. - - `entity`: The entity (user or team) that owns the project. - - `project`: The name of the project to query for artifact collections. - - `filters`: Optional mapping of filters to apply to the query. - - `order`: Optional string to specify the order of the results. If prefixed with '+', sorts ascending (default). If prefixed with '-', sorts descending. - - `per_page`: The number of artifact collections to fetch per page. Default is 50. -### property ProjectArtifactCollections.cursor +## Args -An opaque cursor that marks the start of the next page to fetch. +- **service_api**: Interface to the wandb-core service that performs W&B API calls for this collection. +- **entity**: The entity (user or team) that owns the project. +- **project**: The name of the project to query for artifact collections. +- **filters**: Optional mapping of filters to apply to the query. +- **order**: Optional string to specify the order of the results. If prefixed with '+', sorts ascending (default). If prefixed with '-', sorts descending. +- **per_page**: The number of artifact collections to fetch per page. Default is 50. +- **start**: -This value may be saved and passed as `start=` to a later paginated query to resume iteration from where this paginator left off. -**Returns:** - - `str | None`: The cursor property value. ---- -### property ProjectArtifactCollections.more + +## Methods + +### method convert_objects + +```python +self +``` + +Convert the last fetched response data into the iterated objects. + + + + + +### method next + +```python +self +``` + +Return the next item from the iterator. When exhausted, raise StopIteration + + + + + +### method update_variables + +```python +self +``` + +Update the query variables for the next page fetch. diff --git a/models/ref/python/public-api/projects.mdx b/models/ref/python/public-api/projects.mdx index 9b27852417..e45c111cca 100644 --- a/models/ref/python/public-api/projects.mdx +++ b/models/ref/python/public-api/projects.mdx @@ -1,40 +1,40 @@ --- title: Projects -namespace: public_apis_namespace -python_object_type: class +kind: class +namespace: wandb.apis.public.projects --- + import { GitHubLink } from '/snippets/_includes/github-source-link.mdx'; - + + + +```python +service_api: 'ServiceApi', +entity: 'str', +per_page: 'int' = 50 +``` +## Description -## class `Projects` -An lazy iterator of `Project` objects. +An lazy iterator of `Project` objects. An iterable interface to access projects created and saved by the entity. -### method `Projects.__init__` -```python -__init__( - service_api: 'ServiceApi', - entity: 'str', - per_page: 'int' = 50 -) → Projects -``` -**Args:** - - - `service_api`: Interface to the wandb-core service that performs W&B API calls for this collection. - - `entity` (str): The entity name (username or team) to fetch projects for. - - `per_page` (int): Number of projects to fetch per request (default is 50). +## Args + +- **service_api**: Interface to the wandb-core service that performs W&B API calls for this collection. +- **entity**: The entity name (username or team) to fetch projects for. +- **per_page**: Number of projects to fetch per request (default is 50). +## Examples -**Example:** - ```python +```python from wandb.apis.public.api import Api # Find projects that belong to this entity @@ -46,36 +46,43 @@ for project in projects: print(f"- URL: {project.url}") print(f"- Created at: {project.created_at}") print(f"- Is benchmark: {project.is_benchmark}") -``` +``` -An iterable collection of `Project` objects. +## Methods +### method convert_objects + +```python +self +``` + +Convert the last fetched response data into the iterated objects. -**Args:** - - - `service_api`: The service API used to query W&B. - - `entity`: The entity which owns the projects. - - `per_page`: The number of projects to fetch per request to the API. ---- -### property Projects.cursor -An opaque cursor that marks the start of the next page to fetch. +### method next -This value may be saved and passed as `start=` to a later paginated query to resume iteration from where this paginator left off. +```python +self +``` +Return the next item from the iterator. When exhausted, raise StopIteration -**Returns:** - - `str | None`: The cursor property value. ---- -### property Projects.more + +### method update_variables + +```python +self +``` + +Update the query variables for the next page fetch. diff --git a/models/ref/python/public-api/registry.mdx b/models/ref/python/public-api/registry.mdx index 78505b9db7..e7510981ad 100644 --- a/models/ref/python/public-api/registry.mdx +++ b/models/ref/python/public-api/registry.mdx @@ -1,219 +1,128 @@ --- title: Registry -namespace: public_apis_namespace -python_object_type: class +kind: class +namespace: wandb.apis.public.registries.registry --- -import { GitHubLink } from '/snippets/_includes/github-source-link.mdx'; - - +import { GitHubLink } from '/snippets/_includes/github-source-link.mdx'; + -## class `Registry` -A single registry in the Registry. -### method `Registry.__init__` ```python -__init__( - service_api: 'ServiceApi', - organization: 'str', - entity: 'str', - name: 'str', - attrs: 'RegistryFragment | None' = None -) +(service_api: 'ServiceApi', +organization: 'str', +entity: 'str', +name: 'str', +attrs: 'RegistryFragment | None' = None) ``` +## Description +A single registry in the Registry. +## Args ---- - -### property Registry.allow_all_artifact_types - -Return whether all artifact types are allowed in the registry. - -If `True`, artifacts of any type can be added. If `False`, artifacts are restricted to the types listed in `artifact_types`. - - - -**Returns:** - - `bool`: The allow_all_artifact_types property value. ---- - -### property Registry.artifact_types - -Returns the artifact types allowed in the registry. - -If `allow_all_artifact_types` is `True` then `artifact_types` reflects the types previously saved or currently used in the registry. If `allow_all_artifact_types` is `False` then artifacts are restricted to the types in `artifact_types`. - - - -**Note:** - -> Previously saved artifact types cannot be removed. -> - -**Example:** - ```python -import wandb - -registry = wandb.Api().create_registry() -registry.artifact_types.append("model") -registry.save() # once saved, the artifact type `model` cannot be removed -registry.artifact_types.append("accidentally_added") -registry.artifact_types.remove( - "accidentally_added" -) # Types can only be removed if it has not been saved yet -``` +- **service_api**: +- **organization**: +- **entity**: +- **name**: +- **attrs**: -**Returns:** - - `AddOnlyArtifactTypesList`: The artifact_types property value. ---- -### property Registry.created_at +## Properties -Timestamp of when the registry was created. +### property id +The unique ID for this registry. +### property full_name -**Returns:** - - `str`: The created_at property value. ---- +Full name of the registry including the `wandb-registry-` prefix. -### property Registry.description +### property name -Description of the registry. +Name of the registry without the `wandb-registry-` prefix. +### property entity +Organization entity of the registry. -**Returns:** - - `str | None`: The description property value. ---- +### property organization -### property Registry.entity +Organization name of the registry. -Organization entity of the registry. +### property description +Description of the registry. +### property allow_all_artifact_types -**Returns:** - - `str`: The entity property value. ---- +Return whether all artifact types are allowed in the registry. -### property Registry.full_name +If `True`, artifacts of any type can be added. If `False`, artifacts are +restricted to the types listed in `artifact_types`. -Full name of the registry including the `wandb-registry-` prefix. +### property artifact_types +Returns the artifact types allowed in the registry. +If `allow_all_artifact_types` is `True` then `artifact_types` reflects the +types previously saved or currently used in the registry. +If `allow_all_artifact_types` is `False` then artifacts are restricted to the +types in `artifact_types`. -**Returns:** - - `str`: The full_name property value. ---- +Note: + Previously saved artifact types cannot be removed. -### property Registry.id +### property created_at -The unique ID for this registry. +Timestamp of when the registry was created. +### property updated_at +Timestamp of when the registry was last updated. -**Returns:** - - `str`: The id property value. ---- +### property path -### property Registry.name -Name of the registry without the `wandb-registry-` prefix. +### property visibility +Visibility of the registry. -**Returns:** - - `str`: The name property value. ---- -### property Registry.organization -Organization name of the registry. +## Methods - - -**Returns:** - - `str`: The organization property value. ---- - -### property Registry.path - - - - - ---- - -### property Registry.updated_at - -Timestamp of when the registry was last updated. - - - -**Returns:** - - `str`: The updated_at property value. ---- - -### property Registry.visibility - -Visibility of the registry. - - - -**Returns:** - - - `Literal["organization", "restricted"]`: The visibility level. - - "organization": Anyone in the organization can view this registry. You can edit their roles later from the settings in the UI. - - "restricted": Only invited members via the UI can access this registry. Public sharing is disabled. - - - - - -**Returns:** - - `Literal['organization', 'restricted']`: The visibility property value. ---- - -### method `Registry.add_members` +### method add_members ```python -add_members(*members: 'User | UserMember | Team | TeamMember | str') → Self +self, *members: 'User | UserMember | Team | TeamMember | str' ``` -Adds users or teams to this registry. - - - -**Args:** - - - `members`: The users or teams to add to the registry. Accepts `User` objects, `Team` objects, or their string IDs. +Adds users or teams to this registry. +##### Arguments +- **members**: The users or teams to add to the registry. Accepts `User` objects, `Team` objects, or their string IDs. -**Returns:** - This registry for further method chaining, if needed. +##### Raises +- **TypeError**: If no members are passed as arguments. +- **ValueError**: If unable to infer or parse the user or team IDs. -**Raises:** - - - `TypeError`: If no members are passed as arguments. - - `ValueError`: If unable to infer or parse the user or team IDs. +##### Examples - -**Examples:** - ```python +```python import wandb api = wandb.Api() @@ -227,136 +136,119 @@ registry.add_members(user1, user2) my_team = api.team(name="my-team") registry.add_members(my_team) -``` - ---- +``` -### method `Registry.collections` +### method collections ```python -collections( - filter: 'dict[str, Any] | None' = None, - order: 'str | None' = None, - per_page: 'PositiveInt' = 100, - start: 'str | None' = None -) → Collections +self, +filter: 'dict[str, Any] | None' = None, +order: 'str | None' = None, +per_page: 'PositiveInt' = 100, +start: 'str | None' = None ``` -Returns the collections belonging to this registry. +Returns the collections belonging to this registry. +##### Arguments + +- **filter**: Optional mapping of filters to apply to the collections query. +- **order**: Optional string to specify the order of the results. If prefixed with '+', sorts ascending (default). If prefixed with '-', sorts descending. +- **per_page**: The number of results to fetch per page. Usually there is no reason to change this. +- **start**: Pagination cursor for resuming a past query, captured from a previous paginator's `.cursor` attribute. -**Args:** - - - `filter`: Optional mapping of filters to apply to the collections query. - - `order`: Optional string to specify the order of the results. If prefixed with '+', sorts ascending (default). If prefixed with '-', sorts descending. - - `per_page`: The number of results to fetch per page. Usually there is no reason to change this. - - `start`: Pagination cursor for resuming a past query, captured from a previous paginator's `.cursor` attribute. ---- -### classmethod `Registry.create` +### method create ```python -create( - api: 'Api', - organization: 'str', - name: 'str', - visibility: "Literal['organization', 'restricted']", - description: 'str | None' = None, - artifact_types: 'list[str] | None' = None -) → Self +api: 'Api', +organization: 'str', +name: 'str', +visibility: "Literal['organization', 'restricted']", +description: 'str | None' = None, +artifact_types: 'list[str] | None' = None ``` -Create a new registry. +Create a new registry. -The registry name must be unique within the organization. This function should be called using `api.create_registry()` +The registry name must be unique within the organization. +This function should be called using `api.create_registry()` +##### Arguments +- **api**: The W&B API instance. +- **organization**: The name of the organization. +- **name**: The name of the registry (without the `wandb-registry-` prefix). +- **visibility**: The visibility level ('organization' or 'restricted'). +- **description**: An optional description for the registry. +- **artifact_types**: An optional list of allowed artifact types. -**Args:** - - - `api`: The W&B API instance. - - `organization`: The name of the organization. - - `name`: The name of the registry (without the `wandb-registry-` prefix). - - `visibility`: The visibility level ('organization' or 'restricted'). - - `description`: An optional description for the registry. - - `artifact_types`: An optional list of allowed artifact types. +##### Raises +- **ValueError**: If a registry with the same name already exists in the organization or if the creation fails. -**Returns:** - - - `Registry`: The newly created Registry object. +### method delete +```python +self +``` -**Raises:** - - - `ValueError`: If a registry with the same name already exists in the organization or if the creation fails. +Delete the registry. This is irreversible. ---- -### method `Registry.delete` -```python -delete() → None -``` -Delete the registry. This is irreversible. - ---- -### method `Registry.load` +### method load ```python -load() → None +self ``` -Load registry attributes from the backend. +Load registry attributes from the backend. ---- -### method `Registry.members` -```python -members() → list[UserMember | TeamMember] -``` -Returns the current members (users and teams) of this registry. ---- - -### method `Registry.remove_members` +### method members ```python -remove_members(*members: 'User | UserMember | Team | TeamMember | str') → Self +self ``` -Removes users or teams from this registry. +Returns the current members (users and teams) of this registry. + -**Args:** - - - `members`: The users or teams to remove from the registry. Accepts `User` objects, `Team` objects, or their string IDs. +### method remove_members + +```python +self, *members: 'User | UserMember | Team | TeamMember | str' +``` + +Removes users or teams from this registry. +##### Arguments -**Returns:** - This registry for further method chaining, if needed. +- **members**: The users or teams to remove from the registry. Accepts `User` objects, `Team` objects, or their string IDs. +##### Raises -**Raises:** - - - `TypeError`: If no members are passed as arguments. - - `ValueError`: If unable to infer or parse the user or team IDs. +- **TypeError**: If no members are passed as arguments. +- **ValueError**: If unable to infer or parse the user or team IDs. +##### Examples -**Examples:** - ```python +```python import wandb api = wandb.Api() @@ -370,67 +262,57 @@ registry.remove_members(user1, user2) old_team = api.team(name="old-team") registry.remove_members(old_team) -``` - ---- +``` -### method `Registry.save` +### method save ```python -save() → None +self ``` -Save registry attributes to the backend. - ---- +Save registry attributes to the backend. -### method `Registry.team_members` -```python -team_members() → list[TeamMember] -``` -Returns the current member teams of this registry. ---- -### method `Registry.update_member` +### method team_members ```python -update_member( - member: 'User | UserMember | Team | TeamMember | str', - role: 'MemberRole | str' -) → Self +self ``` -Updates the role of a member (user or team) within this registry. +Returns the current member teams of this registry. + -**Args:** - - - `member`: The user or team to update the role of. Accepts a `User` object, `Team` object, or their string ID. - - `role`: The new role to assign to the member. May be one of: - - "admin" - - "member" - - "viewer" - - "restricted_viewer" (if supported by the W&B server) +### method update_member + +```python +self, +member: 'User | UserMember | Team | TeamMember | str', +role: 'MemberRole | str' +``` +Updates the role of a member (user or team) within this registry. -**Returns:** - This registry for further method chaining, if needed. +##### Arguments +- **member**: The user or team to update the role of. Accepts a `User` object, `Team` object, or their string ID. +- **role**: The new role to assign to the member. May be one of: - "admin" - "member" - "viewer" - "restricted_viewer" (if supported by the W&B server) -**Raises:** - - - `ValueError`: If unable to infer the user or team ID. +##### Raises +- **ValueError**: If unable to infer the user or team ID. -**Examples:** - Make all users in the registry admins ```python +##### Examples + +Make all users in the registry admins +```python import wandb api = wandb.Api() @@ -440,37 +322,39 @@ registry = api.registry(name="my-registry", organization="my-org") for member in registry.user_members(): registry.update_member(member.user, role="admin") -``` - ---- +``` -### method `Registry.user_members` +### method user_members ```python -user_members() → list[UserMember] +self ``` -Returns the current member users of this registry. +Returns the current member users of this registry. + ---- -### method `Registry.versions` + + +### method versions ```python -versions( - filter: 'dict[str, Any] | None' = None, - per_page: 'PositiveInt' = 100, - start: 'str | None' = None -) → Versions +self, +filter: 'dict[str, Any] | None' = None, +per_page: 'PositiveInt' = 100, +start: 'str | None' = None ``` -Returns the artifact versions belonging to this registry. +Returns the artifact versions belonging to this registry. + +##### Arguments + +- **filter**: Optional mapping of filters to apply to the artifact versions query. +- **per_page**: The number of results to fetch per page. Usually there is no reason to change this. +- **start**: Pagination cursor for resuming a past query, captured from a previous paginator's `.cursor` attribute. + + -**Args:** - - - `filter`: Optional mapping of filters to apply to the artifact versions query. - - `per_page`: The number of results to fetch per page. Usually there is no reason to change this. - - `start`: Pagination cursor for resuming a past query, captured from a previous paginator's `.cursor` attribute. diff --git a/models/ref/python/public-api/reports.mdx b/models/ref/python/public-api/reports.mdx index 746d60e383..87e64087ca 100644 --- a/models/ref/python/public-api/reports.mdx +++ b/models/ref/python/public-api/reports.mdx @@ -1,71 +1,80 @@ --- title: Reports -namespace: public_apis_namespace -python_object_type: class +kind: class +namespace: wandb.apis.public.reports --- -import { GitHubLink } from '/snippets/_includes/github-source-link.mdx'; - - +import { GitHubLink } from '/snippets/_includes/github-source-link.mdx'; + -## class `Reports` -Reports is a lazy iterator of `BetaReport` objects. -### method `Reports.__init__` ```python -__init__( - service_api: 'ServiceApi', - project: 'Project', - name: 'str | None' = None, - entity: 'str | None' = None, - per_page: 'int' = 50 -) +(service_api: 'ServiceApi', +project: 'Project', +name: 'str | None' = None, +entity: 'str | None' = None, +per_page: 'int' = 50) ``` -**Args:** - - - `service_api`: Interface to the wandb-core service that performs W&B API calls for this collection. - - `project` (`wandb.sdk.internal.Project`): The project to fetch reports from. - - `name` (str, optional): The name of the report to filter by. If `None`, fetches all reports. - - `entity` (str, optional): The entity name for the project. Defaults to the project entity. - - `per_page` (int): Number of reports to fetch per page (default is 50). +## Description +Reports is a lazy iterator of `BetaReport` objects. +## Args +- **service_api**: Interface to the wandb-core service that performs W&B API calls for this collection. +- **project**: The project to fetch reports from. +- **name**: The name of the report to filter by. If `None`, fetches all reports. +- **entity**: The entity name for the project. Defaults to the project entity. +- **per_page**: Number of reports to fetch per page (default is 50). ---- -### property Reports.length +## Methods +### method convert_objects + +```python +self +``` + +Converts GraphQL edges to File objects. ---- -### method `Reports.convert_objects` + +### method next ```python -convert_objects() → list[BetaReport] +self ``` -Converts GraphQL edges to File objects. +Return the next item from the iterator. When exhausted, raise StopIteration + ---- -### method `Reports.update_variables` + + +### method update_variables ```python -update_variables() → None +self ``` -Updates the GraphQL query variables for pagination. +Updates the GraphQL query variables for pagination. + + + + + + diff --git a/models/ref/python/public-api/run.mdx b/models/ref/python/public-api/run.mdx index 85a45938fb..1bf8b258de 100644 --- a/models/ref/python/public-api/run.mdx +++ b/models/ref/python/public-api/run.mdx @@ -1,309 +1,198 @@ --- title: Run -namespace: public_apis_namespace -python_object_type: class +kind: class +namespace: wandb.apis.public.runs --- -import { GitHubLink } from '/snippets/_includes/github-source-link.mdx'; - +import { GitHubLink } from '/snippets/_includes/github-source-link.mdx'; + -## class `Run` -A single run associated with an entity and project. - -### method `Run.__init__` ```python -__init__( - service_api: 'ServiceApi', - entity: 'str', - project: 'str', - run_id: 'str', - attrs: 'Mapping | None' = None, - include_sweeps: 'bool' = False, - lazy: 'bool' = True, - api_key: 'str | None' = None -) +(service_api: 'ServiceApi', +entity: 'str', +project: 'str', +run_id: 'str', +attrs: 'Mapping | None' = None, +include_sweeps: 'bool' = False, +lazy: 'bool' = True, +api_key: 'str | None' = None) ``` -**Args:** - - - `service_api`: Interface to the wandb-core service that performs W&B API calls for this run. - - `entity`: The entity associated with the run. - - `project`: The project associated with the run. - - `run_id`: The unique identifier for the run. - - `attrs`: The attributes of the run. - - `include_sweeps`: Whether to include sweeps in the run. - - - -**Attributes:** - - - `tags` ([str]): a list of tags associated with the run - - `url` (str): the url of this run - - `id` (str): unique identifier for the run (defaults to eight characters) - - `name` (str): the name of the run - - `state` (str): one of: running, finished, crashed, killed, preempting, preempted - - `config` (dict): a dict of hyperparameters associated with the run - - `created_at` (str): ISO timestamp when the run was started - - `system_metrics` (dict): the latest system metrics recorded for the run - - `summary` (dict): A mutable dict-like property that holds the current summary. Calling update will persist any changes. - - `project` (str): the project associated with the run - - `entity` (str): the name of the entity associated with the run - - `project_internal_id` (int): the internal id of the project - - `user` (str): the name of the user who created the run - - `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): History metric keys logged with `wandb.Run.log({"key": "value"})` - - `metadata` (str): Metadata about the run from wandb-metadata.json - - -Initialize a Run object. - -Run is always initialized by calling api.runs() where api is an instance of wandb.Api. - - ---- - -### property Run.config - -Get run config. Auto-loads full data if in lazy mode. - - - -**Returns:** - - `dict[str, Any]`: The config property value. ---- - -### property Run.entity - -The entity associated with the run. - - - -**Returns:** - - `str`: The entity property value. ---- - -### property Run.id - -The unique identifier for the run. - +## Description +A single run associated with an entity and project. -**Returns:** - - `str`: The id property value. ---- - - -### property Run.lastHistoryStep - -Returns the last step logged in the run's history. - - - -**Returns:** - - `int`: The lastHistoryStep property value. ---- - -### property Run.metadata - -Metadata about the run from wandb-metadata.json. - -Metadata includes the run's description, tags, start time, memory usage and more. - - - -**Returns:** - - `dict[str, Any] | None`: The metadata property value. ---- - -### property Run.name - -The name of the run. - - - -**Returns:** - - `str | None`: The name property value. ---- - -### property Run.path - -The path of the run. The path is a list containing the entity, project, and run_id. - - - -**Returns:** - - `list[str]`: The path property value. ---- - -### property Run.rawconfig - -Get raw run config including internal keys. Auto-loads full data if in lazy mode. - - - -**Returns:** - - `dict[str, Any]`: The rawconfig property value. ---- - -### property Run.state - -The state of the run. -The following table describes the possible states a run can be in: -| State | Description | | -------- | ----------- | | Crashed | Run stopped sending heartbeats in the internal process, which can happen if the machine crashes. | | Failed | Run ended with a non-zero exit status. | | Finished | Run ended and fully synced data, or called `wandb.Run.finish()`. | | Killed | Run was forcibly stopped before it could finish. | | Running | Run is still running and has recently sent a heartbeat. | | Pending | Run is scheduled but not yet started (common in sweeps and Launch jobs). | +## Args +- **service_api**: Interface to the wandb-core service that performs W&B API calls for this run. +- **entity**: the name of the entity associated with the run +- **project**: the project associated with the run +- **run_id**: The unique identifier for the run. +- **attrs**: The attributes of the run. +- **include_sweeps**: Whether to include sweeps in the run. +- **lazy**: +- **api_key**: -**Returns:** - - `str`: The state property value. ---- -### property Run.storage_id -The unique storage identifier for the run. +## Properties +### property state +The state of the run. -**Returns:** - - `str`: The storage_id property value. ---- +The following table describes the possible states a run can be in: -### property Run.summary +| State | Description | +| -------- | ----------- | +| Crashed | Run stopped sending heartbeats in the internal process, which can happen if the machine crashes. | +| Failed | Run ended with a non-zero exit status. | +| Finished | Run ended and fully synced data, or called `wandb.Run.finish()`. | +| Killed | Run was forcibly stopped before it could finish. | +| Running | Run is still running and has recently sent a heartbeat. | +| Pending | Run is scheduled but not yet started (common in sweeps and Launch jobs). | -Get run summary metrics. Auto-loads full data if in lazy mode. +### property entity +The entity associated with the run. +### property username -**Returns:** - - `HTTPSummary`: The summary property value. ---- +This API is deprecated. Use `entity` instead. -### property Run.summary_metrics +### property storage_id -Get run summary metrics. Auto-loads full data if in lazy mode. +The unique storage identifier for the run. +### property id +The unique identifier for the run. -**Returns:** - - `dict[str, Any]`: The summary_metrics property value. ---- +### property name -### property Run.sweep +The name of the run. -The sweep associated with this run. Loads sweep data if include_sweeps is False. +### property config +Get run config. Auto-loads full data if in lazy mode. +### property summary -**Returns:** - - `public.Sweep | None`: The sweep property value. ---- +Get run summary metrics. Auto-loads full data if in lazy mode. -### property Run.sweep_name +### property system_metrics -Get sweep name. Always available since sweepName is in lightweight fragment. +Get run system metrics. Auto-loads full data if in lazy mode. +### property summary_metrics +Get run summary metrics. Auto-loads full data if in lazy mode. -**Returns:** - - `str | None`: The sweep_name property value. ---- +### property rawconfig -### property Run.system_metrics +Get raw run config including internal keys. Auto-loads full data if in lazy mode. -Get run system metrics. Auto-loads full data if in lazy mode. +### property sweep_name +Get sweep name. Always available since sweepName is in lightweight fragment. +### property sweep -**Returns:** - - `dict[str, Any]`: The system_metrics property value. ---- +The sweep associated with this run. Loads sweep data if include_sweeps is False. -### property Run.url +### property path -The URL of the run. +The path of the run. The path is a list containing the entity, project, and run_id. -The run URL is generated from the entity, project, and run_id. For SaaS users, it takes the form of `https://wandb.ai/entity/project/run_id`. +### property url +The URL of the run. +The run URL is generated from the entity, project, and run_id. For +SaaS users, it takes the form of `https://wandb.ai/entity/project/run_id`. -**Returns:** - - `str`: The url property value. ---- +### property metadata -### property Run.username +Metadata about the run from wandb-metadata.json. -This API is deprecated. Use `entity` instead. +Metadata includes the run's description, tags, start time, memory +usage and more. +### property lastHistoryStep +Returns the last step logged in the run's history. -**Returns:** - - `str`: The username property value. ---- +## Methods -### method `Run.beta_scan_history` +### method beta_scan_history ```python -beta_scan_history( - keys: 'list[str] | None' = None, - page_size: 'int' = 1000, - min_step: 'int' = 0, - max_step: 'int | None' = None, - use_cache: 'bool' = True -) → public.HistoryScan +self, +keys: 'list[str] | None' = None, +page_size: 'int' = 1000, +min_step: 'int' = 0, +max_step: 'int | None' = None, +use_cache: 'bool' = True ``` +##### Arguments +- **keys**: +- **page_size**: +- **min_step**: +- **max_step**: +- **use_cache**: ---- -### classmethod `Run.create` -```python -create( - api: 'public.Api', - run_id: 'str | None' = None, - project: 'str | None' = None, - entity: 'str | None' = None, - state: "Literal['running', 'pending']" = 'running' -) → Self -``` -Create a run for the given project. +### method create -For most use cases, use `wandb.init()`. `wandb.init()` provides more robust logic for creating and updating runs. `wandb.apis.public.Run.create` is intended for specific scenarios such as creating runs in a "pending" state for jobs that may be unschedulable (for example, in a Kubernetes cluster with insufficient GPUs or high contention). These pending runs can later be resumed and tracked by W&B. +```python +api: 'public.Api', +run_id: 'str | None' = None, +project: 'str | None' = None, +entity: 'str | None' = None, +state: "Literal['running', 'pending']" = 'running' +``` -Runs created with this method have limited functionality. Calling `update()` on a run created this way may not work as expected. +Create a run for the given project. +For most use cases, use `wandb.init()`. `wandb.init()` provides more robust +logic for creating and updating runs. `wandb.apis.public.Run.create` +is intended for specific scenarios such as creating runs in +a "pending" state for jobs that may be unschedulable +(for example, in a Kubernetes cluster with insufficient GPUs or high +contention). These pending runs can later be resumed and tracked by W&B. +Runs created with this method have limited functionality. Calling +`update()` on a run created this way may not work as expected. -**Args:** - - - `api`: The W&B API instance. - - `run_id`: Optional run ID. If not provided, a random ID will be generated. - - `project`: Optional project name. Defaults to the project in API settings or "uncategorized". - - `entity`: Optional entity (user or team) name. - - `state`: Initial state of the run. Use "pending" for runs that will be resumed later, or "running" for immediate execution. +##### Arguments +- **api**: The W&B API instance. +- **run_id**: Optional run ID. If not provided, a random ID will be generated. +- **project**: Optional project name. Defaults to the project in API settings or "uncategorized". +- **entity**: Optional entity (user or team) name. +- **state**: Initial state of the run. Use "pending" for runs that will be resumed later, or "running" for immediate execution. -**Returns:** - A Run object representing the created run. +##### Examples -**Example:** - Creating a pending run for later execution +Creating a pending run for later execution ```python import wandb @@ -319,228 +208,188 @@ run = Run.create( state="pending", run_id=run_name, ) -``` - ---- +``` -### method `Run.delete` +### method delete ```python -delete(delete_artifacts: 'bool' = False) → None +self, +delete_artifacts: 'bool' = False ``` -Delete the given run from the wandb backend. +Delete the given run from the wandb backend. +##### Arguments +- **delete_artifacts**: Whether to delete the artifacts associated with the run. -**Args:** - - - `delete_artifacts` (bool, optional): Whether to delete the artifacts associated with the run. ---- -### method `Run.download_history_exports` + +### method download_history_exports ```python -download_history_exports( - download_dir: 'pathlib.Path | str', - require_complete_history: 'bool' = True -) → runhistory.DownloadHistoryResult +self, +download_dir: 'pathlib.Path | str', +require_complete_history: 'bool' = True ``` -Download any parquet history files for the run to the provided directory. - +Download any parquet history files for the run to the provided directory. +##### Arguments -**Args:** - - - `download_dir`: The directory to download the history files to. - - `require_complete_history`: Whether to require the complete history to be downloaded. If true, and the run contains data that has not been exported to parquet files yet, an IncompleteRunHistoryError will be raised. +- **download_dir**: The directory to download the history files to. +- **require_complete_history**: Whether to require the complete history to be downloaded. If true, and the run contains data that has not been exported to parquet files yet, an IncompleteRunHistoryError will be raised. +##### Raises -**Returns:** - A DownloadHistoryResult. +- **IncompleteRunHistoryError**: If require_complete_history is True and the run contains data not yet exported to parquet files. +- **WandbApiFailedError**: If the API request fails for reasons other than incomplete history. - -**Raises:** - - - `IncompleteRunHistoryError`: If require_complete_history is True and the run contains data not yet exported to parquet files. - - `WandbApiFailedError`: If the API request fails for reasons other than incomplete history. - ---- - -### method `Run.file` +### method file ```python -file(name: 'str') → public.File +self, +name: 'str' ``` -Return the path of a file with a given name in the artifact. +Return the path of a file with a given name in the artifact. +##### Arguments +- **name**: name of requested file. -**Args:** - - - `name` (str): name of requested file. -**Returns:** - A `File` matching the name argument. - ---- - -### method `Run.files` +### method files ```python -files( - names: 'list[str] | None' = None, - pattern: 'str | None' = None, - per_page: 'int' = 50 -) → public.Files +self, +names: 'list[str] | None' = None, +pattern: 'str | None' = None, +per_page: 'int' = 50 ``` -Returns a `Files` object for all files in the run which match the given criteria. - -You can specify a list of exact file names to match, or a pattern to match against. If both are provided, the pattern will be ignored. - +Returns a `Files` object for all files in the run which match the given criteria. +You can specify a list of exact file names to match, or a pattern to match against. +If both are provided, the pattern will be ignored. -**Args:** - - - `names` (list): names of the requested files, if empty returns all files - - `pattern` (str, optional): Pattern to match when returning files from W&B. This pattern uses mySQL's LIKE syntax, so matching all files that end with .json would be "%.json". If both names and pattern are provided, a ValueError will be raised. - - `per_page` (int): number of results per page. +##### Arguments +- **names**: names of the requested files, if empty returns all files +- **pattern**: Pattern to match when returning files from W&B. This pattern uses mySQL's LIKE syntax, so matching all files that end with .json would be "%.json". If both names and pattern are provided, a ValueError will be raised. +- **per_page**: number of results per page. -**Returns:** - A `Files` object, which is an iterator over `File` objects. ---- -### method `Run.history` +### method history ```python -history( - samples: 'int' = 500, - keys: 'list[str] | None' = None, - x_axis: 'str' = '_step', - pandas: 'bool' = True, - stream: "Literal['default', 'system']" = 'default' -) → list[dict[str, Any]] | pd.DataFrame +self, +samples: 'int' = 500, +keys: 'list[str] | None' = None, +x_axis: 'str' = '_step', +pandas: 'bool' = True, +stream: "Literal['default', 'system']" = 'default' ``` -Return sampled history metrics for a run. - -This is simpler and faster if you are ok with the history records being sampled. +Return sampled history metrics for a run. +This is simpler and faster if you are ok with the history records being sampled. +##### Arguments -**Args:** - - - `samples `: (int, optional) The number of samples to return - - `pandas `: (bool, optional) Return a pandas dataframe - - `keys `: (list, optional) Only return metrics for specific keys - - `x_axis `: (str, optional) Use this metric as the xAxis defaults to _step - - `stream `: (str, optional) "default" for metrics, "system" for machine metrics +- **samples**: (int, optional) The number of samples to return +- **keys**: (list, optional) Only return metrics for specific keys +- **x_axis**: (str, optional) Use this metric as the xAxis defaults to _step +- **pandas**: (bool, optional) Return a pandas dataframe +- **stream**: (str, optional) "default" for metrics, "system" for machine metrics -**Returns:** - - - `pandas.DataFrame`: If pandas=True returns a `pandas.DataFrame` of history metrics. - - `list of dicts`: If pandas=False returns a list of dicts of history metrics. ---- - -### method `Run.load` +### method load ```python -load(force: 'bool' = False) → dict[str, Any] +self, +force: 'bool' = False ``` -Load run data using appropriate fragment based on lazy mode. +Load run data using appropriate fragment based on lazy mode. ---- +##### Arguments -### method `Run.load_full_data` +- **force**: -```python -load_full_data(force: 'bool' = False) → dict[str, Any] -``` -Load full run data including heavy fields like config, systemMetrics, summaryMetrics. -This method is useful when you initially used lazy=True for listing runs, but need access to the full data for specific runs. +### method load_full_data +```python +self, +force: 'bool' = False +``` -**Args:** - - - `force`: Force reload even if data is already loaded +Load full run data including heavy fields like config, systemMetrics, summaryMetrics. +This method is useful when you initially used lazy=True for listing runs, +but need access to the full data for specific runs. +##### Arguments -**Returns:** - The loaded run attributes +- **force**: Force reload even if data is already loaded ---- -### method `Run.log_artifact` -```python -log_artifact( - artifact: 'wandb.Artifact', - aliases: 'Collection[str] | None' = None, - tags: 'Collection[str] | None' = None -) → wandb.Artifact -``` -Declare an artifact as output of a run. +### method log_artifact +```python +self, +artifact: 'wandb.Artifact', +aliases: 'Collection[str] | None' = None, +tags: 'Collection[str] | None' = None +``` +Declare an artifact as output of a run. -**Args:** - - - `artifact` (`Artifact`): An artifact returned from `wandb.Api().artifact(name)`. - - `aliases` (list, optional): Aliases to apply to this artifact. - - `tags`: (list, optional) Tags to apply to this artifact, if any. +##### Arguments +- **artifact**: An artifact returned from `wandb.Api().artifact(name)`. +- **aliases**: Aliases to apply to this artifact. +- **tags**: (list, optional) Tags to apply to this artifact, if any. -**Returns:** - A `Artifact` object. ---- -### method `Run.logged_artifacts` +### method logged_artifacts ```python -logged_artifacts(per_page: 'int' = 100) → public.RunArtifacts +self, +per_page: 'int' = 100 ``` -Fetches all artifacts logged by this run. +Fetches all artifacts logged by this run. -Retrieves all output artifacts that were logged during the run. Returns a paginated result that can be iterated over or collected into a single list. +Retrieves all output artifacts that were logged during the run. Returns a +paginated result that can be iterated over or collected into a single list. +##### Arguments +- **per_page**: Number of artifacts to fetch per API request. -**Args:** - - - `per_page`: Number of artifacts to fetch per API request. -**Returns:** - An iterable collection of all Artifact objects logged as outputs during this run. +##### Examples - - -**Example:** - ```python +```python import wandb import tempfile @@ -559,178 +408,162 @@ finished_run = api.run(f"{run.entity}/{run.project}/{run.id}") for logged_artifact in finished_run.logged_artifacts(): print(logged_artifact.name) -``` - ---- +``` -### method `Run.save` +### method save ```python -save() → None +self ``` -Persist changes to the run object to the W&B backend. +Persist changes to the run object to the W&B backend. ---- -### method `Run.scan_history` -```python -scan_history( - keys: 'list[str] | None' = None, - page_size: 'int' = 1000, - min_step: 'int' = 0, - max_step: 'int | None' = None, - use_cache: 'bool' = True -) → public.HistoryScan -``` -Returns an iterable collection of all history records for a run. +### method scan_history +```python +self, +keys: 'list[str] | None' = None, +page_size: 'int' = 1000, +min_step: 'int' = 0, +max_step: 'int | None' = None, +use_cache: 'bool' = True +``` -**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 an iterable collection of all history records for a run. +##### Arguments +- **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 HistoryScan object, which can be iterator over to get history records. ---- -### method `Run.to_html` + +### method to_html ```python -to_html(height: 'int' = 420, hidden: 'bool' = False) → str +self, +height: 'int' = 420, +hidden: 'bool' = False ``` -Generate HTML containing an iframe displaying this run. +Generate HTML containing an iframe displaying this run. ---- +##### Arguments -### method `Run.update` +- **height**: +- **hidden**: -```python -update() → None -``` -Persist changes to the run object to the wandb backend. ---- -### method `Run.update_state` +### method update ```python -update_state(state: 'str') → bool +self ``` -Update the state of a run. +Persist changes to the run object to the wandb backend. -Supported transitions: - - to `pending` from `running`, `failed`, `crashed`, or `preempted` (e.g. to requeue a terminated or in-progress run) - - to `failed` from `pending` or `running` (e.g. to mark a preempted or lost run as failed) -Sweep runs cannot have their state updated. -See `Run.state` for the list of possible run states. +### method update_state -**Args:** - - - `state`: The target run state. One of `"pending"` or `"failed"`. +```python +self, +state: 'str' +``` +Update the state of a run. +Supported transitions: + - to `pending` from `running`, `failed`, `crashed`, or `preempted` + (e.g. to requeue a terminated or in-progress run) + - to `failed` from `pending` or `running` + (e.g. to mark a preempted or lost run as failed) -**Returns:** - `True` if the state was successfully updated. +Sweep runs cannot have their state updated. +See `Run.state` for the list of possible run states. +##### Arguments -**Raises:** - - - ``wandb.Error``: If the requested state transition is not allowed, or the server does not support this operation. +- **state**: The target run state. One of `"pending"` or `"failed"`. ---- -### method `Run.upload_file` +##### Raises -```python -upload_file(path: 'str', root: 'str' = '.') → public.File -``` +- **`wandb.Error`**: If the requested state transition is not allowed, or the server does not support this operation. -Upload a local file to W&B, associating it with this run. +### method upload_file +```python +self, +path: 'str', +root: 'str' = '.' +``` -**Args:** - - - `path` (str): Path to the file to upload. Can be absolute or relative. - - `root` (str): The root path to save the file relative to. For example, if you want to have the file saved in the run as "my_dir/file.txt" and you're currently in "my_dir" you would set root to "../". Defaults to current directory ("."). +Upload a local file to W&B, associating it with this run. +##### Arguments + +- **path**: Path to the file to upload. Can be absolute or relative. +- **root**: The root path to save the file relative to. For example, if you want to have the file saved in the run as "my_dir/file.txt" and you're currently in "my_dir" you would set root to "../". Defaults to current directory ("."). -**Returns:** - A `File` object representing the uploaded file. ---- -### method `Run.use_artifact` +### method use_artifact ```python -use_artifact( - artifact: 'wandb.Artifact', - use_as: 'str | None' = None -) → wandb.Artifact +self, +artifact: 'wandb.Artifact', +use_as: 'str | None' = None ``` -Declare an artifact as an input to a run. +Declare an artifact as an input to a run. +##### Arguments +- **artifact**: An artifact returned from `wandb.Api().artifact(name)` +- **use_as**: A string identifying how the artifact is used in the script. Used to easily differentiate artifacts used in a run, when using the beta wandb launch feature's artifact swapping functionality. -**Args:** - - - `artifact` (`Artifact`): An artifact returned from `wandb.Api().artifact(name)` - - `use_as` (string, optional): A string identifying how the artifact is used in the script. Used to easily differentiate artifacts used in a run, when using the beta wandb launch feature's artifact swapping functionality. -**Returns:** - An `Artifact` object. - ---- - -### method `Run.used_artifacts` +### method used_artifacts ```python -used_artifacts(per_page: 'int' = 100) → public.RunArtifacts +self, +per_page: 'int' = 100 ``` -Fetches artifacts explicitly used by this run. - -Retrieves only the input artifacts that were explicitly declared as used during the run, typically via `run.use_artifact()`. Returns a paginated result that can be iterated over or collected into a single list. +Fetches artifacts explicitly used by this run. +Retrieves only the input artifacts that were explicitly declared as used +during the run, typically via `run.use_artifact()`. Returns a paginated +result that can be iterated over or collected into a single list. +##### Arguments -**Args:** - - - `per_page`: Number of artifacts to fetch per API request. +- **per_page**: Number of artifacts to fetch per API request. -**Returns:** - An iterable collection of Artifact objects explicitly used as inputs in this run. +##### Examples - -**Example:** - ```python +```python import wandb run = wandb.init(project="artifact-example") @@ -742,15 +575,19 @@ finished_run = api.run(f"{run.entity}/{run.project}/{run.id}") for used_artifact in finished_run.used_artifacts(): print(used_artifact.name) test_artifact -``` - ---- +``` -### method `Run.wait_until_finished` +### method wait_until_finished ```python -wait_until_finished() → None +self ``` -Check the state of the run until it is finished. +Check the state of the run until it is finished. + + + + + + diff --git a/models/ref/python/public-api/runartifacts.mdx b/models/ref/python/public-api/runartifacts.mdx index eedbe04bfe..5d4d696b7b 100644 --- a/models/ref/python/public-api/runartifacts.mdx +++ b/models/ref/python/public-api/runartifacts.mdx @@ -1,32 +1,78 @@ --- title: RunArtifacts -namespace: public_apis_namespace -python_object_type: class +kind: class +namespace: wandb.apis.public.artifacts --- + import { GitHubLink } from '/snippets/_includes/github-source-link.mdx'; - + -## class `RunArtifacts` -An iterable collection of artifacts associated with a specific run. +```python +(service_api: 'ServiceApi', +run: 'Run', +mode: "Literal['logged', 'used']" = 'logged', +per_page: 'int' = 50, +start: 'str | None' = None) +``` +## Description -### property RunArtifacts.cursor +An iterable collection of artifacts associated with a specific run. -An opaque cursor that marks the start of the next page to fetch. -This value may be saved and passed as `start=` to a later paginated query to resume iteration from where this paginator left off. -**Returns:** - - `str | None`: The cursor property value. ---- +## Args + +- **service_api**: +- **run**: +- **mode**: +- **per_page**: +- **start**: + + + + + + +## Methods + +### method convert_objects + +```python +self +``` + +Convert the last fetched response data into the iterated objects. + + + + + +### method next + +```python +self +``` + +Return the next item from the iterator. When exhausted, raise StopIteration + + + + + +### method update_variables + +```python +self +``` -### property RunArtifacts.more +Update the query variables for the next page fetch. diff --git a/models/ref/python/public-api/runs.mdx b/models/ref/python/public-api/runs.mdx index 0efa5fcf9c..636d90d631 100644 --- a/models/ref/python/public-api/runs.mdx +++ b/models/ref/python/public-api/runs.mdx @@ -1,106 +1,120 @@ --- title: Runs -namespace: public_apis_namespace -python_object_type: class +kind: class +namespace: wandb.apis.public.runs --- + import { GitHubLink } from '/snippets/_includes/github-source-link.mdx'; - + -## class `Runs` -A lazy iterator of `Run` objects associated with a project and optional filter. +```python +(service_api: 'ServiceApi', +entity: 'str', +project: 'str', +filters: 'dict[str, Any] | None' = None, +order: 'str' = '+created_at', +per_page: 'int' = 50, +include_sweeps: 'bool' = False, +lazy: 'bool' = True, +api_key: 'str | None' = None) +``` -Runs are retrieved in pages from the W&B server as needed. +## Description -This is generally used indirectly using the `Api.runs` namespace. +A lazy iterator of `Run` objects associated with a project and optional filter. -### method `Runs.__init__` +Runs are retrieved in pages from the W&B server as needed. -```python -__init__( - service_api: 'ServiceApi', - entity: 'str', - project: 'str', - filters: 'dict[str, Any] | None' = None, - order: 'str' = '+created_at', - per_page: 'int' = 50, - include_sweeps: 'bool' = False, - lazy: 'bool' = True, - api_key: 'str | None' = None -) -``` +This is generally used indirectly using the `Api.runs` namespace. -**Args:** - - - `service_api`: The service API to use for requests. - - `entity`: The entity (username or team) that owns the project. - - `project`: The name of the project to fetch runs from. - - `filters`: Filters to apply to the runs query. - - `order`: Order can be `created_at`, `heartbeat_at`, `config.*.value`, or `summary_metrics.*`. If you prepend order with a + order is ascending (default). If you prepend order with a - order is descending. The default order is run.created_at from oldest to newest. - - `per_page`: The number of runs to fetch per request (default is 50). - - `include_sweeps`: Whether to include sweep information in the runs. Defaults to True. +## Args +- **service_api**: The service API to use for requests. +- **entity**: The entity (username or team) that owns the project. +- **project**: The name of the project to fetch runs from. +- **filters**: Filters to apply to the runs query. +- **order**: Order can be `created_at`, `heartbeat_at`, `config.*.value`, or `summary_metrics.*`. If you prepend order with a + order is ascending (default). If you prepend order with a - order is descending. The default order is run.created_at from oldest to newest. +- **per_page**: The number of runs to fetch per request (default is 50). +- **include_sweeps**: Whether to include sweep information in the runs. Defaults to True. +- **lazy**: +- **api_key**: ---- -### property Runs.length +## Methods +### method histories +```python +self, +samples: 'int' = 500, +keys: 'list[str] | None' = None, +x_axis: 'str' = '_step', +format: "Literal['default', 'pandas', 'polars']" = 'default', +stream: "Literal['default', 'system']" = 'default' +``` +Return sampled history metrics for all runs that fit the filters conditions. +##### Arguments ---- +- **samples**: The number of samples to return per run +- **keys**: Only return metrics for specific keys +- **x_axis**: Use this metric as the xAxis defaults to _step +- **format**: Format to return data in, options are "default", "pandas", "polars" +- **stream**: "default" for metrics, "system" for machine metrics -### method `Runs.histories` + +### method next ```python -histories( - samples: 'int' = 500, - keys: 'list[str] | None' = None, - x_axis: 'str' = '_step', - format: "Literal['default', 'pandas', 'polars']" = 'default', - stream: "Literal['default', 'system']" = 'default' -) → list[dict[str, Any]] | pd.DataFrame | pl.DataFrame +self ``` -Return sampled history metrics for all runs that fit the filters conditions. +Return the next item from the iterator. When exhausted, raise StopIteration -**Args:** - - - `samples`: The number of samples to return per run - - `keys`: Only return metrics for specific keys - - `x_axis`: Use this metric as the xAxis defaults to _step - - `format`: Format to return data in, options are "default", "pandas", "polars" - - `stream`: "default" for metrics, "system" for machine metrics -**Returns:** - - - `pandas.DataFrame`: If `format="pandas"`, returns a `pandas.DataFrame` of history metrics. - - `polars.DataFrame`: If `format="polars"`, returns a `polars.DataFrame` of history metrics. - - `list of dicts`: If `format="default"`, returns a list of dicts containing history metrics with a `run_id` key. ---- +### method update_variables -### method `Runs.upgrade_to_full` +```python +self +``` + +Update the query variables for the next page fetch. + + + + + +### method upgrade_to_full ```python -upgrade_to_full() → None +self ``` -Upgrade this Runs collection from lazy to full mode. +Upgrade this Runs collection from lazy to full mode. + +This switches to fetching full run data and +upgrades any already-loaded Run objects to have full data. +Uses parallel loading for better performance when upgrading multiple runs. + + + + + -This switches to fetching full run data and upgrades any already-loaded Run objects to have full data. Uses parallel loading for better performance when upgrading multiple runs. diff --git a/models/ref/python/public-api/sweep.mdx b/models/ref/python/public-api/sweep.mdx index b9a08c83e6..20ec11bd65 100644 --- a/models/ref/python/public-api/sweep.mdx +++ b/models/ref/python/public-api/sweep.mdx @@ -1,190 +1,187 @@ --- title: Sweep -namespace: public_apis_namespace -python_object_type: class +kind: class +namespace: wandb.apis.public.sweeps --- -import { GitHubLink } from '/snippets/_includes/github-source-link.mdx'; - - - - - -## class `Sweep` -The set of runs associated with the sweep. +import { GitHubLink } from '/snippets/_includes/github-source-link.mdx'; + -**Attributes:** - - - `runs` (Runs): List of runs - - `id` (str): Sweep ID - - `project` (str): The name of the project the sweep belongs to - - `config` (dict): Dictionary containing the sweep configuration - - `state` (str): The state of the sweep. Can be "Finished", "Failed", "Crashed", or "Running". - - `expected_run_count` (int): The number of expected runs for the sweep -### method `Sweep.__init__` ```python -__init__( - service_api: 'ServiceApi', - entity: 'str', - project: 'str', - sweep_id: 'str', - attrs: 'Mapping[str, Any] | None' = None -) +(service_api: 'ServiceApi', +entity: 'str', +project: 'str', +sweep_id: 'str', +attrs: 'Mapping[str, Any] | None' = None) ``` +## Description +The set of runs associated with the sweep. +Attributes: + runs (Runs): List of runs + id (str): Sweep ID + project (str): The name of the project the sweep belongs to + config (dict): Dictionary containing the sweep configuration + state (str): The state of the sweep. Can be "Finished", "Failed", + "Crashed", or "Running". + expected_run_count (int): The number of expected runs for the sweep ---- +## Args -### property Sweep.config +- **service_api**: +- **entity**: +- **project**: +- **sweep_id**: +- **attrs**: -The sweep configuration used for the sweep. ---- -### property Sweep.entity -The entity associated with the sweep. +## Properties +### property entity +The entity associated with the sweep. -**Returns:** - - `str`: The entity property value. ---- +### property username -### property Sweep.expected_run_count +Deprecated. Use `Sweep.entity` instead. -Return the number of expected runs in the sweep or None for infinite runs. +### property config +The sweep configuration used for the sweep. +### property order -**Returns:** - - `int | None`: The expected_run_count property value. ---- +Return the order key for the sweep. -### property Sweep.name +### property expected_run_count -The name of the sweep. +Return the number of expected runs in the sweep or None for infinite runs. -Returns the first name that exists in the following priority order: +### property path -1. User-edited display name 2. Name configured at creation time 3. Sweep ID +Returns the path of the project. ---- +The path is a list containing the entity, project name, and sweep ID. -### property Sweep.order +### property url -Return the order key for the sweep. +The URL of the sweep. ---- +The sweep URL is generated from the entity, project, the term +"sweeps", and the sweep ID.run_id. For +SaaS users, it takes the form +of `https://wandb.ai/entity/project/sweeps/sweeps_ID`. -### property Sweep.path +### property name -Returns the path of the project. +The name of the sweep. -The path is a list containing the entity, project name, and sweep ID. +Returns the first name that exists in the following priority order: ---- +1. User-edited display name +2. Name configured at creation time +3. Sweep ID -### property Sweep.url -The URL of the sweep. -The sweep URL is generated from the entity, project, the term "sweeps", and the sweep ID.run_id. For SaaS users, it takes the form of `https://wandb.ai/entity/project/sweeps/sweeps_ID`. +## Methods ---- +### method agent -### property Sweep.username +```python +self, +agent_id: 'str' +``` -Deprecated. Use `Sweep.entity` instead. +Query an agent by ID for this sweep. +##### Arguments +- **agent_id**: The ID of the agent to look up. -**Returns:** - - `str`: The username property value. ---- -### method `Sweep.agent` +### method agents ```python -agent(agent_id: 'str') → Agent +self ``` -Query an agent by ID for this sweep. +Query the list of all agents for this sweep. -**Args:** - - - `agent_id`: The ID of the agent to look up. ---- -### method `Sweep.agents` +### method best_run ```python -agents() → list[Agent] +(self, order=None) ``` -Query the list of all agents for this sweep. +Return the best run sorted by the metric defined in config or the order passed in. ---- +##### Arguments -### method `Sweep.best_run` +- **order**: -```python -best_run(order=None) -``` -Return the best run sorted by the metric defined in config or the order passed in. ---- -### classmethod `Sweep.get` +### method get ```python -get( - api: 'Api', - entity: 'str | None' = None, - project: 'str | None' = None, - sid: 'str | None' = None, - order: 'str | None' = None, - query: 'str | None' = None, - **kwargs -) +(api: 'Api', +entity: 'str | None' = None, +project: 'str | None' = None, +sid: 'str | None' = None, +order: 'str | None' = None, +query: 'str | None' = None, **kwargs) ``` -Execute a query against the cloud backend. +Execute a query against the cloud backend. +##### Arguments +- **api**: The W&B API instance. +- **entity**: The entity (username or team) that owns the project. +- **project**: The name of the project to fetch sweep from. +- **sid**: The sweep ID to query. +- **order**: The order in which the sweep's runs are returned. +- **query**: The query to use to execute the query. +- **kwargs**: -**Args:** - - - `api`: The W&B API instance. - - `entity`: The entity (username or team) that owns the project. - - `project`: The name of the project to fetch sweep from. - - `sid`: The sweep ID to query. - - `order`: The order in which the sweep's runs are returned. - - `query`: The query to use to execute the query. - - `**kwargs`: Additional keyword arguments to pass to the query. ---- -### method `Sweep.to_html` +### method to_html ```python -to_html(height: 'int' = 420, hidden: 'bool' = False) → str +self, +height: 'int' = 420, +hidden: 'bool' = False ``` -Generate HTML containing an iframe displaying this sweep. +Generate HTML containing an iframe displaying this sweep. + +##### Arguments + +- **height**: +- **hidden**: + + + + + diff --git a/models/ref/python/public-api/sweeps.mdx b/models/ref/python/public-api/sweeps.mdx index 20fc78c228..30be4de65d 100644 --- a/models/ref/python/public-api/sweeps.mdx +++ b/models/ref/python/public-api/sweeps.mdx @@ -1,66 +1,79 @@ --- title: Sweeps -namespace: public_apis_namespace -python_object_type: class +kind: class +namespace: wandb.apis.public.sweeps --- + import { GitHubLink } from '/snippets/_includes/github-source-link.mdx'; - + + + + + +```python +service_api: 'ServiceApi', +entity: 'str', +project: 'str', +per_page: 'int' = 50 +``` + +## Description + +A lazy iterator over a collection of `Sweep` objects. +## Args -## class `Sweeps` -A lazy iterator over a collection of `Sweep` objects. +- **service_api**: +- **entity**: +- **project**: +- **per_page**: +## Examples -**Examples:** - ```python +```python 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("----------") -``` + print(f"Sweep name: {sweep.name}") + print(f"Sweep ID: {sweep.id}") + print(f"Sweep URL: {sweep.url}") + print("----------") +``` + + + +## Methods -### method `Sweeps.__init__` +### method next ```python -__init__( - service_api: 'ServiceApi', - entity: 'str', - project: 'str', - per_page: 'int' = 50 -) → Sweeps +self ``` -An iterable collection of `Sweep` objects. +Return the next item from the iterator. When exhausted, raise StopIteration -**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. ---- +### method update_variables +```python +self +``` -### property Sweeps.length +Update the query variables for the next page fetch. ---- diff --git a/models/ref/python/public-api/team.mdx b/models/ref/python/public-api/team.mdx index 9d9dcce332..5e79460b82 100644 --- a/models/ref/python/public-api/team.mdx +++ b/models/ref/python/public-api/team.mdx @@ -1,115 +1,97 @@ --- title: Team -namespace: public_apis_namespace -python_object_type: class +kind: class +namespace: wandb.apis.public.teams --- -import { GitHubLink } from '/snippets/_includes/github-source-link.mdx'; - - - +import { GitHubLink } from '/snippets/_includes/github-source-link.mdx'; -## class `Team` -A class that represents a W&B team. + -This class provides methods to manage W&B teams, including creating teams, inviting members, and managing service accounts. It inherits from Attrs to handle team attributes. -### method `Team.__init__` ```python -__init__( - service_api: 'ServiceApi', - name: 'str', - attrs: 'Mapping[str, Any] | None' = None -) +(service_api: 'ServiceApi', +name: 'str', +attrs: 'Mapping[str, Any] | None' = None) ``` -**Args:** - - - `service_api`: The service API instance to use for querying W&B. - - `name` (str): The name of the team - - `attrs` (dict): Optional dictionary of team attributes +## Description +A class that represents a W&B team. +This class provides methods to manage W&B teams, including creating teams, +inviting members, and managing service accounts. It inherits from Attrs +to handle team attributes. -**Note:** -> Team management requires appropriate permissions. +## Args +- **service_api**: The service API instance to use for querying W&B. +- **name**: The name of the team +- **attrs**: Optional dictionary of team attributes +## Methods ---- - -### classmethod `Team.create` +### method create ```python -create(api: 'Api', team: 'str', admin_username: 'str | None' = None) → Team +api: 'Api', +team: 'str', +admin_username: 'str | None' = None ``` -Create a new team. +Create a new team. +##### Arguments +- **api**: (`Api`) The api instance to use +- **team**: (str) The name of the team +- **admin_username**: (str) optional username of the admin user of the team, defaults to the current user. -**Args:** - - - `api`: (`Api`) The api instance to use - - `team`: (str) The name of the team - - `admin_username`: (str) optional username of the admin user of the team, defaults to the current user. -**Returns:** - A `Team` object - ---- - -### method `Team.create_service_account` +### method create_service_account ```python -create_service_account(description: 'str') → Member | None +self, +description: 'str' ``` -Create a service account for the team. - +Create a service account for the team. +##### Arguments -**Args:** - - - `description`: (str) A description for this service account +- **description**: (str) A description for this service account -**Returns:** - The service account `Member` object, or None on failure ---- - -### method `Team.invite` +### method invite ```python -invite(username_or_email: 'str', admin: 'bool' = False) → bool +self, +username_or_email: 'str', +admin: 'bool' = False ``` -Invite a user to a team. +Invite a user to a team. +##### Arguments +- **username_or_email**: (str) The username or email address of the user you want to invite. +- **admin**: (bool) Whether to make this user a team admin. Defaults to `False`. -**Args:** - - - `username_or_email`: (str) The username or email address of the user you want to invite. - - `admin`: (bool) Whether to make this user a team admin. Defaults to `False`. -**Returns:** - `True` on success, `False` if user was already invited or didn't exist. ---- diff --git a/models/ref/python/public-api/user.mdx b/models/ref/python/public-api/user.mdx index 70145c41e3..8b81c2a4d3 100644 --- a/models/ref/python/public-api/user.mdx +++ b/models/ref/python/public-api/user.mdx @@ -1,106 +1,124 @@ --- title: User -namespace: public_apis_namespace -python_object_type: class +kind: class +namespace: wandb.apis.public.users --- + import { GitHubLink } from '/snippets/_includes/github-source-link.mdx'; - + -## class `User` -A user on a W&B instance. +```python +(service_api: 'ServiceApi', +attrs: 'MutableMapping[str, Any]', +api_key: 'str | None' = None) +``` -This allows managing a user's API keys and accessing information like team memberships. The `create` class method can be used to create a new user. +## Description +A user on a W&B instance. +This allows managing a user's API keys and accessing information like +team memberships. The `create` class method can be used to create a new +user. -**Args:** - - - `service_api`: The service API instance to use for querying W&B. - - `attrs`: A subset of the User type in the GraphQL schema. -### property User.api_keys +## Args -Names of the user's API keys. +- **service_api**: The service API instance to use for querying W&B. +- **attrs**: A subset of the User type in the GraphQL schema. +- **api_key**: -This property returns the names of the the API keys, *not* the secret associated with the key. The name of the key cannot be used as an API key. -The list is empty if the user has no API keys or if API keys have not been loaded. +## Properties -**Returns:** - - `list[str]`: The api_keys property value. ---- +### property user_api -### property User.teams +A `wandb.Api` instance using the user's credentials. -Names of the user's teams. +### property api_keys -This is an empty list if the user has no team memberships or if teams data was not loaded. +Names of the user's API keys. +This property returns the names of the the API keys, *not* the secret +associated with the key. The name of the key cannot be used as an API +key. +The list is empty if the user has no API keys or if API keys have not +been loaded. -**Returns:** - - `list[str]`: The teams property value. ---- +### property teams -### property User.user_api +Names of the user's teams. -A `wandb.Api` instance using the user's credentials. +This is an empty list if the user has no team memberships or if teams +data was not loaded. +## Methods +### method create -**Returns:** - - `Api | None`: The user_api property value. ---- +```python +api: 'Api', +email: 'str', +admin: 'bool | None' = False +``` +Create a new user. -### method `User.delete_api_key` +This is an internal method. Use the `create_user()` method of +`wandb.Api` instead. -```python -delete_api_key(api_key: 'str') → bool -``` +##### Arguments -Delete a user's API key. +- **api**: The API instance to use to create the user. +- **email**: The email for the user. +- **admin**: Whether this user should be a global instance admin. -Only the owner of the key or an admin can delete it. -**Args:** - - - `api_key`: The name of the API key to delete. Use one of the names returned by the `api_keys` property. +### method delete_api_key +```python +self, +api_key: 'str' +``` +Delete a user's API key. -**Returns:** - True on success, false on failure. +Only the owner of the key or an admin can delete it. ---- +##### Arguments + +- **api_key**: The name of the API key to delete. Use one of the names returned by the `api_keys` property. -### method `User.generate_api_key` + + + +### method generate_api_key ```python -generate_api_key(description: 'str | None' = None) → str | None +self, +description: 'str | None' = None ``` -Generate a new API key. +Generate a new API key. + +##### Arguments +- **description**: A description for the new API key. This can be used to identify the purpose of the API key. -**Args:** - - - `description`: A description for the new API key. This can be used to identify the purpose of the API key. -**Returns:** - The generated API key (the full secret, not just the name), or None on failure. From eab22db797fe36ea86bb31e4348bac11a3368367 Mon Sep 17 00:00:00 2001 From: Noah Luna <15202580+ngrayluna@users.noreply.github.com> Date: Wed, 24 Jun 2026 09:13:41 -0700 Subject: [PATCH 2/9] remove old agent file --- docs.json | 3 +- models/ref/python/data-types/box3d.mdx | 104 -------------------- models/ref/python/experiments/settings.mdx | 2 +- models/ref/python/functions/agent.mdx | 39 -------- models/ref/python/functions/box3d.mdx | 107 +++++++++++++++++++++ 5 files changed, 109 insertions(+), 146 deletions(-) delete mode 100644 models/ref/python/data-types/box3d.mdx delete mode 100644 models/ref/python/functions/agent.mdx create mode 100644 models/ref/python/functions/box3d.mdx diff --git a/docs.json b/docs.json index 5c9705376a..4ac47a4633 100644 --- a/docs.json +++ b/docs.json @@ -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", @@ -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", diff --git a/models/ref/python/data-types/box3d.mdx b/models/ref/python/data-types/box3d.mdx deleted file mode 100644 index 731f65ee43..0000000000 --- a/models/ref/python/data-types/box3d.mdx +++ /dev/null @@ -1,104 +0,0 @@ ---- -title: box3d() -namespace: python_sdk_data_type -python_object_type: function ---- -import { GitHubLink } from '/snippets/_includes/github-source-link.mdx'; - - - - - - -### function `box3d` - -```python -box3d( - center: 'npt.ArrayLike', - size: 'npt.ArrayLike', - orientation: 'npt.ArrayLike', - color: 'RGBColor', - label: 'str | None' = None, - score: 'numeric | None' = None -) → Box3D -``` - -A 3D bounding box. The box is specified by its center, size and orientation. - - - -**Args:** - - - `center`: The center point of the box as a length-3 ndarray. - - `size`: The box's X, Y and Z dimensions as a length-3 ndarray. - - `orientation`: The rotation transforming global XYZ coordinates into the box's local XYZ coordinates, given as a length-4 ndarray [r, x, y, z] corresponding to the non-zero quaternion r + xi + yj + zk. - - `color`: The box's color as an (r, g, b) tuple with `0 <= r,g,b <= 1`. - - `label`: An optional label for the box. - - `score`: An optional score for the box. Typically used to indicate the confidence of a detection. - - - -**Returns:** - A Box3D object. - - - -**Example:** - The following example creates a point cloud with 60 boxes rotating around the X, Y and Z axes. - -```python -import wandb - -import math -import numpy as np -from scipy.spatial.transform import Rotation - - -with wandb.init() as run: - run.log( - { - "points": wandb.Object3D.from_point_cloud( - points=np.random.uniform(-5, 5, size=(100, 3)), - boxes=[ - wandb.box3d( - center=(0.3 * t - 3, 0, 0), - size=(0.1, 0.1, 0.1), - orientation=Rotation.from_euler( - "xyz", [t * math.pi / 10, 0, 0] - ).as_quat(), - color=(0.5 + t / 40, 0.5, 0.5), - label=f"box {t}", - score=0.9, - ) - for t in range(20) - ] - + [ - wandb.box3d( - center=(0, 0.3 * t - 3, 0.3), - size=(0.1, 0.1, 0.1), - orientation=Rotation.from_euler( - "xyz", [0, t * math.pi / 10, 0] - ).as_quat(), - color=(0.5, 0.5 + t / 40, 0.5), - label=f"box {t}", - score=0.9, - ) - for t in range(20) - ] - + [ - wandb.box3d( - center=(0.3, 0.3, 0.3 * t - 3), - size=(0.1, 0.1, 0.1), - orientation=Rotation.from_euler( - "xyz", [0, 0, t * math.pi / 10] - ).as_quat(), - color=(0.5, 0.5, 0.5 + t / 40), - label=f"box {t}", - score=0.9, - ) - for t in range(20) - ], - ), - } - ) -``` diff --git a/models/ref/python/experiments/settings.mdx b/models/ref/python/experiments/settings.mdx index 97561e8c9b..9e367726af 100644 --- a/models/ref/python/experiments/settings.mdx +++ b/models/ref/python/experiments/settings.mdx @@ -146,7 +146,7 @@ x_service_transport: str | None = None, x_service_wait: float = 30.0, x_skip_transaction_log: bool = False, x_start_time: float | None = None, -x_stats_pid: int = 16446, +x_stats_pid: int = 67606, x_stats_sampling_interval: float = 15.0, x_stats_neuron_monitor_config_path: str | None = None, x_stats_dcgm_exporter: str | None = None, diff --git a/models/ref/python/functions/agent.mdx b/models/ref/python/functions/agent.mdx deleted file mode 100644 index a1b6d2e413..0000000000 --- a/models/ref/python/functions/agent.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -title: agent() -namespace: python_sdk_actions -python_object_type: function ---- -import { GitHubLink } from '/snippets/_includes/github-source-link.mdx'; - - - - - - -### function `agent` - -```python -agent( - sweep_id: 'str', - function: 'Callable | None' = None, - entity: 'str | None' = None, - project: 'str | None' = None, - count: 'int | None' = None, - forward_signals: 'bool' = False -) → None -``` - -Start one or more sweep agents. - -The sweep agent uses the `sweep_id` to know which sweep it is a part of, what function to execute, and (optionally) how many agents to run. - - - -**Args:** - - - `sweep_id`: The unique identifier for a sweep. A sweep ID is generated by W&B CLI or Python SDK. - - `function`: A function to call instead of the "program" specified in the sweep config. - - `entity`: The username or team name where you want to send W&B runs created by the sweep to. Ensure that the entity you specify already exists. If you don't specify an entity, the run will be sent to your default entity, which is usually your username. - - `project`: The name of the project where W&B runs created from the sweep are sent to. If the project is not specified, the run is sent to a project labeled "Uncategorized". - - `count`: The number of sweep config trials to try. - - `forward_signals`: Whether to forward signals the agent receives to the child processes. Only supported by CLI agent. diff --git a/models/ref/python/functions/box3d.mdx b/models/ref/python/functions/box3d.mdx new file mode 100644 index 0000000000..925ba94676 --- /dev/null +++ b/models/ref/python/functions/box3d.mdx @@ -0,0 +1,107 @@ +--- +title: box3d() +kind: function +namespace: wandb.sdk.data_types.object_3d +--- + +import { GitHubLink } from '/snippets/_includes/github-source-link.mdx'; + + + + + + +```python +*, +center: 'npt.ArrayLike', +size: 'npt.ArrayLike', +orientation: 'npt.ArrayLike', +color: 'RGBColor', +label: 'str | None' = None, +score: 'numeric | None' = None +``` + +## Description + +A 3D bounding box. The box is specified by its center, size and orientation. + + + +## Args + +- **center**: The center point of the box as a length-3 ndarray. +- **size**: The box's X, Y and Z dimensions as a length-3 ndarray. +- **orientation**: The rotation transforming global XYZ coordinates into the box's local XYZ coordinates, given as a length-4 ndarray [r, x, y, z] corresponding to the non-zero quaternion r + xi + yj + zk. +- **color**: The box's color as an (r, g, b) tuple with `0 <= r,g,b <= 1`. +- **label**: An optional label for the box. +- **score**: An optional score for the box. Typically used to indicate the confidence of a detection. + + +## Returns + +A Box3D object. + + + +## Examples + +The following example creates a point cloud with 60 boxes rotating +around the X, Y and Z axes. + +```python +import wandb + +import math +import numpy as np +from scipy.spatial.transform import Rotation + + +with wandb.init() as run: + run.log( + { + "points": wandb.Object3D.from_point_cloud( + points=np.random.uniform(-5, 5, size=(100, 3)), + boxes=[ + wandb.box3d( + center=(0.3 * t - 3, 0, 0), + size=(0.1, 0.1, 0.1), + orientation=Rotation.from_euler( + "xyz", [t * math.pi / 10, 0, 0] + ).as_quat(), + color=(0.5 + t / 40, 0.5, 0.5), + label=f"box {t}", + score=0.9, + ) + for t in range(20) + ] + + [ + wandb.box3d( + center=(0, 0.3 * t - 3, 0.3), + size=(0.1, 0.1, 0.1), + orientation=Rotation.from_euler( + "xyz", [0, t * math.pi / 10, 0] + ).as_quat(), + color=(0.5, 0.5 + t / 40, 0.5), + label=f"box {t}", + score=0.9, + ) + for t in range(20) + ] + + [ + wandb.box3d( + center=(0.3, 0.3, 0.3 * t - 3), + size=(0.1, 0.1, 0.1), + orientation=Rotation.from_euler( + "xyz", [0, 0, t * math.pi / 10] + ).as_quat(), + color=(0.5, 0.5, 0.5 + t / 40), + label=f"box {t}", + score=0.9, + ) + for t in range(20) + ], + ), + } + ) +``` + From 0341aebc3b4d0363e0a254f1105a7ea76693d6bd Mon Sep 17 00:00:00 2001 From: Noah Luna <15202580+ngrayluna@users.noreply.github.com> Date: Wed, 24 Jun 2026 10:21:51 -0700 Subject: [PATCH 3/9] function, class title updates --- models/ref/python/automations/automation.mdx | 175 +++--- models/ref/python/automations/donothing.mdx | 159 +++--- .../python/automations/metricchangefilter.mdx | 171 +++--- .../automations/metricthresholdfilter.mdx | 165 +++--- .../python/automations/metriczscorefilter.mdx | 163 +++--- .../ref/python/automations/newautomation.mdx | 165 +++--- .../python/automations/onaddartifactalias.mdx | 163 +++--- .../python/automations/onaddartifacttag.mdx | 163 +++--- .../python/automations/onaddcollectiontag.mdx | 163 +++--- .../python/automations/oncreateartifact.mdx | 163 +++--- .../ref/python/automations/onlinkartifact.mdx | 163 +++--- .../automations/onremoveartifacttag.mdx | 163 +++--- .../automations/onremovecollectiontag.mdx | 163 +++--- models/ref/python/automations/onrunmetric.mdx | 163 +++--- models/ref/python/automations/onrunstate.mdx | 163 +++--- .../python/automations/onunlinkartifact.mdx | 163 +++--- .../ref/python/automations/runstatefilter.mdx | 159 +++--- .../python/automations/sendnotification.mdx | 173 +++--- models/ref/python/automations/sendwebhook.mdx | 165 +++--- models/ref/python/custom-charts/bar.mdx | 11 +- .../python/custom-charts/confusion_matrix.mdx | 17 +- models/ref/python/custom-charts/histogram.mdx | 9 +- models/ref/python/custom-charts/line.mdx | 13 +- .../ref/python/custom-charts/line_series.mdx | 13 +- .../ref/python/custom-charts/plot_table.mdx | 13 +- models/ref/python/custom-charts/pr_curve.mdx | 17 +- models/ref/python/custom-charts/roc_curve.mdx | 15 +- models/ref/python/custom-charts/scatter.mdx | 11 +- models/ref/python/data-types/audio.mdx | 21 +- models/ref/python/data-types/evaltable.mdx | 59 +- models/ref/python/data-types/histogram.mdx | 19 +- models/ref/python/data-types/html.mdx | 29 +- models/ref/python/data-types/image.mdx | 31 +- models/ref/python/data-types/molecule.mdx | 51 +- models/ref/python/data-types/object3d.mdx | 47 +- models/ref/python/data-types/plotly.mdx | 29 +- models/ref/python/data-types/table.mdx | 51 +- models/ref/python/data-types/video.mdx | 35 +- models/ref/python/experiments/artifact.mdx | 153 +++--- models/ref/python/experiments/run.mdx | 163 +++--- models/ref/python/experiments/settings.mdx | 511 +++++++++--------- models/ref/python/functions/box3d.mdx | 13 +- models/ref/python/functions/controller.mdx | 7 +- models/ref/python/functions/finish.mdx | 5 +- models/ref/python/functions/init.mdx | 61 ++- models/ref/python/functions/login.mdx | 21 +- models/ref/python/functions/restore.mdx | 13 +- models/ref/python/functions/setup.mdx | 3 +- models/ref/python/functions/sweep.mdx | 9 +- models/ref/python/functions/teardown.mdx | 3 +- models/ref/python/public-api/agentruns.mdx | 17 +- models/ref/python/public-api/api.mdx | 263 ++++----- .../python/public-api/artifactcollection.mdx | 21 +- .../python/public-api/artifactcollections.mdx | 17 +- .../ref/python/public-api/artifactfiles.mdx | 11 +- models/ref/python/public-api/artifacts.mdx | 21 +- models/ref/python/public-api/artifacttype.mdx | 21 +- .../ref/python/public-api/artifacttypes.mdx | 11 +- models/ref/python/public-api/automations.mdx | 19 +- models/ref/python/public-api/betareport.mdx | 19 +- .../public-api/downloadhistoryresult.mdx | 7 +- models/ref/python/public-api/file.mdx | 15 +- models/ref/python/public-api/files.mdx | 13 +- .../public-api/incompleterunhistoryerror.mdx | 1 + models/ref/python/public-api/member.mdx | 7 +- models/ref/python/public-api/project.mdx | 19 +- .../public-api/projectartifactcollections.mdx | 15 +- models/ref/python/public-api/projects.mdx | 7 +- models/ref/python/public-api/registry.mdx | 57 +- models/ref/python/public-api/reports.mdx | 11 +- models/ref/python/public-api/run.mdx | 105 ++-- models/ref/python/public-api/runartifacts.mdx | 11 +- models/ref/python/public-api/runs.mdx | 29 +- models/ref/python/public-api/sweep.mdx | 33 +- models/ref/python/public-api/sweeps.mdx | 9 +- models/ref/python/public-api/team.mdx | 19 +- models/ref/python/public-api/user.mdx | 17 +- 77 files changed, 2725 insertions(+), 2648 deletions(-) diff --git a/models/ref/python/automations/automation.mdx b/models/ref/python/automations/automation.mdx index 6dced1738c..5b54edc6bd 100644 --- a/models/ref/python/automations/automation.mdx +++ b/models/ref/python/automations/automation.mdx @@ -11,6 +11,7 @@ import { GitHubLink } from '/snippets/_includes/github-source-link.mdx'; +## class Automation ```python *, __typename: Literal['Trigger'] = 'Trigger', @@ -33,16 +34,16 @@ A local instance of a saved W&B automation that supports editing. ## Args -- **__typename**: -- **id**: -- **createdAt**: -- **updatedAt**: -- **name**: -- **description**: -- **enabled**: -- **scope**: -- **event**: -- **action**: +- `__typename`: +- `id`: +- `createdAt`: +- `updatedAt`: +- `name`: +- `description`: +- `enabled`: +- `scope`: +- `event`: +- `action`: @@ -61,8 +62,8 @@ _fields_set: 'set[str] | None' = None, **values: 'Any' ##### Arguments -- **_fields_set**: -- **values**: +- `_fields_set`: +- `values`: @@ -92,10 +93,10 @@ copied = self.model_validate(data) ##### Arguments -- **include**: Optional set or mapping specifying which fields to include in the copied model. -- **exclude**: Optional set or mapping specifying which fields to exclude in the copied model. -- **update**: Optional dictionary of field-value pairs to override field values in the copied model. -- **deep**: If True, the values of fields that are Pydantic models will be deep-copied. +- `include`: Optional set or mapping specifying which fields to include in the copied model. +- `exclude`: Optional set or mapping specifying which fields to exclude in the copied model. +- `update`: Optional dictionary of field-value pairs to override field values in the copied model. +- `deep`: If True, the values of fields that are Pydantic models will be deep-copied. @@ -116,12 +117,12 @@ exclude_none: 'bool' = False ##### Arguments -- **include**: -- **exclude**: -- **by_alias**: -- **exclude_unset**: -- **exclude_defaults**: -- **exclude_none**: +- `include`: +- `exclude`: +- `by_alias`: +- `exclude_unset`: +- `exclude_defaults`: +- `exclude_none`: @@ -136,7 +137,7 @@ obj: 'Any' ##### Arguments -- **obj**: +- `obj`: @@ -159,15 +160,15 @@ models_as_dict: 'bool' = PydanticUndefined, **dumps_kwargs: 'Any' ##### Arguments -- **include**: -- **exclude**: -- **by_alias**: -- **exclude_unset**: -- **exclude_defaults**: -- **exclude_none**: -- **encoder**: -- **models_as_dict**: -- **dumps_kwargs**: +- `include`: +- `exclude`: +- `by_alias`: +- `exclude_unset`: +- `exclude_defaults`: +- `exclude_none`: +- `encoder`: +- `models_as_dict`: +- `dumps_kwargs`: @@ -192,8 +193,8 @@ Default values are respected, but no other validation is performed. ##### Arguments -- **_fields_set**: A set of field names that were originally explicitly set during instantiation. If provided, this is directly used for the [`model_fields_set`][pydantic.BaseModel.model_fields_set] attribute. Otherwise, the field names from the `values` argument will be used. -- **values**: Trusted or pre-validated data dictionary. +- `_fields_set`: A set of field names that were originally explicitly set during instantiation. If provided, this is directly used for the [`model_fields_set`][pydantic.BaseModel.model_fields_set] attribute. Otherwise, the field names from the `values` argument will be used. +- `values`: Trusted or pre-validated data dictionary. @@ -218,8 +219,8 @@ Returns a copy of the model. ##### Arguments -- **update**: Values to change/add in the new model. Note: the data is not validated before creating the new model. You should trust this data. -- **deep**: Set to `True` to make a deep copy of the model. +- `update`: Values to change/add in the new model. Note: the data is not validated before creating the new model. You should trust this data. +- `deep`: Set to `True` to make a deep copy of the model. @@ -238,8 +239,8 @@ Generate a dictionary representation of the model, optionally specifying which f ##### Arguments -- **mode**: The mode in which `to_python` should run. If mode is 'json', the output will only contain JSON serializable types. If mode is 'python', the output may contain non-JSON-serializable Python objects. -- **kwargs**: +- `mode`: The mode in which `to_python` should run. If mode is 'json', the output will only contain JSON serializable types. If mode is 'python', the output may contain non-JSON-serializable Python objects. +- `kwargs`: @@ -258,8 +259,8 @@ Generates a JSON representation of the model using Pydantic's `to_json` method. ##### Arguments -- **indent**: Indentation to use in the JSON output. If None is passed, the output will be compact. -- **kwargs**: +- `indent`: Indentation to use in the JSON output. If None is passed, the output will be compact. +- `kwargs`: @@ -277,10 +278,10 @@ Generates a JSON schema for a model class. ##### Arguments -- **by_alias**: Whether to use attribute aliases or not. -- **ref_template**: The reference template. -- **schema_generator**: To override the logic used to generate the JSON schema, as a subclass of `GenerateJsonSchema` with your desired modifications -- **mode**: The mode in which to generate the schema. +- `by_alias`: Whether to use attribute aliases or not. +- `ref_template`: The reference template. +- `schema_generator`: To override the logic used to generate the JSON schema, as a subclass of `GenerateJsonSchema` with your desired modifications +- `mode`: The mode in which to generate the schema. @@ -297,12 +298,12 @@ This method can be overridden to achieve a custom naming scheme for generic Base ##### Arguments -- **params**: Tuple of types of the class. Given a generic class `Model` with 2 type variables and a concrete model `Model[str, int]`, the value `(str, int)` would be passed to `params`. +- `params`: Tuple of types of the class. Given a generic class `Model` with 2 type variables and a concrete model `Model[str, int]`, the value `(str, int)` would be passed to `params`. ##### Raises -- **TypeError**: Raised when trying to generate concrete names for non-generic models. +- `TypeError`: Raised when trying to generate concrete names for non-generic models. ### method model_post_init @@ -317,7 +318,7 @@ This is useful if you want to do some validation that requires the entire model ##### Arguments -- **context**: +- `context`: @@ -339,10 +340,10 @@ the initial attempt to build the schema, and automatic rebuilding fails. ##### Arguments -- **force**: Whether to force the rebuilding of the model schema, defaults to `False`. -- **raise_errors**: Whether to raise errors, defaults to `True`. -- **_parent_namespace_depth**: The depth level of the parent namespace, defaults to 2. -- **_types_namespace**: The types namespace, defaults to `None`. +- `force`: Whether to force the rebuilding of the model schema, defaults to `False`. +- `raise_errors`: Whether to raise errors, defaults to `True`. +- `_parent_namespace_depth`: The depth level of the parent namespace, defaults to 2. +- `_types_namespace`: The types namespace, defaults to `None`. @@ -362,17 +363,17 @@ Validate a pydantic model instance. ##### Arguments -- **obj**: The object to validate. -- **strict**: Whether to enforce types strictly. -- **from_attributes**: Whether to extract data from object attributes. -- **context**: Additional context to pass to the validator. -- **by_alias**: Whether to use the field's alias when validating against the provided input data. -- **by_name**: Whether to use the field's name when validating against the provided input data. +- `obj`: The object to validate. +- `strict`: Whether to enforce types strictly. +- `from_attributes`: Whether to extract data from object attributes. +- `context`: Additional context to pass to the validator. +- `by_alias`: Whether to use the field's alias when validating against the provided input data. +- `by_name`: Whether to use the field's name when validating against the provided input data. ##### Raises -- **ValidationError**: If the object could not be validated. +- `ValidationError`: If the object could not be validated. ### method model_validate_json @@ -392,16 +393,16 @@ Validate the given JSON data against the Pydantic model. ##### Arguments -- **json_data**: The JSON data to validate. -- **strict**: Whether to enforce types strictly. -- **context**: Extra variables to pass to the validator. -- **by_alias**: Whether to use the field's alias when validating against the provided input data. -- **by_name**: Whether to use the field's name when validating against the provided input data. +- `json_data`: The JSON data to validate. +- `strict`: Whether to enforce types strictly. +- `context`: Extra variables to pass to the validator. +- `by_alias`: Whether to use the field's alias when validating against the provided input data. +- `by_name`: Whether to use the field's name when validating against the provided input data. ##### Raises -- **ValidationError**: If `json_data` is not a JSON string or the object could not be validated. +- `ValidationError`: If `json_data` is not a JSON string or the object could not be validated. ### method model_validate_strings @@ -418,11 +419,11 @@ Validate the given object with string data against the Pydantic model. ##### Arguments -- **obj**: The object containing string data to validate. -- **strict**: Whether to enforce types strictly. -- **context**: Extra variables to pass to the validator. -- **by_alias**: Whether to use the field's alias when validating against the provided input data. -- **by_name**: Whether to use the field's name when validating against the provided input data. +- `obj`: The object containing string data to validate. +- `strict`: Whether to enforce types strictly. +- `context`: Extra variables to pass to the validator. +- `by_alias`: Whether to use the field's alias when validating against the provided input data. +- `by_name`: Whether to use the field's name when validating against the provided input data. @@ -441,11 +442,11 @@ allow_pickle: 'bool' = False ##### Arguments -- **path**: -- **content_type**: -- **encoding**: -- **proto**: -- **allow_pickle**: +- `path`: +- `content_type`: +- `encoding`: +- `proto`: +- `allow_pickle`: @@ -460,7 +461,7 @@ obj: 'Any' ##### Arguments -- **obj**: +- `obj`: @@ -479,11 +480,11 @@ allow_pickle: 'bool' = False ##### Arguments -- **b**: -- **content_type**: -- **encoding**: -- **proto**: -- **allow_pickle**: +- `b`: +- `content_type`: +- `encoding`: +- `proto`: +- `allow_pickle`: @@ -499,8 +500,8 @@ ref_template: 'str' = '#/$defs/{model}' ##### Arguments -- **by_alias**: -- **ref_template**: +- `by_alias`: +- `ref_template`: @@ -517,9 +518,9 @@ ref_template: 'str' = '#/$defs/{model}', **dumps_kwargs: 'Any' ##### Arguments -- **by_alias**: -- **ref_template**: -- **dumps_kwargs**: +- `by_alias`: +- `ref_template`: +- `dumps_kwargs`: @@ -534,7 +535,7 @@ ref_template: 'str' = '#/$defs/{model}', **dumps_kwargs: 'Any' ##### Arguments -- **localns**: +- `localns`: @@ -549,7 +550,7 @@ value: 'Any' ##### Arguments -- **value**: +- `value`: diff --git a/models/ref/python/automations/donothing.mdx b/models/ref/python/automations/donothing.mdx index 21e3da1f45..f4757c6d38 100644 --- a/models/ref/python/automations/donothing.mdx +++ b/models/ref/python/automations/donothing.mdx @@ -11,6 +11,7 @@ import { GitHubLink } from '/snippets/_includes/github-source-link.mdx'; +## class DoNothing ```python *, no_op: typing.Annotated[bool, BeforeValidator(func=, json_schema_input_type=PydanticUndefined)] = True, @@ -25,8 +26,8 @@ Defines an automation action that intentionally does nothing. ## Args -- **no_op**: -- **action_type**: +- `no_op`: +- `action_type`: @@ -45,8 +46,8 @@ _fields_set: 'set[str] | None' = None, **values: 'Any' ##### Arguments -- **_fields_set**: -- **values**: +- `_fields_set`: +- `values`: @@ -76,10 +77,10 @@ copied = self.model_validate(data) ##### Arguments -- **include**: Optional set or mapping specifying which fields to include in the copied model. -- **exclude**: Optional set or mapping specifying which fields to exclude in the copied model. -- **update**: Optional dictionary of field-value pairs to override field values in the copied model. -- **deep**: If True, the values of fields that are Pydantic models will be deep-copied. +- `include`: Optional set or mapping specifying which fields to include in the copied model. +- `exclude`: Optional set or mapping specifying which fields to exclude in the copied model. +- `update`: Optional dictionary of field-value pairs to override field values in the copied model. +- `deep`: If True, the values of fields that are Pydantic models will be deep-copied. @@ -100,12 +101,12 @@ exclude_none: 'bool' = False ##### Arguments -- **include**: -- **exclude**: -- **by_alias**: -- **exclude_unset**: -- **exclude_defaults**: -- **exclude_none**: +- `include`: +- `exclude`: +- `by_alias`: +- `exclude_unset`: +- `exclude_defaults`: +- `exclude_none`: @@ -120,7 +121,7 @@ obj: 'Any' ##### Arguments -- **obj**: +- `obj`: @@ -143,15 +144,15 @@ models_as_dict: 'bool' = PydanticUndefined, **dumps_kwargs: 'Any' ##### Arguments -- **include**: -- **exclude**: -- **by_alias**: -- **exclude_unset**: -- **exclude_defaults**: -- **exclude_none**: -- **encoder**: -- **models_as_dict**: -- **dumps_kwargs**: +- `include`: +- `exclude`: +- `by_alias`: +- `exclude_unset`: +- `exclude_defaults`: +- `exclude_none`: +- `encoder`: +- `models_as_dict`: +- `dumps_kwargs`: @@ -176,8 +177,8 @@ Default values are respected, but no other validation is performed. ##### Arguments -- **_fields_set**: A set of field names that were originally explicitly set during instantiation. If provided, this is directly used for the [`model_fields_set`][pydantic.BaseModel.model_fields_set] attribute. Otherwise, the field names from the `values` argument will be used. -- **values**: Trusted or pre-validated data dictionary. +- `_fields_set`: A set of field names that were originally explicitly set during instantiation. If provided, this is directly used for the [`model_fields_set`][pydantic.BaseModel.model_fields_set] attribute. Otherwise, the field names from the `values` argument will be used. +- `values`: Trusted or pre-validated data dictionary. @@ -202,8 +203,8 @@ Returns a copy of the model. ##### Arguments -- **update**: Values to change/add in the new model. Note: the data is not validated before creating the new model. You should trust this data. -- **deep**: Set to `True` to make a deep copy of the model. +- `update`: Values to change/add in the new model. Note: the data is not validated before creating the new model. You should trust this data. +- `deep`: Set to `True` to make a deep copy of the model. @@ -222,8 +223,8 @@ Generate a dictionary representation of the model, optionally specifying which f ##### Arguments -- **mode**: The mode in which `to_python` should run. If mode is 'json', the output will only contain JSON serializable types. If mode is 'python', the output may contain non-JSON-serializable Python objects. -- **kwargs**: +- `mode`: The mode in which `to_python` should run. If mode is 'json', the output will only contain JSON serializable types. If mode is 'python', the output may contain non-JSON-serializable Python objects. +- `kwargs`: @@ -242,8 +243,8 @@ Generates a JSON representation of the model using Pydantic's `to_json` method. ##### Arguments -- **indent**: Indentation to use in the JSON output. If None is passed, the output will be compact. -- **kwargs**: +- `indent`: Indentation to use in the JSON output. If None is passed, the output will be compact. +- `kwargs`: @@ -261,10 +262,10 @@ Generates a JSON schema for a model class. ##### Arguments -- **by_alias**: Whether to use attribute aliases or not. -- **ref_template**: The reference template. -- **schema_generator**: To override the logic used to generate the JSON schema, as a subclass of `GenerateJsonSchema` with your desired modifications -- **mode**: The mode in which to generate the schema. +- `by_alias`: Whether to use attribute aliases or not. +- `ref_template`: The reference template. +- `schema_generator`: To override the logic used to generate the JSON schema, as a subclass of `GenerateJsonSchema` with your desired modifications +- `mode`: The mode in which to generate the schema. @@ -281,12 +282,12 @@ This method can be overridden to achieve a custom naming scheme for generic Base ##### Arguments -- **params**: Tuple of types of the class. Given a generic class `Model` with 2 type variables and a concrete model `Model[str, int]`, the value `(str, int)` would be passed to `params`. +- `params`: Tuple of types of the class. Given a generic class `Model` with 2 type variables and a concrete model `Model[str, int]`, the value `(str, int)` would be passed to `params`. ##### Raises -- **TypeError**: Raised when trying to generate concrete names for non-generic models. +- `TypeError`: Raised when trying to generate concrete names for non-generic models. ### method model_post_init @@ -301,7 +302,7 @@ This is useful if you want to do some validation that requires the entire model ##### Arguments -- **context**: +- `context`: @@ -323,10 +324,10 @@ the initial attempt to build the schema, and automatic rebuilding fails. ##### Arguments -- **force**: Whether to force the rebuilding of the model schema, defaults to `False`. -- **raise_errors**: Whether to raise errors, defaults to `True`. -- **_parent_namespace_depth**: The depth level of the parent namespace, defaults to 2. -- **_types_namespace**: The types namespace, defaults to `None`. +- `force`: Whether to force the rebuilding of the model schema, defaults to `False`. +- `raise_errors`: Whether to raise errors, defaults to `True`. +- `_parent_namespace_depth`: The depth level of the parent namespace, defaults to 2. +- `_types_namespace`: The types namespace, defaults to `None`. @@ -346,17 +347,17 @@ Validate a pydantic model instance. ##### Arguments -- **obj**: The object to validate. -- **strict**: Whether to enforce types strictly. -- **from_attributes**: Whether to extract data from object attributes. -- **context**: Additional context to pass to the validator. -- **by_alias**: Whether to use the field's alias when validating against the provided input data. -- **by_name**: Whether to use the field's name when validating against the provided input data. +- `obj`: The object to validate. +- `strict`: Whether to enforce types strictly. +- `from_attributes`: Whether to extract data from object attributes. +- `context`: Additional context to pass to the validator. +- `by_alias`: Whether to use the field's alias when validating against the provided input data. +- `by_name`: Whether to use the field's name when validating against the provided input data. ##### Raises -- **ValidationError**: If the object could not be validated. +- `ValidationError`: If the object could not be validated. ### method model_validate_json @@ -376,16 +377,16 @@ Validate the given JSON data against the Pydantic model. ##### Arguments -- **json_data**: The JSON data to validate. -- **strict**: Whether to enforce types strictly. -- **context**: Extra variables to pass to the validator. -- **by_alias**: Whether to use the field's alias when validating against the provided input data. -- **by_name**: Whether to use the field's name when validating against the provided input data. +- `json_data`: The JSON data to validate. +- `strict`: Whether to enforce types strictly. +- `context`: Extra variables to pass to the validator. +- `by_alias`: Whether to use the field's alias when validating against the provided input data. +- `by_name`: Whether to use the field's name when validating against the provided input data. ##### Raises -- **ValidationError**: If `json_data` is not a JSON string or the object could not be validated. +- `ValidationError`: If `json_data` is not a JSON string or the object could not be validated. ### method model_validate_strings @@ -402,11 +403,11 @@ Validate the given object with string data against the Pydantic model. ##### Arguments -- **obj**: The object containing string data to validate. -- **strict**: Whether to enforce types strictly. -- **context**: Extra variables to pass to the validator. -- **by_alias**: Whether to use the field's alias when validating against the provided input data. -- **by_name**: Whether to use the field's name when validating against the provided input data. +- `obj`: The object containing string data to validate. +- `strict`: Whether to enforce types strictly. +- `context`: Extra variables to pass to the validator. +- `by_alias`: Whether to use the field's alias when validating against the provided input data. +- `by_name`: Whether to use the field's name when validating against the provided input data. @@ -425,11 +426,11 @@ allow_pickle: 'bool' = False ##### Arguments -- **path**: -- **content_type**: -- **encoding**: -- **proto**: -- **allow_pickle**: +- `path`: +- `content_type`: +- `encoding`: +- `proto`: +- `allow_pickle`: @@ -444,7 +445,7 @@ obj: 'Any' ##### Arguments -- **obj**: +- `obj`: @@ -463,11 +464,11 @@ allow_pickle: 'bool' = False ##### Arguments -- **b**: -- **content_type**: -- **encoding**: -- **proto**: -- **allow_pickle**: +- `b`: +- `content_type`: +- `encoding`: +- `proto`: +- `allow_pickle`: @@ -483,8 +484,8 @@ ref_template: 'str' = '#/$defs/{model}' ##### Arguments -- **by_alias**: -- **ref_template**: +- `by_alias`: +- `ref_template`: @@ -501,9 +502,9 @@ ref_template: 'str' = '#/$defs/{model}', **dumps_kwargs: 'Any' ##### Arguments -- **by_alias**: -- **ref_template**: -- **dumps_kwargs**: +- `by_alias`: +- `ref_template`: +- `dumps_kwargs`: @@ -518,7 +519,7 @@ ref_template: 'str' = '#/$defs/{model}', **dumps_kwargs: 'Any' ##### Arguments -- **localns**: +- `localns`: @@ -533,7 +534,7 @@ value: 'Any' ##### Arguments -- **value**: +- `value`: diff --git a/models/ref/python/automations/metricchangefilter.mdx b/models/ref/python/automations/metricchangefilter.mdx index 2fe3a8b246..2d536b2549 100644 --- a/models/ref/python/automations/metricchangefilter.mdx +++ b/models/ref/python/automations/metricchangefilter.mdx @@ -11,6 +11,7 @@ import { GitHubLink } from '/snippets/_includes/github-source-link.mdx'; +## class MetricChangeFilter ```python *, name: str, @@ -34,14 +35,14 @@ between the current window and the non-overlapping prior window. ## Args -- **name**: -- **agg_op**: -- **current_window_size**: -- **cmp**: -- **change_amount**: -- **prior_window_size**: -- **change_type**: -- **change_dir**: +- `name`: +- `agg_op`: +- `current_window_size`: +- `cmp`: +- `change_amount`: +- `prior_window_size`: +- `change_type`: +- `change_dir`: @@ -60,8 +61,8 @@ _fields_set: 'set[str] | None' = None, **values: 'Any' ##### Arguments -- **_fields_set**: -- **values**: +- `_fields_set`: +- `values`: @@ -91,10 +92,10 @@ copied = self.model_validate(data) ##### Arguments -- **include**: Optional set or mapping specifying which fields to include in the copied model. -- **exclude**: Optional set or mapping specifying which fields to exclude in the copied model. -- **update**: Optional dictionary of field-value pairs to override field values in the copied model. -- **deep**: If True, the values of fields that are Pydantic models will be deep-copied. +- `include`: Optional set or mapping specifying which fields to include in the copied model. +- `exclude`: Optional set or mapping specifying which fields to exclude in the copied model. +- `update`: Optional dictionary of field-value pairs to override field values in the copied model. +- `deep`: If True, the values of fields that are Pydantic models will be deep-copied. @@ -115,12 +116,12 @@ exclude_none: 'bool' = False ##### Arguments -- **include**: -- **exclude**: -- **by_alias**: -- **exclude_unset**: -- **exclude_defaults**: -- **exclude_none**: +- `include`: +- `exclude`: +- `by_alias`: +- `exclude_unset`: +- `exclude_defaults`: +- `exclude_none`: @@ -135,7 +136,7 @@ obj: 'Any' ##### Arguments -- **obj**: +- `obj`: @@ -158,15 +159,15 @@ models_as_dict: 'bool' = PydanticUndefined, **dumps_kwargs: 'Any' ##### Arguments -- **include**: -- **exclude**: -- **by_alias**: -- **exclude_unset**: -- **exclude_defaults**: -- **exclude_none**: -- **encoder**: -- **models_as_dict**: -- **dumps_kwargs**: +- `include`: +- `exclude`: +- `by_alias`: +- `exclude_unset`: +- `exclude_defaults`: +- `exclude_none`: +- `encoder`: +- `models_as_dict`: +- `dumps_kwargs`: @@ -191,8 +192,8 @@ Default values are respected, but no other validation is performed. ##### Arguments -- **_fields_set**: A set of field names that were originally explicitly set during instantiation. If provided, this is directly used for the [`model_fields_set`][pydantic.BaseModel.model_fields_set] attribute. Otherwise, the field names from the `values` argument will be used. -- **values**: Trusted or pre-validated data dictionary. +- `_fields_set`: A set of field names that were originally explicitly set during instantiation. If provided, this is directly used for the [`model_fields_set`][pydantic.BaseModel.model_fields_set] attribute. Otherwise, the field names from the `values` argument will be used. +- `values`: Trusted or pre-validated data dictionary. @@ -217,8 +218,8 @@ Returns a copy of the model. ##### Arguments -- **update**: Values to change/add in the new model. Note: the data is not validated before creating the new model. You should trust this data. -- **deep**: Set to `True` to make a deep copy of the model. +- `update`: Values to change/add in the new model. Note: the data is not validated before creating the new model. You should trust this data. +- `deep`: Set to `True` to make a deep copy of the model. @@ -237,8 +238,8 @@ Generate a dictionary representation of the model, optionally specifying which f ##### Arguments -- **mode**: The mode in which `to_python` should run. If mode is 'json', the output will only contain JSON serializable types. If mode is 'python', the output may contain non-JSON-serializable Python objects. -- **kwargs**: +- `mode`: The mode in which `to_python` should run. If mode is 'json', the output will only contain JSON serializable types. If mode is 'python', the output may contain non-JSON-serializable Python objects. +- `kwargs`: @@ -257,8 +258,8 @@ Generates a JSON representation of the model using Pydantic's `to_json` method. ##### Arguments -- **indent**: Indentation to use in the JSON output. If None is passed, the output will be compact. -- **kwargs**: +- `indent`: Indentation to use in the JSON output. If None is passed, the output will be compact. +- `kwargs`: @@ -276,10 +277,10 @@ Generates a JSON schema for a model class. ##### Arguments -- **by_alias**: Whether to use attribute aliases or not. -- **ref_template**: The reference template. -- **schema_generator**: To override the logic used to generate the JSON schema, as a subclass of `GenerateJsonSchema` with your desired modifications -- **mode**: The mode in which to generate the schema. +- `by_alias`: Whether to use attribute aliases or not. +- `ref_template`: The reference template. +- `schema_generator`: To override the logic used to generate the JSON schema, as a subclass of `GenerateJsonSchema` with your desired modifications +- `mode`: The mode in which to generate the schema. @@ -296,12 +297,12 @@ This method can be overridden to achieve a custom naming scheme for generic Base ##### Arguments -- **params**: Tuple of types of the class. Given a generic class `Model` with 2 type variables and a concrete model `Model[str, int]`, the value `(str, int)` would be passed to `params`. +- `params`: Tuple of types of the class. Given a generic class `Model` with 2 type variables and a concrete model `Model[str, int]`, the value `(str, int)` would be passed to `params`. ##### Raises -- **TypeError**: Raised when trying to generate concrete names for non-generic models. +- `TypeError`: Raised when trying to generate concrete names for non-generic models. ### method model_post_init @@ -316,7 +317,7 @@ This is useful if you want to do some validation that requires the entire model ##### Arguments -- **context**: +- `context`: @@ -338,10 +339,10 @@ the initial attempt to build the schema, and automatic rebuilding fails. ##### Arguments -- **force**: Whether to force the rebuilding of the model schema, defaults to `False`. -- **raise_errors**: Whether to raise errors, defaults to `True`. -- **_parent_namespace_depth**: The depth level of the parent namespace, defaults to 2. -- **_types_namespace**: The types namespace, defaults to `None`. +- `force`: Whether to force the rebuilding of the model schema, defaults to `False`. +- `raise_errors`: Whether to raise errors, defaults to `True`. +- `_parent_namespace_depth`: The depth level of the parent namespace, defaults to 2. +- `_types_namespace`: The types namespace, defaults to `None`. @@ -361,17 +362,17 @@ Validate a pydantic model instance. ##### Arguments -- **obj**: The object to validate. -- **strict**: Whether to enforce types strictly. -- **from_attributes**: Whether to extract data from object attributes. -- **context**: Additional context to pass to the validator. -- **by_alias**: Whether to use the field's alias when validating against the provided input data. -- **by_name**: Whether to use the field's name when validating against the provided input data. +- `obj`: The object to validate. +- `strict`: Whether to enforce types strictly. +- `from_attributes`: Whether to extract data from object attributes. +- `context`: Additional context to pass to the validator. +- `by_alias`: Whether to use the field's alias when validating against the provided input data. +- `by_name`: Whether to use the field's name when validating against the provided input data. ##### Raises -- **ValidationError**: If the object could not be validated. +- `ValidationError`: If the object could not be validated. ### method model_validate_json @@ -391,16 +392,16 @@ Validate the given JSON data against the Pydantic model. ##### Arguments -- **json_data**: The JSON data to validate. -- **strict**: Whether to enforce types strictly. -- **context**: Extra variables to pass to the validator. -- **by_alias**: Whether to use the field's alias when validating against the provided input data. -- **by_name**: Whether to use the field's name when validating against the provided input data. +- `json_data`: The JSON data to validate. +- `strict`: Whether to enforce types strictly. +- `context`: Extra variables to pass to the validator. +- `by_alias`: Whether to use the field's alias when validating against the provided input data. +- `by_name`: Whether to use the field's name when validating against the provided input data. ##### Raises -- **ValidationError**: If `json_data` is not a JSON string or the object could not be validated. +- `ValidationError`: If `json_data` is not a JSON string or the object could not be validated. ### method model_validate_strings @@ -417,11 +418,11 @@ Validate the given object with string data against the Pydantic model. ##### Arguments -- **obj**: The object containing string data to validate. -- **strict**: Whether to enforce types strictly. -- **context**: Extra variables to pass to the validator. -- **by_alias**: Whether to use the field's alias when validating against the provided input data. -- **by_name**: Whether to use the field's name when validating against the provided input data. +- `obj`: The object containing string data to validate. +- `strict`: Whether to enforce types strictly. +- `context`: Extra variables to pass to the validator. +- `by_alias`: Whether to use the field's alias when validating against the provided input data. +- `by_name`: Whether to use the field's name when validating against the provided input data. @@ -440,11 +441,11 @@ allow_pickle: 'bool' = False ##### Arguments -- **path**: -- **content_type**: -- **encoding**: -- **proto**: -- **allow_pickle**: +- `path`: +- `content_type`: +- `encoding`: +- `proto`: +- `allow_pickle`: @@ -459,7 +460,7 @@ obj: 'Any' ##### Arguments -- **obj**: +- `obj`: @@ -478,11 +479,11 @@ allow_pickle: 'bool' = False ##### Arguments -- **b**: -- **content_type**: -- **encoding**: -- **proto**: -- **allow_pickle**: +- `b`: +- `content_type`: +- `encoding`: +- `proto`: +- `allow_pickle`: @@ -498,8 +499,8 @@ ref_template: 'str' = '#/$defs/{model}' ##### Arguments -- **by_alias**: -- **ref_template**: +- `by_alias`: +- `ref_template`: @@ -516,9 +517,9 @@ ref_template: 'str' = '#/$defs/{model}', **dumps_kwargs: 'Any' ##### Arguments -- **by_alias**: -- **ref_template**: -- **dumps_kwargs**: +- `by_alias`: +- `ref_template`: +- `dumps_kwargs`: @@ -533,7 +534,7 @@ ref_template: 'str' = '#/$defs/{model}', **dumps_kwargs: 'Any' ##### Arguments -- **localns**: +- `localns`: @@ -548,7 +549,7 @@ value: 'Any' ##### Arguments -- **value**: +- `value`: diff --git a/models/ref/python/automations/metricthresholdfilter.mdx b/models/ref/python/automations/metricthresholdfilter.mdx index 969240f8c6..06cea07a16 100644 --- a/models/ref/python/automations/metricthresholdfilter.mdx +++ b/models/ref/python/automations/metricthresholdfilter.mdx @@ -11,6 +11,7 @@ import { GitHubLink } from '/snippets/_includes/github-source-link.mdx'; +## class MetricThresholdFilter ```python *, name: str, @@ -31,11 +32,11 @@ multiple values. ## Args -- **name**: -- **agg_op**: -- **window_size**: -- **cmp_op**: -- **threshold**: +- `name`: +- `agg_op`: +- `window_size`: +- `cmp_op`: +- `threshold`: @@ -54,8 +55,8 @@ _fields_set: 'set[str] | None' = None, **values: 'Any' ##### Arguments -- **_fields_set**: -- **values**: +- `_fields_set`: +- `values`: @@ -85,10 +86,10 @@ copied = self.model_validate(data) ##### Arguments -- **include**: Optional set or mapping specifying which fields to include in the copied model. -- **exclude**: Optional set or mapping specifying which fields to exclude in the copied model. -- **update**: Optional dictionary of field-value pairs to override field values in the copied model. -- **deep**: If True, the values of fields that are Pydantic models will be deep-copied. +- `include`: Optional set or mapping specifying which fields to include in the copied model. +- `exclude`: Optional set or mapping specifying which fields to exclude in the copied model. +- `update`: Optional dictionary of field-value pairs to override field values in the copied model. +- `deep`: If True, the values of fields that are Pydantic models will be deep-copied. @@ -109,12 +110,12 @@ exclude_none: 'bool' = False ##### Arguments -- **include**: -- **exclude**: -- **by_alias**: -- **exclude_unset**: -- **exclude_defaults**: -- **exclude_none**: +- `include`: +- `exclude`: +- `by_alias`: +- `exclude_unset`: +- `exclude_defaults`: +- `exclude_none`: @@ -129,7 +130,7 @@ obj: 'Any' ##### Arguments -- **obj**: +- `obj`: @@ -152,15 +153,15 @@ models_as_dict: 'bool' = PydanticUndefined, **dumps_kwargs: 'Any' ##### Arguments -- **include**: -- **exclude**: -- **by_alias**: -- **exclude_unset**: -- **exclude_defaults**: -- **exclude_none**: -- **encoder**: -- **models_as_dict**: -- **dumps_kwargs**: +- `include`: +- `exclude`: +- `by_alias`: +- `exclude_unset`: +- `exclude_defaults`: +- `exclude_none`: +- `encoder`: +- `models_as_dict`: +- `dumps_kwargs`: @@ -185,8 +186,8 @@ Default values are respected, but no other validation is performed. ##### Arguments -- **_fields_set**: A set of field names that were originally explicitly set during instantiation. If provided, this is directly used for the [`model_fields_set`][pydantic.BaseModel.model_fields_set] attribute. Otherwise, the field names from the `values` argument will be used. -- **values**: Trusted or pre-validated data dictionary. +- `_fields_set`: A set of field names that were originally explicitly set during instantiation. If provided, this is directly used for the [`model_fields_set`][pydantic.BaseModel.model_fields_set] attribute. Otherwise, the field names from the `values` argument will be used. +- `values`: Trusted or pre-validated data dictionary. @@ -211,8 +212,8 @@ Returns a copy of the model. ##### Arguments -- **update**: Values to change/add in the new model. Note: the data is not validated before creating the new model. You should trust this data. -- **deep**: Set to `True` to make a deep copy of the model. +- `update`: Values to change/add in the new model. Note: the data is not validated before creating the new model. You should trust this data. +- `deep`: Set to `True` to make a deep copy of the model. @@ -231,8 +232,8 @@ Generate a dictionary representation of the model, optionally specifying which f ##### Arguments -- **mode**: The mode in which `to_python` should run. If mode is 'json', the output will only contain JSON serializable types. If mode is 'python', the output may contain non-JSON-serializable Python objects. -- **kwargs**: +- `mode`: The mode in which `to_python` should run. If mode is 'json', the output will only contain JSON serializable types. If mode is 'python', the output may contain non-JSON-serializable Python objects. +- `kwargs`: @@ -251,8 +252,8 @@ Generates a JSON representation of the model using Pydantic's `to_json` method. ##### Arguments -- **indent**: Indentation to use in the JSON output. If None is passed, the output will be compact. -- **kwargs**: +- `indent`: Indentation to use in the JSON output. If None is passed, the output will be compact. +- `kwargs`: @@ -270,10 +271,10 @@ Generates a JSON schema for a model class. ##### Arguments -- **by_alias**: Whether to use attribute aliases or not. -- **ref_template**: The reference template. -- **schema_generator**: To override the logic used to generate the JSON schema, as a subclass of `GenerateJsonSchema` with your desired modifications -- **mode**: The mode in which to generate the schema. +- `by_alias`: Whether to use attribute aliases or not. +- `ref_template`: The reference template. +- `schema_generator`: To override the logic used to generate the JSON schema, as a subclass of `GenerateJsonSchema` with your desired modifications +- `mode`: The mode in which to generate the schema. @@ -290,12 +291,12 @@ This method can be overridden to achieve a custom naming scheme for generic Base ##### Arguments -- **params**: Tuple of types of the class. Given a generic class `Model` with 2 type variables and a concrete model `Model[str, int]`, the value `(str, int)` would be passed to `params`. +- `params`: Tuple of types of the class. Given a generic class `Model` with 2 type variables and a concrete model `Model[str, int]`, the value `(str, int)` would be passed to `params`. ##### Raises -- **TypeError**: Raised when trying to generate concrete names for non-generic models. +- `TypeError`: Raised when trying to generate concrete names for non-generic models. ### method model_post_init @@ -310,7 +311,7 @@ This is useful if you want to do some validation that requires the entire model ##### Arguments -- **context**: +- `context`: @@ -332,10 +333,10 @@ the initial attempt to build the schema, and automatic rebuilding fails. ##### Arguments -- **force**: Whether to force the rebuilding of the model schema, defaults to `False`. -- **raise_errors**: Whether to raise errors, defaults to `True`. -- **_parent_namespace_depth**: The depth level of the parent namespace, defaults to 2. -- **_types_namespace**: The types namespace, defaults to `None`. +- `force`: Whether to force the rebuilding of the model schema, defaults to `False`. +- `raise_errors`: Whether to raise errors, defaults to `True`. +- `_parent_namespace_depth`: The depth level of the parent namespace, defaults to 2. +- `_types_namespace`: The types namespace, defaults to `None`. @@ -355,17 +356,17 @@ Validate a pydantic model instance. ##### Arguments -- **obj**: The object to validate. -- **strict**: Whether to enforce types strictly. -- **from_attributes**: Whether to extract data from object attributes. -- **context**: Additional context to pass to the validator. -- **by_alias**: Whether to use the field's alias when validating against the provided input data. -- **by_name**: Whether to use the field's name when validating against the provided input data. +- `obj`: The object to validate. +- `strict`: Whether to enforce types strictly. +- `from_attributes`: Whether to extract data from object attributes. +- `context`: Additional context to pass to the validator. +- `by_alias`: Whether to use the field's alias when validating against the provided input data. +- `by_name`: Whether to use the field's name when validating against the provided input data. ##### Raises -- **ValidationError**: If the object could not be validated. +- `ValidationError`: If the object could not be validated. ### method model_validate_json @@ -385,16 +386,16 @@ Validate the given JSON data against the Pydantic model. ##### Arguments -- **json_data**: The JSON data to validate. -- **strict**: Whether to enforce types strictly. -- **context**: Extra variables to pass to the validator. -- **by_alias**: Whether to use the field's alias when validating against the provided input data. -- **by_name**: Whether to use the field's name when validating against the provided input data. +- `json_data`: The JSON data to validate. +- `strict`: Whether to enforce types strictly. +- `context`: Extra variables to pass to the validator. +- `by_alias`: Whether to use the field's alias when validating against the provided input data. +- `by_name`: Whether to use the field's name when validating against the provided input data. ##### Raises -- **ValidationError**: If `json_data` is not a JSON string or the object could not be validated. +- `ValidationError`: If `json_data` is not a JSON string or the object could not be validated. ### method model_validate_strings @@ -411,11 +412,11 @@ Validate the given object with string data against the Pydantic model. ##### Arguments -- **obj**: The object containing string data to validate. -- **strict**: Whether to enforce types strictly. -- **context**: Extra variables to pass to the validator. -- **by_alias**: Whether to use the field's alias when validating against the provided input data. -- **by_name**: Whether to use the field's name when validating against the provided input data. +- `obj`: The object containing string data to validate. +- `strict`: Whether to enforce types strictly. +- `context`: Extra variables to pass to the validator. +- `by_alias`: Whether to use the field's alias when validating against the provided input data. +- `by_name`: Whether to use the field's name when validating against the provided input data. @@ -434,11 +435,11 @@ allow_pickle: 'bool' = False ##### Arguments -- **path**: -- **content_type**: -- **encoding**: -- **proto**: -- **allow_pickle**: +- `path`: +- `content_type`: +- `encoding`: +- `proto`: +- `allow_pickle`: @@ -453,7 +454,7 @@ obj: 'Any' ##### Arguments -- **obj**: +- `obj`: @@ -472,11 +473,11 @@ allow_pickle: 'bool' = False ##### Arguments -- **b**: -- **content_type**: -- **encoding**: -- **proto**: -- **allow_pickle**: +- `b`: +- `content_type`: +- `encoding`: +- `proto`: +- `allow_pickle`: @@ -492,8 +493,8 @@ ref_template: 'str' = '#/$defs/{model}' ##### Arguments -- **by_alias**: -- **ref_template**: +- `by_alias`: +- `ref_template`: @@ -510,9 +511,9 @@ ref_template: 'str' = '#/$defs/{model}', **dumps_kwargs: 'Any' ##### Arguments -- **by_alias**: -- **ref_template**: -- **dumps_kwargs**: +- `by_alias`: +- `ref_template`: +- `dumps_kwargs`: @@ -527,7 +528,7 @@ ref_template: 'str' = '#/$defs/{model}', **dumps_kwargs: 'Any' ##### Arguments -- **localns**: +- `localns`: @@ -542,7 +543,7 @@ value: 'Any' ##### Arguments -- **value**: +- `value`: diff --git a/models/ref/python/automations/metriczscorefilter.mdx b/models/ref/python/automations/metriczscorefilter.mdx index e690890bca..d69703c976 100644 --- a/models/ref/python/automations/metriczscorefilter.mdx +++ b/models/ref/python/automations/metriczscorefilter.mdx @@ -11,6 +11,7 @@ import { GitHubLink } from '/snippets/_includes/github-source-link.mdx'; +## class MetricZScoreFilter ```python *, name: str, @@ -27,10 +28,10 @@ Filter that compares a metric's z-score against a user-defined threshold. ## Args -- **name**: -- **window_size**: -- **threshold**: -- **change_dir**: +- `name`: +- `window_size`: +- `threshold`: +- `change_dir`: @@ -49,8 +50,8 @@ _fields_set: 'set[str] | None' = None, **values: 'Any' ##### Arguments -- **_fields_set**: -- **values**: +- `_fields_set`: +- `values`: @@ -80,10 +81,10 @@ copied = self.model_validate(data) ##### Arguments -- **include**: Optional set or mapping specifying which fields to include in the copied model. -- **exclude**: Optional set or mapping specifying which fields to exclude in the copied model. -- **update**: Optional dictionary of field-value pairs to override field values in the copied model. -- **deep**: If True, the values of fields that are Pydantic models will be deep-copied. +- `include`: Optional set or mapping specifying which fields to include in the copied model. +- `exclude`: Optional set or mapping specifying which fields to exclude in the copied model. +- `update`: Optional dictionary of field-value pairs to override field values in the copied model. +- `deep`: If True, the values of fields that are Pydantic models will be deep-copied. @@ -104,12 +105,12 @@ exclude_none: 'bool' = False ##### Arguments -- **include**: -- **exclude**: -- **by_alias**: -- **exclude_unset**: -- **exclude_defaults**: -- **exclude_none**: +- `include`: +- `exclude`: +- `by_alias`: +- `exclude_unset`: +- `exclude_defaults`: +- `exclude_none`: @@ -124,7 +125,7 @@ obj: 'Any' ##### Arguments -- **obj**: +- `obj`: @@ -147,15 +148,15 @@ models_as_dict: 'bool' = PydanticUndefined, **dumps_kwargs: 'Any' ##### Arguments -- **include**: -- **exclude**: -- **by_alias**: -- **exclude_unset**: -- **exclude_defaults**: -- **exclude_none**: -- **encoder**: -- **models_as_dict**: -- **dumps_kwargs**: +- `include`: +- `exclude`: +- `by_alias`: +- `exclude_unset`: +- `exclude_defaults`: +- `exclude_none`: +- `encoder`: +- `models_as_dict`: +- `dumps_kwargs`: @@ -180,8 +181,8 @@ Default values are respected, but no other validation is performed. ##### Arguments -- **_fields_set**: A set of field names that were originally explicitly set during instantiation. If provided, this is directly used for the [`model_fields_set`][pydantic.BaseModel.model_fields_set] attribute. Otherwise, the field names from the `values` argument will be used. -- **values**: Trusted or pre-validated data dictionary. +- `_fields_set`: A set of field names that were originally explicitly set during instantiation. If provided, this is directly used for the [`model_fields_set`][pydantic.BaseModel.model_fields_set] attribute. Otherwise, the field names from the `values` argument will be used. +- `values`: Trusted or pre-validated data dictionary. @@ -206,8 +207,8 @@ Returns a copy of the model. ##### Arguments -- **update**: Values to change/add in the new model. Note: the data is not validated before creating the new model. You should trust this data. -- **deep**: Set to `True` to make a deep copy of the model. +- `update`: Values to change/add in the new model. Note: the data is not validated before creating the new model. You should trust this data. +- `deep`: Set to `True` to make a deep copy of the model. @@ -226,8 +227,8 @@ Generate a dictionary representation of the model, optionally specifying which f ##### Arguments -- **mode**: The mode in which `to_python` should run. If mode is 'json', the output will only contain JSON serializable types. If mode is 'python', the output may contain non-JSON-serializable Python objects. -- **kwargs**: +- `mode`: The mode in which `to_python` should run. If mode is 'json', the output will only contain JSON serializable types. If mode is 'python', the output may contain non-JSON-serializable Python objects. +- `kwargs`: @@ -246,8 +247,8 @@ Generates a JSON representation of the model using Pydantic's `to_json` method. ##### Arguments -- **indent**: Indentation to use in the JSON output. If None is passed, the output will be compact. -- **kwargs**: +- `indent`: Indentation to use in the JSON output. If None is passed, the output will be compact. +- `kwargs`: @@ -265,10 +266,10 @@ Generates a JSON schema for a model class. ##### Arguments -- **by_alias**: Whether to use attribute aliases or not. -- **ref_template**: The reference template. -- **schema_generator**: To override the logic used to generate the JSON schema, as a subclass of `GenerateJsonSchema` with your desired modifications -- **mode**: The mode in which to generate the schema. +- `by_alias`: Whether to use attribute aliases or not. +- `ref_template`: The reference template. +- `schema_generator`: To override the logic used to generate the JSON schema, as a subclass of `GenerateJsonSchema` with your desired modifications +- `mode`: The mode in which to generate the schema. @@ -285,12 +286,12 @@ This method can be overridden to achieve a custom naming scheme for generic Base ##### Arguments -- **params**: Tuple of types of the class. Given a generic class `Model` with 2 type variables and a concrete model `Model[str, int]`, the value `(str, int)` would be passed to `params`. +- `params`: Tuple of types of the class. Given a generic class `Model` with 2 type variables and a concrete model `Model[str, int]`, the value `(str, int)` would be passed to `params`. ##### Raises -- **TypeError**: Raised when trying to generate concrete names for non-generic models. +- `TypeError`: Raised when trying to generate concrete names for non-generic models. ### method model_post_init @@ -305,7 +306,7 @@ This is useful if you want to do some validation that requires the entire model ##### Arguments -- **context**: +- `context`: @@ -327,10 +328,10 @@ the initial attempt to build the schema, and automatic rebuilding fails. ##### Arguments -- **force**: Whether to force the rebuilding of the model schema, defaults to `False`. -- **raise_errors**: Whether to raise errors, defaults to `True`. -- **_parent_namespace_depth**: The depth level of the parent namespace, defaults to 2. -- **_types_namespace**: The types namespace, defaults to `None`. +- `force`: Whether to force the rebuilding of the model schema, defaults to `False`. +- `raise_errors`: Whether to raise errors, defaults to `True`. +- `_parent_namespace_depth`: The depth level of the parent namespace, defaults to 2. +- `_types_namespace`: The types namespace, defaults to `None`. @@ -350,17 +351,17 @@ Validate a pydantic model instance. ##### Arguments -- **obj**: The object to validate. -- **strict**: Whether to enforce types strictly. -- **from_attributes**: Whether to extract data from object attributes. -- **context**: Additional context to pass to the validator. -- **by_alias**: Whether to use the field's alias when validating against the provided input data. -- **by_name**: Whether to use the field's name when validating against the provided input data. +- `obj`: The object to validate. +- `strict`: Whether to enforce types strictly. +- `from_attributes`: Whether to extract data from object attributes. +- `context`: Additional context to pass to the validator. +- `by_alias`: Whether to use the field's alias when validating against the provided input data. +- `by_name`: Whether to use the field's name when validating against the provided input data. ##### Raises -- **ValidationError**: If the object could not be validated. +- `ValidationError`: If the object could not be validated. ### method model_validate_json @@ -380,16 +381,16 @@ Validate the given JSON data against the Pydantic model. ##### Arguments -- **json_data**: The JSON data to validate. -- **strict**: Whether to enforce types strictly. -- **context**: Extra variables to pass to the validator. -- **by_alias**: Whether to use the field's alias when validating against the provided input data. -- **by_name**: Whether to use the field's name when validating against the provided input data. +- `json_data`: The JSON data to validate. +- `strict`: Whether to enforce types strictly. +- `context`: Extra variables to pass to the validator. +- `by_alias`: Whether to use the field's alias when validating against the provided input data. +- `by_name`: Whether to use the field's name when validating against the provided input data. ##### Raises -- **ValidationError**: If `json_data` is not a JSON string or the object could not be validated. +- `ValidationError`: If `json_data` is not a JSON string or the object could not be validated. ### method model_validate_strings @@ -406,11 +407,11 @@ Validate the given object with string data against the Pydantic model. ##### Arguments -- **obj**: The object containing string data to validate. -- **strict**: Whether to enforce types strictly. -- **context**: Extra variables to pass to the validator. -- **by_alias**: Whether to use the field's alias when validating against the provided input data. -- **by_name**: Whether to use the field's name when validating against the provided input data. +- `obj`: The object containing string data to validate. +- `strict`: Whether to enforce types strictly. +- `context`: Extra variables to pass to the validator. +- `by_alias`: Whether to use the field's alias when validating against the provided input data. +- `by_name`: Whether to use the field's name when validating against the provided input data. @@ -429,11 +430,11 @@ allow_pickle: 'bool' = False ##### Arguments -- **path**: -- **content_type**: -- **encoding**: -- **proto**: -- **allow_pickle**: +- `path`: +- `content_type`: +- `encoding`: +- `proto`: +- `allow_pickle`: @@ -448,7 +449,7 @@ obj: 'Any' ##### Arguments -- **obj**: +- `obj`: @@ -467,11 +468,11 @@ allow_pickle: 'bool' = False ##### Arguments -- **b**: -- **content_type**: -- **encoding**: -- **proto**: -- **allow_pickle**: +- `b`: +- `content_type`: +- `encoding`: +- `proto`: +- `allow_pickle`: @@ -487,8 +488,8 @@ ref_template: 'str' = '#/$defs/{model}' ##### Arguments -- **by_alias**: -- **ref_template**: +- `by_alias`: +- `ref_template`: @@ -505,9 +506,9 @@ ref_template: 'str' = '#/$defs/{model}', **dumps_kwargs: 'Any' ##### Arguments -- **by_alias**: -- **ref_template**: -- **dumps_kwargs**: +- `by_alias`: +- `ref_template`: +- `dumps_kwargs`: @@ -522,7 +523,7 @@ ref_template: 'str' = '#/$defs/{model}', **dumps_kwargs: 'Any' ##### Arguments -- **localns**: +- `localns`: @@ -537,7 +538,7 @@ value: 'Any' ##### Arguments -- **value**: +- `value`: diff --git a/models/ref/python/automations/newautomation.mdx b/models/ref/python/automations/newautomation.mdx index ee9811dd7f..d27cbd92ab 100644 --- a/models/ref/python/automations/newautomation.mdx +++ b/models/ref/python/automations/newautomation.mdx @@ -11,6 +11,7 @@ import { GitHubLink } from '/snippets/_includes/github-source-link.mdx'; +## class NewAutomation ```python *, name: str | None = None, @@ -28,11 +29,11 @@ A new automation to be created. ## Args -- **name**: -- **description**: -- **enabled**: -- **event**: -- **action**: +- `name`: +- `description`: +- `enabled`: +- `event`: +- `action`: @@ -57,8 +58,8 @@ _fields_set: 'set[str] | None' = None, **values: 'Any' ##### Arguments -- **_fields_set**: -- **values**: +- `_fields_set`: +- `values`: @@ -88,10 +89,10 @@ copied = self.model_validate(data) ##### Arguments -- **include**: Optional set or mapping specifying which fields to include in the copied model. -- **exclude**: Optional set or mapping specifying which fields to exclude in the copied model. -- **update**: Optional dictionary of field-value pairs to override field values in the copied model. -- **deep**: If True, the values of fields that are Pydantic models will be deep-copied. +- `include`: Optional set or mapping specifying which fields to include in the copied model. +- `exclude`: Optional set or mapping specifying which fields to exclude in the copied model. +- `update`: Optional dictionary of field-value pairs to override field values in the copied model. +- `deep`: If True, the values of fields that are Pydantic models will be deep-copied. @@ -112,12 +113,12 @@ exclude_none: 'bool' = False ##### Arguments -- **include**: -- **exclude**: -- **by_alias**: -- **exclude_unset**: -- **exclude_defaults**: -- **exclude_none**: +- `include`: +- `exclude`: +- `by_alias`: +- `exclude_unset`: +- `exclude_defaults`: +- `exclude_none`: @@ -132,7 +133,7 @@ obj: 'Any' ##### Arguments -- **obj**: +- `obj`: @@ -155,15 +156,15 @@ models_as_dict: 'bool' = PydanticUndefined, **dumps_kwargs: 'Any' ##### Arguments -- **include**: -- **exclude**: -- **by_alias**: -- **exclude_unset**: -- **exclude_defaults**: -- **exclude_none**: -- **encoder**: -- **models_as_dict**: -- **dumps_kwargs**: +- `include`: +- `exclude`: +- `by_alias`: +- `exclude_unset`: +- `exclude_defaults`: +- `exclude_none`: +- `encoder`: +- `models_as_dict`: +- `dumps_kwargs`: @@ -188,8 +189,8 @@ Default values are respected, but no other validation is performed. ##### Arguments -- **_fields_set**: A set of field names that were originally explicitly set during instantiation. If provided, this is directly used for the [`model_fields_set`][pydantic.BaseModel.model_fields_set] attribute. Otherwise, the field names from the `values` argument will be used. -- **values**: Trusted or pre-validated data dictionary. +- `_fields_set`: A set of field names that were originally explicitly set during instantiation. If provided, this is directly used for the [`model_fields_set`][pydantic.BaseModel.model_fields_set] attribute. Otherwise, the field names from the `values` argument will be used. +- `values`: Trusted or pre-validated data dictionary. @@ -214,8 +215,8 @@ Returns a copy of the model. ##### Arguments -- **update**: Values to change/add in the new model. Note: the data is not validated before creating the new model. You should trust this data. -- **deep**: Set to `True` to make a deep copy of the model. +- `update`: Values to change/add in the new model. Note: the data is not validated before creating the new model. You should trust this data. +- `deep`: Set to `True` to make a deep copy of the model. @@ -234,8 +235,8 @@ Generate a dictionary representation of the model, optionally specifying which f ##### Arguments -- **mode**: The mode in which `to_python` should run. If mode is 'json', the output will only contain JSON serializable types. If mode is 'python', the output may contain non-JSON-serializable Python objects. -- **kwargs**: +- `mode`: The mode in which `to_python` should run. If mode is 'json', the output will only contain JSON serializable types. If mode is 'python', the output may contain non-JSON-serializable Python objects. +- `kwargs`: @@ -254,8 +255,8 @@ Generates a JSON representation of the model using Pydantic's `to_json` method. ##### Arguments -- **indent**: Indentation to use in the JSON output. If None is passed, the output will be compact. -- **kwargs**: +- `indent`: Indentation to use in the JSON output. If None is passed, the output will be compact. +- `kwargs`: @@ -273,10 +274,10 @@ Generates a JSON schema for a model class. ##### Arguments -- **by_alias**: Whether to use attribute aliases or not. -- **ref_template**: The reference template. -- **schema_generator**: To override the logic used to generate the JSON schema, as a subclass of `GenerateJsonSchema` with your desired modifications -- **mode**: The mode in which to generate the schema. +- `by_alias`: Whether to use attribute aliases or not. +- `ref_template`: The reference template. +- `schema_generator`: To override the logic used to generate the JSON schema, as a subclass of `GenerateJsonSchema` with your desired modifications +- `mode`: The mode in which to generate the schema. @@ -293,12 +294,12 @@ This method can be overridden to achieve a custom naming scheme for generic Base ##### Arguments -- **params**: Tuple of types of the class. Given a generic class `Model` with 2 type variables and a concrete model `Model[str, int]`, the value `(str, int)` would be passed to `params`. +- `params`: Tuple of types of the class. Given a generic class `Model` with 2 type variables and a concrete model `Model[str, int]`, the value `(str, int)` would be passed to `params`. ##### Raises -- **TypeError**: Raised when trying to generate concrete names for non-generic models. +- `TypeError`: Raised when trying to generate concrete names for non-generic models. ### method model_post_init @@ -313,7 +314,7 @@ This is useful if you want to do some validation that requires the entire model ##### Arguments -- **context**: +- `context`: @@ -335,10 +336,10 @@ the initial attempt to build the schema, and automatic rebuilding fails. ##### Arguments -- **force**: Whether to force the rebuilding of the model schema, defaults to `False`. -- **raise_errors**: Whether to raise errors, defaults to `True`. -- **_parent_namespace_depth**: The depth level of the parent namespace, defaults to 2. -- **_types_namespace**: The types namespace, defaults to `None`. +- `force`: Whether to force the rebuilding of the model schema, defaults to `False`. +- `raise_errors`: Whether to raise errors, defaults to `True`. +- `_parent_namespace_depth`: The depth level of the parent namespace, defaults to 2. +- `_types_namespace`: The types namespace, defaults to `None`. @@ -358,17 +359,17 @@ Validate a pydantic model instance. ##### Arguments -- **obj**: The object to validate. -- **strict**: Whether to enforce types strictly. -- **from_attributes**: Whether to extract data from object attributes. -- **context**: Additional context to pass to the validator. -- **by_alias**: Whether to use the field's alias when validating against the provided input data. -- **by_name**: Whether to use the field's name when validating against the provided input data. +- `obj`: The object to validate. +- `strict`: Whether to enforce types strictly. +- `from_attributes`: Whether to extract data from object attributes. +- `context`: Additional context to pass to the validator. +- `by_alias`: Whether to use the field's alias when validating against the provided input data. +- `by_name`: Whether to use the field's name when validating against the provided input data. ##### Raises -- **ValidationError**: If the object could not be validated. +- `ValidationError`: If the object could not be validated. ### method model_validate_json @@ -388,16 +389,16 @@ Validate the given JSON data against the Pydantic model. ##### Arguments -- **json_data**: The JSON data to validate. -- **strict**: Whether to enforce types strictly. -- **context**: Extra variables to pass to the validator. -- **by_alias**: Whether to use the field's alias when validating against the provided input data. -- **by_name**: Whether to use the field's name when validating against the provided input data. +- `json_data`: The JSON data to validate. +- `strict`: Whether to enforce types strictly. +- `context`: Extra variables to pass to the validator. +- `by_alias`: Whether to use the field's alias when validating against the provided input data. +- `by_name`: Whether to use the field's name when validating against the provided input data. ##### Raises -- **ValidationError**: If `json_data` is not a JSON string or the object could not be validated. +- `ValidationError`: If `json_data` is not a JSON string or the object could not be validated. ### method model_validate_strings @@ -414,11 +415,11 @@ Validate the given object with string data against the Pydantic model. ##### Arguments -- **obj**: The object containing string data to validate. -- **strict**: Whether to enforce types strictly. -- **context**: Extra variables to pass to the validator. -- **by_alias**: Whether to use the field's alias when validating against the provided input data. -- **by_name**: Whether to use the field's name when validating against the provided input data. +- `obj`: The object containing string data to validate. +- `strict`: Whether to enforce types strictly. +- `context`: Extra variables to pass to the validator. +- `by_alias`: Whether to use the field's alias when validating against the provided input data. +- `by_name`: Whether to use the field's name when validating against the provided input data. @@ -437,11 +438,11 @@ allow_pickle: 'bool' = False ##### Arguments -- **path**: -- **content_type**: -- **encoding**: -- **proto**: -- **allow_pickle**: +- `path`: +- `content_type`: +- `encoding`: +- `proto`: +- `allow_pickle`: @@ -456,7 +457,7 @@ obj: 'Any' ##### Arguments -- **obj**: +- `obj`: @@ -475,11 +476,11 @@ allow_pickle: 'bool' = False ##### Arguments -- **b**: -- **content_type**: -- **encoding**: -- **proto**: -- **allow_pickle**: +- `b`: +- `content_type`: +- `encoding`: +- `proto`: +- `allow_pickle`: @@ -495,8 +496,8 @@ ref_template: 'str' = '#/$defs/{model}' ##### Arguments -- **by_alias**: -- **ref_template**: +- `by_alias`: +- `ref_template`: @@ -513,9 +514,9 @@ ref_template: 'str' = '#/$defs/{model}', **dumps_kwargs: 'Any' ##### Arguments -- **by_alias**: -- **ref_template**: -- **dumps_kwargs**: +- `by_alias`: +- `ref_template`: +- `dumps_kwargs`: @@ -530,7 +531,7 @@ ref_template: 'str' = '#/$defs/{model}', **dumps_kwargs: 'Any' ##### Arguments -- **localns**: +- `localns`: @@ -545,7 +546,7 @@ value: 'Any' ##### Arguments -- **value**: +- `value`: diff --git a/models/ref/python/automations/onaddartifactalias.mdx b/models/ref/python/automations/onaddartifactalias.mdx index 3c030730e5..e501327d9b 100644 --- a/models/ref/python/automations/onaddartifactalias.mdx +++ b/models/ref/python/automations/onaddartifactalias.mdx @@ -11,6 +11,7 @@ import { GitHubLink } from '/snippets/_includes/github-source-link.mdx'; +## class OnAddArtifactAlias ```python *, event_type: Literal[ADD_ARTIFACT_ALIAS] = ADD_ARTIFACT_ALIAS, @@ -26,9 +27,9 @@ A new alias is assigned to an artifact. ## Args -- **event_type**: -- **scope**: -- **filter**: +- `event_type`: +- `scope`: +- `filter`: ## Examples @@ -63,8 +64,8 @@ _fields_set: 'set[str] | None' = None, **values: 'Any' ##### Arguments -- **_fields_set**: -- **values**: +- `_fields_set`: +- `values`: @@ -94,10 +95,10 @@ copied = self.model_validate(data) ##### Arguments -- **include**: Optional set or mapping specifying which fields to include in the copied model. -- **exclude**: Optional set or mapping specifying which fields to exclude in the copied model. -- **update**: Optional dictionary of field-value pairs to override field values in the copied model. -- **deep**: If True, the values of fields that are Pydantic models will be deep-copied. +- `include`: Optional set or mapping specifying which fields to include in the copied model. +- `exclude`: Optional set or mapping specifying which fields to exclude in the copied model. +- `update`: Optional dictionary of field-value pairs to override field values in the copied model. +- `deep`: If True, the values of fields that are Pydantic models will be deep-copied. @@ -118,12 +119,12 @@ exclude_none: 'bool' = False ##### Arguments -- **include**: -- **exclude**: -- **by_alias**: -- **exclude_unset**: -- **exclude_defaults**: -- **exclude_none**: +- `include`: +- `exclude`: +- `by_alias`: +- `exclude_unset`: +- `exclude_defaults`: +- `exclude_none`: @@ -138,7 +139,7 @@ obj: 'Any' ##### Arguments -- **obj**: +- `obj`: @@ -161,15 +162,15 @@ models_as_dict: 'bool' = PydanticUndefined, **dumps_kwargs: 'Any' ##### Arguments -- **include**: -- **exclude**: -- **by_alias**: -- **exclude_unset**: -- **exclude_defaults**: -- **exclude_none**: -- **encoder**: -- **models_as_dict**: -- **dumps_kwargs**: +- `include`: +- `exclude`: +- `by_alias`: +- `exclude_unset`: +- `exclude_defaults`: +- `exclude_none`: +- `encoder`: +- `models_as_dict`: +- `dumps_kwargs`: @@ -194,8 +195,8 @@ Default values are respected, but no other validation is performed. ##### Arguments -- **_fields_set**: A set of field names that were originally explicitly set during instantiation. If provided, this is directly used for the [`model_fields_set`][pydantic.BaseModel.model_fields_set] attribute. Otherwise, the field names from the `values` argument will be used. -- **values**: Trusted or pre-validated data dictionary. +- `_fields_set`: A set of field names that were originally explicitly set during instantiation. If provided, this is directly used for the [`model_fields_set`][pydantic.BaseModel.model_fields_set] attribute. Otherwise, the field names from the `values` argument will be used. +- `values`: Trusted or pre-validated data dictionary. @@ -220,8 +221,8 @@ Returns a copy of the model. ##### Arguments -- **update**: Values to change/add in the new model. Note: the data is not validated before creating the new model. You should trust this data. -- **deep**: Set to `True` to make a deep copy of the model. +- `update`: Values to change/add in the new model. Note: the data is not validated before creating the new model. You should trust this data. +- `deep`: Set to `True` to make a deep copy of the model. @@ -240,8 +241,8 @@ Generate a dictionary representation of the model, optionally specifying which f ##### Arguments -- **mode**: The mode in which `to_python` should run. If mode is 'json', the output will only contain JSON serializable types. If mode is 'python', the output may contain non-JSON-serializable Python objects. -- **kwargs**: +- `mode`: The mode in which `to_python` should run. If mode is 'json', the output will only contain JSON serializable types. If mode is 'python', the output may contain non-JSON-serializable Python objects. +- `kwargs`: @@ -260,8 +261,8 @@ Generates a JSON representation of the model using Pydantic's `to_json` method. ##### Arguments -- **indent**: Indentation to use in the JSON output. If None is passed, the output will be compact. -- **kwargs**: +- `indent`: Indentation to use in the JSON output. If None is passed, the output will be compact. +- `kwargs`: @@ -279,10 +280,10 @@ Generates a JSON schema for a model class. ##### Arguments -- **by_alias**: Whether to use attribute aliases or not. -- **ref_template**: The reference template. -- **schema_generator**: To override the logic used to generate the JSON schema, as a subclass of `GenerateJsonSchema` with your desired modifications -- **mode**: The mode in which to generate the schema. +- `by_alias`: Whether to use attribute aliases or not. +- `ref_template`: The reference template. +- `schema_generator`: To override the logic used to generate the JSON schema, as a subclass of `GenerateJsonSchema` with your desired modifications +- `mode`: The mode in which to generate the schema. @@ -299,12 +300,12 @@ This method can be overridden to achieve a custom naming scheme for generic Base ##### Arguments -- **params**: Tuple of types of the class. Given a generic class `Model` with 2 type variables and a concrete model `Model[str, int]`, the value `(str, int)` would be passed to `params`. +- `params`: Tuple of types of the class. Given a generic class `Model` with 2 type variables and a concrete model `Model[str, int]`, the value `(str, int)` would be passed to `params`. ##### Raises -- **TypeError**: Raised when trying to generate concrete names for non-generic models. +- `TypeError`: Raised when trying to generate concrete names for non-generic models. ### method model_post_init @@ -319,7 +320,7 @@ This is useful if you want to do some validation that requires the entire model ##### Arguments -- **context**: +- `context`: @@ -341,10 +342,10 @@ the initial attempt to build the schema, and automatic rebuilding fails. ##### Arguments -- **force**: Whether to force the rebuilding of the model schema, defaults to `False`. -- **raise_errors**: Whether to raise errors, defaults to `True`. -- **_parent_namespace_depth**: The depth level of the parent namespace, defaults to 2. -- **_types_namespace**: The types namespace, defaults to `None`. +- `force`: Whether to force the rebuilding of the model schema, defaults to `False`. +- `raise_errors`: Whether to raise errors, defaults to `True`. +- `_parent_namespace_depth`: The depth level of the parent namespace, defaults to 2. +- `_types_namespace`: The types namespace, defaults to `None`. @@ -364,17 +365,17 @@ Validate a pydantic model instance. ##### Arguments -- **obj**: The object to validate. -- **strict**: Whether to enforce types strictly. -- **from_attributes**: Whether to extract data from object attributes. -- **context**: Additional context to pass to the validator. -- **by_alias**: Whether to use the field's alias when validating against the provided input data. -- **by_name**: Whether to use the field's name when validating against the provided input data. +- `obj`: The object to validate. +- `strict`: Whether to enforce types strictly. +- `from_attributes`: Whether to extract data from object attributes. +- `context`: Additional context to pass to the validator. +- `by_alias`: Whether to use the field's alias when validating against the provided input data. +- `by_name`: Whether to use the field's name when validating against the provided input data. ##### Raises -- **ValidationError**: If the object could not be validated. +- `ValidationError`: If the object could not be validated. ### method model_validate_json @@ -394,16 +395,16 @@ Validate the given JSON data against the Pydantic model. ##### Arguments -- **json_data**: The JSON data to validate. -- **strict**: Whether to enforce types strictly. -- **context**: Extra variables to pass to the validator. -- **by_alias**: Whether to use the field's alias when validating against the provided input data. -- **by_name**: Whether to use the field's name when validating against the provided input data. +- `json_data`: The JSON data to validate. +- `strict`: Whether to enforce types strictly. +- `context`: Extra variables to pass to the validator. +- `by_alias`: Whether to use the field's alias when validating against the provided input data. +- `by_name`: Whether to use the field's name when validating against the provided input data. ##### Raises -- **ValidationError**: If `json_data` is not a JSON string or the object could not be validated. +- `ValidationError`: If `json_data` is not a JSON string or the object could not be validated. ### method model_validate_strings @@ -420,11 +421,11 @@ Validate the given object with string data against the Pydantic model. ##### Arguments -- **obj**: The object containing string data to validate. -- **strict**: Whether to enforce types strictly. -- **context**: Extra variables to pass to the validator. -- **by_alias**: Whether to use the field's alias when validating against the provided input data. -- **by_name**: Whether to use the field's name when validating against the provided input data. +- `obj`: The object containing string data to validate. +- `strict`: Whether to enforce types strictly. +- `context`: Extra variables to pass to the validator. +- `by_alias`: Whether to use the field's alias when validating against the provided input data. +- `by_name`: Whether to use the field's name when validating against the provided input data. @@ -443,11 +444,11 @@ allow_pickle: 'bool' = False ##### Arguments -- **path**: -- **content_type**: -- **encoding**: -- **proto**: -- **allow_pickle**: +- `path`: +- `content_type`: +- `encoding`: +- `proto`: +- `allow_pickle`: @@ -462,7 +463,7 @@ obj: 'Any' ##### Arguments -- **obj**: +- `obj`: @@ -481,11 +482,11 @@ allow_pickle: 'bool' = False ##### Arguments -- **b**: -- **content_type**: -- **encoding**: -- **proto**: -- **allow_pickle**: +- `b`: +- `content_type`: +- `encoding`: +- `proto`: +- `allow_pickle`: @@ -501,8 +502,8 @@ ref_template: 'str' = '#/$defs/{model}' ##### Arguments -- **by_alias**: -- **ref_template**: +- `by_alias`: +- `ref_template`: @@ -519,9 +520,9 @@ ref_template: 'str' = '#/$defs/{model}', **dumps_kwargs: 'Any' ##### Arguments -- **by_alias**: -- **ref_template**: -- **dumps_kwargs**: +- `by_alias`: +- `ref_template`: +- `dumps_kwargs`: @@ -537,7 +538,7 @@ Define a new Automation in which this event triggers the given action. ##### Arguments -- **action**: +- `action`: @@ -552,7 +553,7 @@ Define a new Automation in which this event triggers the given action. ##### Arguments -- **localns**: +- `localns`: @@ -567,7 +568,7 @@ value: 'Any' ##### Arguments -- **value**: +- `value`: diff --git a/models/ref/python/automations/onaddartifacttag.mdx b/models/ref/python/automations/onaddartifacttag.mdx index 9e0e660aa4..72d6b7bcf2 100644 --- a/models/ref/python/automations/onaddartifacttag.mdx +++ b/models/ref/python/automations/onaddartifacttag.mdx @@ -11,6 +11,7 @@ import { GitHubLink } from '/snippets/_includes/github-source-link.mdx'; +## class OnAddArtifactTag ```python *, event_type: Literal[ADD_ARTIFACT_TAG] = ADD_ARTIFACT_TAG, @@ -26,9 +27,9 @@ A new tag is assigned to an artifact version. ## Args -- **event_type**: -- **scope**: -- **filter**: +- `event_type`: +- `scope`: +- `filter`: ## Examples @@ -63,8 +64,8 @@ _fields_set: 'set[str] | None' = None, **values: 'Any' ##### Arguments -- **_fields_set**: -- **values**: +- `_fields_set`: +- `values`: @@ -94,10 +95,10 @@ copied = self.model_validate(data) ##### Arguments -- **include**: Optional set or mapping specifying which fields to include in the copied model. -- **exclude**: Optional set or mapping specifying which fields to exclude in the copied model. -- **update**: Optional dictionary of field-value pairs to override field values in the copied model. -- **deep**: If True, the values of fields that are Pydantic models will be deep-copied. +- `include`: Optional set or mapping specifying which fields to include in the copied model. +- `exclude`: Optional set or mapping specifying which fields to exclude in the copied model. +- `update`: Optional dictionary of field-value pairs to override field values in the copied model. +- `deep`: If True, the values of fields that are Pydantic models will be deep-copied. @@ -118,12 +119,12 @@ exclude_none: 'bool' = False ##### Arguments -- **include**: -- **exclude**: -- **by_alias**: -- **exclude_unset**: -- **exclude_defaults**: -- **exclude_none**: +- `include`: +- `exclude`: +- `by_alias`: +- `exclude_unset`: +- `exclude_defaults`: +- `exclude_none`: @@ -138,7 +139,7 @@ obj: 'Any' ##### Arguments -- **obj**: +- `obj`: @@ -161,15 +162,15 @@ models_as_dict: 'bool' = PydanticUndefined, **dumps_kwargs: 'Any' ##### Arguments -- **include**: -- **exclude**: -- **by_alias**: -- **exclude_unset**: -- **exclude_defaults**: -- **exclude_none**: -- **encoder**: -- **models_as_dict**: -- **dumps_kwargs**: +- `include`: +- `exclude`: +- `by_alias`: +- `exclude_unset`: +- `exclude_defaults`: +- `exclude_none`: +- `encoder`: +- `models_as_dict`: +- `dumps_kwargs`: @@ -194,8 +195,8 @@ Default values are respected, but no other validation is performed. ##### Arguments -- **_fields_set**: A set of field names that were originally explicitly set during instantiation. If provided, this is directly used for the [`model_fields_set`][pydantic.BaseModel.model_fields_set] attribute. Otherwise, the field names from the `values` argument will be used. -- **values**: Trusted or pre-validated data dictionary. +- `_fields_set`: A set of field names that were originally explicitly set during instantiation. If provided, this is directly used for the [`model_fields_set`][pydantic.BaseModel.model_fields_set] attribute. Otherwise, the field names from the `values` argument will be used. +- `values`: Trusted or pre-validated data dictionary. @@ -220,8 +221,8 @@ Returns a copy of the model. ##### Arguments -- **update**: Values to change/add in the new model. Note: the data is not validated before creating the new model. You should trust this data. -- **deep**: Set to `True` to make a deep copy of the model. +- `update`: Values to change/add in the new model. Note: the data is not validated before creating the new model. You should trust this data. +- `deep`: Set to `True` to make a deep copy of the model. @@ -240,8 +241,8 @@ Generate a dictionary representation of the model, optionally specifying which f ##### Arguments -- **mode**: The mode in which `to_python` should run. If mode is 'json', the output will only contain JSON serializable types. If mode is 'python', the output may contain non-JSON-serializable Python objects. -- **kwargs**: +- `mode`: The mode in which `to_python` should run. If mode is 'json', the output will only contain JSON serializable types. If mode is 'python', the output may contain non-JSON-serializable Python objects. +- `kwargs`: @@ -260,8 +261,8 @@ Generates a JSON representation of the model using Pydantic's `to_json` method. ##### Arguments -- **indent**: Indentation to use in the JSON output. If None is passed, the output will be compact. -- **kwargs**: +- `indent`: Indentation to use in the JSON output. If None is passed, the output will be compact. +- `kwargs`: @@ -279,10 +280,10 @@ Generates a JSON schema for a model class. ##### Arguments -- **by_alias**: Whether to use attribute aliases or not. -- **ref_template**: The reference template. -- **schema_generator**: To override the logic used to generate the JSON schema, as a subclass of `GenerateJsonSchema` with your desired modifications -- **mode**: The mode in which to generate the schema. +- `by_alias`: Whether to use attribute aliases or not. +- `ref_template`: The reference template. +- `schema_generator`: To override the logic used to generate the JSON schema, as a subclass of `GenerateJsonSchema` with your desired modifications +- `mode`: The mode in which to generate the schema. @@ -299,12 +300,12 @@ This method can be overridden to achieve a custom naming scheme for generic Base ##### Arguments -- **params**: Tuple of types of the class. Given a generic class `Model` with 2 type variables and a concrete model `Model[str, int]`, the value `(str, int)` would be passed to `params`. +- `params`: Tuple of types of the class. Given a generic class `Model` with 2 type variables and a concrete model `Model[str, int]`, the value `(str, int)` would be passed to `params`. ##### Raises -- **TypeError**: Raised when trying to generate concrete names for non-generic models. +- `TypeError`: Raised when trying to generate concrete names for non-generic models. ### method model_post_init @@ -319,7 +320,7 @@ This is useful if you want to do some validation that requires the entire model ##### Arguments -- **context**: +- `context`: @@ -341,10 +342,10 @@ the initial attempt to build the schema, and automatic rebuilding fails. ##### Arguments -- **force**: Whether to force the rebuilding of the model schema, defaults to `False`. -- **raise_errors**: Whether to raise errors, defaults to `True`. -- **_parent_namespace_depth**: The depth level of the parent namespace, defaults to 2. -- **_types_namespace**: The types namespace, defaults to `None`. +- `force`: Whether to force the rebuilding of the model schema, defaults to `False`. +- `raise_errors`: Whether to raise errors, defaults to `True`. +- `_parent_namespace_depth`: The depth level of the parent namespace, defaults to 2. +- `_types_namespace`: The types namespace, defaults to `None`. @@ -364,17 +365,17 @@ Validate a pydantic model instance. ##### Arguments -- **obj**: The object to validate. -- **strict**: Whether to enforce types strictly. -- **from_attributes**: Whether to extract data from object attributes. -- **context**: Additional context to pass to the validator. -- **by_alias**: Whether to use the field's alias when validating against the provided input data. -- **by_name**: Whether to use the field's name when validating against the provided input data. +- `obj`: The object to validate. +- `strict`: Whether to enforce types strictly. +- `from_attributes`: Whether to extract data from object attributes. +- `context`: Additional context to pass to the validator. +- `by_alias`: Whether to use the field's alias when validating against the provided input data. +- `by_name`: Whether to use the field's name when validating against the provided input data. ##### Raises -- **ValidationError**: If the object could not be validated. +- `ValidationError`: If the object could not be validated. ### method model_validate_json @@ -394,16 +395,16 @@ Validate the given JSON data against the Pydantic model. ##### Arguments -- **json_data**: The JSON data to validate. -- **strict**: Whether to enforce types strictly. -- **context**: Extra variables to pass to the validator. -- **by_alias**: Whether to use the field's alias when validating against the provided input data. -- **by_name**: Whether to use the field's name when validating against the provided input data. +- `json_data`: The JSON data to validate. +- `strict`: Whether to enforce types strictly. +- `context`: Extra variables to pass to the validator. +- `by_alias`: Whether to use the field's alias when validating against the provided input data. +- `by_name`: Whether to use the field's name when validating against the provided input data. ##### Raises -- **ValidationError**: If `json_data` is not a JSON string or the object could not be validated. +- `ValidationError`: If `json_data` is not a JSON string or the object could not be validated. ### method model_validate_strings @@ -420,11 +421,11 @@ Validate the given object with string data against the Pydantic model. ##### Arguments -- **obj**: The object containing string data to validate. -- **strict**: Whether to enforce types strictly. -- **context**: Extra variables to pass to the validator. -- **by_alias**: Whether to use the field's alias when validating against the provided input data. -- **by_name**: Whether to use the field's name when validating against the provided input data. +- `obj`: The object containing string data to validate. +- `strict`: Whether to enforce types strictly. +- `context`: Extra variables to pass to the validator. +- `by_alias`: Whether to use the field's alias when validating against the provided input data. +- `by_name`: Whether to use the field's name when validating against the provided input data. @@ -443,11 +444,11 @@ allow_pickle: 'bool' = False ##### Arguments -- **path**: -- **content_type**: -- **encoding**: -- **proto**: -- **allow_pickle**: +- `path`: +- `content_type`: +- `encoding`: +- `proto`: +- `allow_pickle`: @@ -462,7 +463,7 @@ obj: 'Any' ##### Arguments -- **obj**: +- `obj`: @@ -481,11 +482,11 @@ allow_pickle: 'bool' = False ##### Arguments -- **b**: -- **content_type**: -- **encoding**: -- **proto**: -- **allow_pickle**: +- `b`: +- `content_type`: +- `encoding`: +- `proto`: +- `allow_pickle`: @@ -501,8 +502,8 @@ ref_template: 'str' = '#/$defs/{model}' ##### Arguments -- **by_alias**: -- **ref_template**: +- `by_alias`: +- `ref_template`: @@ -519,9 +520,9 @@ ref_template: 'str' = '#/$defs/{model}', **dumps_kwargs: 'Any' ##### Arguments -- **by_alias**: -- **ref_template**: -- **dumps_kwargs**: +- `by_alias`: +- `ref_template`: +- `dumps_kwargs`: @@ -537,7 +538,7 @@ Define a new Automation in which this event triggers the given action. ##### Arguments -- **action**: +- `action`: @@ -552,7 +553,7 @@ Define a new Automation in which this event triggers the given action. ##### Arguments -- **localns**: +- `localns`: @@ -567,7 +568,7 @@ value: 'Any' ##### Arguments -- **value**: +- `value`: diff --git a/models/ref/python/automations/onaddcollectiontag.mdx b/models/ref/python/automations/onaddcollectiontag.mdx index 70fdd70b7d..3bd6e30a70 100644 --- a/models/ref/python/automations/onaddcollectiontag.mdx +++ b/models/ref/python/automations/onaddcollectiontag.mdx @@ -11,6 +11,7 @@ import { GitHubLink } from '/snippets/_includes/github-source-link.mdx'; +## class OnAddCollectionTag ```python *, event_type: Literal[ADD_COLLECTION_TAG] = ADD_COLLECTION_TAG, @@ -26,9 +27,9 @@ A new tag is assigned to an artifact collection. ## Args -- **event_type**: -- **scope**: -- **filter**: +- `event_type`: +- `scope`: +- `filter`: @@ -47,8 +48,8 @@ _fields_set: 'set[str] | None' = None, **values: 'Any' ##### Arguments -- **_fields_set**: -- **values**: +- `_fields_set`: +- `values`: @@ -78,10 +79,10 @@ copied = self.model_validate(data) ##### Arguments -- **include**: Optional set or mapping specifying which fields to include in the copied model. -- **exclude**: Optional set or mapping specifying which fields to exclude in the copied model. -- **update**: Optional dictionary of field-value pairs to override field values in the copied model. -- **deep**: If True, the values of fields that are Pydantic models will be deep-copied. +- `include`: Optional set or mapping specifying which fields to include in the copied model. +- `exclude`: Optional set or mapping specifying which fields to exclude in the copied model. +- `update`: Optional dictionary of field-value pairs to override field values in the copied model. +- `deep`: If True, the values of fields that are Pydantic models will be deep-copied. @@ -102,12 +103,12 @@ exclude_none: 'bool' = False ##### Arguments -- **include**: -- **exclude**: -- **by_alias**: -- **exclude_unset**: -- **exclude_defaults**: -- **exclude_none**: +- `include`: +- `exclude`: +- `by_alias`: +- `exclude_unset`: +- `exclude_defaults`: +- `exclude_none`: @@ -122,7 +123,7 @@ obj: 'Any' ##### Arguments -- **obj**: +- `obj`: @@ -145,15 +146,15 @@ models_as_dict: 'bool' = PydanticUndefined, **dumps_kwargs: 'Any' ##### Arguments -- **include**: -- **exclude**: -- **by_alias**: -- **exclude_unset**: -- **exclude_defaults**: -- **exclude_none**: -- **encoder**: -- **models_as_dict**: -- **dumps_kwargs**: +- `include`: +- `exclude`: +- `by_alias`: +- `exclude_unset`: +- `exclude_defaults`: +- `exclude_none`: +- `encoder`: +- `models_as_dict`: +- `dumps_kwargs`: @@ -178,8 +179,8 @@ Default values are respected, but no other validation is performed. ##### Arguments -- **_fields_set**: A set of field names that were originally explicitly set during instantiation. If provided, this is directly used for the [`model_fields_set`][pydantic.BaseModel.model_fields_set] attribute. Otherwise, the field names from the `values` argument will be used. -- **values**: Trusted or pre-validated data dictionary. +- `_fields_set`: A set of field names that were originally explicitly set during instantiation. If provided, this is directly used for the [`model_fields_set`][pydantic.BaseModel.model_fields_set] attribute. Otherwise, the field names from the `values` argument will be used. +- `values`: Trusted or pre-validated data dictionary. @@ -204,8 +205,8 @@ Returns a copy of the model. ##### Arguments -- **update**: Values to change/add in the new model. Note: the data is not validated before creating the new model. You should trust this data. -- **deep**: Set to `True` to make a deep copy of the model. +- `update`: Values to change/add in the new model. Note: the data is not validated before creating the new model. You should trust this data. +- `deep`: Set to `True` to make a deep copy of the model. @@ -224,8 +225,8 @@ Generate a dictionary representation of the model, optionally specifying which f ##### Arguments -- **mode**: The mode in which `to_python` should run. If mode is 'json', the output will only contain JSON serializable types. If mode is 'python', the output may contain non-JSON-serializable Python objects. -- **kwargs**: +- `mode`: The mode in which `to_python` should run. If mode is 'json', the output will only contain JSON serializable types. If mode is 'python', the output may contain non-JSON-serializable Python objects. +- `kwargs`: @@ -244,8 +245,8 @@ Generates a JSON representation of the model using Pydantic's `to_json` method. ##### Arguments -- **indent**: Indentation to use in the JSON output. If None is passed, the output will be compact. -- **kwargs**: +- `indent`: Indentation to use in the JSON output. If None is passed, the output will be compact. +- `kwargs`: @@ -263,10 +264,10 @@ Generates a JSON schema for a model class. ##### Arguments -- **by_alias**: Whether to use attribute aliases or not. -- **ref_template**: The reference template. -- **schema_generator**: To override the logic used to generate the JSON schema, as a subclass of `GenerateJsonSchema` with your desired modifications -- **mode**: The mode in which to generate the schema. +- `by_alias`: Whether to use attribute aliases or not. +- `ref_template`: The reference template. +- `schema_generator`: To override the logic used to generate the JSON schema, as a subclass of `GenerateJsonSchema` with your desired modifications +- `mode`: The mode in which to generate the schema. @@ -283,12 +284,12 @@ This method can be overridden to achieve a custom naming scheme for generic Base ##### Arguments -- **params**: Tuple of types of the class. Given a generic class `Model` with 2 type variables and a concrete model `Model[str, int]`, the value `(str, int)` would be passed to `params`. +- `params`: Tuple of types of the class. Given a generic class `Model` with 2 type variables and a concrete model `Model[str, int]`, the value `(str, int)` would be passed to `params`. ##### Raises -- **TypeError**: Raised when trying to generate concrete names for non-generic models. +- `TypeError`: Raised when trying to generate concrete names for non-generic models. ### method model_post_init @@ -303,7 +304,7 @@ This is useful if you want to do some validation that requires the entire model ##### Arguments -- **context**: +- `context`: @@ -325,10 +326,10 @@ the initial attempt to build the schema, and automatic rebuilding fails. ##### Arguments -- **force**: Whether to force the rebuilding of the model schema, defaults to `False`. -- **raise_errors**: Whether to raise errors, defaults to `True`. -- **_parent_namespace_depth**: The depth level of the parent namespace, defaults to 2. -- **_types_namespace**: The types namespace, defaults to `None`. +- `force`: Whether to force the rebuilding of the model schema, defaults to `False`. +- `raise_errors`: Whether to raise errors, defaults to `True`. +- `_parent_namespace_depth`: The depth level of the parent namespace, defaults to 2. +- `_types_namespace`: The types namespace, defaults to `None`. @@ -348,17 +349,17 @@ Validate a pydantic model instance. ##### Arguments -- **obj**: The object to validate. -- **strict**: Whether to enforce types strictly. -- **from_attributes**: Whether to extract data from object attributes. -- **context**: Additional context to pass to the validator. -- **by_alias**: Whether to use the field's alias when validating against the provided input data. -- **by_name**: Whether to use the field's name when validating against the provided input data. +- `obj`: The object to validate. +- `strict`: Whether to enforce types strictly. +- `from_attributes`: Whether to extract data from object attributes. +- `context`: Additional context to pass to the validator. +- `by_alias`: Whether to use the field's alias when validating against the provided input data. +- `by_name`: Whether to use the field's name when validating against the provided input data. ##### Raises -- **ValidationError**: If the object could not be validated. +- `ValidationError`: If the object could not be validated. ### method model_validate_json @@ -378,16 +379,16 @@ Validate the given JSON data against the Pydantic model. ##### Arguments -- **json_data**: The JSON data to validate. -- **strict**: Whether to enforce types strictly. -- **context**: Extra variables to pass to the validator. -- **by_alias**: Whether to use the field's alias when validating against the provided input data. -- **by_name**: Whether to use the field's name when validating against the provided input data. +- `json_data`: The JSON data to validate. +- `strict`: Whether to enforce types strictly. +- `context`: Extra variables to pass to the validator. +- `by_alias`: Whether to use the field's alias when validating against the provided input data. +- `by_name`: Whether to use the field's name when validating against the provided input data. ##### Raises -- **ValidationError**: If `json_data` is not a JSON string or the object could not be validated. +- `ValidationError`: If `json_data` is not a JSON string or the object could not be validated. ### method model_validate_strings @@ -404,11 +405,11 @@ Validate the given object with string data against the Pydantic model. ##### Arguments -- **obj**: The object containing string data to validate. -- **strict**: Whether to enforce types strictly. -- **context**: Extra variables to pass to the validator. -- **by_alias**: Whether to use the field's alias when validating against the provided input data. -- **by_name**: Whether to use the field's name when validating against the provided input data. +- `obj`: The object containing string data to validate. +- `strict`: Whether to enforce types strictly. +- `context`: Extra variables to pass to the validator. +- `by_alias`: Whether to use the field's alias when validating against the provided input data. +- `by_name`: Whether to use the field's name when validating against the provided input data. @@ -427,11 +428,11 @@ allow_pickle: 'bool' = False ##### Arguments -- **path**: -- **content_type**: -- **encoding**: -- **proto**: -- **allow_pickle**: +- `path`: +- `content_type`: +- `encoding`: +- `proto`: +- `allow_pickle`: @@ -446,7 +447,7 @@ obj: 'Any' ##### Arguments -- **obj**: +- `obj`: @@ -465,11 +466,11 @@ allow_pickle: 'bool' = False ##### Arguments -- **b**: -- **content_type**: -- **encoding**: -- **proto**: -- **allow_pickle**: +- `b`: +- `content_type`: +- `encoding`: +- `proto`: +- `allow_pickle`: @@ -485,8 +486,8 @@ ref_template: 'str' = '#/$defs/{model}' ##### Arguments -- **by_alias**: -- **ref_template**: +- `by_alias`: +- `ref_template`: @@ -503,9 +504,9 @@ ref_template: 'str' = '#/$defs/{model}', **dumps_kwargs: 'Any' ##### Arguments -- **by_alias**: -- **ref_template**: -- **dumps_kwargs**: +- `by_alias`: +- `ref_template`: +- `dumps_kwargs`: @@ -521,7 +522,7 @@ Define a new Automation in which this event triggers the given action. ##### Arguments -- **action**: +- `action`: @@ -536,7 +537,7 @@ Define a new Automation in which this event triggers the given action. ##### Arguments -- **localns**: +- `localns`: @@ -551,7 +552,7 @@ value: 'Any' ##### Arguments -- **value**: +- `value`: diff --git a/models/ref/python/automations/oncreateartifact.mdx b/models/ref/python/automations/oncreateartifact.mdx index 091a7767d6..f6ced11f1b 100644 --- a/models/ref/python/automations/oncreateartifact.mdx +++ b/models/ref/python/automations/oncreateartifact.mdx @@ -11,6 +11,7 @@ import { GitHubLink } from '/snippets/_includes/github-source-link.mdx'; +## class OnCreateArtifact ```python *, event_type: Literal[CREATE_ARTIFACT] = CREATE_ARTIFACT, @@ -26,9 +27,9 @@ A new artifact is created. ## Args -- **event_type**: -- **scope**: -- **filter**: +- `event_type`: +- `scope`: +- `filter`: ## Examples @@ -60,8 +61,8 @@ _fields_set: 'set[str] | None' = None, **values: 'Any' ##### Arguments -- **_fields_set**: -- **values**: +- `_fields_set`: +- `values`: @@ -91,10 +92,10 @@ copied = self.model_validate(data) ##### Arguments -- **include**: Optional set or mapping specifying which fields to include in the copied model. -- **exclude**: Optional set or mapping specifying which fields to exclude in the copied model. -- **update**: Optional dictionary of field-value pairs to override field values in the copied model. -- **deep**: If True, the values of fields that are Pydantic models will be deep-copied. +- `include`: Optional set or mapping specifying which fields to include in the copied model. +- `exclude`: Optional set or mapping specifying which fields to exclude in the copied model. +- `update`: Optional dictionary of field-value pairs to override field values in the copied model. +- `deep`: If True, the values of fields that are Pydantic models will be deep-copied. @@ -115,12 +116,12 @@ exclude_none: 'bool' = False ##### Arguments -- **include**: -- **exclude**: -- **by_alias**: -- **exclude_unset**: -- **exclude_defaults**: -- **exclude_none**: +- `include`: +- `exclude`: +- `by_alias`: +- `exclude_unset`: +- `exclude_defaults`: +- `exclude_none`: @@ -135,7 +136,7 @@ obj: 'Any' ##### Arguments -- **obj**: +- `obj`: @@ -158,15 +159,15 @@ models_as_dict: 'bool' = PydanticUndefined, **dumps_kwargs: 'Any' ##### Arguments -- **include**: -- **exclude**: -- **by_alias**: -- **exclude_unset**: -- **exclude_defaults**: -- **exclude_none**: -- **encoder**: -- **models_as_dict**: -- **dumps_kwargs**: +- `include`: +- `exclude`: +- `by_alias`: +- `exclude_unset`: +- `exclude_defaults`: +- `exclude_none`: +- `encoder`: +- `models_as_dict`: +- `dumps_kwargs`: @@ -191,8 +192,8 @@ Default values are respected, but no other validation is performed. ##### Arguments -- **_fields_set**: A set of field names that were originally explicitly set during instantiation. If provided, this is directly used for the [`model_fields_set`][pydantic.BaseModel.model_fields_set] attribute. Otherwise, the field names from the `values` argument will be used. -- **values**: Trusted or pre-validated data dictionary. +- `_fields_set`: A set of field names that were originally explicitly set during instantiation. If provided, this is directly used for the [`model_fields_set`][pydantic.BaseModel.model_fields_set] attribute. Otherwise, the field names from the `values` argument will be used. +- `values`: Trusted or pre-validated data dictionary. @@ -217,8 +218,8 @@ Returns a copy of the model. ##### Arguments -- **update**: Values to change/add in the new model. Note: the data is not validated before creating the new model. You should trust this data. -- **deep**: Set to `True` to make a deep copy of the model. +- `update`: Values to change/add in the new model. Note: the data is not validated before creating the new model. You should trust this data. +- `deep`: Set to `True` to make a deep copy of the model. @@ -237,8 +238,8 @@ Generate a dictionary representation of the model, optionally specifying which f ##### Arguments -- **mode**: The mode in which `to_python` should run. If mode is 'json', the output will only contain JSON serializable types. If mode is 'python', the output may contain non-JSON-serializable Python objects. -- **kwargs**: +- `mode`: The mode in which `to_python` should run. If mode is 'json', the output will only contain JSON serializable types. If mode is 'python', the output may contain non-JSON-serializable Python objects. +- `kwargs`: @@ -257,8 +258,8 @@ Generates a JSON representation of the model using Pydantic's `to_json` method. ##### Arguments -- **indent**: Indentation to use in the JSON output. If None is passed, the output will be compact. -- **kwargs**: +- `indent`: Indentation to use in the JSON output. If None is passed, the output will be compact. +- `kwargs`: @@ -276,10 +277,10 @@ Generates a JSON schema for a model class. ##### Arguments -- **by_alias**: Whether to use attribute aliases or not. -- **ref_template**: The reference template. -- **schema_generator**: To override the logic used to generate the JSON schema, as a subclass of `GenerateJsonSchema` with your desired modifications -- **mode**: The mode in which to generate the schema. +- `by_alias`: Whether to use attribute aliases or not. +- `ref_template`: The reference template. +- `schema_generator`: To override the logic used to generate the JSON schema, as a subclass of `GenerateJsonSchema` with your desired modifications +- `mode`: The mode in which to generate the schema. @@ -296,12 +297,12 @@ This method can be overridden to achieve a custom naming scheme for generic Base ##### Arguments -- **params**: Tuple of types of the class. Given a generic class `Model` with 2 type variables and a concrete model `Model[str, int]`, the value `(str, int)` would be passed to `params`. +- `params`: Tuple of types of the class. Given a generic class `Model` with 2 type variables and a concrete model `Model[str, int]`, the value `(str, int)` would be passed to `params`. ##### Raises -- **TypeError**: Raised when trying to generate concrete names for non-generic models. +- `TypeError`: Raised when trying to generate concrete names for non-generic models. ### method model_post_init @@ -316,7 +317,7 @@ This is useful if you want to do some validation that requires the entire model ##### Arguments -- **context**: +- `context`: @@ -338,10 +339,10 @@ the initial attempt to build the schema, and automatic rebuilding fails. ##### Arguments -- **force**: Whether to force the rebuilding of the model schema, defaults to `False`. -- **raise_errors**: Whether to raise errors, defaults to `True`. -- **_parent_namespace_depth**: The depth level of the parent namespace, defaults to 2. -- **_types_namespace**: The types namespace, defaults to `None`. +- `force`: Whether to force the rebuilding of the model schema, defaults to `False`. +- `raise_errors`: Whether to raise errors, defaults to `True`. +- `_parent_namespace_depth`: The depth level of the parent namespace, defaults to 2. +- `_types_namespace`: The types namespace, defaults to `None`. @@ -361,17 +362,17 @@ Validate a pydantic model instance. ##### Arguments -- **obj**: The object to validate. -- **strict**: Whether to enforce types strictly. -- **from_attributes**: Whether to extract data from object attributes. -- **context**: Additional context to pass to the validator. -- **by_alias**: Whether to use the field's alias when validating against the provided input data. -- **by_name**: Whether to use the field's name when validating against the provided input data. +- `obj`: The object to validate. +- `strict`: Whether to enforce types strictly. +- `from_attributes`: Whether to extract data from object attributes. +- `context`: Additional context to pass to the validator. +- `by_alias`: Whether to use the field's alias when validating against the provided input data. +- `by_name`: Whether to use the field's name when validating against the provided input data. ##### Raises -- **ValidationError**: If the object could not be validated. +- `ValidationError`: If the object could not be validated. ### method model_validate_json @@ -391,16 +392,16 @@ Validate the given JSON data against the Pydantic model. ##### Arguments -- **json_data**: The JSON data to validate. -- **strict**: Whether to enforce types strictly. -- **context**: Extra variables to pass to the validator. -- **by_alias**: Whether to use the field's alias when validating against the provided input data. -- **by_name**: Whether to use the field's name when validating against the provided input data. +- `json_data`: The JSON data to validate. +- `strict`: Whether to enforce types strictly. +- `context`: Extra variables to pass to the validator. +- `by_alias`: Whether to use the field's alias when validating against the provided input data. +- `by_name`: Whether to use the field's name when validating against the provided input data. ##### Raises -- **ValidationError**: If `json_data` is not a JSON string or the object could not be validated. +- `ValidationError`: If `json_data` is not a JSON string or the object could not be validated. ### method model_validate_strings @@ -417,11 +418,11 @@ Validate the given object with string data against the Pydantic model. ##### Arguments -- **obj**: The object containing string data to validate. -- **strict**: Whether to enforce types strictly. -- **context**: Extra variables to pass to the validator. -- **by_alias**: Whether to use the field's alias when validating against the provided input data. -- **by_name**: Whether to use the field's name when validating against the provided input data. +- `obj`: The object containing string data to validate. +- `strict`: Whether to enforce types strictly. +- `context`: Extra variables to pass to the validator. +- `by_alias`: Whether to use the field's alias when validating against the provided input data. +- `by_name`: Whether to use the field's name when validating against the provided input data. @@ -440,11 +441,11 @@ allow_pickle: 'bool' = False ##### Arguments -- **path**: -- **content_type**: -- **encoding**: -- **proto**: -- **allow_pickle**: +- `path`: +- `content_type`: +- `encoding`: +- `proto`: +- `allow_pickle`: @@ -459,7 +460,7 @@ obj: 'Any' ##### Arguments -- **obj**: +- `obj`: @@ -478,11 +479,11 @@ allow_pickle: 'bool' = False ##### Arguments -- **b**: -- **content_type**: -- **encoding**: -- **proto**: -- **allow_pickle**: +- `b`: +- `content_type`: +- `encoding`: +- `proto`: +- `allow_pickle`: @@ -498,8 +499,8 @@ ref_template: 'str' = '#/$defs/{model}' ##### Arguments -- **by_alias**: -- **ref_template**: +- `by_alias`: +- `ref_template`: @@ -516,9 +517,9 @@ ref_template: 'str' = '#/$defs/{model}', **dumps_kwargs: 'Any' ##### Arguments -- **by_alias**: -- **ref_template**: -- **dumps_kwargs**: +- `by_alias`: +- `ref_template`: +- `dumps_kwargs`: @@ -534,7 +535,7 @@ Define a new Automation in which this event triggers the given action. ##### Arguments -- **action**: +- `action`: @@ -549,7 +550,7 @@ Define a new Automation in which this event triggers the given action. ##### Arguments -- **localns**: +- `localns`: @@ -564,7 +565,7 @@ value: 'Any' ##### Arguments -- **value**: +- `value`: diff --git a/models/ref/python/automations/onlinkartifact.mdx b/models/ref/python/automations/onlinkartifact.mdx index d4cbacd902..34d5d1c80e 100644 --- a/models/ref/python/automations/onlinkartifact.mdx +++ b/models/ref/python/automations/onlinkartifact.mdx @@ -11,6 +11,7 @@ import { GitHubLink } from '/snippets/_includes/github-source-link.mdx'; +## class OnLinkArtifact ```python *, event_type: Literal[LINK_ARTIFACT] = LINK_ARTIFACT, @@ -26,9 +27,9 @@ A new artifact is linked to a collection. ## Args -- **event_type**: -- **scope**: -- **filter**: +- `event_type`: +- `scope`: +- `filter`: ## Examples @@ -63,8 +64,8 @@ _fields_set: 'set[str] | None' = None, **values: 'Any' ##### Arguments -- **_fields_set**: -- **values**: +- `_fields_set`: +- `values`: @@ -94,10 +95,10 @@ copied = self.model_validate(data) ##### Arguments -- **include**: Optional set or mapping specifying which fields to include in the copied model. -- **exclude**: Optional set or mapping specifying which fields to exclude in the copied model. -- **update**: Optional dictionary of field-value pairs to override field values in the copied model. -- **deep**: If True, the values of fields that are Pydantic models will be deep-copied. +- `include`: Optional set or mapping specifying which fields to include in the copied model. +- `exclude`: Optional set or mapping specifying which fields to exclude in the copied model. +- `update`: Optional dictionary of field-value pairs to override field values in the copied model. +- `deep`: If True, the values of fields that are Pydantic models will be deep-copied. @@ -118,12 +119,12 @@ exclude_none: 'bool' = False ##### Arguments -- **include**: -- **exclude**: -- **by_alias**: -- **exclude_unset**: -- **exclude_defaults**: -- **exclude_none**: +- `include`: +- `exclude`: +- `by_alias`: +- `exclude_unset`: +- `exclude_defaults`: +- `exclude_none`: @@ -138,7 +139,7 @@ obj: 'Any' ##### Arguments -- **obj**: +- `obj`: @@ -161,15 +162,15 @@ models_as_dict: 'bool' = PydanticUndefined, **dumps_kwargs: 'Any' ##### Arguments -- **include**: -- **exclude**: -- **by_alias**: -- **exclude_unset**: -- **exclude_defaults**: -- **exclude_none**: -- **encoder**: -- **models_as_dict**: -- **dumps_kwargs**: +- `include`: +- `exclude`: +- `by_alias`: +- `exclude_unset`: +- `exclude_defaults`: +- `exclude_none`: +- `encoder`: +- `models_as_dict`: +- `dumps_kwargs`: @@ -194,8 +195,8 @@ Default values are respected, but no other validation is performed. ##### Arguments -- **_fields_set**: A set of field names that were originally explicitly set during instantiation. If provided, this is directly used for the [`model_fields_set`][pydantic.BaseModel.model_fields_set] attribute. Otherwise, the field names from the `values` argument will be used. -- **values**: Trusted or pre-validated data dictionary. +- `_fields_set`: A set of field names that were originally explicitly set during instantiation. If provided, this is directly used for the [`model_fields_set`][pydantic.BaseModel.model_fields_set] attribute. Otherwise, the field names from the `values` argument will be used. +- `values`: Trusted or pre-validated data dictionary. @@ -220,8 +221,8 @@ Returns a copy of the model. ##### Arguments -- **update**: Values to change/add in the new model. Note: the data is not validated before creating the new model. You should trust this data. -- **deep**: Set to `True` to make a deep copy of the model. +- `update`: Values to change/add in the new model. Note: the data is not validated before creating the new model. You should trust this data. +- `deep`: Set to `True` to make a deep copy of the model. @@ -240,8 +241,8 @@ Generate a dictionary representation of the model, optionally specifying which f ##### Arguments -- **mode**: The mode in which `to_python` should run. If mode is 'json', the output will only contain JSON serializable types. If mode is 'python', the output may contain non-JSON-serializable Python objects. -- **kwargs**: +- `mode`: The mode in which `to_python` should run. If mode is 'json', the output will only contain JSON serializable types. If mode is 'python', the output may contain non-JSON-serializable Python objects. +- `kwargs`: @@ -260,8 +261,8 @@ Generates a JSON representation of the model using Pydantic's `to_json` method. ##### Arguments -- **indent**: Indentation to use in the JSON output. If None is passed, the output will be compact. -- **kwargs**: +- `indent`: Indentation to use in the JSON output. If None is passed, the output will be compact. +- `kwargs`: @@ -279,10 +280,10 @@ Generates a JSON schema for a model class. ##### Arguments -- **by_alias**: Whether to use attribute aliases or not. -- **ref_template**: The reference template. -- **schema_generator**: To override the logic used to generate the JSON schema, as a subclass of `GenerateJsonSchema` with your desired modifications -- **mode**: The mode in which to generate the schema. +- `by_alias`: Whether to use attribute aliases or not. +- `ref_template`: The reference template. +- `schema_generator`: To override the logic used to generate the JSON schema, as a subclass of `GenerateJsonSchema` with your desired modifications +- `mode`: The mode in which to generate the schema. @@ -299,12 +300,12 @@ This method can be overridden to achieve a custom naming scheme for generic Base ##### Arguments -- **params**: Tuple of types of the class. Given a generic class `Model` with 2 type variables and a concrete model `Model[str, int]`, the value `(str, int)` would be passed to `params`. +- `params`: Tuple of types of the class. Given a generic class `Model` with 2 type variables and a concrete model `Model[str, int]`, the value `(str, int)` would be passed to `params`. ##### Raises -- **TypeError**: Raised when trying to generate concrete names for non-generic models. +- `TypeError`: Raised when trying to generate concrete names for non-generic models. ### method model_post_init @@ -319,7 +320,7 @@ This is useful if you want to do some validation that requires the entire model ##### Arguments -- **context**: +- `context`: @@ -341,10 +342,10 @@ the initial attempt to build the schema, and automatic rebuilding fails. ##### Arguments -- **force**: Whether to force the rebuilding of the model schema, defaults to `False`. -- **raise_errors**: Whether to raise errors, defaults to `True`. -- **_parent_namespace_depth**: The depth level of the parent namespace, defaults to 2. -- **_types_namespace**: The types namespace, defaults to `None`. +- `force`: Whether to force the rebuilding of the model schema, defaults to `False`. +- `raise_errors`: Whether to raise errors, defaults to `True`. +- `_parent_namespace_depth`: The depth level of the parent namespace, defaults to 2. +- `_types_namespace`: The types namespace, defaults to `None`. @@ -364,17 +365,17 @@ Validate a pydantic model instance. ##### Arguments -- **obj**: The object to validate. -- **strict**: Whether to enforce types strictly. -- **from_attributes**: Whether to extract data from object attributes. -- **context**: Additional context to pass to the validator. -- **by_alias**: Whether to use the field's alias when validating against the provided input data. -- **by_name**: Whether to use the field's name when validating against the provided input data. +- `obj`: The object to validate. +- `strict`: Whether to enforce types strictly. +- `from_attributes`: Whether to extract data from object attributes. +- `context`: Additional context to pass to the validator. +- `by_alias`: Whether to use the field's alias when validating against the provided input data. +- `by_name`: Whether to use the field's name when validating against the provided input data. ##### Raises -- **ValidationError**: If the object could not be validated. +- `ValidationError`: If the object could not be validated. ### method model_validate_json @@ -394,16 +395,16 @@ Validate the given JSON data against the Pydantic model. ##### Arguments -- **json_data**: The JSON data to validate. -- **strict**: Whether to enforce types strictly. -- **context**: Extra variables to pass to the validator. -- **by_alias**: Whether to use the field's alias when validating against the provided input data. -- **by_name**: Whether to use the field's name when validating against the provided input data. +- `json_data`: The JSON data to validate. +- `strict`: Whether to enforce types strictly. +- `context`: Extra variables to pass to the validator. +- `by_alias`: Whether to use the field's alias when validating against the provided input data. +- `by_name`: Whether to use the field's name when validating against the provided input data. ##### Raises -- **ValidationError**: If `json_data` is not a JSON string or the object could not be validated. +- `ValidationError`: If `json_data` is not a JSON string or the object could not be validated. ### method model_validate_strings @@ -420,11 +421,11 @@ Validate the given object with string data against the Pydantic model. ##### Arguments -- **obj**: The object containing string data to validate. -- **strict**: Whether to enforce types strictly. -- **context**: Extra variables to pass to the validator. -- **by_alias**: Whether to use the field's alias when validating against the provided input data. -- **by_name**: Whether to use the field's name when validating against the provided input data. +- `obj`: The object containing string data to validate. +- `strict`: Whether to enforce types strictly. +- `context`: Extra variables to pass to the validator. +- `by_alias`: Whether to use the field's alias when validating against the provided input data. +- `by_name`: Whether to use the field's name when validating against the provided input data. @@ -443,11 +444,11 @@ allow_pickle: 'bool' = False ##### Arguments -- **path**: -- **content_type**: -- **encoding**: -- **proto**: -- **allow_pickle**: +- `path`: +- `content_type`: +- `encoding`: +- `proto`: +- `allow_pickle`: @@ -462,7 +463,7 @@ obj: 'Any' ##### Arguments -- **obj**: +- `obj`: @@ -481,11 +482,11 @@ allow_pickle: 'bool' = False ##### Arguments -- **b**: -- **content_type**: -- **encoding**: -- **proto**: -- **allow_pickle**: +- `b`: +- `content_type`: +- `encoding`: +- `proto`: +- `allow_pickle`: @@ -501,8 +502,8 @@ ref_template: 'str' = '#/$defs/{model}' ##### Arguments -- **by_alias**: -- **ref_template**: +- `by_alias`: +- `ref_template`: @@ -519,9 +520,9 @@ ref_template: 'str' = '#/$defs/{model}', **dumps_kwargs: 'Any' ##### Arguments -- **by_alias**: -- **ref_template**: -- **dumps_kwargs**: +- `by_alias`: +- `ref_template`: +- `dumps_kwargs`: @@ -537,7 +538,7 @@ Define a new Automation in which this event triggers the given action. ##### Arguments -- **action**: +- `action`: @@ -552,7 +553,7 @@ Define a new Automation in which this event triggers the given action. ##### Arguments -- **localns**: +- `localns`: @@ -567,7 +568,7 @@ value: 'Any' ##### Arguments -- **value**: +- `value`: diff --git a/models/ref/python/automations/onremoveartifacttag.mdx b/models/ref/python/automations/onremoveartifacttag.mdx index d03d64c5c2..c2514e110a 100644 --- a/models/ref/python/automations/onremoveartifacttag.mdx +++ b/models/ref/python/automations/onremoveartifacttag.mdx @@ -11,6 +11,7 @@ import { GitHubLink } from '/snippets/_includes/github-source-link.mdx'; +## class OnRemoveArtifactTag ```python *, event_type: Literal[REMOVE_ARTIFACT_TAG] = REMOVE_ARTIFACT_TAG, @@ -26,9 +27,9 @@ A tag is removed from an artifact version. ## Args -- **event_type**: -- **scope**: -- **filter**: +- `event_type`: +- `scope`: +- `filter`: @@ -47,8 +48,8 @@ _fields_set: 'set[str] | None' = None, **values: 'Any' ##### Arguments -- **_fields_set**: -- **values**: +- `_fields_set`: +- `values`: @@ -78,10 +79,10 @@ copied = self.model_validate(data) ##### Arguments -- **include**: Optional set or mapping specifying which fields to include in the copied model. -- **exclude**: Optional set or mapping specifying which fields to exclude in the copied model. -- **update**: Optional dictionary of field-value pairs to override field values in the copied model. -- **deep**: If True, the values of fields that are Pydantic models will be deep-copied. +- `include`: Optional set or mapping specifying which fields to include in the copied model. +- `exclude`: Optional set or mapping specifying which fields to exclude in the copied model. +- `update`: Optional dictionary of field-value pairs to override field values in the copied model. +- `deep`: If True, the values of fields that are Pydantic models will be deep-copied. @@ -102,12 +103,12 @@ exclude_none: 'bool' = False ##### Arguments -- **include**: -- **exclude**: -- **by_alias**: -- **exclude_unset**: -- **exclude_defaults**: -- **exclude_none**: +- `include`: +- `exclude`: +- `by_alias`: +- `exclude_unset`: +- `exclude_defaults`: +- `exclude_none`: @@ -122,7 +123,7 @@ obj: 'Any' ##### Arguments -- **obj**: +- `obj`: @@ -145,15 +146,15 @@ models_as_dict: 'bool' = PydanticUndefined, **dumps_kwargs: 'Any' ##### Arguments -- **include**: -- **exclude**: -- **by_alias**: -- **exclude_unset**: -- **exclude_defaults**: -- **exclude_none**: -- **encoder**: -- **models_as_dict**: -- **dumps_kwargs**: +- `include`: +- `exclude`: +- `by_alias`: +- `exclude_unset`: +- `exclude_defaults`: +- `exclude_none`: +- `encoder`: +- `models_as_dict`: +- `dumps_kwargs`: @@ -178,8 +179,8 @@ Default values are respected, but no other validation is performed. ##### Arguments -- **_fields_set**: A set of field names that were originally explicitly set during instantiation. If provided, this is directly used for the [`model_fields_set`][pydantic.BaseModel.model_fields_set] attribute. Otherwise, the field names from the `values` argument will be used. -- **values**: Trusted or pre-validated data dictionary. +- `_fields_set`: A set of field names that were originally explicitly set during instantiation. If provided, this is directly used for the [`model_fields_set`][pydantic.BaseModel.model_fields_set] attribute. Otherwise, the field names from the `values` argument will be used. +- `values`: Trusted or pre-validated data dictionary. @@ -204,8 +205,8 @@ Returns a copy of the model. ##### Arguments -- **update**: Values to change/add in the new model. Note: the data is not validated before creating the new model. You should trust this data. -- **deep**: Set to `True` to make a deep copy of the model. +- `update`: Values to change/add in the new model. Note: the data is not validated before creating the new model. You should trust this data. +- `deep`: Set to `True` to make a deep copy of the model. @@ -224,8 +225,8 @@ Generate a dictionary representation of the model, optionally specifying which f ##### Arguments -- **mode**: The mode in which `to_python` should run. If mode is 'json', the output will only contain JSON serializable types. If mode is 'python', the output may contain non-JSON-serializable Python objects. -- **kwargs**: +- `mode`: The mode in which `to_python` should run. If mode is 'json', the output will only contain JSON serializable types. If mode is 'python', the output may contain non-JSON-serializable Python objects. +- `kwargs`: @@ -244,8 +245,8 @@ Generates a JSON representation of the model using Pydantic's `to_json` method. ##### Arguments -- **indent**: Indentation to use in the JSON output. If None is passed, the output will be compact. -- **kwargs**: +- `indent`: Indentation to use in the JSON output. If None is passed, the output will be compact. +- `kwargs`: @@ -263,10 +264,10 @@ Generates a JSON schema for a model class. ##### Arguments -- **by_alias**: Whether to use attribute aliases or not. -- **ref_template**: The reference template. -- **schema_generator**: To override the logic used to generate the JSON schema, as a subclass of `GenerateJsonSchema` with your desired modifications -- **mode**: The mode in which to generate the schema. +- `by_alias`: Whether to use attribute aliases or not. +- `ref_template`: The reference template. +- `schema_generator`: To override the logic used to generate the JSON schema, as a subclass of `GenerateJsonSchema` with your desired modifications +- `mode`: The mode in which to generate the schema. @@ -283,12 +284,12 @@ This method can be overridden to achieve a custom naming scheme for generic Base ##### Arguments -- **params**: Tuple of types of the class. Given a generic class `Model` with 2 type variables and a concrete model `Model[str, int]`, the value `(str, int)` would be passed to `params`. +- `params`: Tuple of types of the class. Given a generic class `Model` with 2 type variables and a concrete model `Model[str, int]`, the value `(str, int)` would be passed to `params`. ##### Raises -- **TypeError**: Raised when trying to generate concrete names for non-generic models. +- `TypeError`: Raised when trying to generate concrete names for non-generic models. ### method model_post_init @@ -303,7 +304,7 @@ This is useful if you want to do some validation that requires the entire model ##### Arguments -- **context**: +- `context`: @@ -325,10 +326,10 @@ the initial attempt to build the schema, and automatic rebuilding fails. ##### Arguments -- **force**: Whether to force the rebuilding of the model schema, defaults to `False`. -- **raise_errors**: Whether to raise errors, defaults to `True`. -- **_parent_namespace_depth**: The depth level of the parent namespace, defaults to 2. -- **_types_namespace**: The types namespace, defaults to `None`. +- `force`: Whether to force the rebuilding of the model schema, defaults to `False`. +- `raise_errors`: Whether to raise errors, defaults to `True`. +- `_parent_namespace_depth`: The depth level of the parent namespace, defaults to 2. +- `_types_namespace`: The types namespace, defaults to `None`. @@ -348,17 +349,17 @@ Validate a pydantic model instance. ##### Arguments -- **obj**: The object to validate. -- **strict**: Whether to enforce types strictly. -- **from_attributes**: Whether to extract data from object attributes. -- **context**: Additional context to pass to the validator. -- **by_alias**: Whether to use the field's alias when validating against the provided input data. -- **by_name**: Whether to use the field's name when validating against the provided input data. +- `obj`: The object to validate. +- `strict`: Whether to enforce types strictly. +- `from_attributes`: Whether to extract data from object attributes. +- `context`: Additional context to pass to the validator. +- `by_alias`: Whether to use the field's alias when validating against the provided input data. +- `by_name`: Whether to use the field's name when validating against the provided input data. ##### Raises -- **ValidationError**: If the object could not be validated. +- `ValidationError`: If the object could not be validated. ### method model_validate_json @@ -378,16 +379,16 @@ Validate the given JSON data against the Pydantic model. ##### Arguments -- **json_data**: The JSON data to validate. -- **strict**: Whether to enforce types strictly. -- **context**: Extra variables to pass to the validator. -- **by_alias**: Whether to use the field's alias when validating against the provided input data. -- **by_name**: Whether to use the field's name when validating against the provided input data. +- `json_data`: The JSON data to validate. +- `strict`: Whether to enforce types strictly. +- `context`: Extra variables to pass to the validator. +- `by_alias`: Whether to use the field's alias when validating against the provided input data. +- `by_name`: Whether to use the field's name when validating against the provided input data. ##### Raises -- **ValidationError**: If `json_data` is not a JSON string or the object could not be validated. +- `ValidationError`: If `json_data` is not a JSON string or the object could not be validated. ### method model_validate_strings @@ -404,11 +405,11 @@ Validate the given object with string data against the Pydantic model. ##### Arguments -- **obj**: The object containing string data to validate. -- **strict**: Whether to enforce types strictly. -- **context**: Extra variables to pass to the validator. -- **by_alias**: Whether to use the field's alias when validating against the provided input data. -- **by_name**: Whether to use the field's name when validating against the provided input data. +- `obj`: The object containing string data to validate. +- `strict`: Whether to enforce types strictly. +- `context`: Extra variables to pass to the validator. +- `by_alias`: Whether to use the field's alias when validating against the provided input data. +- `by_name`: Whether to use the field's name when validating against the provided input data. @@ -427,11 +428,11 @@ allow_pickle: 'bool' = False ##### Arguments -- **path**: -- **content_type**: -- **encoding**: -- **proto**: -- **allow_pickle**: +- `path`: +- `content_type`: +- `encoding`: +- `proto`: +- `allow_pickle`: @@ -446,7 +447,7 @@ obj: 'Any' ##### Arguments -- **obj**: +- `obj`: @@ -465,11 +466,11 @@ allow_pickle: 'bool' = False ##### Arguments -- **b**: -- **content_type**: -- **encoding**: -- **proto**: -- **allow_pickle**: +- `b`: +- `content_type`: +- `encoding`: +- `proto`: +- `allow_pickle`: @@ -485,8 +486,8 @@ ref_template: 'str' = '#/$defs/{model}' ##### Arguments -- **by_alias**: -- **ref_template**: +- `by_alias`: +- `ref_template`: @@ -503,9 +504,9 @@ ref_template: 'str' = '#/$defs/{model}', **dumps_kwargs: 'Any' ##### Arguments -- **by_alias**: -- **ref_template**: -- **dumps_kwargs**: +- `by_alias`: +- `ref_template`: +- `dumps_kwargs`: @@ -521,7 +522,7 @@ Define a new Automation in which this event triggers the given action. ##### Arguments -- **action**: +- `action`: @@ -536,7 +537,7 @@ Define a new Automation in which this event triggers the given action. ##### Arguments -- **localns**: +- `localns`: @@ -551,7 +552,7 @@ value: 'Any' ##### Arguments -- **value**: +- `value`: diff --git a/models/ref/python/automations/onremovecollectiontag.mdx b/models/ref/python/automations/onremovecollectiontag.mdx index 107e31c867..8f2580f16e 100644 --- a/models/ref/python/automations/onremovecollectiontag.mdx +++ b/models/ref/python/automations/onremovecollectiontag.mdx @@ -11,6 +11,7 @@ import { GitHubLink } from '/snippets/_includes/github-source-link.mdx'; +## class OnRemoveCollectionTag ```python *, event_type: Literal[REMOVE_COLLECTION_TAG] = REMOVE_COLLECTION_TAG, @@ -26,9 +27,9 @@ A tag is removed from an artifact collection. ## Args -- **event_type**: -- **scope**: -- **filter**: +- `event_type`: +- `scope`: +- `filter`: @@ -47,8 +48,8 @@ _fields_set: 'set[str] | None' = None, **values: 'Any' ##### Arguments -- **_fields_set**: -- **values**: +- `_fields_set`: +- `values`: @@ -78,10 +79,10 @@ copied = self.model_validate(data) ##### Arguments -- **include**: Optional set or mapping specifying which fields to include in the copied model. -- **exclude**: Optional set or mapping specifying which fields to exclude in the copied model. -- **update**: Optional dictionary of field-value pairs to override field values in the copied model. -- **deep**: If True, the values of fields that are Pydantic models will be deep-copied. +- `include`: Optional set or mapping specifying which fields to include in the copied model. +- `exclude`: Optional set or mapping specifying which fields to exclude in the copied model. +- `update`: Optional dictionary of field-value pairs to override field values in the copied model. +- `deep`: If True, the values of fields that are Pydantic models will be deep-copied. @@ -102,12 +103,12 @@ exclude_none: 'bool' = False ##### Arguments -- **include**: -- **exclude**: -- **by_alias**: -- **exclude_unset**: -- **exclude_defaults**: -- **exclude_none**: +- `include`: +- `exclude`: +- `by_alias`: +- `exclude_unset`: +- `exclude_defaults`: +- `exclude_none`: @@ -122,7 +123,7 @@ obj: 'Any' ##### Arguments -- **obj**: +- `obj`: @@ -145,15 +146,15 @@ models_as_dict: 'bool' = PydanticUndefined, **dumps_kwargs: 'Any' ##### Arguments -- **include**: -- **exclude**: -- **by_alias**: -- **exclude_unset**: -- **exclude_defaults**: -- **exclude_none**: -- **encoder**: -- **models_as_dict**: -- **dumps_kwargs**: +- `include`: +- `exclude`: +- `by_alias`: +- `exclude_unset`: +- `exclude_defaults`: +- `exclude_none`: +- `encoder`: +- `models_as_dict`: +- `dumps_kwargs`: @@ -178,8 +179,8 @@ Default values are respected, but no other validation is performed. ##### Arguments -- **_fields_set**: A set of field names that were originally explicitly set during instantiation. If provided, this is directly used for the [`model_fields_set`][pydantic.BaseModel.model_fields_set] attribute. Otherwise, the field names from the `values` argument will be used. -- **values**: Trusted or pre-validated data dictionary. +- `_fields_set`: A set of field names that were originally explicitly set during instantiation. If provided, this is directly used for the [`model_fields_set`][pydantic.BaseModel.model_fields_set] attribute. Otherwise, the field names from the `values` argument will be used. +- `values`: Trusted or pre-validated data dictionary. @@ -204,8 +205,8 @@ Returns a copy of the model. ##### Arguments -- **update**: Values to change/add in the new model. Note: the data is not validated before creating the new model. You should trust this data. -- **deep**: Set to `True` to make a deep copy of the model. +- `update`: Values to change/add in the new model. Note: the data is not validated before creating the new model. You should trust this data. +- `deep`: Set to `True` to make a deep copy of the model. @@ -224,8 +225,8 @@ Generate a dictionary representation of the model, optionally specifying which f ##### Arguments -- **mode**: The mode in which `to_python` should run. If mode is 'json', the output will only contain JSON serializable types. If mode is 'python', the output may contain non-JSON-serializable Python objects. -- **kwargs**: +- `mode`: The mode in which `to_python` should run. If mode is 'json', the output will only contain JSON serializable types. If mode is 'python', the output may contain non-JSON-serializable Python objects. +- `kwargs`: @@ -244,8 +245,8 @@ Generates a JSON representation of the model using Pydantic's `to_json` method. ##### Arguments -- **indent**: Indentation to use in the JSON output. If None is passed, the output will be compact. -- **kwargs**: +- `indent`: Indentation to use in the JSON output. If None is passed, the output will be compact. +- `kwargs`: @@ -263,10 +264,10 @@ Generates a JSON schema for a model class. ##### Arguments -- **by_alias**: Whether to use attribute aliases or not. -- **ref_template**: The reference template. -- **schema_generator**: To override the logic used to generate the JSON schema, as a subclass of `GenerateJsonSchema` with your desired modifications -- **mode**: The mode in which to generate the schema. +- `by_alias`: Whether to use attribute aliases or not. +- `ref_template`: The reference template. +- `schema_generator`: To override the logic used to generate the JSON schema, as a subclass of `GenerateJsonSchema` with your desired modifications +- `mode`: The mode in which to generate the schema. @@ -283,12 +284,12 @@ This method can be overridden to achieve a custom naming scheme for generic Base ##### Arguments -- **params**: Tuple of types of the class. Given a generic class `Model` with 2 type variables and a concrete model `Model[str, int]`, the value `(str, int)` would be passed to `params`. +- `params`: Tuple of types of the class. Given a generic class `Model` with 2 type variables and a concrete model `Model[str, int]`, the value `(str, int)` would be passed to `params`. ##### Raises -- **TypeError**: Raised when trying to generate concrete names for non-generic models. +- `TypeError`: Raised when trying to generate concrete names for non-generic models. ### method model_post_init @@ -303,7 +304,7 @@ This is useful if you want to do some validation that requires the entire model ##### Arguments -- **context**: +- `context`: @@ -325,10 +326,10 @@ the initial attempt to build the schema, and automatic rebuilding fails. ##### Arguments -- **force**: Whether to force the rebuilding of the model schema, defaults to `False`. -- **raise_errors**: Whether to raise errors, defaults to `True`. -- **_parent_namespace_depth**: The depth level of the parent namespace, defaults to 2. -- **_types_namespace**: The types namespace, defaults to `None`. +- `force`: Whether to force the rebuilding of the model schema, defaults to `False`. +- `raise_errors`: Whether to raise errors, defaults to `True`. +- `_parent_namespace_depth`: The depth level of the parent namespace, defaults to 2. +- `_types_namespace`: The types namespace, defaults to `None`. @@ -348,17 +349,17 @@ Validate a pydantic model instance. ##### Arguments -- **obj**: The object to validate. -- **strict**: Whether to enforce types strictly. -- **from_attributes**: Whether to extract data from object attributes. -- **context**: Additional context to pass to the validator. -- **by_alias**: Whether to use the field's alias when validating against the provided input data. -- **by_name**: Whether to use the field's name when validating against the provided input data. +- `obj`: The object to validate. +- `strict`: Whether to enforce types strictly. +- `from_attributes`: Whether to extract data from object attributes. +- `context`: Additional context to pass to the validator. +- `by_alias`: Whether to use the field's alias when validating against the provided input data. +- `by_name`: Whether to use the field's name when validating against the provided input data. ##### Raises -- **ValidationError**: If the object could not be validated. +- `ValidationError`: If the object could not be validated. ### method model_validate_json @@ -378,16 +379,16 @@ Validate the given JSON data against the Pydantic model. ##### Arguments -- **json_data**: The JSON data to validate. -- **strict**: Whether to enforce types strictly. -- **context**: Extra variables to pass to the validator. -- **by_alias**: Whether to use the field's alias when validating against the provided input data. -- **by_name**: Whether to use the field's name when validating against the provided input data. +- `json_data`: The JSON data to validate. +- `strict`: Whether to enforce types strictly. +- `context`: Extra variables to pass to the validator. +- `by_alias`: Whether to use the field's alias when validating against the provided input data. +- `by_name`: Whether to use the field's name when validating against the provided input data. ##### Raises -- **ValidationError**: If `json_data` is not a JSON string or the object could not be validated. +- `ValidationError`: If `json_data` is not a JSON string or the object could not be validated. ### method model_validate_strings @@ -404,11 +405,11 @@ Validate the given object with string data against the Pydantic model. ##### Arguments -- **obj**: The object containing string data to validate. -- **strict**: Whether to enforce types strictly. -- **context**: Extra variables to pass to the validator. -- **by_alias**: Whether to use the field's alias when validating against the provided input data. -- **by_name**: Whether to use the field's name when validating against the provided input data. +- `obj`: The object containing string data to validate. +- `strict`: Whether to enforce types strictly. +- `context`: Extra variables to pass to the validator. +- `by_alias`: Whether to use the field's alias when validating against the provided input data. +- `by_name`: Whether to use the field's name when validating against the provided input data. @@ -427,11 +428,11 @@ allow_pickle: 'bool' = False ##### Arguments -- **path**: -- **content_type**: -- **encoding**: -- **proto**: -- **allow_pickle**: +- `path`: +- `content_type`: +- `encoding`: +- `proto`: +- `allow_pickle`: @@ -446,7 +447,7 @@ obj: 'Any' ##### Arguments -- **obj**: +- `obj`: @@ -465,11 +466,11 @@ allow_pickle: 'bool' = False ##### Arguments -- **b**: -- **content_type**: -- **encoding**: -- **proto**: -- **allow_pickle**: +- `b`: +- `content_type`: +- `encoding`: +- `proto`: +- `allow_pickle`: @@ -485,8 +486,8 @@ ref_template: 'str' = '#/$defs/{model}' ##### Arguments -- **by_alias**: -- **ref_template**: +- `by_alias`: +- `ref_template`: @@ -503,9 +504,9 @@ ref_template: 'str' = '#/$defs/{model}', **dumps_kwargs: 'Any' ##### Arguments -- **by_alias**: -- **ref_template**: -- **dumps_kwargs**: +- `by_alias`: +- `ref_template`: +- `dumps_kwargs`: @@ -521,7 +522,7 @@ Define a new Automation in which this event triggers the given action. ##### Arguments -- **action**: +- `action`: @@ -536,7 +537,7 @@ Define a new Automation in which this event triggers the given action. ##### Arguments -- **localns**: +- `localns`: @@ -551,7 +552,7 @@ value: 'Any' ##### Arguments -- **value**: +- `value`: diff --git a/models/ref/python/automations/onrunmetric.mdx b/models/ref/python/automations/onrunmetric.mdx index 2e57e3b211..267182fe67 100644 --- a/models/ref/python/automations/onrunmetric.mdx +++ b/models/ref/python/automations/onrunmetric.mdx @@ -11,6 +11,7 @@ import { GitHubLink } from '/snippets/_includes/github-source-link.mdx'; +## class OnRunMetric ```python *, event_type: Literal[RUN_METRIC_THRESHOLD, RUN_METRIC_CHANGE, RUN_METRIC_ZSCORE], @@ -26,9 +27,9 @@ A run metric satisfies a user-defined condition. ## Args -- **event_type**: -- **scope**: -- **filter**: +- `event_type`: +- `scope`: +- `filter`: ## Examples @@ -63,8 +64,8 @@ _fields_set: 'set[str] | None' = None, **values: 'Any' ##### Arguments -- **_fields_set**: -- **values**: +- `_fields_set`: +- `values`: @@ -94,10 +95,10 @@ copied = self.model_validate(data) ##### Arguments -- **include**: Optional set or mapping specifying which fields to include in the copied model. -- **exclude**: Optional set or mapping specifying which fields to exclude in the copied model. -- **update**: Optional dictionary of field-value pairs to override field values in the copied model. -- **deep**: If True, the values of fields that are Pydantic models will be deep-copied. +- `include`: Optional set or mapping specifying which fields to include in the copied model. +- `exclude`: Optional set or mapping specifying which fields to exclude in the copied model. +- `update`: Optional dictionary of field-value pairs to override field values in the copied model. +- `deep`: If True, the values of fields that are Pydantic models will be deep-copied. @@ -118,12 +119,12 @@ exclude_none: 'bool' = False ##### Arguments -- **include**: -- **exclude**: -- **by_alias**: -- **exclude_unset**: -- **exclude_defaults**: -- **exclude_none**: +- `include`: +- `exclude`: +- `by_alias`: +- `exclude_unset`: +- `exclude_defaults`: +- `exclude_none`: @@ -138,7 +139,7 @@ obj: 'Any' ##### Arguments -- **obj**: +- `obj`: @@ -161,15 +162,15 @@ models_as_dict: 'bool' = PydanticUndefined, **dumps_kwargs: 'Any' ##### Arguments -- **include**: -- **exclude**: -- **by_alias**: -- **exclude_unset**: -- **exclude_defaults**: -- **exclude_none**: -- **encoder**: -- **models_as_dict**: -- **dumps_kwargs**: +- `include`: +- `exclude`: +- `by_alias`: +- `exclude_unset`: +- `exclude_defaults`: +- `exclude_none`: +- `encoder`: +- `models_as_dict`: +- `dumps_kwargs`: @@ -194,8 +195,8 @@ Default values are respected, but no other validation is performed. ##### Arguments -- **_fields_set**: A set of field names that were originally explicitly set during instantiation. If provided, this is directly used for the [`model_fields_set`][pydantic.BaseModel.model_fields_set] attribute. Otherwise, the field names from the `values` argument will be used. -- **values**: Trusted or pre-validated data dictionary. +- `_fields_set`: A set of field names that were originally explicitly set during instantiation. If provided, this is directly used for the [`model_fields_set`][pydantic.BaseModel.model_fields_set] attribute. Otherwise, the field names from the `values` argument will be used. +- `values`: Trusted or pre-validated data dictionary. @@ -220,8 +221,8 @@ Returns a copy of the model. ##### Arguments -- **update**: Values to change/add in the new model. Note: the data is not validated before creating the new model. You should trust this data. -- **deep**: Set to `True` to make a deep copy of the model. +- `update`: Values to change/add in the new model. Note: the data is not validated before creating the new model. You should trust this data. +- `deep`: Set to `True` to make a deep copy of the model. @@ -240,8 +241,8 @@ Generate a dictionary representation of the model, optionally specifying which f ##### Arguments -- **mode**: The mode in which `to_python` should run. If mode is 'json', the output will only contain JSON serializable types. If mode is 'python', the output may contain non-JSON-serializable Python objects. -- **kwargs**: +- `mode`: The mode in which `to_python` should run. If mode is 'json', the output will only contain JSON serializable types. If mode is 'python', the output may contain non-JSON-serializable Python objects. +- `kwargs`: @@ -260,8 +261,8 @@ Generates a JSON representation of the model using Pydantic's `to_json` method. ##### Arguments -- **indent**: Indentation to use in the JSON output. If None is passed, the output will be compact. -- **kwargs**: +- `indent`: Indentation to use in the JSON output. If None is passed, the output will be compact. +- `kwargs`: @@ -279,10 +280,10 @@ Generates a JSON schema for a model class. ##### Arguments -- **by_alias**: Whether to use attribute aliases or not. -- **ref_template**: The reference template. -- **schema_generator**: To override the logic used to generate the JSON schema, as a subclass of `GenerateJsonSchema` with your desired modifications -- **mode**: The mode in which to generate the schema. +- `by_alias`: Whether to use attribute aliases or not. +- `ref_template`: The reference template. +- `schema_generator`: To override the logic used to generate the JSON schema, as a subclass of `GenerateJsonSchema` with your desired modifications +- `mode`: The mode in which to generate the schema. @@ -299,12 +300,12 @@ This method can be overridden to achieve a custom naming scheme for generic Base ##### Arguments -- **params**: Tuple of types of the class. Given a generic class `Model` with 2 type variables and a concrete model `Model[str, int]`, the value `(str, int)` would be passed to `params`. +- `params`: Tuple of types of the class. Given a generic class `Model` with 2 type variables and a concrete model `Model[str, int]`, the value `(str, int)` would be passed to `params`. ##### Raises -- **TypeError**: Raised when trying to generate concrete names for non-generic models. +- `TypeError`: Raised when trying to generate concrete names for non-generic models. ### method model_post_init @@ -319,7 +320,7 @@ This is useful if you want to do some validation that requires the entire model ##### Arguments -- **context**: +- `context`: @@ -341,10 +342,10 @@ the initial attempt to build the schema, and automatic rebuilding fails. ##### Arguments -- **force**: Whether to force the rebuilding of the model schema, defaults to `False`. -- **raise_errors**: Whether to raise errors, defaults to `True`. -- **_parent_namespace_depth**: The depth level of the parent namespace, defaults to 2. -- **_types_namespace**: The types namespace, defaults to `None`. +- `force`: Whether to force the rebuilding of the model schema, defaults to `False`. +- `raise_errors`: Whether to raise errors, defaults to `True`. +- `_parent_namespace_depth`: The depth level of the parent namespace, defaults to 2. +- `_types_namespace`: The types namespace, defaults to `None`. @@ -364,17 +365,17 @@ Validate a pydantic model instance. ##### Arguments -- **obj**: The object to validate. -- **strict**: Whether to enforce types strictly. -- **from_attributes**: Whether to extract data from object attributes. -- **context**: Additional context to pass to the validator. -- **by_alias**: Whether to use the field's alias when validating against the provided input data. -- **by_name**: Whether to use the field's name when validating against the provided input data. +- `obj`: The object to validate. +- `strict`: Whether to enforce types strictly. +- `from_attributes`: Whether to extract data from object attributes. +- `context`: Additional context to pass to the validator. +- `by_alias`: Whether to use the field's alias when validating against the provided input data. +- `by_name`: Whether to use the field's name when validating against the provided input data. ##### Raises -- **ValidationError**: If the object could not be validated. +- `ValidationError`: If the object could not be validated. ### method model_validate_json @@ -394,16 +395,16 @@ Validate the given JSON data against the Pydantic model. ##### Arguments -- **json_data**: The JSON data to validate. -- **strict**: Whether to enforce types strictly. -- **context**: Extra variables to pass to the validator. -- **by_alias**: Whether to use the field's alias when validating against the provided input data. -- **by_name**: Whether to use the field's name when validating against the provided input data. +- `json_data`: The JSON data to validate. +- `strict`: Whether to enforce types strictly. +- `context`: Extra variables to pass to the validator. +- `by_alias`: Whether to use the field's alias when validating against the provided input data. +- `by_name`: Whether to use the field's name when validating against the provided input data. ##### Raises -- **ValidationError**: If `json_data` is not a JSON string or the object could not be validated. +- `ValidationError`: If `json_data` is not a JSON string or the object could not be validated. ### method model_validate_strings @@ -420,11 +421,11 @@ Validate the given object with string data against the Pydantic model. ##### Arguments -- **obj**: The object containing string data to validate. -- **strict**: Whether to enforce types strictly. -- **context**: Extra variables to pass to the validator. -- **by_alias**: Whether to use the field's alias when validating against the provided input data. -- **by_name**: Whether to use the field's name when validating against the provided input data. +- `obj`: The object containing string data to validate. +- `strict`: Whether to enforce types strictly. +- `context`: Extra variables to pass to the validator. +- `by_alias`: Whether to use the field's alias when validating against the provided input data. +- `by_name`: Whether to use the field's name when validating against the provided input data. @@ -443,11 +444,11 @@ allow_pickle: 'bool' = False ##### Arguments -- **path**: -- **content_type**: -- **encoding**: -- **proto**: -- **allow_pickle**: +- `path`: +- `content_type`: +- `encoding`: +- `proto`: +- `allow_pickle`: @@ -462,7 +463,7 @@ obj: 'Any' ##### Arguments -- **obj**: +- `obj`: @@ -481,11 +482,11 @@ allow_pickle: 'bool' = False ##### Arguments -- **b**: -- **content_type**: -- **encoding**: -- **proto**: -- **allow_pickle**: +- `b`: +- `content_type`: +- `encoding`: +- `proto`: +- `allow_pickle`: @@ -501,8 +502,8 @@ ref_template: 'str' = '#/$defs/{model}' ##### Arguments -- **by_alias**: -- **ref_template**: +- `by_alias`: +- `ref_template`: @@ -519,9 +520,9 @@ ref_template: 'str' = '#/$defs/{model}', **dumps_kwargs: 'Any' ##### Arguments -- **by_alias**: -- **ref_template**: -- **dumps_kwargs**: +- `by_alias`: +- `ref_template`: +- `dumps_kwargs`: @@ -537,7 +538,7 @@ Define a new Automation in which this event triggers the given action. ##### Arguments -- **action**: +- `action`: @@ -552,7 +553,7 @@ Define a new Automation in which this event triggers the given action. ##### Arguments -- **localns**: +- `localns`: @@ -567,7 +568,7 @@ value: 'Any' ##### Arguments -- **value**: +- `value`: diff --git a/models/ref/python/automations/onrunstate.mdx b/models/ref/python/automations/onrunstate.mdx index 82158b7720..104959da66 100644 --- a/models/ref/python/automations/onrunstate.mdx +++ b/models/ref/python/automations/onrunstate.mdx @@ -11,6 +11,7 @@ import { GitHubLink } from '/snippets/_includes/github-source-link.mdx'; +## class OnRunState ```python *, event_type: Literal[RUN_STATE] = RUN_STATE, @@ -26,9 +27,9 @@ A run state changes. ## Args -- **event_type**: -- **scope**: -- **filter**: +- `event_type`: +- `scope`: +- `filter`: ## Examples @@ -63,8 +64,8 @@ _fields_set: 'set[str] | None' = None, **values: 'Any' ##### Arguments -- **_fields_set**: -- **values**: +- `_fields_set`: +- `values`: @@ -94,10 +95,10 @@ copied = self.model_validate(data) ##### Arguments -- **include**: Optional set or mapping specifying which fields to include in the copied model. -- **exclude**: Optional set or mapping specifying which fields to exclude in the copied model. -- **update**: Optional dictionary of field-value pairs to override field values in the copied model. -- **deep**: If True, the values of fields that are Pydantic models will be deep-copied. +- `include`: Optional set or mapping specifying which fields to include in the copied model. +- `exclude`: Optional set or mapping specifying which fields to exclude in the copied model. +- `update`: Optional dictionary of field-value pairs to override field values in the copied model. +- `deep`: If True, the values of fields that are Pydantic models will be deep-copied. @@ -118,12 +119,12 @@ exclude_none: 'bool' = False ##### Arguments -- **include**: -- **exclude**: -- **by_alias**: -- **exclude_unset**: -- **exclude_defaults**: -- **exclude_none**: +- `include`: +- `exclude`: +- `by_alias`: +- `exclude_unset`: +- `exclude_defaults`: +- `exclude_none`: @@ -138,7 +139,7 @@ obj: 'Any' ##### Arguments -- **obj**: +- `obj`: @@ -161,15 +162,15 @@ models_as_dict: 'bool' = PydanticUndefined, **dumps_kwargs: 'Any' ##### Arguments -- **include**: -- **exclude**: -- **by_alias**: -- **exclude_unset**: -- **exclude_defaults**: -- **exclude_none**: -- **encoder**: -- **models_as_dict**: -- **dumps_kwargs**: +- `include`: +- `exclude`: +- `by_alias`: +- `exclude_unset`: +- `exclude_defaults`: +- `exclude_none`: +- `encoder`: +- `models_as_dict`: +- `dumps_kwargs`: @@ -194,8 +195,8 @@ Default values are respected, but no other validation is performed. ##### Arguments -- **_fields_set**: A set of field names that were originally explicitly set during instantiation. If provided, this is directly used for the [`model_fields_set`][pydantic.BaseModel.model_fields_set] attribute. Otherwise, the field names from the `values` argument will be used. -- **values**: Trusted or pre-validated data dictionary. +- `_fields_set`: A set of field names that were originally explicitly set during instantiation. If provided, this is directly used for the [`model_fields_set`][pydantic.BaseModel.model_fields_set] attribute. Otherwise, the field names from the `values` argument will be used. +- `values`: Trusted or pre-validated data dictionary. @@ -220,8 +221,8 @@ Returns a copy of the model. ##### Arguments -- **update**: Values to change/add in the new model. Note: the data is not validated before creating the new model. You should trust this data. -- **deep**: Set to `True` to make a deep copy of the model. +- `update`: Values to change/add in the new model. Note: the data is not validated before creating the new model. You should trust this data. +- `deep`: Set to `True` to make a deep copy of the model. @@ -240,8 +241,8 @@ Generate a dictionary representation of the model, optionally specifying which f ##### Arguments -- **mode**: The mode in which `to_python` should run. If mode is 'json', the output will only contain JSON serializable types. If mode is 'python', the output may contain non-JSON-serializable Python objects. -- **kwargs**: +- `mode`: The mode in which `to_python` should run. If mode is 'json', the output will only contain JSON serializable types. If mode is 'python', the output may contain non-JSON-serializable Python objects. +- `kwargs`: @@ -260,8 +261,8 @@ Generates a JSON representation of the model using Pydantic's `to_json` method. ##### Arguments -- **indent**: Indentation to use in the JSON output. If None is passed, the output will be compact. -- **kwargs**: +- `indent`: Indentation to use in the JSON output. If None is passed, the output will be compact. +- `kwargs`: @@ -279,10 +280,10 @@ Generates a JSON schema for a model class. ##### Arguments -- **by_alias**: Whether to use attribute aliases or not. -- **ref_template**: The reference template. -- **schema_generator**: To override the logic used to generate the JSON schema, as a subclass of `GenerateJsonSchema` with your desired modifications -- **mode**: The mode in which to generate the schema. +- `by_alias`: Whether to use attribute aliases or not. +- `ref_template`: The reference template. +- `schema_generator`: To override the logic used to generate the JSON schema, as a subclass of `GenerateJsonSchema` with your desired modifications +- `mode`: The mode in which to generate the schema. @@ -299,12 +300,12 @@ This method can be overridden to achieve a custom naming scheme for generic Base ##### Arguments -- **params**: Tuple of types of the class. Given a generic class `Model` with 2 type variables and a concrete model `Model[str, int]`, the value `(str, int)` would be passed to `params`. +- `params`: Tuple of types of the class. Given a generic class `Model` with 2 type variables and a concrete model `Model[str, int]`, the value `(str, int)` would be passed to `params`. ##### Raises -- **TypeError**: Raised when trying to generate concrete names for non-generic models. +- `TypeError`: Raised when trying to generate concrete names for non-generic models. ### method model_post_init @@ -319,7 +320,7 @@ This is useful if you want to do some validation that requires the entire model ##### Arguments -- **context**: +- `context`: @@ -341,10 +342,10 @@ the initial attempt to build the schema, and automatic rebuilding fails. ##### Arguments -- **force**: Whether to force the rebuilding of the model schema, defaults to `False`. -- **raise_errors**: Whether to raise errors, defaults to `True`. -- **_parent_namespace_depth**: The depth level of the parent namespace, defaults to 2. -- **_types_namespace**: The types namespace, defaults to `None`. +- `force`: Whether to force the rebuilding of the model schema, defaults to `False`. +- `raise_errors`: Whether to raise errors, defaults to `True`. +- `_parent_namespace_depth`: The depth level of the parent namespace, defaults to 2. +- `_types_namespace`: The types namespace, defaults to `None`. @@ -364,17 +365,17 @@ Validate a pydantic model instance. ##### Arguments -- **obj**: The object to validate. -- **strict**: Whether to enforce types strictly. -- **from_attributes**: Whether to extract data from object attributes. -- **context**: Additional context to pass to the validator. -- **by_alias**: Whether to use the field's alias when validating against the provided input data. -- **by_name**: Whether to use the field's name when validating against the provided input data. +- `obj`: The object to validate. +- `strict`: Whether to enforce types strictly. +- `from_attributes`: Whether to extract data from object attributes. +- `context`: Additional context to pass to the validator. +- `by_alias`: Whether to use the field's alias when validating against the provided input data. +- `by_name`: Whether to use the field's name when validating against the provided input data. ##### Raises -- **ValidationError**: If the object could not be validated. +- `ValidationError`: If the object could not be validated. ### method model_validate_json @@ -394,16 +395,16 @@ Validate the given JSON data against the Pydantic model. ##### Arguments -- **json_data**: The JSON data to validate. -- **strict**: Whether to enforce types strictly. -- **context**: Extra variables to pass to the validator. -- **by_alias**: Whether to use the field's alias when validating against the provided input data. -- **by_name**: Whether to use the field's name when validating against the provided input data. +- `json_data`: The JSON data to validate. +- `strict`: Whether to enforce types strictly. +- `context`: Extra variables to pass to the validator. +- `by_alias`: Whether to use the field's alias when validating against the provided input data. +- `by_name`: Whether to use the field's name when validating against the provided input data. ##### Raises -- **ValidationError**: If `json_data` is not a JSON string or the object could not be validated. +- `ValidationError`: If `json_data` is not a JSON string or the object could not be validated. ### method model_validate_strings @@ -420,11 +421,11 @@ Validate the given object with string data against the Pydantic model. ##### Arguments -- **obj**: The object containing string data to validate. -- **strict**: Whether to enforce types strictly. -- **context**: Extra variables to pass to the validator. -- **by_alias**: Whether to use the field's alias when validating against the provided input data. -- **by_name**: Whether to use the field's name when validating against the provided input data. +- `obj`: The object containing string data to validate. +- `strict`: Whether to enforce types strictly. +- `context`: Extra variables to pass to the validator. +- `by_alias`: Whether to use the field's alias when validating against the provided input data. +- `by_name`: Whether to use the field's name when validating against the provided input data. @@ -443,11 +444,11 @@ allow_pickle: 'bool' = False ##### Arguments -- **path**: -- **content_type**: -- **encoding**: -- **proto**: -- **allow_pickle**: +- `path`: +- `content_type`: +- `encoding`: +- `proto`: +- `allow_pickle`: @@ -462,7 +463,7 @@ obj: 'Any' ##### Arguments -- **obj**: +- `obj`: @@ -481,11 +482,11 @@ allow_pickle: 'bool' = False ##### Arguments -- **b**: -- **content_type**: -- **encoding**: -- **proto**: -- **allow_pickle**: +- `b`: +- `content_type`: +- `encoding`: +- `proto`: +- `allow_pickle`: @@ -501,8 +502,8 @@ ref_template: 'str' = '#/$defs/{model}' ##### Arguments -- **by_alias**: -- **ref_template**: +- `by_alias`: +- `ref_template`: @@ -519,9 +520,9 @@ ref_template: 'str' = '#/$defs/{model}', **dumps_kwargs: 'Any' ##### Arguments -- **by_alias**: -- **ref_template**: -- **dumps_kwargs**: +- `by_alias`: +- `ref_template`: +- `dumps_kwargs`: @@ -537,7 +538,7 @@ Define a new Automation in which this event triggers the given action. ##### Arguments -- **action**: +- `action`: @@ -552,7 +553,7 @@ Define a new Automation in which this event triggers the given action. ##### Arguments -- **localns**: +- `localns`: @@ -567,7 +568,7 @@ value: 'Any' ##### Arguments -- **value**: +- `value`: diff --git a/models/ref/python/automations/onunlinkartifact.mdx b/models/ref/python/automations/onunlinkartifact.mdx index 82ffbf221e..c397dee8b6 100644 --- a/models/ref/python/automations/onunlinkartifact.mdx +++ b/models/ref/python/automations/onunlinkartifact.mdx @@ -11,6 +11,7 @@ import { GitHubLink } from '/snippets/_includes/github-source-link.mdx'; +## class OnUnlinkArtifact ```python *, event_type: Literal[UNLINK_ARTIFACT] = UNLINK_ARTIFACT, @@ -26,9 +27,9 @@ An artifact version is unlinked from a collection. ## Args -- **event_type**: -- **scope**: -- **filter**: +- `event_type`: +- `scope`: +- `filter`: @@ -47,8 +48,8 @@ _fields_set: 'set[str] | None' = None, **values: 'Any' ##### Arguments -- **_fields_set**: -- **values**: +- `_fields_set`: +- `values`: @@ -78,10 +79,10 @@ copied = self.model_validate(data) ##### Arguments -- **include**: Optional set or mapping specifying which fields to include in the copied model. -- **exclude**: Optional set or mapping specifying which fields to exclude in the copied model. -- **update**: Optional dictionary of field-value pairs to override field values in the copied model. -- **deep**: If True, the values of fields that are Pydantic models will be deep-copied. +- `include`: Optional set or mapping specifying which fields to include in the copied model. +- `exclude`: Optional set or mapping specifying which fields to exclude in the copied model. +- `update`: Optional dictionary of field-value pairs to override field values in the copied model. +- `deep`: If True, the values of fields that are Pydantic models will be deep-copied. @@ -102,12 +103,12 @@ exclude_none: 'bool' = False ##### Arguments -- **include**: -- **exclude**: -- **by_alias**: -- **exclude_unset**: -- **exclude_defaults**: -- **exclude_none**: +- `include`: +- `exclude`: +- `by_alias`: +- `exclude_unset`: +- `exclude_defaults`: +- `exclude_none`: @@ -122,7 +123,7 @@ obj: 'Any' ##### Arguments -- **obj**: +- `obj`: @@ -145,15 +146,15 @@ models_as_dict: 'bool' = PydanticUndefined, **dumps_kwargs: 'Any' ##### Arguments -- **include**: -- **exclude**: -- **by_alias**: -- **exclude_unset**: -- **exclude_defaults**: -- **exclude_none**: -- **encoder**: -- **models_as_dict**: -- **dumps_kwargs**: +- `include`: +- `exclude`: +- `by_alias`: +- `exclude_unset`: +- `exclude_defaults`: +- `exclude_none`: +- `encoder`: +- `models_as_dict`: +- `dumps_kwargs`: @@ -178,8 +179,8 @@ Default values are respected, but no other validation is performed. ##### Arguments -- **_fields_set**: A set of field names that were originally explicitly set during instantiation. If provided, this is directly used for the [`model_fields_set`][pydantic.BaseModel.model_fields_set] attribute. Otherwise, the field names from the `values` argument will be used. -- **values**: Trusted or pre-validated data dictionary. +- `_fields_set`: A set of field names that were originally explicitly set during instantiation. If provided, this is directly used for the [`model_fields_set`][pydantic.BaseModel.model_fields_set] attribute. Otherwise, the field names from the `values` argument will be used. +- `values`: Trusted or pre-validated data dictionary. @@ -204,8 +205,8 @@ Returns a copy of the model. ##### Arguments -- **update**: Values to change/add in the new model. Note: the data is not validated before creating the new model. You should trust this data. -- **deep**: Set to `True` to make a deep copy of the model. +- `update`: Values to change/add in the new model. Note: the data is not validated before creating the new model. You should trust this data. +- `deep`: Set to `True` to make a deep copy of the model. @@ -224,8 +225,8 @@ Generate a dictionary representation of the model, optionally specifying which f ##### Arguments -- **mode**: The mode in which `to_python` should run. If mode is 'json', the output will only contain JSON serializable types. If mode is 'python', the output may contain non-JSON-serializable Python objects. -- **kwargs**: +- `mode`: The mode in which `to_python` should run. If mode is 'json', the output will only contain JSON serializable types. If mode is 'python', the output may contain non-JSON-serializable Python objects. +- `kwargs`: @@ -244,8 +245,8 @@ Generates a JSON representation of the model using Pydantic's `to_json` method. ##### Arguments -- **indent**: Indentation to use in the JSON output. If None is passed, the output will be compact. -- **kwargs**: +- `indent`: Indentation to use in the JSON output. If None is passed, the output will be compact. +- `kwargs`: @@ -263,10 +264,10 @@ Generates a JSON schema for a model class. ##### Arguments -- **by_alias**: Whether to use attribute aliases or not. -- **ref_template**: The reference template. -- **schema_generator**: To override the logic used to generate the JSON schema, as a subclass of `GenerateJsonSchema` with your desired modifications -- **mode**: The mode in which to generate the schema. +- `by_alias`: Whether to use attribute aliases or not. +- `ref_template`: The reference template. +- `schema_generator`: To override the logic used to generate the JSON schema, as a subclass of `GenerateJsonSchema` with your desired modifications +- `mode`: The mode in which to generate the schema. @@ -283,12 +284,12 @@ This method can be overridden to achieve a custom naming scheme for generic Base ##### Arguments -- **params**: Tuple of types of the class. Given a generic class `Model` with 2 type variables and a concrete model `Model[str, int]`, the value `(str, int)` would be passed to `params`. +- `params`: Tuple of types of the class. Given a generic class `Model` with 2 type variables and a concrete model `Model[str, int]`, the value `(str, int)` would be passed to `params`. ##### Raises -- **TypeError**: Raised when trying to generate concrete names for non-generic models. +- `TypeError`: Raised when trying to generate concrete names for non-generic models. ### method model_post_init @@ -303,7 +304,7 @@ This is useful if you want to do some validation that requires the entire model ##### Arguments -- **context**: +- `context`: @@ -325,10 +326,10 @@ the initial attempt to build the schema, and automatic rebuilding fails. ##### Arguments -- **force**: Whether to force the rebuilding of the model schema, defaults to `False`. -- **raise_errors**: Whether to raise errors, defaults to `True`. -- **_parent_namespace_depth**: The depth level of the parent namespace, defaults to 2. -- **_types_namespace**: The types namespace, defaults to `None`. +- `force`: Whether to force the rebuilding of the model schema, defaults to `False`. +- `raise_errors`: Whether to raise errors, defaults to `True`. +- `_parent_namespace_depth`: The depth level of the parent namespace, defaults to 2. +- `_types_namespace`: The types namespace, defaults to `None`. @@ -348,17 +349,17 @@ Validate a pydantic model instance. ##### Arguments -- **obj**: The object to validate. -- **strict**: Whether to enforce types strictly. -- **from_attributes**: Whether to extract data from object attributes. -- **context**: Additional context to pass to the validator. -- **by_alias**: Whether to use the field's alias when validating against the provided input data. -- **by_name**: Whether to use the field's name when validating against the provided input data. +- `obj`: The object to validate. +- `strict`: Whether to enforce types strictly. +- `from_attributes`: Whether to extract data from object attributes. +- `context`: Additional context to pass to the validator. +- `by_alias`: Whether to use the field's alias when validating against the provided input data. +- `by_name`: Whether to use the field's name when validating against the provided input data. ##### Raises -- **ValidationError**: If the object could not be validated. +- `ValidationError`: If the object could not be validated. ### method model_validate_json @@ -378,16 +379,16 @@ Validate the given JSON data against the Pydantic model. ##### Arguments -- **json_data**: The JSON data to validate. -- **strict**: Whether to enforce types strictly. -- **context**: Extra variables to pass to the validator. -- **by_alias**: Whether to use the field's alias when validating against the provided input data. -- **by_name**: Whether to use the field's name when validating against the provided input data. +- `json_data`: The JSON data to validate. +- `strict`: Whether to enforce types strictly. +- `context`: Extra variables to pass to the validator. +- `by_alias`: Whether to use the field's alias when validating against the provided input data. +- `by_name`: Whether to use the field's name when validating against the provided input data. ##### Raises -- **ValidationError**: If `json_data` is not a JSON string or the object could not be validated. +- `ValidationError`: If `json_data` is not a JSON string or the object could not be validated. ### method model_validate_strings @@ -404,11 +405,11 @@ Validate the given object with string data against the Pydantic model. ##### Arguments -- **obj**: The object containing string data to validate. -- **strict**: Whether to enforce types strictly. -- **context**: Extra variables to pass to the validator. -- **by_alias**: Whether to use the field's alias when validating against the provided input data. -- **by_name**: Whether to use the field's name when validating against the provided input data. +- `obj`: The object containing string data to validate. +- `strict`: Whether to enforce types strictly. +- `context`: Extra variables to pass to the validator. +- `by_alias`: Whether to use the field's alias when validating against the provided input data. +- `by_name`: Whether to use the field's name when validating against the provided input data. @@ -427,11 +428,11 @@ allow_pickle: 'bool' = False ##### Arguments -- **path**: -- **content_type**: -- **encoding**: -- **proto**: -- **allow_pickle**: +- `path`: +- `content_type`: +- `encoding`: +- `proto`: +- `allow_pickle`: @@ -446,7 +447,7 @@ obj: 'Any' ##### Arguments -- **obj**: +- `obj`: @@ -465,11 +466,11 @@ allow_pickle: 'bool' = False ##### Arguments -- **b**: -- **content_type**: -- **encoding**: -- **proto**: -- **allow_pickle**: +- `b`: +- `content_type`: +- `encoding`: +- `proto`: +- `allow_pickle`: @@ -485,8 +486,8 @@ ref_template: 'str' = '#/$defs/{model}' ##### Arguments -- **by_alias**: -- **ref_template**: +- `by_alias`: +- `ref_template`: @@ -503,9 +504,9 @@ ref_template: 'str' = '#/$defs/{model}', **dumps_kwargs: 'Any' ##### Arguments -- **by_alias**: -- **ref_template**: -- **dumps_kwargs**: +- `by_alias`: +- `ref_template`: +- `dumps_kwargs`: @@ -521,7 +522,7 @@ Define a new Automation in which this event triggers the given action. ##### Arguments -- **action**: +- `action`: @@ -536,7 +537,7 @@ Define a new Automation in which this event triggers the given action. ##### Arguments -- **localns**: +- `localns`: @@ -551,7 +552,7 @@ value: 'Any' ##### Arguments -- **value**: +- `value`: diff --git a/models/ref/python/automations/runstatefilter.mdx b/models/ref/python/automations/runstatefilter.mdx index 817f3d2c32..2f173f5976 100644 --- a/models/ref/python/automations/runstatefilter.mdx +++ b/models/ref/python/automations/runstatefilter.mdx @@ -11,6 +11,7 @@ import { GitHubLink } from '/snippets/_includes/github-source-link.mdx'; +## class RunStateFilter ```python *, run_filter: typing.Annotated[wandb.automations._filters.operators.And | wandb.automations._filters.operators.Or | wandb.automations._filters.operators.Nor | wandb.automations._filters.operators.Not | wandb.automations._filters.operators.Lt | wandb.automations._filters.operators.Gt | wandb.automations._filters.operators.Lte | wandb.automations._filters.operators.Gte | wandb.automations._filters.operators.Eq | wandb.automations._filters.operators.Ne | wandb.automations._filters.operators.In | wandb.automations._filters.operators.NotIn | wandb.automations._filters.operators.Exists | wandb.automations._filters.operators.Regex | wandb.automations._filters.operators.Contains | wandb.automations._filters.expressions.FilterExpr | dict[str, typing.Any], Json, BeforeValidator(func=, json_schema_input_type=PydanticUndefined), PlainSerializer(func=, return_type=PydanticUndefined, when_used='always'), AfterValidator(func=)] = And(()), @@ -25,8 +26,8 @@ Represents a filter for triggering events based on changes in run states. ## Args -- **run_filter**: -- **run_state_filter**: +- `run_filter`: +- `run_state_filter`: @@ -45,8 +46,8 @@ _fields_set: 'set[str] | None' = None, **values: 'Any' ##### Arguments -- **_fields_set**: -- **values**: +- `_fields_set`: +- `values`: @@ -76,10 +77,10 @@ copied = self.model_validate(data) ##### Arguments -- **include**: Optional set or mapping specifying which fields to include in the copied model. -- **exclude**: Optional set or mapping specifying which fields to exclude in the copied model. -- **update**: Optional dictionary of field-value pairs to override field values in the copied model. -- **deep**: If True, the values of fields that are Pydantic models will be deep-copied. +- `include`: Optional set or mapping specifying which fields to include in the copied model. +- `exclude`: Optional set or mapping specifying which fields to exclude in the copied model. +- `update`: Optional dictionary of field-value pairs to override field values in the copied model. +- `deep`: If True, the values of fields that are Pydantic models will be deep-copied. @@ -100,12 +101,12 @@ exclude_none: 'bool' = False ##### Arguments -- **include**: -- **exclude**: -- **by_alias**: -- **exclude_unset**: -- **exclude_defaults**: -- **exclude_none**: +- `include`: +- `exclude`: +- `by_alias`: +- `exclude_unset`: +- `exclude_defaults`: +- `exclude_none`: @@ -120,7 +121,7 @@ obj: 'Any' ##### Arguments -- **obj**: +- `obj`: @@ -143,15 +144,15 @@ models_as_dict: 'bool' = PydanticUndefined, **dumps_kwargs: 'Any' ##### Arguments -- **include**: -- **exclude**: -- **by_alias**: -- **exclude_unset**: -- **exclude_defaults**: -- **exclude_none**: -- **encoder**: -- **models_as_dict**: -- **dumps_kwargs**: +- `include`: +- `exclude`: +- `by_alias`: +- `exclude_unset`: +- `exclude_defaults`: +- `exclude_none`: +- `encoder`: +- `models_as_dict`: +- `dumps_kwargs`: @@ -176,8 +177,8 @@ Default values are respected, but no other validation is performed. ##### Arguments -- **_fields_set**: A set of field names that were originally explicitly set during instantiation. If provided, this is directly used for the [`model_fields_set`][pydantic.BaseModel.model_fields_set] attribute. Otherwise, the field names from the `values` argument will be used. -- **values**: Trusted or pre-validated data dictionary. +- `_fields_set`: A set of field names that were originally explicitly set during instantiation. If provided, this is directly used for the [`model_fields_set`][pydantic.BaseModel.model_fields_set] attribute. Otherwise, the field names from the `values` argument will be used. +- `values`: Trusted or pre-validated data dictionary. @@ -202,8 +203,8 @@ Returns a copy of the model. ##### Arguments -- **update**: Values to change/add in the new model. Note: the data is not validated before creating the new model. You should trust this data. -- **deep**: Set to `True` to make a deep copy of the model. +- `update`: Values to change/add in the new model. Note: the data is not validated before creating the new model. You should trust this data. +- `deep`: Set to `True` to make a deep copy of the model. @@ -222,8 +223,8 @@ Generate a dictionary representation of the model, optionally specifying which f ##### Arguments -- **mode**: The mode in which `to_python` should run. If mode is 'json', the output will only contain JSON serializable types. If mode is 'python', the output may contain non-JSON-serializable Python objects. -- **kwargs**: +- `mode`: The mode in which `to_python` should run. If mode is 'json', the output will only contain JSON serializable types. If mode is 'python', the output may contain non-JSON-serializable Python objects. +- `kwargs`: @@ -242,8 +243,8 @@ Generates a JSON representation of the model using Pydantic's `to_json` method. ##### Arguments -- **indent**: Indentation to use in the JSON output. If None is passed, the output will be compact. -- **kwargs**: +- `indent`: Indentation to use in the JSON output. If None is passed, the output will be compact. +- `kwargs`: @@ -261,10 +262,10 @@ Generates a JSON schema for a model class. ##### Arguments -- **by_alias**: Whether to use attribute aliases or not. -- **ref_template**: The reference template. -- **schema_generator**: To override the logic used to generate the JSON schema, as a subclass of `GenerateJsonSchema` with your desired modifications -- **mode**: The mode in which to generate the schema. +- `by_alias`: Whether to use attribute aliases or not. +- `ref_template`: The reference template. +- `schema_generator`: To override the logic used to generate the JSON schema, as a subclass of `GenerateJsonSchema` with your desired modifications +- `mode`: The mode in which to generate the schema. @@ -281,12 +282,12 @@ This method can be overridden to achieve a custom naming scheme for generic Base ##### Arguments -- **params**: Tuple of types of the class. Given a generic class `Model` with 2 type variables and a concrete model `Model[str, int]`, the value `(str, int)` would be passed to `params`. +- `params`: Tuple of types of the class. Given a generic class `Model` with 2 type variables and a concrete model `Model[str, int]`, the value `(str, int)` would be passed to `params`. ##### Raises -- **TypeError**: Raised when trying to generate concrete names for non-generic models. +- `TypeError`: Raised when trying to generate concrete names for non-generic models. ### method model_post_init @@ -301,7 +302,7 @@ This is useful if you want to do some validation that requires the entire model ##### Arguments -- **context**: +- `context`: @@ -323,10 +324,10 @@ the initial attempt to build the schema, and automatic rebuilding fails. ##### Arguments -- **force**: Whether to force the rebuilding of the model schema, defaults to `False`. -- **raise_errors**: Whether to raise errors, defaults to `True`. -- **_parent_namespace_depth**: The depth level of the parent namespace, defaults to 2. -- **_types_namespace**: The types namespace, defaults to `None`. +- `force`: Whether to force the rebuilding of the model schema, defaults to `False`. +- `raise_errors`: Whether to raise errors, defaults to `True`. +- `_parent_namespace_depth`: The depth level of the parent namespace, defaults to 2. +- `_types_namespace`: The types namespace, defaults to `None`. @@ -346,17 +347,17 @@ Validate a pydantic model instance. ##### Arguments -- **obj**: The object to validate. -- **strict**: Whether to enforce types strictly. -- **from_attributes**: Whether to extract data from object attributes. -- **context**: Additional context to pass to the validator. -- **by_alias**: Whether to use the field's alias when validating against the provided input data. -- **by_name**: Whether to use the field's name when validating against the provided input data. +- `obj`: The object to validate. +- `strict`: Whether to enforce types strictly. +- `from_attributes`: Whether to extract data from object attributes. +- `context`: Additional context to pass to the validator. +- `by_alias`: Whether to use the field's alias when validating against the provided input data. +- `by_name`: Whether to use the field's name when validating against the provided input data. ##### Raises -- **ValidationError**: If the object could not be validated. +- `ValidationError`: If the object could not be validated. ### method model_validate_json @@ -376,16 +377,16 @@ Validate the given JSON data against the Pydantic model. ##### Arguments -- **json_data**: The JSON data to validate. -- **strict**: Whether to enforce types strictly. -- **context**: Extra variables to pass to the validator. -- **by_alias**: Whether to use the field's alias when validating against the provided input data. -- **by_name**: Whether to use the field's name when validating against the provided input data. +- `json_data`: The JSON data to validate. +- `strict`: Whether to enforce types strictly. +- `context`: Extra variables to pass to the validator. +- `by_alias`: Whether to use the field's alias when validating against the provided input data. +- `by_name`: Whether to use the field's name when validating against the provided input data. ##### Raises -- **ValidationError**: If `json_data` is not a JSON string or the object could not be validated. +- `ValidationError`: If `json_data` is not a JSON string or the object could not be validated. ### method model_validate_strings @@ -402,11 +403,11 @@ Validate the given object with string data against the Pydantic model. ##### Arguments -- **obj**: The object containing string data to validate. -- **strict**: Whether to enforce types strictly. -- **context**: Extra variables to pass to the validator. -- **by_alias**: Whether to use the field's alias when validating against the provided input data. -- **by_name**: Whether to use the field's name when validating against the provided input data. +- `obj`: The object containing string data to validate. +- `strict`: Whether to enforce types strictly. +- `context`: Extra variables to pass to the validator. +- `by_alias`: Whether to use the field's alias when validating against the provided input data. +- `by_name`: Whether to use the field's name when validating against the provided input data. @@ -425,11 +426,11 @@ allow_pickle: 'bool' = False ##### Arguments -- **path**: -- **content_type**: -- **encoding**: -- **proto**: -- **allow_pickle**: +- `path`: +- `content_type`: +- `encoding`: +- `proto`: +- `allow_pickle`: @@ -444,7 +445,7 @@ obj: 'Any' ##### Arguments -- **obj**: +- `obj`: @@ -463,11 +464,11 @@ allow_pickle: 'bool' = False ##### Arguments -- **b**: -- **content_type**: -- **encoding**: -- **proto**: -- **allow_pickle**: +- `b`: +- `content_type`: +- `encoding`: +- `proto`: +- `allow_pickle`: @@ -483,8 +484,8 @@ ref_template: 'str' = '#/$defs/{model}' ##### Arguments -- **by_alias**: -- **ref_template**: +- `by_alias`: +- `ref_template`: @@ -501,9 +502,9 @@ ref_template: 'str' = '#/$defs/{model}', **dumps_kwargs: 'Any' ##### Arguments -- **by_alias**: -- **ref_template**: -- **dumps_kwargs**: +- `by_alias`: +- `ref_template`: +- `dumps_kwargs`: @@ -518,7 +519,7 @@ ref_template: 'str' = '#/$defs/{model}', **dumps_kwargs: 'Any' ##### Arguments -- **localns**: +- `localns`: @@ -533,7 +534,7 @@ value: 'Any' ##### Arguments -- **value**: +- `value`: diff --git a/models/ref/python/automations/sendnotification.mdx b/models/ref/python/automations/sendnotification.mdx index 58ef819062..d0c332531b 100644 --- a/models/ref/python/automations/sendnotification.mdx +++ b/models/ref/python/automations/sendnotification.mdx @@ -11,6 +11,7 @@ import { GitHubLink } from '/snippets/_includes/github-source-link.mdx'; +## class SendNotification ```python *, integration_id: typing.Annotated[str, Strict(strict=True)], @@ -28,11 +29,11 @@ Defines an automation action that sends a (Slack) notification. ## Args -- **integration_id**: -- **text**: -- **level**: -- **title**: -- **action_type**: +- `integration_id`: +- `text`: +- `level`: +- `title`: +- `action_type`: @@ -51,8 +52,8 @@ _fields_set: 'set[str] | None' = None, **values: 'Any' ##### Arguments -- **_fields_set**: -- **values**: +- `_fields_set`: +- `values`: @@ -82,10 +83,10 @@ copied = self.model_validate(data) ##### Arguments -- **include**: Optional set or mapping specifying which fields to include in the copied model. -- **exclude**: Optional set or mapping specifying which fields to exclude in the copied model. -- **update**: Optional dictionary of field-value pairs to override field values in the copied model. -- **deep**: If True, the values of fields that are Pydantic models will be deep-copied. +- `include`: Optional set or mapping specifying which fields to include in the copied model. +- `exclude`: Optional set or mapping specifying which fields to exclude in the copied model. +- `update`: Optional dictionary of field-value pairs to override field values in the copied model. +- `deep`: If True, the values of fields that are Pydantic models will be deep-copied. @@ -106,12 +107,12 @@ exclude_none: 'bool' = False ##### Arguments -- **include**: -- **exclude**: -- **by_alias**: -- **exclude_unset**: -- **exclude_defaults**: -- **exclude_none**: +- `include`: +- `exclude`: +- `by_alias`: +- `exclude_unset`: +- `exclude_defaults`: +- `exclude_none`: @@ -129,10 +130,10 @@ Define a notification action that sends to the given (Slack) integration. ##### Arguments -- **integration**: -- **title**: -- **text**: -- **level**: +- `integration`: +- `title`: +- `text`: +- `level`: @@ -147,7 +148,7 @@ obj: 'Any' ##### Arguments -- **obj**: +- `obj`: @@ -170,15 +171,15 @@ models_as_dict: 'bool' = PydanticUndefined, **dumps_kwargs: 'Any' ##### Arguments -- **include**: -- **exclude**: -- **by_alias**: -- **exclude_unset**: -- **exclude_defaults**: -- **exclude_none**: -- **encoder**: -- **models_as_dict**: -- **dumps_kwargs**: +- `include`: +- `exclude`: +- `by_alias`: +- `exclude_unset`: +- `exclude_defaults`: +- `exclude_none`: +- `encoder`: +- `models_as_dict`: +- `dumps_kwargs`: @@ -203,8 +204,8 @@ Default values are respected, but no other validation is performed. ##### Arguments -- **_fields_set**: A set of field names that were originally explicitly set during instantiation. If provided, this is directly used for the [`model_fields_set`][pydantic.BaseModel.model_fields_set] attribute. Otherwise, the field names from the `values` argument will be used. -- **values**: Trusted or pre-validated data dictionary. +- `_fields_set`: A set of field names that were originally explicitly set during instantiation. If provided, this is directly used for the [`model_fields_set`][pydantic.BaseModel.model_fields_set] attribute. Otherwise, the field names from the `values` argument will be used. +- `values`: Trusted or pre-validated data dictionary. @@ -229,8 +230,8 @@ Returns a copy of the model. ##### Arguments -- **update**: Values to change/add in the new model. Note: the data is not validated before creating the new model. You should trust this data. -- **deep**: Set to `True` to make a deep copy of the model. +- `update`: Values to change/add in the new model. Note: the data is not validated before creating the new model. You should trust this data. +- `deep`: Set to `True` to make a deep copy of the model. @@ -249,8 +250,8 @@ Generate a dictionary representation of the model, optionally specifying which f ##### Arguments -- **mode**: The mode in which `to_python` should run. If mode is 'json', the output will only contain JSON serializable types. If mode is 'python', the output may contain non-JSON-serializable Python objects. -- **kwargs**: +- `mode`: The mode in which `to_python` should run. If mode is 'json', the output will only contain JSON serializable types. If mode is 'python', the output may contain non-JSON-serializable Python objects. +- `kwargs`: @@ -269,8 +270,8 @@ Generates a JSON representation of the model using Pydantic's `to_json` method. ##### Arguments -- **indent**: Indentation to use in the JSON output. If None is passed, the output will be compact. -- **kwargs**: +- `indent`: Indentation to use in the JSON output. If None is passed, the output will be compact. +- `kwargs`: @@ -288,10 +289,10 @@ Generates a JSON schema for a model class. ##### Arguments -- **by_alias**: Whether to use attribute aliases or not. -- **ref_template**: The reference template. -- **schema_generator**: To override the logic used to generate the JSON schema, as a subclass of `GenerateJsonSchema` with your desired modifications -- **mode**: The mode in which to generate the schema. +- `by_alias`: Whether to use attribute aliases or not. +- `ref_template`: The reference template. +- `schema_generator`: To override the logic used to generate the JSON schema, as a subclass of `GenerateJsonSchema` with your desired modifications +- `mode`: The mode in which to generate the schema. @@ -308,12 +309,12 @@ This method can be overridden to achieve a custom naming scheme for generic Base ##### Arguments -- **params**: Tuple of types of the class. Given a generic class `Model` with 2 type variables and a concrete model `Model[str, int]`, the value `(str, int)` would be passed to `params`. +- `params`: Tuple of types of the class. Given a generic class `Model` with 2 type variables and a concrete model `Model[str, int]`, the value `(str, int)` would be passed to `params`. ##### Raises -- **TypeError**: Raised when trying to generate concrete names for non-generic models. +- `TypeError`: Raised when trying to generate concrete names for non-generic models. ### method model_post_init @@ -328,7 +329,7 @@ This is useful if you want to do some validation that requires the entire model ##### Arguments -- **context**: +- `context`: @@ -350,10 +351,10 @@ the initial attempt to build the schema, and automatic rebuilding fails. ##### Arguments -- **force**: Whether to force the rebuilding of the model schema, defaults to `False`. -- **raise_errors**: Whether to raise errors, defaults to `True`. -- **_parent_namespace_depth**: The depth level of the parent namespace, defaults to 2. -- **_types_namespace**: The types namespace, defaults to `None`. +- `force`: Whether to force the rebuilding of the model schema, defaults to `False`. +- `raise_errors`: Whether to raise errors, defaults to `True`. +- `_parent_namespace_depth`: The depth level of the parent namespace, defaults to 2. +- `_types_namespace`: The types namespace, defaults to `None`. @@ -373,17 +374,17 @@ Validate a pydantic model instance. ##### Arguments -- **obj**: The object to validate. -- **strict**: Whether to enforce types strictly. -- **from_attributes**: Whether to extract data from object attributes. -- **context**: Additional context to pass to the validator. -- **by_alias**: Whether to use the field's alias when validating against the provided input data. -- **by_name**: Whether to use the field's name when validating against the provided input data. +- `obj`: The object to validate. +- `strict`: Whether to enforce types strictly. +- `from_attributes`: Whether to extract data from object attributes. +- `context`: Additional context to pass to the validator. +- `by_alias`: Whether to use the field's alias when validating against the provided input data. +- `by_name`: Whether to use the field's name when validating against the provided input data. ##### Raises -- **ValidationError**: If the object could not be validated. +- `ValidationError`: If the object could not be validated. ### method model_validate_json @@ -403,16 +404,16 @@ Validate the given JSON data against the Pydantic model. ##### Arguments -- **json_data**: The JSON data to validate. -- **strict**: Whether to enforce types strictly. -- **context**: Extra variables to pass to the validator. -- **by_alias**: Whether to use the field's alias when validating against the provided input data. -- **by_name**: Whether to use the field's name when validating against the provided input data. +- `json_data`: The JSON data to validate. +- `strict`: Whether to enforce types strictly. +- `context`: Extra variables to pass to the validator. +- `by_alias`: Whether to use the field's alias when validating against the provided input data. +- `by_name`: Whether to use the field's name when validating against the provided input data. ##### Raises -- **ValidationError**: If `json_data` is not a JSON string or the object could not be validated. +- `ValidationError`: If `json_data` is not a JSON string or the object could not be validated. ### method model_validate_strings @@ -429,11 +430,11 @@ Validate the given object with string data against the Pydantic model. ##### Arguments -- **obj**: The object containing string data to validate. -- **strict**: Whether to enforce types strictly. -- **context**: Extra variables to pass to the validator. -- **by_alias**: Whether to use the field's alias when validating against the provided input data. -- **by_name**: Whether to use the field's name when validating against the provided input data. +- `obj`: The object containing string data to validate. +- `strict`: Whether to enforce types strictly. +- `context`: Extra variables to pass to the validator. +- `by_alias`: Whether to use the field's alias when validating against the provided input data. +- `by_name`: Whether to use the field's name when validating against the provided input data. @@ -452,11 +453,11 @@ allow_pickle: 'bool' = False ##### Arguments -- **path**: -- **content_type**: -- **encoding**: -- **proto**: -- **allow_pickle**: +- `path`: +- `content_type`: +- `encoding`: +- `proto`: +- `allow_pickle`: @@ -471,7 +472,7 @@ obj: 'Any' ##### Arguments -- **obj**: +- `obj`: @@ -490,11 +491,11 @@ allow_pickle: 'bool' = False ##### Arguments -- **b**: -- **content_type**: -- **encoding**: -- **proto**: -- **allow_pickle**: +- `b`: +- `content_type`: +- `encoding`: +- `proto`: +- `allow_pickle`: @@ -510,8 +511,8 @@ ref_template: 'str' = '#/$defs/{model}' ##### Arguments -- **by_alias**: -- **ref_template**: +- `by_alias`: +- `ref_template`: @@ -528,9 +529,9 @@ ref_template: 'str' = '#/$defs/{model}', **dumps_kwargs: 'Any' ##### Arguments -- **by_alias**: -- **ref_template**: -- **dumps_kwargs**: +- `by_alias`: +- `ref_template`: +- `dumps_kwargs`: @@ -545,7 +546,7 @@ ref_template: 'str' = '#/$defs/{model}', **dumps_kwargs: 'Any' ##### Arguments -- **localns**: +- `localns`: @@ -560,7 +561,7 @@ value: 'Any' ##### Arguments -- **value**: +- `value`: diff --git a/models/ref/python/automations/sendwebhook.mdx b/models/ref/python/automations/sendwebhook.mdx index 1b1dbc37b2..9423f35396 100644 --- a/models/ref/python/automations/sendwebhook.mdx +++ b/models/ref/python/automations/sendwebhook.mdx @@ -11,6 +11,7 @@ import { GitHubLink } from '/snippets/_includes/github-source-link.mdx'; +## class SendWebhook ```python *, integration_id: typing.Annotated[str, Strict(strict=True)], @@ -26,9 +27,9 @@ Defines an automation action that sends a webhook request. ## Args -- **integration_id**: -- **requestPayload**: -- **action_type**: +- `integration_id`: +- `requestPayload`: +- `action_type`: @@ -47,8 +48,8 @@ _fields_set: 'set[str] | None' = None, **values: 'Any' ##### Arguments -- **_fields_set**: -- **values**: +- `_fields_set`: +- `values`: @@ -78,10 +79,10 @@ copied = self.model_validate(data) ##### Arguments -- **include**: Optional set or mapping specifying which fields to include in the copied model. -- **exclude**: Optional set or mapping specifying which fields to exclude in the copied model. -- **update**: Optional dictionary of field-value pairs to override field values in the copied model. -- **deep**: If True, the values of fields that are Pydantic models will be deep-copied. +- `include`: Optional set or mapping specifying which fields to include in the copied model. +- `exclude`: Optional set or mapping specifying which fields to exclude in the copied model. +- `update`: Optional dictionary of field-value pairs to override field values in the copied model. +- `deep`: If True, the values of fields that are Pydantic models will be deep-copied. @@ -102,12 +103,12 @@ exclude_none: 'bool' = False ##### Arguments -- **include**: -- **exclude**: -- **by_alias**: -- **exclude_unset**: -- **exclude_defaults**: -- **exclude_none**: +- `include`: +- `exclude`: +- `by_alias`: +- `exclude_unset`: +- `exclude_defaults`: +- `exclude_none`: @@ -123,8 +124,8 @@ Define a webhook action that sends to the given (webhook) integration. ##### Arguments -- **integration**: -- **payload**: +- `integration`: +- `payload`: @@ -139,7 +140,7 @@ obj: 'Any' ##### Arguments -- **obj**: +- `obj`: @@ -162,15 +163,15 @@ models_as_dict: 'bool' = PydanticUndefined, **dumps_kwargs: 'Any' ##### Arguments -- **include**: -- **exclude**: -- **by_alias**: -- **exclude_unset**: -- **exclude_defaults**: -- **exclude_none**: -- **encoder**: -- **models_as_dict**: -- **dumps_kwargs**: +- `include`: +- `exclude`: +- `by_alias`: +- `exclude_unset`: +- `exclude_defaults`: +- `exclude_none`: +- `encoder`: +- `models_as_dict`: +- `dumps_kwargs`: @@ -195,8 +196,8 @@ Default values are respected, but no other validation is performed. ##### Arguments -- **_fields_set**: A set of field names that were originally explicitly set during instantiation. If provided, this is directly used for the [`model_fields_set`][pydantic.BaseModel.model_fields_set] attribute. Otherwise, the field names from the `values` argument will be used. -- **values**: Trusted or pre-validated data dictionary. +- `_fields_set`: A set of field names that were originally explicitly set during instantiation. If provided, this is directly used for the [`model_fields_set`][pydantic.BaseModel.model_fields_set] attribute. Otherwise, the field names from the `values` argument will be used. +- `values`: Trusted or pre-validated data dictionary. @@ -221,8 +222,8 @@ Returns a copy of the model. ##### Arguments -- **update**: Values to change/add in the new model. Note: the data is not validated before creating the new model. You should trust this data. -- **deep**: Set to `True` to make a deep copy of the model. +- `update`: Values to change/add in the new model. Note: the data is not validated before creating the new model. You should trust this data. +- `deep`: Set to `True` to make a deep copy of the model. @@ -241,8 +242,8 @@ Generate a dictionary representation of the model, optionally specifying which f ##### Arguments -- **mode**: The mode in which `to_python` should run. If mode is 'json', the output will only contain JSON serializable types. If mode is 'python', the output may contain non-JSON-serializable Python objects. -- **kwargs**: +- `mode`: The mode in which `to_python` should run. If mode is 'json', the output will only contain JSON serializable types. If mode is 'python', the output may contain non-JSON-serializable Python objects. +- `kwargs`: @@ -261,8 +262,8 @@ Generates a JSON representation of the model using Pydantic's `to_json` method. ##### Arguments -- **indent**: Indentation to use in the JSON output. If None is passed, the output will be compact. -- **kwargs**: +- `indent`: Indentation to use in the JSON output. If None is passed, the output will be compact. +- `kwargs`: @@ -280,10 +281,10 @@ Generates a JSON schema for a model class. ##### Arguments -- **by_alias**: Whether to use attribute aliases or not. -- **ref_template**: The reference template. -- **schema_generator**: To override the logic used to generate the JSON schema, as a subclass of `GenerateJsonSchema` with your desired modifications -- **mode**: The mode in which to generate the schema. +- `by_alias`: Whether to use attribute aliases or not. +- `ref_template`: The reference template. +- `schema_generator`: To override the logic used to generate the JSON schema, as a subclass of `GenerateJsonSchema` with your desired modifications +- `mode`: The mode in which to generate the schema. @@ -300,12 +301,12 @@ This method can be overridden to achieve a custom naming scheme for generic Base ##### Arguments -- **params**: Tuple of types of the class. Given a generic class `Model` with 2 type variables and a concrete model `Model[str, int]`, the value `(str, int)` would be passed to `params`. +- `params`: Tuple of types of the class. Given a generic class `Model` with 2 type variables and a concrete model `Model[str, int]`, the value `(str, int)` would be passed to `params`. ##### Raises -- **TypeError**: Raised when trying to generate concrete names for non-generic models. +- `TypeError`: Raised when trying to generate concrete names for non-generic models. ### method model_post_init @@ -320,7 +321,7 @@ This is useful if you want to do some validation that requires the entire model ##### Arguments -- **context**: +- `context`: @@ -342,10 +343,10 @@ the initial attempt to build the schema, and automatic rebuilding fails. ##### Arguments -- **force**: Whether to force the rebuilding of the model schema, defaults to `False`. -- **raise_errors**: Whether to raise errors, defaults to `True`. -- **_parent_namespace_depth**: The depth level of the parent namespace, defaults to 2. -- **_types_namespace**: The types namespace, defaults to `None`. +- `force`: Whether to force the rebuilding of the model schema, defaults to `False`. +- `raise_errors`: Whether to raise errors, defaults to `True`. +- `_parent_namespace_depth`: The depth level of the parent namespace, defaults to 2. +- `_types_namespace`: The types namespace, defaults to `None`. @@ -365,17 +366,17 @@ Validate a pydantic model instance. ##### Arguments -- **obj**: The object to validate. -- **strict**: Whether to enforce types strictly. -- **from_attributes**: Whether to extract data from object attributes. -- **context**: Additional context to pass to the validator. -- **by_alias**: Whether to use the field's alias when validating against the provided input data. -- **by_name**: Whether to use the field's name when validating against the provided input data. +- `obj`: The object to validate. +- `strict`: Whether to enforce types strictly. +- `from_attributes`: Whether to extract data from object attributes. +- `context`: Additional context to pass to the validator. +- `by_alias`: Whether to use the field's alias when validating against the provided input data. +- `by_name`: Whether to use the field's name when validating against the provided input data. ##### Raises -- **ValidationError**: If the object could not be validated. +- `ValidationError`: If the object could not be validated. ### method model_validate_json @@ -395,16 +396,16 @@ Validate the given JSON data against the Pydantic model. ##### Arguments -- **json_data**: The JSON data to validate. -- **strict**: Whether to enforce types strictly. -- **context**: Extra variables to pass to the validator. -- **by_alias**: Whether to use the field's alias when validating against the provided input data. -- **by_name**: Whether to use the field's name when validating against the provided input data. +- `json_data`: The JSON data to validate. +- `strict`: Whether to enforce types strictly. +- `context`: Extra variables to pass to the validator. +- `by_alias`: Whether to use the field's alias when validating against the provided input data. +- `by_name`: Whether to use the field's name when validating against the provided input data. ##### Raises -- **ValidationError**: If `json_data` is not a JSON string or the object could not be validated. +- `ValidationError`: If `json_data` is not a JSON string or the object could not be validated. ### method model_validate_strings @@ -421,11 +422,11 @@ Validate the given object with string data against the Pydantic model. ##### Arguments -- **obj**: The object containing string data to validate. -- **strict**: Whether to enforce types strictly. -- **context**: Extra variables to pass to the validator. -- **by_alias**: Whether to use the field's alias when validating against the provided input data. -- **by_name**: Whether to use the field's name when validating against the provided input data. +- `obj`: The object containing string data to validate. +- `strict`: Whether to enforce types strictly. +- `context`: Extra variables to pass to the validator. +- `by_alias`: Whether to use the field's alias when validating against the provided input data. +- `by_name`: Whether to use the field's name when validating against the provided input data. @@ -444,11 +445,11 @@ allow_pickle: 'bool' = False ##### Arguments -- **path**: -- **content_type**: -- **encoding**: -- **proto**: -- **allow_pickle**: +- `path`: +- `content_type`: +- `encoding`: +- `proto`: +- `allow_pickle`: @@ -463,7 +464,7 @@ obj: 'Any' ##### Arguments -- **obj**: +- `obj`: @@ -482,11 +483,11 @@ allow_pickle: 'bool' = False ##### Arguments -- **b**: -- **content_type**: -- **encoding**: -- **proto**: -- **allow_pickle**: +- `b`: +- `content_type`: +- `encoding`: +- `proto`: +- `allow_pickle`: @@ -502,8 +503,8 @@ ref_template: 'str' = '#/$defs/{model}' ##### Arguments -- **by_alias**: -- **ref_template**: +- `by_alias`: +- `ref_template`: @@ -520,9 +521,9 @@ ref_template: 'str' = '#/$defs/{model}', **dumps_kwargs: 'Any' ##### Arguments -- **by_alias**: -- **ref_template**: -- **dumps_kwargs**: +- `by_alias`: +- `ref_template`: +- `dumps_kwargs`: @@ -537,7 +538,7 @@ ref_template: 'str' = '#/$defs/{model}', **dumps_kwargs: 'Any' ##### Arguments -- **localns**: +- `localns`: @@ -552,7 +553,7 @@ value: 'Any' ##### Arguments -- **value**: +- `value`: diff --git a/models/ref/python/custom-charts/bar.mdx b/models/ref/python/custom-charts/bar.mdx index 42bc317521..1215a6176d 100644 --- a/models/ref/python/custom-charts/bar.mdx +++ b/models/ref/python/custom-charts/bar.mdx @@ -11,6 +11,7 @@ import { GitHubLink } from '/snippets/_includes/github-source-link.mdx'; +## function bar ```python table: 'wandb.Table', label: 'str', @@ -27,11 +28,11 @@ Constructs a bar chart from a wandb.Table of data. ## Args -- **table**: A table containing the data for the bar chart. -- **label**: The name of the column to use for the labels of each bar. -- **value**: The name of the column to use for the values of each bar. -- **title**: The title of the bar chart. -- **split_table**: Whether the table should be split into a separate section in the W&B UI. If `True`, the table will be displayed in a section named "Custom Chart Tables". Default is `False`. +- `table`: A table containing the data for the bar chart. +- `label`: The name of the column to use for the labels of each bar. +- `value`: The name of the column to use for the values of each bar. +- `title`: The title of the bar chart. +- `split_table`: Whether the table should be split into a separate section in the W&B UI. If `True`, the table will be displayed in a section named "Custom Chart Tables". Default is `False`. ## Returns diff --git a/models/ref/python/custom-charts/confusion_matrix.mdx b/models/ref/python/custom-charts/confusion_matrix.mdx index c24a795da0..607210ed40 100644 --- a/models/ref/python/custom-charts/confusion_matrix.mdx +++ b/models/ref/python/custom-charts/confusion_matrix.mdx @@ -11,6 +11,7 @@ import { GitHubLink } from '/snippets/_includes/github-source-link.mdx'; +## function confusion_matrix ```python probs: 'Sequence[Sequence[float]] | None' = None, y_true: 'Sequence[T] | None' = None, @@ -28,12 +29,12 @@ Constructs a confusion matrix from a sequence of probabilities or predictions. ## Args -- **probs**: A sequence of predicted probabilities for each class. The sequence shape should be (N, K) where N is the number of samples and K is the number of classes. If provided, `preds` should not be provided. -- **y_true**: A sequence of true labels. -- **preds**: A sequence of predicted class labels. If provided, `probs` should not be provided. -- **class_names**: Sequence of class names. If not provided, class names will be defined as "Class_1", "Class_2", etc. -- **title**: Title of the confusion matrix chart. -- **split_table**: Whether the table should be split into a separate section in the W&B UI. If `True`, the table will be displayed in a section named "Custom Chart Tables". Default is `False`. +- `probs`: A sequence of predicted probabilities for each class. The sequence shape should be (N, K) where N is the number of samples and K is the number of classes. If provided, `preds` should not be provided. +- `y_true`: A sequence of true labels. +- `preds`: A sequence of predicted class labels. If provided, `probs` should not be provided. +- `class_names`: Sequence of class names. If not provided, class names will be defined as "Class_1", "Class_2", etc. +- `title`: Title of the confusion matrix chart. +- `split_table`: Whether the table should be split into a separate section in the W&B UI. If `True`, the table will be displayed in a section named "Custom Chart Tables". Default is `False`. ## Returns @@ -43,8 +44,8 @@ Constructs a confusion matrix from a sequence of probabilities or predictions. ## Raises -- **ValueError**: If both `probs` and `preds` are provided or if the number of predictions and true labels are not equal. If the number of unique predicted classes exceeds the number of class names or if the number of unique true labels exceeds the number of class names. -- **wandb.Error**: If numpy is not installed. +- `ValueError`: If both `probs` and `preds` are provided or if the number of predictions and true labels are not equal. If the number of unique predicted classes exceeds the number of class names or if the number of unique true labels exceeds the number of class names. +- `wandb.Error`: If numpy is not installed. ## Examples diff --git a/models/ref/python/custom-charts/histogram.mdx b/models/ref/python/custom-charts/histogram.mdx index 68a454e392..a9c5a214ee 100644 --- a/models/ref/python/custom-charts/histogram.mdx +++ b/models/ref/python/custom-charts/histogram.mdx @@ -11,6 +11,7 @@ import { GitHubLink } from '/snippets/_includes/github-source-link.mdx'; +## function histogram ```python table: 'wandb.Table', value: 'str', @@ -26,10 +27,10 @@ Constructs a histogram chart from a W&B Table. ## Args -- **table**: The W&B Table containing the data for the histogram. -- **value**: The label for the bin axis (x-axis). -- **title**: The title of the histogram plot. -- **split_table**: Whether the table should be split into a separate section in the W&B UI. If `True`, the table will be displayed in a section named "Custom Chart Tables". Default is `False`. +- `table`: The W&B Table containing the data for the histogram. +- `value`: The label for the bin axis (x-axis). +- `title`: The title of the histogram plot. +- `split_table`: Whether the table should be split into a separate section in the W&B UI. If `True`, the table will be displayed in a section named "Custom Chart Tables". Default is `False`. ## Returns diff --git a/models/ref/python/custom-charts/line.mdx b/models/ref/python/custom-charts/line.mdx index b381be8ce4..2df017fe4d 100644 --- a/models/ref/python/custom-charts/line.mdx +++ b/models/ref/python/custom-charts/line.mdx @@ -11,6 +11,7 @@ import { GitHubLink } from '/snippets/_includes/github-source-link.mdx'; +## function line ```python table: 'wandb.Table', x: 'str', @@ -28,12 +29,12 @@ Constructs a customizable line chart. ## Args -- **table**: The table containing data for the chart. -- **x**: Column name for the x-axis values. -- **y**: Column name for the y-axis values. -- **stroke**: Column name to differentiate line strokes (e.g., for grouping lines). -- **title**: Title of the chart. -- **split_table**: Whether the table should be split into a separate section in the W&B UI. If `True`, the table will be displayed in a section named "Custom Chart Tables". Default is `False`. +- `table`: The table containing data for the chart. +- `x`: Column name for the x-axis values. +- `y`: Column name for the y-axis values. +- `stroke`: Column name to differentiate line strokes (e.g., for grouping lines). +- `title`: Title of the chart. +- `split_table`: Whether the table should be split into a separate section in the W&B UI. If `True`, the table will be displayed in a section named "Custom Chart Tables". Default is `False`. ## Returns diff --git a/models/ref/python/custom-charts/line_series.mdx b/models/ref/python/custom-charts/line_series.mdx index e4139055c9..4c9ff11e32 100644 --- a/models/ref/python/custom-charts/line_series.mdx +++ b/models/ref/python/custom-charts/line_series.mdx @@ -11,6 +11,7 @@ import { GitHubLink } from '/snippets/_includes/github-source-link.mdx'; +## function line_series ```python xs: 'Iterable[Iterable[Any]] | Iterable[Any]', ys: 'Iterable[Iterable[Any]]', @@ -28,12 +29,12 @@ Constructs a line series chart. ## Args -- **xs**: Sequence of x values. If a singular array is provided, all y values are plotted against that x array. If an array of arrays is provided, each y value is plotted against the corresponding x array. -- **ys**: Sequence of y values, where each iterable represents a separate line series. -- **keys**: Sequence of keys for labeling each line series. If not provided, keys will be automatically generated as "line_1", "line_2", etc. -- **title**: Title of the chart. -- **xname**: Label for the x-axis. -- **split_table**: Whether the table should be split into a separate section in the W&B UI. If `True`, the table will be displayed in a section named "Custom Chart Tables". Default is `False`. +- `xs`: Sequence of x values. If a singular array is provided, all y values are plotted against that x array. If an array of arrays is provided, each y value is plotted against the corresponding x array. +- `ys`: Sequence of y values, where each iterable represents a separate line series. +- `keys`: Sequence of keys for labeling each line series. If not provided, keys will be automatically generated as "line_1", "line_2", etc. +- `title`: Title of the chart. +- `xname`: Label for the x-axis. +- `split_table`: Whether the table should be split into a separate section in the W&B UI. If `True`, the table will be displayed in a section named "Custom Chart Tables". Default is `False`. ## Returns diff --git a/models/ref/python/custom-charts/plot_table.mdx b/models/ref/python/custom-charts/plot_table.mdx index 869da556c3..2ae7d79143 100644 --- a/models/ref/python/custom-charts/plot_table.mdx +++ b/models/ref/python/custom-charts/plot_table.mdx @@ -11,6 +11,7 @@ import { GitHubLink } from '/snippets/_includes/github-source-link.mdx'; +## function plot_table ```python vega_spec_name: 'str', data_table: 'wandb.Table', @@ -32,11 +33,11 @@ chart object that can be logged to W&B using `wandb.Run.log()`. ## Args -- **vega_spec_name**: The name or identifier of the Vega-Lite spec that defines the visualization structure. -- **data_table**: A `wandb.Table` object containing the data to be visualized. -- **fields**: A mapping between the fields in the Vega-Lite spec and the corresponding columns in the data table to be visualized. -- **string_fields**: A dictionary for providing values for any string constants required by the custom visualization. -- **split_table**: Whether the table should be split into a separate section in the W&B UI. If `True`, the table will be displayed in a section named "Custom Chart Tables". Default is `False`. +- `vega_spec_name`: The name or identifier of the Vega-Lite spec that defines the visualization structure. +- `data_table`: A `wandb.Table` object containing the data to be visualized. +- `fields`: A mapping between the fields in the Vega-Lite spec and the corresponding columns in the data table to be visualized. +- `string_fields`: A dictionary for providing values for any string constants required by the custom visualization. +- `split_table`: Whether the table should be split into a separate section in the W&B UI. If `True`, the table will be displayed in a section named "Custom Chart Tables". Default is `False`. ## Returns @@ -46,7 +47,7 @@ chart object that can be logged to W&B using `wandb.Run.log()`. ## Raises -- **wandb.Error**: If `data_table` is not a `wandb.Table` object. +- `wandb.Error`: If `data_table` is not a `wandb.Table` object. ## Examples diff --git a/models/ref/python/custom-charts/pr_curve.mdx b/models/ref/python/custom-charts/pr_curve.mdx index a59a44c115..2cbbd1430b 100644 --- a/models/ref/python/custom-charts/pr_curve.mdx +++ b/models/ref/python/custom-charts/pr_curve.mdx @@ -11,6 +11,7 @@ import { GitHubLink } from '/snippets/_includes/github-source-link.mdx'; +## function pr_curve ```python y_true: 'Iterable[T] | None' = None, y_probas: 'Iterable[numbers.Number] | None' = None, @@ -36,13 +37,13 @@ a model's performance. ## Args -- **y_true**: True binary labels. The shape should be (`num_samples`,). -- **y_probas**: Predicted scores or probabilities for each class. These can be probability estimates, confidence scores, or non-thresholded decision values. The shape should be (`num_samples`, `num_classes`). -- **labels**: Optional list of class names to replace numeric values in `y_true` for easier plot interpretation. For example, `labels = ['dog', 'cat', 'owl']` will replace 0 with 'dog', 1 with 'cat', and 2 with 'owl' in the plot. If not provided, numeric values from `y_true` will be used. -- **classes_to_plot**: Optional list of unique class values from y_true to be included in the plot. If not specified, all unique classes in y_true will be plotted. -- **interp_size**: Number of points to interpolate recall values. The recall values will be fixed to `interp_size` uniformly distributed points in the range [0, 1], and the precision will be interpolated accordingly. -- **title**: Title of the plot. Defaults to "Precision-Recall Curve". -- **split_table**: Whether the table should be split into a separate section in the W&B UI. If `True`, the table will be displayed in a section named "Custom Chart Tables". Default is `False`. +- `y_true`: True binary labels. The shape should be (`num_samples`,). +- `y_probas`: Predicted scores or probabilities for each class. These can be probability estimates, confidence scores, or non-thresholded decision values. The shape should be (`num_samples`, `num_classes`). +- `labels`: Optional list of class names to replace numeric values in `y_true` for easier plot interpretation. For example, `labels = ['dog', 'cat', 'owl']` will replace 0 with 'dog', 1 with 'cat', and 2 with 'owl' in the plot. If not provided, numeric values from `y_true` will be used. +- `classes_to_plot`: Optional list of unique class values from y_true to be included in the plot. If not specified, all unique classes in y_true will be plotted. +- `interp_size`: Number of points to interpolate recall values. The recall values will be fixed to `interp_size` uniformly distributed points in the range [0, 1], and the precision will be interpolated accordingly. +- `title`: Title of the plot. Defaults to "Precision-Recall Curve". +- `split_table`: Whether the table should be split into a separate section in the W&B UI. If `True`, the table will be displayed in a section named "Custom Chart Tables". Default is `False`. ## Returns @@ -52,7 +53,7 @@ a model's performance. ## Raises -- **wandb.Error**: If NumPy, pandas, or scikit-learn is not installed. +- `wandb.Error`: If NumPy, pandas, or scikit-learn is not installed. ## Examples diff --git a/models/ref/python/custom-charts/roc_curve.mdx b/models/ref/python/custom-charts/roc_curve.mdx index 99e4ec5418..b10a4c0c9e 100644 --- a/models/ref/python/custom-charts/roc_curve.mdx +++ b/models/ref/python/custom-charts/roc_curve.mdx @@ -11,6 +11,7 @@ import { GitHubLink } from '/snippets/_includes/github-source-link.mdx'; +## function roc_curve ```python y_true: 'Sequence[numbers.Number]', y_probas: 'Sequence[Sequence[float]] | None' = None, @@ -28,12 +29,12 @@ Constructs Receiver Operating Characteristic (ROC) curve chart. ## Args -- **y_true**: The true class labels (ground truth) for the target variable. Shape should be (num_samples,). -- **y_probas**: The predicted probabilities or decision scores for each class. Shape should be (num_samples, num_classes). -- **labels**: Human-readable labels corresponding to the class indices in `y_true`. For example, if `labels=['dog', 'cat']`, class 0 will be displayed as 'dog' and class 1 as 'cat' in the plot. If None, the raw class indices from `y_true` will be used. Default is None. -- **classes_to_plot**: A subset of unique class labels to include in the ROC curve. If None, all classes in `y_true` will be plotted. Default is None. -- **title**: Title of the ROC curve plot. Default is "ROC Curve". -- **split_table**: Whether the table should be split into a separate section in the W&B UI. If `True`, the table will be displayed in a section named "Custom Chart Tables". Default is `False`. +- `y_true`: The true class labels (ground truth) for the target variable. Shape should be (num_samples,). +- `y_probas`: The predicted probabilities or decision scores for each class. Shape should be (num_samples, num_classes). +- `labels`: Human-readable labels corresponding to the class indices in `y_true`. For example, if `labels=['dog', 'cat']`, class 0 will be displayed as 'dog' and class 1 as 'cat' in the plot. If None, the raw class indices from `y_true` will be used. Default is None. +- `classes_to_plot`: A subset of unique class labels to include in the ROC curve. If None, all classes in `y_true` will be plotted. Default is None. +- `title`: Title of the ROC curve plot. Default is "ROC Curve". +- `split_table`: Whether the table should be split into a separate section in the W&B UI. If `True`, the table will be displayed in a section named "Custom Chart Tables". Default is `False`. ## Returns @@ -43,7 +44,7 @@ Constructs Receiver Operating Characteristic (ROC) curve chart. ## Raises -- **wandb.Error**: If numpy, pandas, or scikit-learn are not found. +- `wandb.Error`: If numpy, pandas, or scikit-learn are not found. ## Examples diff --git a/models/ref/python/custom-charts/scatter.mdx b/models/ref/python/custom-charts/scatter.mdx index b08e5b4dc9..aa5d45b380 100644 --- a/models/ref/python/custom-charts/scatter.mdx +++ b/models/ref/python/custom-charts/scatter.mdx @@ -11,6 +11,7 @@ import { GitHubLink } from '/snippets/_includes/github-source-link.mdx'; +## function scatter ```python table: 'wandb.Table', x: 'str', @@ -27,11 +28,11 @@ Constructs a scatter plot from a wandb.Table of data. ## Args -- **table**: The W&B Table containing the data to visualize. -- **x**: The name of the column used for the x-axis. -- **y**: The name of the column used for the y-axis. -- **title**: The title of the scatter chart. -- **split_table**: Whether the table should be split into a separate section in the W&B UI. If `True`, the table will be displayed in a section named "Custom Chart Tables". Default is `False`. +- `table`: The W&B Table containing the data to visualize. +- `x`: The name of the column used for the x-axis. +- `y`: The name of the column used for the y-axis. +- `title`: The title of the scatter chart. +- `split_table`: Whether the table should be split into a separate section in the W&B UI. If `True`, the table will be displayed in a section named "Custom Chart Tables". Default is `False`. ## Returns diff --git a/models/ref/python/data-types/audio.mdx b/models/ref/python/data-types/audio.mdx index 435175e058..a3591f2b59 100644 --- a/models/ref/python/data-types/audio.mdx +++ b/models/ref/python/data-types/audio.mdx @@ -11,6 +11,7 @@ import { GitHubLink } from '/snippets/_includes/github-source-link.mdx'; +## class Audio ```python (data_or_path: 'str | pathlib.Path | list | np.ndarray', sample_rate: 'int | None' = None, @@ -25,9 +26,9 @@ W&B class for audio clips. ## Args -- **data_or_path**: -- **sample_rate**: -- **caption**: +- `data_or_path`: +- `sample_rate`: +- `caption`: @@ -46,7 +47,7 @@ Calculate the duration of the audio files. ##### Arguments -- **audio_list**: +- `audio_list`: @@ -81,8 +82,8 @@ make sure to properly set this `artifact_source` to avoid data duplication. ##### Arguments -- **json_obj**: A JSON dictionary to deserialize. It must contain a `_type` key. This is used to lookup the correct subclass to use. -- **source_artifact**: An artifact which will hold any additional resources which were stored during the `to_json` function. +- `json_obj`: A JSON dictionary to deserialize. It must contain a `_type` key. This is used to lookup the correct subclass to use. +- `source_artifact`: An artifact which will hold any additional resources which were stored during the `to_json` function. @@ -109,7 +110,7 @@ path: 'str | pathlib.Path | None' ##### Arguments -- **path**: +- `path`: @@ -124,7 +125,7 @@ Get sample rates of the audio files. ##### Arguments -- **audio_list**: +- `audio_list`: @@ -162,8 +163,8 @@ Get the name with the appropriate suffix. ##### Arguments -- **name**: the name of the file -- **filetype**: the filetype to use. Defaults to "json". +- `name`: the name of the file +- `filetype`: the filetype to use. Defaults to "json". diff --git a/models/ref/python/data-types/evaltable.mdx b/models/ref/python/data-types/evaltable.mdx index ca04ed4d28..5a892d4feb 100644 --- a/models/ref/python/data-types/evaltable.mdx +++ b/models/ref/python/data-types/evaltable.mdx @@ -11,6 +11,7 @@ import { GitHubLink } from '/snippets/_includes/github-source-link.mdx'; +## class EvalTable ```python columns: 'list[str | int] | None' = None, data: 'list[Iterable[Any]] | np.ndarray | pd.DataFrame | None' = None, @@ -42,18 +43,18 @@ supported. ## Args -- **columns**: -- **data**: -- **rows**: -- **dataframe**: -- **dtype**: -- **optional**: -- **allow_mixed_types**: -- **log_mode**: -- **input_columns**: -- **output_columns**: -- **score_columns**: -- **unsupported_media_mode**: +- `columns`: +- `data`: +- `rows`: +- `dataframe`: +- `dtype`: +- `optional`: +- `allow_mixed_types`: +- `log_mode`: +- `input_columns`: +- `output_columns`: +- `score_columns`: +- `unsupported_media_mode`: @@ -75,9 +76,9 @@ Adds a column of data to the table. ##### Arguments -- **name**: (str) - the unique name of the column -- **data**: (list | np.array) - a column of homogeneous data -- **optional**: (bool) - if null-like values are permitted +- `name`: (str) - the unique name of the column +- `data`: (list | np.array) - a column of homogeneous data +- `optional`: (bool) - if null-like values are permitted @@ -92,7 +93,7 @@ Adds one or more computed columns based on existing data. ##### Arguments -- **fn**: A function which accepts one or two parameters, ndx (int) and row (dict), which is expected to return a dict representing new columns for that row, keyed by the new column names. - `ndx` is an integer representing the index of the row. Only included if `include_ndx` is set to `True`. - `row` is a dictionary keyed by existing columns +- `fn`: A function which accepts one or two parameters, ndx (int) and row (dict), which is expected to return a dict representing new columns for that row, keyed by the new column names. - `ndx` is an integer representing the index of the row. Only included if `include_ndx` is set to `True`. - `row` is a dictionary keyed by existing columns @@ -112,7 +113,7 @@ The length of the data should match the length of the table column. ##### Arguments -- **data**: +- `data`: @@ -127,7 +128,7 @@ Deprecated. Use `Table.add_data` method instead. ##### Arguments -- **row**: +- `row`: @@ -142,7 +143,7 @@ media_items: 'Sequence[Media]' ##### Arguments -- **media_items**: +- `media_items`: @@ -161,9 +162,9 @@ wandb.Classes. ##### Arguments -- **col_name**: The name of the column to cast. -- **dtype**: The target dtype. -- **optional**: If the column should allow Nones. +- `col_name`: The name of the column to cast. +- `dtype`: The target dtype. +- `optional`: If the column should allow Nones. @@ -190,8 +191,8 @@ Retrieves a column from the table and optionally converts it to a NumPy object. ##### Arguments -- **name**: (str) - the name of the column -- **convert_to**: (str, optional) +- `name`: (str) - the name of the column +- `convert_to`: (str, optional) @@ -238,8 +239,8 @@ make sure to properly set this `artifact_source` to avoid data duplication. ##### Arguments -- **json_obj**: A JSON dictionary to deserialize. It must contain a `_type` key. This is used to lookup the correct subclass to use. -- **source_artifact**: An artifact which will hold any additional resources which were stored during the `to_json` function. +- `json_obj`: A JSON dictionary to deserialize. It must contain a `_type` key. This is used to lookup the correct subclass to use. +- `source_artifact`: An artifact which will hold any additional resources which were stored during the `to_json` function. @@ -266,7 +267,7 @@ path: 'str | pathlib.Path | None' ##### Arguments -- **path**: +- `path`: @@ -304,8 +305,8 @@ Get the name with the appropriate suffix. ##### Arguments -- **name**: the name of the file -- **filetype**: the filetype to use. Defaults to "json". +- `name`: the name of the file +- `filetype`: the filetype to use. Defaults to "json". diff --git a/models/ref/python/data-types/histogram.mdx b/models/ref/python/data-types/histogram.mdx index f3a6c35ae9..323f37a002 100644 --- a/models/ref/python/data-types/histogram.mdx +++ b/models/ref/python/data-types/histogram.mdx @@ -11,6 +11,7 @@ import { GitHubLink } from '/snippets/_includes/github-source-link.mdx'; +## class Histogram ```python sequence: 'Sequence | None' = None, np_histogram: 'NumpyHistogram | None' = None, @@ -32,9 +33,9 @@ Attributes: ## Args -- **sequence**: -- **np_histogram**: -- **num_bins**: +- `sequence`: +- `np_histogram`: +- `num_bins`: @@ -57,8 +58,8 @@ If additional resources were stored in the `run_or_artifact` artifact during the ##### Arguments -- **json_obj**: A JSON dictionary to deserialize source_artifact -- **source_artifact**: +- `json_obj`: A JSON dictionary to deserialize source_artifact +- `source_artifact`: @@ -81,8 +82,8 @@ make sure to properly set this `artifact_source` to avoid data duplication. ##### Arguments -- **json_obj**: A JSON dictionary to deserialize. It must contain a `_type` key. This is used to lookup the correct subclass to use. -- **source_artifact**: An artifact which will hold any additional resources which were stored during the `to_json` function. +- `json_obj`: A JSON dictionary to deserialize. It must contain a `_type` key. This is used to lookup the correct subclass to use. +- `source_artifact`: An artifact which will hold any additional resources which were stored during the `to_json` function. @@ -120,8 +121,8 @@ Get the name with the appropriate suffix. ##### Arguments -- **name**: the name of the file -- **filetype**: the filetype to use. Defaults to "json". +- `name`: the name of the file +- `filetype`: the filetype to use. Defaults to "json". diff --git a/models/ref/python/data-types/html.mdx b/models/ref/python/data-types/html.mdx index ddf31b9f7d..e974ab0efe 100644 --- a/models/ref/python/data-types/html.mdx +++ b/models/ref/python/data-types/html.mdx @@ -11,6 +11,7 @@ import { GitHubLink } from '/snippets/_includes/github-source-link.mdx'; +## class Html ```python data: 'str | pathlib.Path | TextIO', inject: 'bool' = True, @@ -25,9 +26,9 @@ W&B class for logging HTML content to W&B. ## Args -- **data**: -- **inject**: -- **data_is_not_path**: +- `data`: +- `inject`: +- `data_is_not_path`: @@ -54,11 +55,11 @@ file associated with this object, from which other Runs can refer to it. ##### Arguments -- **run**: -- **key**: -- **step**: -- **id_**: -- **ignore_copy_err**: +- `run`: +- `key`: +- `step`: +- `id_`: +- `ignore_copy_err`: @@ -73,7 +74,7 @@ media_items: 'Sequence[Media]' ##### Arguments -- **media_items**: +- `media_items`: @@ -108,8 +109,8 @@ make sure to properly set this `artifact_source` to avoid data duplication. ##### Arguments -- **json_obj**: A JSON dictionary to deserialize. It must contain a `_type` key. This is used to lookup the correct subclass to use. -- **source_artifact**: An artifact which will hold any additional resources which were stored during the `to_json` function. +- `json_obj`: A JSON dictionary to deserialize. It must contain a `_type` key. This is used to lookup the correct subclass to use. +- `source_artifact`: An artifact which will hold any additional resources which were stored during the `to_json` function. @@ -136,7 +137,7 @@ path: 'str | pathlib.Path | None' ##### Arguments -- **path**: +- `path`: @@ -174,8 +175,8 @@ Get the name with the appropriate suffix. ##### Arguments -- **name**: the name of the file -- **filetype**: the filetype to use. Defaults to "json". +- `name`: the name of the file +- `filetype`: the filetype to use. Defaults to "json". diff --git a/models/ref/python/data-types/image.mdx b/models/ref/python/data-types/image.mdx index 0dfcc0d43c..428cf22bfd 100644 --- a/models/ref/python/data-types/image.mdx +++ b/models/ref/python/data-types/image.mdx @@ -11,6 +11,7 @@ import { GitHubLink } from '/snippets/_includes/github-source-link.mdx'; +## class Image ```python data_or_path: 'ImageDataOrPathType', mode: 'str | None' = None, @@ -31,15 +32,15 @@ A class for logging images to W&B. ## Args -- **data_or_path**: -- **mode**: -- **caption**: -- **grouping**: -- **classes**: -- **boxes**: -- **masks**: -- **file_type**: -- **normalize**: +- `data_or_path`: +- `mode`: +- `caption`: +- `grouping`: +- `classes`: +- `boxes`: +- `masks`: +- `file_type`: +- `normalize`: @@ -64,7 +65,7 @@ media_items: 'Sequence[Media]' ##### Arguments -- **media_items**: +- `media_items`: @@ -99,8 +100,8 @@ make sure to properly set this `artifact_source` to avoid data duplication. ##### Arguments -- **json_obj**: A JSON dictionary to deserialize. It must contain a `_type` key. This is used to lookup the correct subclass to use. -- **source_artifact**: An artifact which will hold any additional resources which were stored during the `to_json` function. +- `json_obj`: A JSON dictionary to deserialize. It must contain a `_type` key. This is used to lookup the correct subclass to use. +- `source_artifact`: An artifact which will hold any additional resources which were stored during the `to_json` function. @@ -127,7 +128,7 @@ path: 'str | pathlib.Path | None' ##### Arguments -- **path**: +- `path`: @@ -153,8 +154,8 @@ Get the name with the appropriate suffix. ##### Arguments -- **name**: the name of the file -- **filetype**: the filetype to use. Defaults to "json". +- `name`: the name of the file +- `filetype`: the filetype to use. Defaults to "json". diff --git a/models/ref/python/data-types/molecule.mdx b/models/ref/python/data-types/molecule.mdx index d5cc8ad7a0..3be5a893aa 100644 --- a/models/ref/python/data-types/molecule.mdx +++ b/models/ref/python/data-types/molecule.mdx @@ -11,6 +11,7 @@ import { GitHubLink } from '/snippets/_includes/github-source-link.mdx'; +## class Molecule ```python data_or_path: 'str | pathlib.Path | TextIO', caption: 'str | None' = None, **kwargs: 'str' @@ -24,9 +25,9 @@ W&B class for 3D Molecular data. ## Args -- **data_or_path**: -- **caption**: -- **kwargs**: +- `data_or_path`: +- `caption`: +- `kwargs`: @@ -53,11 +54,11 @@ file associated with this object, from which other Runs can refer to it. ##### Arguments -- **run**: -- **key**: -- **step**: -- **id_**: -- **ignore_copy_err**: +- `run`: +- `key`: +- `step`: +- `id_`: +- `ignore_copy_err`: @@ -72,7 +73,7 @@ media_items: 'Sequence[Media]' ##### Arguments -- **media_items**: +- `media_items`: @@ -100,8 +101,8 @@ Likely will need to override for any more complicated media objects. ##### Arguments -- **json_obj**: -- **source_artifact**: +- `json_obj`: +- `source_artifact`: @@ -119,10 +120,10 @@ Convert RDKit-supported file/object types to wandb.Molecule. ##### Arguments -- **data_or_path**: (string, rdkit.Chem.rdchem.Mol) Molecule can be initialized from a file name or an rdkit.Chem.rdchem.Mol object. -- **caption**: (string) Caption associated with the molecule for display. -- **convert_to_3d_and_optimize**: (bool) Convert to rdkit.Chem.rdchem.Mol with 3D coordinates. This is an expensive operation that may take a long time for complicated molecules. -- **mmff_optimize_molecule_max_iterations**: (int) Number of iterations to use in rdkit.Chem.AllChem.MMFFOptimizeMolecule +- `data_or_path`: (string, rdkit.Chem.rdchem.Mol) Molecule can be initialized from a file name or an rdkit.Chem.rdchem.Mol object. +- `caption`: (string) Caption associated with the molecule for display. +- `convert_to_3d_and_optimize`: (bool) Convert to rdkit.Chem.rdchem.Mol with 3D coordinates. This is an expensive operation that may take a long time for complicated molecules. +- `mmff_optimize_molecule_max_iterations`: (int) Number of iterations to use in rdkit.Chem.AllChem.MMFFOptimizeMolecule @@ -141,11 +142,11 @@ Convert SMILES string to wandb.Molecule. ##### Arguments -- **data**: SMILES string. -- **caption**: Caption associated with the molecule for display. -- **sanitize**: Check if the molecule is chemically reasonable by the RDKit's definition. -- **convert_to_3d_and_optimize**: Convert to rdkit.Chem.rdchem.Mol with 3D coordinates. This is a computationally intensive operation that may take a long time for complicated molecules. -- **mmff_optimize_molecule_max_iterations**: Number of iterations to use in rdkit.Chem.AllChem.MMFFOptimizeMolecule. +- `data`: SMILES string. +- `caption`: Caption associated with the molecule for display. +- `sanitize`: Check if the molecule is chemically reasonable by the RDKit's definition. +- `convert_to_3d_and_optimize`: Convert to rdkit.Chem.rdchem.Mol with 3D coordinates. This is a computationally intensive operation that may take a long time for complicated molecules. +- `mmff_optimize_molecule_max_iterations`: Number of iterations to use in rdkit.Chem.AllChem.MMFFOptimizeMolecule. @@ -168,8 +169,8 @@ make sure to properly set this `artifact_source` to avoid data duplication. ##### Arguments -- **json_obj**: A JSON dictionary to deserialize. It must contain a `_type` key. This is used to lookup the correct subclass to use. -- **source_artifact**: An artifact which will hold any additional resources which were stored during the `to_json` function. +- `json_obj`: A JSON dictionary to deserialize. It must contain a `_type` key. This is used to lookup the correct subclass to use. +- `source_artifact`: An artifact which will hold any additional resources which were stored during the `to_json` function. @@ -196,7 +197,7 @@ path: 'str | pathlib.Path | None' ##### Arguments -- **path**: +- `path`: @@ -234,8 +235,8 @@ Get the name with the appropriate suffix. ##### Arguments -- **name**: the name of the file -- **filetype**: the filetype to use. Defaults to "json". +- `name`: the name of the file +- `filetype`: the filetype to use. Defaults to "json". diff --git a/models/ref/python/data-types/object3d.mdx b/models/ref/python/data-types/object3d.mdx index facb30901c..ef1a60f8ac 100644 --- a/models/ref/python/data-types/object3d.mdx +++ b/models/ref/python/data-types/object3d.mdx @@ -11,6 +11,7 @@ import { GitHubLink } from '/snippets/_includes/github-source-link.mdx'; +## class Object3D ```python data_or_path: 'np.ndarray | str | pathlib.Path | TextIO | dict', caption: 'str | None' = None, **kwargs: 'str | FileFormat3D | None' @@ -24,9 +25,9 @@ W&B class for 3D point clouds. ## Args -- **data_or_path**: -- **caption**: -- **kwargs**: +- `data_or_path`: +- `caption`: +- `kwargs`: @@ -53,11 +54,11 @@ file associated with this object, from which other Runs can refer to it. ##### Arguments -- **run**: -- **key**: -- **step**: -- **id_**: -- **ignore_copy_err**: +- `run`: +- `key`: +- `step`: +- `id_`: +- `ignore_copy_err`: @@ -72,7 +73,7 @@ media_items: 'Sequence[Media]' ##### Arguments -- **media_items**: +- `media_items`: @@ -100,8 +101,8 @@ Initializes Object3D from a file or stream. ##### Arguments -- **data_or_path**: A path to a file or a `TextIO` stream. -- **file_type**: Specifies the data format passed to `data_or_path`. Required when `data_or_path` is a `TextIO` stream. This parameter is ignored if a file path is provided. The type is taken from the file extension. +- `data_or_path`: A path to a file or a `TextIO` stream. +- `file_type`: Specifies the data format passed to `data_or_path`. Required when `data_or_path` is a `TextIO` stream. This parameter is ignored if a file path is provided. The type is taken from the file extension. @@ -117,8 +118,8 @@ Likely will need to override for any more complicated media objects. ##### Arguments -- **json_obj**: -- **source_artifact**: +- `json_obj`: +- `source_artifact`: @@ -133,7 +134,7 @@ Initializes Object3D from a numpy array. ##### Arguments -- **data**: Each entry in the array will represent one point in the point cloud. +- `data`: Each entry in the array will represent one point in the point cloud. @@ -151,10 +152,10 @@ Initializes Object3D from a python object. ##### Arguments -- **points**: The points in the point cloud. -- **boxes**: 3D bounding boxes for labeling the point cloud. Boxes are displayed in point cloud visualizations. -- **vectors**: Each vector is displayed in the point cloud visualization. Can be used to indicate directionality of bounding boxes. Defaults to None. -- **point_cloud_type**: At this time, only the "lidar/beta" type is supported. Defaults to "lidar/beta". +- `points`: The points in the point cloud. +- `boxes`: 3D bounding boxes for labeling the point cloud. Boxes are displayed in point cloud visualizations. +- `vectors`: Each vector is displayed in the point cloud visualization. Can be used to indicate directionality of bounding boxes. Defaults to None. +- `point_cloud_type`: At this time, only the "lidar/beta" type is supported. Defaults to "lidar/beta". @@ -177,8 +178,8 @@ make sure to properly set this `artifact_source` to avoid data duplication. ##### Arguments -- **json_obj**: A JSON dictionary to deserialize. It must contain a `_type` key. This is used to lookup the correct subclass to use. -- **source_artifact**: An artifact which will hold any additional resources which were stored during the `to_json` function. +- `json_obj`: A JSON dictionary to deserialize. It must contain a `_type` key. This is used to lookup the correct subclass to use. +- `source_artifact`: An artifact which will hold any additional resources which were stored during the `to_json` function. @@ -205,7 +206,7 @@ path: 'str | pathlib.Path | None' ##### Arguments -- **path**: +- `path`: @@ -243,8 +244,8 @@ Get the name with the appropriate suffix. ##### Arguments -- **name**: the name of the file -- **filetype**: the filetype to use. Defaults to "json". +- `name`: the name of the file +- `filetype`: the filetype to use. Defaults to "json". diff --git a/models/ref/python/data-types/plotly.mdx b/models/ref/python/data-types/plotly.mdx index 34afd616f5..92f24682f0 100644 --- a/models/ref/python/data-types/plotly.mdx +++ b/models/ref/python/data-types/plotly.mdx @@ -11,6 +11,7 @@ import { GitHubLink } from '/snippets/_includes/github-source-link.mdx'; +## class Plotly ```python (val: 'plotly.Figure | matplotlib.artist.Artist') ``` @@ -23,7 +24,7 @@ W&B class for Plotly plots. ## Args -- **val**: +- `val`: @@ -50,11 +51,11 @@ file associated with this object, from which other Runs can refer to it. ##### Arguments -- **run**: -- **key**: -- **step**: -- **id_**: -- **ignore_copy_err**: +- `run`: +- `key`: +- `step`: +- `id_`: +- `ignore_copy_err`: @@ -69,7 +70,7 @@ media_items: 'Sequence[Media]' ##### Arguments -- **media_items**: +- `media_items`: @@ -97,8 +98,8 @@ Likely will need to override for any more complicated media objects. ##### Arguments -- **json_obj**: -- **source_artifact**: +- `json_obj`: +- `source_artifact`: @@ -121,8 +122,8 @@ make sure to properly set this `artifact_source` to avoid data duplication. ##### Arguments -- **json_obj**: A JSON dictionary to deserialize. It must contain a `_type` key. This is used to lookup the correct subclass to use. -- **source_artifact**: An artifact which will hold any additional resources which were stored during the `to_json` function. +- `json_obj`: A JSON dictionary to deserialize. It must contain a `_type` key. This is used to lookup the correct subclass to use. +- `source_artifact`: An artifact which will hold any additional resources which were stored during the `to_json` function. @@ -149,7 +150,7 @@ path: 'str | pathlib.Path | None' ##### Arguments -- **path**: +- `path`: @@ -187,8 +188,8 @@ Get the name with the appropriate suffix. ##### Arguments -- **name**: the name of the file -- **filetype**: the filetype to use. Defaults to "json". +- `name`: the name of the file +- `filetype`: the filetype to use. Defaults to "json". diff --git a/models/ref/python/data-types/table.mdx b/models/ref/python/data-types/table.mdx index d1cd09940a..c251a710e9 100644 --- a/models/ref/python/data-types/table.mdx +++ b/models/ref/python/data-types/table.mdx @@ -11,6 +11,7 @@ import { GitHubLink } from '/snippets/_includes/github-source-link.mdx'; +## class Table ```python (columns=None, data=None, rows=None, dataframe=None, dtype=None, optional=True, allow_mixed_types=False, log_mode: "Literal['IMMUTABLE', 'MUTABLE', 'INCREMENTAL'] | None" = 'IMMUTABLE') @@ -32,14 +33,14 @@ https://docs.wandb.ai/models/tables ## Args -- **columns**: -- **data**: -- **rows**: -- **dataframe**: -- **dtype**: -- **optional**: -- **allow_mixed_types**: -- **log_mode**: +- `columns`: +- `data`: +- `rows`: +- `dataframe`: +- `dtype`: +- `optional`: +- `allow_mixed_types`: +- `log_mode`: @@ -58,9 +59,9 @@ Adds a column of data to the table. ##### Arguments -- **name**: (str) - the unique name of the column -- **data**: (list | np.array) - a column of homogeneous data -- **optional**: (bool) - if null-like values are permitted +- `name`: (str) - the unique name of the column +- `data`: (list | np.array) - a column of homogeneous data +- `optional`: (bool) - if null-like values are permitted @@ -75,7 +76,7 @@ Adds one or more computed columns based on existing data. ##### Arguments -- **fn**: A function which accepts one or two parameters, ndx (int) and row (dict), which is expected to return a dict representing new columns for that row, keyed by the new column names. - `ndx` is an integer representing the index of the row. Only included if `include_ndx` is set to `True`. - `row` is a dictionary keyed by existing columns +- `fn`: A function which accepts one or two parameters, ndx (int) and row (dict), which is expected to return a dict representing new columns for that row, keyed by the new column names. - `ndx` is an integer representing the index of the row. Only included if `include_ndx` is set to `True`. - `row` is a dictionary keyed by existing columns @@ -95,7 +96,7 @@ The length of the data should match the length of the table column. ##### Arguments -- **data**: +- `data`: @@ -110,7 +111,7 @@ Deprecated. Use `Table.add_data` method instead. ##### Arguments -- **row**: +- `row`: @@ -125,7 +126,7 @@ media_items: 'Sequence[Media]' ##### Arguments -- **media_items**: +- `media_items`: @@ -144,9 +145,9 @@ wandb.Classes. ##### Arguments -- **col_name**: The name of the column to cast. -- **dtype**: The target dtype. -- **optional**: If the column should allow Nones. +- `col_name`: The name of the column to cast. +- `dtype`: The target dtype. +- `optional`: If the column should allow Nones. @@ -173,8 +174,8 @@ Retrieves a column from the table and optionally converts it to a NumPy object. ##### Arguments -- **name**: (str) - the name of the column -- **convert_to**: (str, optional) +- `name`: (str) - the name of the column +- `convert_to`: (str, optional) @@ -221,8 +222,8 @@ make sure to properly set this `artifact_source` to avoid data duplication. ##### Arguments -- **json_obj**: A JSON dictionary to deserialize. It must contain a `_type` key. This is used to lookup the correct subclass to use. -- **source_artifact**: An artifact which will hold any additional resources which were stored during the `to_json` function. +- `json_obj`: A JSON dictionary to deserialize. It must contain a `_type` key. This is used to lookup the correct subclass to use. +- `source_artifact`: An artifact which will hold any additional resources which were stored during the `to_json` function. @@ -249,7 +250,7 @@ path: 'str | pathlib.Path | None' ##### Arguments -- **path**: +- `path`: @@ -287,8 +288,8 @@ Get the name with the appropriate suffix. ##### Arguments -- **name**: the name of the file -- **filetype**: the filetype to use. Defaults to "json". +- `name`: the name of the file +- `filetype`: the filetype to use. Defaults to "json". diff --git a/models/ref/python/data-types/video.mdx b/models/ref/python/data-types/video.mdx index bf9b82634f..e5590999b9 100644 --- a/models/ref/python/data-types/video.mdx +++ b/models/ref/python/data-types/video.mdx @@ -11,6 +11,7 @@ import { GitHubLink } from '/snippets/_includes/github-source-link.mdx'; +## class Video ```python (data_or_path: 'str | pathlib.Path | np.ndarray | TextIO | BytesIO', caption: 'str | None' = None, @@ -26,10 +27,10 @@ A class for logging videos to W&B. ## Args -- **data_or_path**: -- **caption**: -- **fps**: -- **format**: +- `data_or_path`: +- `caption`: +- `fps`: +- `format`: @@ -56,11 +57,11 @@ file associated with this object, from which other Runs can refer to it. ##### Arguments -- **run**: -- **key**: -- **step**: -- **id_**: -- **ignore_copy_err**: +- `run`: +- `key`: +- `step`: +- `id_`: +- `ignore_copy_err`: @@ -75,7 +76,7 @@ media_items: 'Sequence[Media]' ##### Arguments -- **media_items**: +- `media_items`: @@ -103,8 +104,8 @@ Likely will need to override for any more complicated media objects. ##### Arguments -- **json_obj**: -- **source_artifact**: +- `json_obj`: +- `source_artifact`: @@ -127,8 +128,8 @@ make sure to properly set this `artifact_source` to avoid data duplication. ##### Arguments -- **json_obj**: A JSON dictionary to deserialize. It must contain a `_type` key. This is used to lookup the correct subclass to use. -- **source_artifact**: An artifact which will hold any additional resources which were stored during the `to_json` function. +- `json_obj`: A JSON dictionary to deserialize. It must contain a `_type` key. This is used to lookup the correct subclass to use. +- `source_artifact`: An artifact which will hold any additional resources which were stored during the `to_json` function. @@ -155,7 +156,7 @@ path: 'str | pathlib.Path | None' ##### Arguments -- **path**: +- `path`: @@ -193,8 +194,8 @@ Get the name with the appropriate suffix. ##### Arguments -- **name**: the name of the file -- **filetype**: the filetype to use. Defaults to "json". +- `name`: the name of the file +- `filetype`: the filetype to use. Defaults to "json". diff --git a/models/ref/python/experiments/artifact.mdx b/models/ref/python/experiments/artifact.mdx index 6e9977fa83..d6366722b8 100644 --- a/models/ref/python/experiments/artifact.mdx +++ b/models/ref/python/experiments/artifact.mdx @@ -11,6 +11,7 @@ import { GitHubLink } from '/snippets/_includes/github-source-link.mdx'; +## class Artifact ```python name: 'str', type: 'str', @@ -33,13 +34,13 @@ begin with `add`. Once the artifact has all the desired files, you can call ## Args -- **name**: 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. -- **type**: 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-`. -- **description**: 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. -- **metadata**: Additional information about an artifact. Specify metadata as a dictionary of key-value pairs. You can specify no more than 100 total keys. -- **incremental**: Use `Artifact.new_draft()` method instead to modify an existing artifact. -- **use_as**: Deprecated. -- **storage_region**: +- `name`: 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. +- `type`: 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-`. +- `description`: 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. +- `metadata`: Additional information about an artifact. Specify metadata as a dictionary of key-value pairs. You can specify no more than 100 total keys. +- `incremental`: Use `Artifact.new_draft()` method instead to modify an existing artifact. +- `use_as`: Deprecated. +- `storage_region`: @@ -259,14 +260,14 @@ Add wandb.WBValue `obj` to the artifact. ##### Arguments -- **obj**: The object to add. Currently support one of Bokeh, JoinedTable, PartitionedTable, Table, Classes, ImageMask, BoundingBoxes2D, Audio, Image, Video, Html, Object3D -- **name**: The path within the artifact to add the object. -- **overwrite**: If True, overwrite existing objects with the same file path if applicable. +- `obj`: The object to add. Currently support one of Bokeh, JoinedTable, PartitionedTable, Table, Classes, ImageMask, BoundingBoxes2D, Audio, Image, Video, Html, Object3D +- `name`: The path within the artifact to add the object. +- `overwrite`: If True, overwrite existing objects with the same file path if applicable. ##### Raises -- **ArtifactFinalizedError**: You cannot make changes to the current artifact version because it is finalized. Log a new artifact version instead. +- `ArtifactFinalizedError`: You cannot make changes to the current artifact version because it is finalized. Log a new artifact version instead. ### method add_dir @@ -284,17 +285,17 @@ Add a local directory to the artifact. ##### Arguments -- **local_path**: The path of the local directory. -- **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. -- **skip_cache**: If set to `True`, W&B will not copy/move files to the cache while uploading -- **policy**: By default, "mutable". -- **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. +- `local_path`: The path of the local directory. +- `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. +- `skip_cache`: If set to `True`, W&B will not copy/move files to the cache while uploading +- `policy`: By default, "mutable". +- `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. ##### Raises -- **ArtifactFinalizedError**: You cannot make changes to the current artifact version because it is finalized. Log a new artifact version instead. -- **ValueError**: Policy must be "mutable" or "immutable" +- `ArtifactFinalizedError`: You cannot make changes to the current artifact version because it is finalized. Log a new artifact version instead. +- `ValueError`: Policy must be "mutable" or "immutable" ### method add_file @@ -313,18 +314,18 @@ Add a local file to the artifact. ##### Arguments -- **local_path**: The path to the file being added. -- **name**: The path within the artifact to use for the file being added. Defaults to the basename of the file. -- **is_tmp**: If true, then the file is renamed deterministically to avoid collisions. -- **skip_cache**: If `True`, do not copy files to the cache after uploading. -- **policy**: By default, set to "mutable". If set to "mutable", create a temporary copy of the file to prevent corruption during upload. If set to "immutable", disable protection and rely on the user not to delete or change the file. -- **overwrite**: If `True`, overwrite the file if it already exists. +- `local_path`: The path to the file being added. +- `name`: The path within the artifact to use for the file being added. Defaults to the basename of the file. +- `is_tmp`: If true, then the file is renamed deterministically to avoid collisions. +- `skip_cache`: If `True`, do not copy files to the cache after uploading. +- `policy`: By default, set to "mutable". If set to "mutable", create a temporary copy of the file to prevent corruption during upload. If set to "immutable", disable protection and rely on the user not to delete or change the file. +- `overwrite`: If `True`, overwrite the file if it already exists. ##### Raises -- **ArtifactFinalizedError**: You cannot make changes to the current artifact version because it is finalized. Log a new artifact version instead. -- **ValueError**: Policy must be "mutable" or "immutable" +- `ArtifactFinalizedError`: You cannot make changes to the current artifact version because it is finalized. Log a new artifact version instead. +- `ValueError`: Policy must be "mutable" or "immutable" ### method add_reference @@ -364,15 +365,15 @@ blank. ##### Arguments -- **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. -- **name**: The path within the artifact to place the contents of this reference. -- **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. -- **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. +- `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. +- `name`: The path within the artifact to place the contents of this reference. +- `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. +- `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. ##### Raises -- **ArtifactFinalizedError**: You cannot make changes to the current artifact version because it is finalized. Log a new artifact version instead. +- `ArtifactFinalizedError`: You cannot make changes to the current artifact version because it is finalized. Log a new artifact version instead. ### method checkout @@ -389,12 +390,12 @@ artifact. ##### Arguments -- **root**: The directory to replace with this artifact's files. +- `root`: The directory to replace with this artifact's files. ##### Raises -- **ArtifactNotLoggedError**: If the artifact is not logged. +- `ArtifactNotLoggedError`: If the artifact is not logged. ### method delete @@ -414,12 +415,12 @@ link between a source artifact and a collection. ##### Arguments -- **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. +- `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. ##### Raises -- **ArtifactNotLoggedError**: If the artifact is not logged. +- `ArtifactNotLoggedError`: If the artifact is not logged. ### method download @@ -441,16 +442,16 @@ the artifact. ##### Arguments -- **root**: The directory W&B stores the artifact's files. -- **allow_missing_references**: If set to `True`, any invalid reference paths will be ignored while downloading referenced files. -- **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. -- **path_prefix**: If specified, only files with a path that starts with the given prefix will be downloaded. Uses unix format (forward slashes). -- **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. +- `root`: The directory W&B stores the artifact's files. +- `allow_missing_references`: If set to `True`, any invalid reference paths will be ignored while downloading referenced files. +- `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. +- `path_prefix`: If specified, only files with a path that starts with the given prefix will be downloaded. Uses unix format (forward slashes). +- `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. ##### Raises -- **ArtifactNotLoggedError**: If the artifact is not logged. +- `ArtifactNotLoggedError`: If the artifact is not logged. ### method file @@ -464,13 +465,13 @@ Download a single file artifact to the directory you specify with `root`. ##### Arguments -- **root**: The root directory to store the file. Defaults to `./artifacts/self.name/`. +- `root`: The root directory to store the file. Defaults to `./artifacts/self.name/`. ##### Raises -- **ArtifactNotLoggedError**: If the artifact is not logged. -- **ValueError**: If the artifact contains more than one file. +- `ArtifactNotLoggedError`: If the artifact is not logged. +- `ValueError`: If the artifact contains more than one file. ### method files @@ -486,14 +487,14 @@ Iterate over all files stored in this artifact. ##### Arguments -- **names**: The filename paths relative to the root of the artifact you wish to list. -- **per_page**: The number of files to return per request. -- **start**: Pagination cursor for resuming a past query, captured from a previous paginator's `.cursor` attribute. +- `names`: The filename paths relative to the root of the artifact you wish to list. +- `per_page`: The number of files to return per request. +- `start`: Pagination cursor for resuming a past query, captured from a previous paginator's `.cursor` attribute. ##### Raises -- **ArtifactNotLoggedError**: If the artifact is not logged. +- `ArtifactNotLoggedError`: If the artifact is not logged. ### method finalize @@ -524,12 +525,12 @@ Get the WBValue object located at the artifact relative `name`. ##### Arguments -- **name**: The artifact relative name to retrieve. +- `name`: The artifact relative name to retrieve. ##### Raises -- **ArtifactNotLoggedError**: if the artifact isn't logged or the run is offline. +- `ArtifactNotLoggedError`: if the artifact isn't logged or the run is offline. ### method get_added_local_path_name @@ -543,7 +544,7 @@ Get the artifact relative name of a file added by a local filesystem path. ##### Arguments -- **local_path**: The local path to resolve into an artifact relative name. +- `local_path`: The local path to resolve into an artifact relative name. @@ -559,13 +560,13 @@ Get the entry with the given name. ##### Arguments -- **name**: The artifact relative name to get +- `name`: The artifact relative name to get ##### Raises -- **ArtifactNotLoggedError**: if the artifact isn't logged or the run is offline. -- **KeyError**: if the artifact doesn't contain an entry with the given name. +- `ArtifactNotLoggedError`: if the artifact isn't logged or the run is offline. +- `KeyError`: if the artifact doesn't contain an entry with the given name. ### method get_path @@ -579,7 +580,7 @@ Deprecated. Use `get_entry(name)`. ##### Arguments -- **name**: +- `name`: @@ -620,13 +621,13 @@ Link this artifact to a collection. ##### Arguments -- **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}`. -- **aliases**: Add one or more aliases to the linked artifact. The "latest" alias is automatically applied to the most recent artifact you link. +- `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}`. +- `aliases`: Add one or more aliases to the linked artifact. The "latest" alias is automatically applied to the most recent artifact you link. ##### Raises -- **ArtifactNotLoggedError**: If the artifact is not logged. +- `ArtifactNotLoggedError`: If the artifact is not logged. ### method logged_by @@ -641,7 +642,7 @@ Get the W&B run that originally logged the artifact. ##### Raises -- **ArtifactNotLoggedError**: If the artifact is not logged. +- `ArtifactNotLoggedError`: If the artifact is not logged. ### method new_draft @@ -660,7 +661,7 @@ modified and logged as a new version. ##### Raises -- **ArtifactNotLoggedError**: If the artifact is not logged. +- `ArtifactNotLoggedError`: If the artifact is not logged. ### method new_file @@ -676,14 +677,14 @@ Open a new temporary file and add it to the artifact. ##### Arguments -- **name**: The name of the new file to add to the artifact. -- **mode**: The file access mode to use to open the new file. -- **encoding**: The encoding used to open the new file. +- `name`: The name of the new file to add to the artifact. +- `mode`: The file access mode to use to open the new file. +- `encoding`: The encoding used to open the new file. ##### Raises -- **ArtifactFinalizedError**: You cannot make changes to the current artifact version because it is finalized. Log a new artifact version instead. +- `ArtifactFinalizedError`: You cannot make changes to the current artifact version because it is finalized. Log a new artifact version instead. ### method remove @@ -697,13 +698,13 @@ Remove an item from the artifact. ##### Arguments -- **item**: The item to remove. Can be a specific manifest entry or the name of an artifact-relative path. If the item matches a directory all items in that directory will be removed. +- `item`: The item to remove. Can be a specific manifest entry or the name of an artifact-relative path. If the item matches a directory all items in that directory will be removed. ##### Raises -- **ArtifactFinalizedError**: You cannot make changes to the current artifact version because it is finalized. Log a new artifact version instead. -- **FileNotFoundError**: If the item isn't found in the artifact. +- `ArtifactFinalizedError`: You cannot make changes to the current artifact version because it is finalized. Log a new artifact version instead. +- `FileNotFoundError`: If the item isn't found in the artifact. ### method save @@ -721,8 +722,8 @@ run, a run of type "auto" is created to track this artifact. ##### Arguments -- **project**: A project to use for the artifact in the case that a run is not already in context. -- **settings**: A settings object to use when initializing an automatic run. Most commonly used in testing harness. +- `project`: A project to use for the artifact in the case that a run is not already in context. +- `settings`: A settings object to use when initializing an automatic run. Most commonly used in testing harness. @@ -739,8 +740,8 @@ Unlink this artifact if it is a linked member of an artifact collection. ##### Raises -- **ArtifactNotLoggedError**: If the artifact is not logged. -- **ValueError**: If the artifact is not linked to any collection. +- `ArtifactNotLoggedError`: If the artifact is not logged. +- `ValueError`: If the artifact is not linked to any collection. ### method used_by @@ -755,7 +756,7 @@ Get a list of the runs that have used this artifact and its linked artifacts. ##### Raises -- **ArtifactNotLoggedError**: If the artifact is not logged. +- `ArtifactNotLoggedError`: If the artifact is not logged. ### method verify @@ -772,13 +773,13 @@ cross-referenced against the artifact's manifest. References are not verified. ##### Arguments -- **root**: The directory to verify. If None artifact will be downloaded to './artifacts/self.name/'. +- `root`: The directory to verify. If None artifact will be downloaded to './artifacts/self.name/'. ##### Raises -- **ArtifactNotLoggedError**: If the artifact is not logged. -- **ValueError**: If the verification fails. +- `ArtifactNotLoggedError`: If the artifact is not logged. +- `ValueError`: If the verification fails. ### method wait @@ -792,7 +793,7 @@ If needed, wait for this artifact to finish logging. ##### Arguments -- **timeout**: The time, in seconds, to wait. +- `timeout`: The time, in seconds, to wait. diff --git a/models/ref/python/experiments/run.mdx b/models/ref/python/experiments/run.mdx index f90cb600ac..c925f37877 100644 --- a/models/ref/python/experiments/run.mdx +++ b/models/ref/python/experiments/run.mdx @@ -11,6 +11,7 @@ import { GitHubLink } from '/snippets/_includes/github-source-link.mdx'; +## class Run ```python settings: 'Settings', config: 'dict[str, Any] | None' = None, @@ -52,10 +53,10 @@ Attributes: ## Args -- **settings**: -- **config**: -- **sweep_config**: -- **launch_config**: +- `settings`: +- `config`: +- `sweep_config`: +- `launch_config`: ## Examples @@ -217,10 +218,10 @@ Create an alert with the given title and text. ##### Arguments -- **title**: The title of the alert, must be less than 64 characters long. -- **text**: The text body of the alert. -- **level**: The alert level to use, either: `INFO`, `WARN`, or `ERROR`. -- **wait_duration**: The time to wait (in seconds) before sending another alert with this title. +- `title`: The title of the alert, must be less than 64 characters long. +- `text`: The text body of the alert. +- `level`: The alert level to use, either: `INFO`, `WARN`, or `ERROR`. +- `wait_duration`: The time to wait (in seconds) before sending another alert with this title. @@ -242,13 +243,13 @@ Customize metrics logged with `wandb.Run.log()`. ##### Arguments -- **name**: The name of the metric to customize. -- **step_metric**: The name of another metric to serve as the X-axis for this metric in automatically generated charts. -- **step_sync**: Automatically insert the last value of step_metric into `wandb.Run.log()` if it is not provided explicitly. Defaults to True if step_metric is specified. -- **hidden**: Hide this metric from automatic plots. -- **summary**: Specify aggregate metrics added to summary. Supported aggregations include "min", "max", "mean", "last", "first", "best", "copy" and "none". "none" prevents a summary from being generated. "best" is used together with the goal parameter, "best" is deprecated and should not be used, use "min" or "max" instead. "copy" is deprecated and should not be used. -- **goal**: Specify how to interpret the "best" summary type. Supported options are "minimize" and "maximize". "goal" is deprecated and should not be used, use "min" or "max" instead. -- **overwrite**: If false, then this call is merged with previous `define_metric` calls for the same metric by using their values for any unspecified parameters. If true, then unspecified parameters overwrite values specified by previous calls. +- `name`: The name of the metric to customize. +- `step_metric`: The name of another metric to serve as the X-axis for this metric in automatically generated charts. +- `step_sync`: Automatically insert the last value of step_metric into `wandb.Run.log()` if it is not provided explicitly. Defaults to True if step_metric is specified. +- `hidden`: Hide this metric from automatic plots. +- `summary`: Specify aggregate metrics added to summary. Supported aggregations include "min", "max", "mean", "last", "first", "best", "copy" and "none". "none" prevents a summary from being generated. "best" is used together with the goal parameter, "best" is deprecated and should not be used, use "min" or "max" instead. "copy" is deprecated and should not be used. +- `goal`: Specify how to interpret the "best" summary type. Supported options are "minimize" and "maximize". "goal" is deprecated and should not be used, use "min" or "max" instead. +- `overwrite`: If false, then this call is merged with previous `define_metric` calls for the same metric by using their values for any unspecified parameters. If true, then unspecified parameters overwrite values specified by previous calls. @@ -265,8 +266,8 @@ Display this run in Jupyter. ##### Arguments -- **height**: -- **hidden**: +- `height`: +- `hidden`: @@ -293,8 +294,8 @@ Run States: ##### Arguments -- **exit_code**: Integer indicating the run's exit status. Use 0 for success, any other value marks the run as failed. -- **quiet**: Deprecated. Configure logging verbosity using `wandb.Settings(quiet=...)`. +- `exit_code`: Integer indicating the run's exit status. Use 0 for success, any other value marks the run as failed. +- `quiet`: Deprecated. Configure logging verbosity using `wandb.Settings(quiet=...)`. @@ -316,11 +317,11 @@ Subsequent "upserts" with the same distributed ID will result in a new version. ##### Arguments -- **artifact_or_path**: A path to the contents of this artifact, -- **name**: An artifact name. May be prefixed with entity/project. -- **type**: The type of artifact to log, examples include `dataset`, `model` -- **aliases**: Aliases to apply to this artifact, defaults to `["latest"]` -- **distributed_id**: Unique string that all distributed jobs share. If None, defaults to the run's group name. +- `artifact_or_path`: A path to the contents of this artifact, +- `name`: An artifact name. May be prefixed with entity/project. +- `type`: The type of artifact to log, examples include `dataset`, `model` +- `aliases`: Aliases to apply to this artifact, defaults to `["latest"]` +- `distributed_id`: Unique string that all distributed jobs share. If None, defaults to the run's group name. @@ -344,9 +345,9 @@ View linked artifacts in the Registry UI for the specified collection. ##### Arguments -- **artifact**: The artifact object to link to the collection. -- **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}`. -- **aliases**: Add one or more aliases to the linked artifact. The "latest" alias is automatically applied to the most recent artifact you link. +- `artifact`: The artifact object to link to the collection. +- `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}`. +- `aliases`: Add one or more aliases to the linked artifact. The "latest" alias is automatically applied to the most recent artifact you link. @@ -376,16 +377,16 @@ If not, create a new registered model with name 'registered_model_name'. ##### Arguments -- **path**: (str) A path to the contents of this model, can be in the -- **registered_model_name**: The name of the registered model that the model is to be linked to. A registered model is a collection of model versions linked to the model registry, typically representing a team's specific ML Task. The entity that this registered model belongs to will be derived from the run. -- **name**: The name of the model artifact that files in 'path' will be logged to. This will default to the basename of the path prepended with the current run id if not specified. -- **aliases**: Aliases that will only be applied on this linked artifact inside the registered model. The alias "latest" will always be applied to the latest version of an artifact that is linked. +- `path`: (str) A path to the contents of this model, can be in the +- `registered_model_name`: The name of the registered model that the model is to be linked to. A registered model is a collection of model versions linked to the model registry, typically representing a team's specific ML Task. The entity that this registered model belongs to will be derived from the run. +- `name`: The name of the model artifact that files in 'path' will be logged to. This will default to the basename of the path prepended with the current run id if not specified. +- `aliases`: Aliases that will only be applied on this linked artifact inside the registered model. The alias "latest" will always be applied to the latest version of an artifact that is linked. ##### Raises -- **AssertionError**: If registered_model_name is a path or if model artifact 'name' is of a type that does not contain the substring 'model'. -- **ValueError**: If name has invalid special characters. +- `AssertionError`: If registered_model_name is a path or if model artifact 'name' is of a type that does not contain the substring 'model'. +- `ValueError`: If name has invalid special characters. ### method log @@ -492,15 +493,15 @@ with wandb.init() as run: ##### Arguments -- **data**: A `dict` with `str` keys and values that are serializable -- **step**: The step number to log. If `None`, then an implicit auto-incrementing step is used. See the notes in the description. -- **commit**: If true, finalize and upload the step. If false, then accumulate data for the step. See the notes in the description. If `step` is `None`, then the default is `commit=True`; otherwise, the default is `commit=False`. +- `data`: A `dict` with `str` keys and values that are serializable +- `step`: The step number to log. If `None`, then an implicit auto-incrementing step is used. See the notes in the description. +- `commit`: If true, finalize and upload the step. If false, then accumulate data for the step. See the notes in the description. If `step` is `None`, then the default is `commit=True`; otherwise, the default is `commit=False`. ##### Raises -- **wandb.Error**: If called before `wandb.init()`. -- **ValueError**: If invalid data is passed. +- `wandb.Error`: If called before `wandb.init()`. +- `ValueError`: If invalid data is passed. ##### Examples @@ -650,11 +651,11 @@ Declare an artifact as an output of a run. ##### Arguments -- **artifact_or_path**: (str or Artifact) A path to the contents of this artifact, -- **name**: (str, optional) An artifact name. Valid names can be in the following forms: -- **type**: (str) The type of artifact to log, examples include `dataset`, `model` -- **aliases**: (list, optional) Aliases to apply to this artifact, defaults to `["latest"]` -- **tags**: (list, optional) Tags to apply to this artifact, if any. +- `artifact_or_path`: (str or Artifact) A path to the contents of this artifact, +- `name`: (str, optional) An artifact name. Valid names can be in the following forms: +- `type`: (str) The type of artifact to log, examples include `dataset`, `model` +- `aliases`: (list, optional) Aliases to apply to this artifact, defaults to `["latest"]` +- `tags`: (list, optional) Tags to apply to this artifact, if any. @@ -675,10 +676,10 @@ By default, it walks the current directory and logs all files that end with `.py ##### Arguments -- **root**: The relative (to `os.getcwd()`) or absolute path to recursively find code from. -- **name**: (str, optional) The name of our code artifact. By default, we'll name the artifact `source-$PROJECT_ID-$ENTRYPOINT_RELPATH`. There may be scenarios where you want many runs to share the same artifact. Specifying name allows you to achieve that. -- **include_fn**: A callable that accepts a file path and (optionally) root path and returns True when it should be included and False otherwise. This -- **exclude_fn**: A callable that accepts a file path and (optionally) root path and returns `True` when it should be excluded and `False` otherwise. This defaults to a function that excludes all files within `/.wandb/` and `/wandb/` directories. +- `root`: The relative (to `os.getcwd()`) or absolute path to recursively find code from. +- `name`: (str, optional) The name of our code artifact. By default, we'll name the artifact `source-$PROJECT_ID-$ENTRYPOINT_RELPATH`. There may be scenarios where you want many runs to share the same artifact. Specifying name allows you to achieve that. +- `include_fn`: A callable that accepts a file path and (optionally) root path and returns True when it should be included and False otherwise. This +- `exclude_fn`: A callable that accepts a file path and (optionally) root path and returns `True` when it should be excluded and `False` otherwise. This defaults to a function that excludes all files within `/.wandb/` and `/wandb/` directories. @@ -725,14 +726,14 @@ underscores, and hyphens. ##### Arguments -- **path**: (str) A path to the contents of this model, -- **name**: A name to assign to the model artifact that the file contents will be added to. This will default to the basename of the path prepended with the current run id if not specified. -- **aliases**: Aliases to apply to the created model artifact, defaults to `["latest"]` +- `path`: (str) A path to the contents of this model, +- `name`: A name to assign to the model artifact that the file contents will be added to. This will default to the basename of the path prepended with the current run id if not specified. +- `aliases`: Aliases to apply to the created model artifact, defaults to `["latest"]` ##### Raises -- **ValueError**: If name has invalid special characters. +- `ValueError`: If name has invalid special characters. ### method mark_preempting @@ -764,7 +765,7 @@ plain text. Calling this again replaces the previously pinned list. ##### Arguments -- **keys**: Config key names to pin, matching keys set via ``run.config``. These are exact key strings (dots and slashes are treated literally, not as path separators). Order is preserved and determines display order. +- `keys`: Config key names to pin, matching keys set via ``run.config``. These are exact key strings (dots and slashes are treated literally, not as path separators). Order is preserved and determines display order. @@ -786,16 +787,16 @@ By default, will only download the file if it doesn't already exist. ##### Arguments -- **name**: The name of the file. -- **run_path**: Optional path to a run to pull files from, i.e. `username/project_name/run_id` if wandb.init has not been called, this is required. -- **replace**: Whether to download the file even if it already exists locally -- **root**: The directory to download the file to. Defaults to the current directory or the run directory if wandb.init was called. +- `name`: The name of the file. +- `run_path`: Optional path to a run to pull files from, i.e. `username/project_name/run_id` if wandb.init has not been called, this is required. +- `replace`: Whether to download the file even if it already exists locally +- `root`: The directory to download the file to. Defaults to the current directory or the run directory if wandb.init was called. ##### Raises -- **CommError**: If W&B can't connect to the W&B backend. -- **ValueError**: If the file is not found or can't find run_path. +- `CommError`: If W&B can't connect to the W&B backend. +- `ValueError`: If the file is not found or can't find run_path. ### method save @@ -827,9 +828,9 @@ on the same file without modifications will not re-upload it. ##### Arguments -- **glob_str**: A relative or absolute path or Unix glob. -- **base_path**: A path to use to infer a directory structure; see examples. -- **policy**: One of `live`, `now`, or `end`. +- `glob_str`: A relative or absolute path or Unix glob. +- `base_path`: A path to use to infer a directory structure; see examples. +- `policy`: One of `live`, `now`, or `end`. @@ -857,7 +858,7 @@ Remove pytorch model topology, gradient and parameter hooks. ##### Arguments -- **models**: Optional list of pytorch models that have had watch called on them. +- `models`: Optional list of pytorch models that have had watch called on them. @@ -880,11 +881,11 @@ This is useful when distributed jobs need to all contribute to the same artifact ##### Arguments -- **artifact_or_path**: A path to the contents of this artifact, -- **name**: An artifact name. May be prefixed with "entity/project". Defaults to the basename of the path prepended with the current run ID -- **type**: The type of artifact to log. Common examples include `dataset`, `model`. -- **aliases**: Aliases to apply to this artifact, defaults to `["latest"]`. -- **distributed_id**: Unique string that all distributed jobs share. If None, defaults to the run's group name. +- `artifact_or_path`: A path to the contents of this artifact, +- `name`: An artifact name. May be prefixed with "entity/project". Defaults to the basename of the path prepended with the current run ID +- `type`: The type of artifact to log. Common examples include `dataset`, `model`. +- `aliases`: Aliases to apply to this artifact, defaults to `["latest"]`. +- `distributed_id`: Unique string that all distributed jobs share. If None, defaults to the run's group name. @@ -905,10 +906,10 @@ Call `download` or `file` on the returned object to get the contents locally. ##### Arguments -- **artifact_or_name**: The name of the artifact to use. May be prefixed with the name of the project the artifact was logged to ("entity" or "entity/project"). If no entity is specified in the name, the Run or API setting's entity is used. Valid names can be in the following forms -- **type**: The type of artifact to use. -- **aliases**: Aliases to apply to this artifact -- **use_as**: This argument is deprecated and does nothing. +- `artifact_or_name`: The name of the artifact to use. May be prefixed with the name of the project the artifact was logged to ("entity" or "entity/project"). If no entity is specified in the name, the Run or API setting's entity is used. Valid names can be in the following forms +- `type`: The type of artifact to use. +- `aliases`: Aliases to apply to this artifact +- `use_as`: This argument is deprecated and does nothing. @@ -951,12 +952,12 @@ Download the files logged in a model artifact 'name'. ##### Arguments -- **name**: A model artifact name. 'name' must match the name of an existing logged model artifact. May be prefixed with `entity/project/`. Valid names can be in the following forms +- `name`: A model artifact name. 'name' must match the name of an existing logged model artifact. May be prefixed with `entity/project/`. Valid names can be in the following forms ##### Raises -- **AssertionError**: If model artifact 'name' is of a type that does not contain the substring 'model'. +- `AssertionError`: If model artifact 'name' is of a type that does not contain the substring 'model'. ### method watch @@ -977,17 +978,17 @@ This function can track parameters, gradients, or both during training. ##### Arguments -- **models**: A single model or a sequence of models to be monitored. -- **criterion**: The loss function being optimized (optional). -- **log**: Specifies whether to log "gradients", "parameters", or "all". Set to None to disable logging. (default="gradients"). -- **log_freq**: Frequency (in batches) to log gradients and parameters. (default=1000) -- **idx**: Index used when tracking multiple models with `wandb.watch`. (default=None) -- **log_graph**: Whether to log the model's computational graph. (default=False) +- `models`: A single model or a sequence of models to be monitored. +- `criterion`: The loss function being optimized (optional). +- `log`: Specifies whether to log "gradients", "parameters", or "all". Set to None to disable logging. (default="gradients"). +- `log_freq`: Frequency (in batches) to log gradients and parameters. (default=1000) +- `idx`: Index used when tracking multiple models with `wandb.watch`. (default=None) +- `log_graph`: Whether to log the model's computational graph. (default=False) ##### Raises -- **ValueError**: If `wandb.init()` has not been called or if any of the models are not instances of `torch.nn.Module`. +- `ValueError`: If `wandb.init()` has not been called or if any of the models are not instances of `torch.nn.Module`. ### method write_logs @@ -1008,7 +1009,7 @@ Python's `logging` module. ##### Arguments -- **text**: The text to write. A trailing newline is added if not present. +- `text`: The text to write. A trailing newline is added if not present. diff --git a/models/ref/python/experiments/settings.mdx b/models/ref/python/experiments/settings.mdx index 9e367726af..9ee11de053 100644 --- a/models/ref/python/experiments/settings.mdx +++ b/models/ref/python/experiments/settings.mdx @@ -11,6 +11,7 @@ import { GitHubLink } from '/snippets/_includes/github-source-link.mdx'; +## class Settings ```python *, allow_media_symlink: bool = False, @@ -146,7 +147,7 @@ x_service_transport: str | None = None, x_service_wait: float = 30.0, x_skip_transaction_log: bool = False, x_start_time: float | None = None, -x_stats_pid: int = 67606, +x_stats_pid: int = 96128, x_stats_sampling_interval: float = 15.0, x_stats_neuron_monitor_config_path: str | None = None, x_stats_dcgm_exporter: str | None = None, @@ -192,160 +193,160 @@ The settings are organized into three categories: ## Args -- **allow_media_symlink**: -- **allow_offline_artifacts**: -- **allow_val_change**: -- **anonymous**: -- **api_key**: -- **azure_account_url_to_access_key**: -- **app_url_override**: -- **base_url**: -- **code_dir**: -- **config_paths**: -- **console**: -- **console_multipart**: -- **console_chunk_max_bytes**: -- **console_chunk_max_seconds**: -- **capture_loggers**: -- **credentials_file**: -- **disable_code**: -- **disable_git**: -- **disable_git_fork_point**: -- **disable_job_creation**: -- **docker**: -- **email**: -- **entity**: -- **organization**: -- **force**: -- **fork_from**: -- **git_commit**: -- **git_remote**: -- **git_remote_url**: -- **git_root**: -- **heartbeat_seconds**: -- **host**: -- **http_proxy**: -- **https_proxy**: -- **identity_token_file**: -- **ignore_globs**: -- **init_timeout**: -- **finish_timeout**: -- **finish_timeout_raises**: -- **insecure_disable_ssl**: -- **job_name**: -- **job_source**: -- **label_disable**: -- **launch**: -- **launch_config_path**: -- **login_timeout**: -- **mode**: -- **notebook_name**: -- **program**: -- **program_abspath**: -- **program_relpath**: -- **project**: -- **quiet**: -- **reinit**: -- **relogin**: -- **resume**: -- **resume_from**: -- **resumed**: -- **root_dir**: -- **run_group**: -- **run_id**: -- **run_job_type**: -- **run_name**: -- **run_notes**: -- **run_tags**: -- **sagemaker_disable**: -- **save_code**: -- **settings_system**: -- **stop_fn**: -- **max_end_of_run_history_metrics**: -- **max_end_of_run_summary_metrics**: -- **show_colors**: -- **show_emoji**: -- **show_errors**: -- **show_info**: -- **show_warnings**: -- **silent**: -- **start_method**: -- **stop_on_fatal_error**: -- **strict**: -- **summary_timeout**: -- **summary_warnings**: -- **sweep_id**: -- **sweep_param_path**: -- **symlink**: -- **sync_tensorboard**: -- **table_raise_on_max_row_limit_exceeded**: -- **use_dot_wandb**: -- **username**: -- **x_cli_only_mode**: -- **x_disable_meta**: -- **x_disable_stats**: -- **x_disable_viewer**: -- **x_disable_machine_info**: -- **x_executable**: -- **x_extra_http_headers**: -- **x_file_stream_max_bytes**: -- **x_file_stream_max_line_bytes**: -- **x_file_stream_transmit_interval**: -- **x_file_stream_retry_max**: -- **x_file_stream_retry_wait_min_seconds**: -- **x_file_stream_retry_wait_max_seconds**: -- **x_file_stream_timeout_seconds**: -- **x_file_transfer_retry_max**: -- **x_file_transfer_retry_wait_min_seconds**: -- **x_file_transfer_retry_wait_max_seconds**: -- **x_file_transfer_timeout_seconds**: -- **x_files_dir**: -- **x_flow_control_custom**: -- **x_flow_control_disabled**: -- **x_graphql_retry_max**: -- **x_graphql_retry_wait_min_seconds**: -- **x_graphql_retry_wait_max_seconds**: -- **x_graphql_timeout_seconds**: -- **x_internal_check_process**: -- **x_jupyter_name**: -- **x_jupyter_path**: -- **x_jupyter_root**: -- **x_label**: -- **x_live_policy_rate_limit**: -- **x_live_policy_wait_time**: -- **x_log_level**: -- **x_network_buffer**: -- **x_primary**: -- **x_proxies**: -- **x_runqueue_item_id**: -- **x_save_requirements**: -- **x_server_side_derived_summary**: -- **x_server_side_expand_glob_metrics**: -- **x_service_transport**: -- **x_service_wait**: -- **x_skip_transaction_log**: -- **x_start_time**: -- **x_stats_pid**: -- **x_stats_sampling_interval**: -- **x_stats_neuron_monitor_config_path**: -- **x_stats_dcgm_exporter**: -- **x_stats_open_metrics_endpoints**: -- **x_stats_open_metrics_filters**: -- **x_stats_open_metrics_http_headers**: -- **x_stats_disk_paths**: -- **x_stats_cpu_count**: -- **x_stats_cpu_logical_count**: -- **x_stats_gpu_count**: -- **x_stats_gpu_type**: -- **x_stats_gpu_device_ids**: -- **x_stats_buffer_size**: -- **x_stats_coreweave_metadata_base_url**: -- **x_stats_coreweave_metadata_endpoint**: -- **x_stats_track_process_tree**: -- **x_stats_no_cgroup**: -- **x_sync**: -- **x_sync_dir_suffix**: -- **x_update_finish_state**: +- `allow_media_symlink`: +- `allow_offline_artifacts`: +- `allow_val_change`: +- `anonymous`: +- `api_key`: +- `azure_account_url_to_access_key`: +- `app_url_override`: +- `base_url`: +- `code_dir`: +- `config_paths`: +- `console`: +- `console_multipart`: +- `console_chunk_max_bytes`: +- `console_chunk_max_seconds`: +- `capture_loggers`: +- `credentials_file`: +- `disable_code`: +- `disable_git`: +- `disable_git_fork_point`: +- `disable_job_creation`: +- `docker`: +- `email`: +- `entity`: +- `organization`: +- `force`: +- `fork_from`: +- `git_commit`: +- `git_remote`: +- `git_remote_url`: +- `git_root`: +- `heartbeat_seconds`: +- `host`: +- `http_proxy`: +- `https_proxy`: +- `identity_token_file`: +- `ignore_globs`: +- `init_timeout`: +- `finish_timeout`: +- `finish_timeout_raises`: +- `insecure_disable_ssl`: +- `job_name`: +- `job_source`: +- `label_disable`: +- `launch`: +- `launch_config_path`: +- `login_timeout`: +- `mode`: +- `notebook_name`: +- `program`: +- `program_abspath`: +- `program_relpath`: +- `project`: +- `quiet`: +- `reinit`: +- `relogin`: +- `resume`: +- `resume_from`: +- `resumed`: +- `root_dir`: +- `run_group`: +- `run_id`: +- `run_job_type`: +- `run_name`: +- `run_notes`: +- `run_tags`: +- `sagemaker_disable`: +- `save_code`: +- `settings_system`: +- `stop_fn`: +- `max_end_of_run_history_metrics`: +- `max_end_of_run_summary_metrics`: +- `show_colors`: +- `show_emoji`: +- `show_errors`: +- `show_info`: +- `show_warnings`: +- `silent`: +- `start_method`: +- `stop_on_fatal_error`: +- `strict`: +- `summary_timeout`: +- `summary_warnings`: +- `sweep_id`: +- `sweep_param_path`: +- `symlink`: +- `sync_tensorboard`: +- `table_raise_on_max_row_limit_exceeded`: +- `use_dot_wandb`: +- `username`: +- `x_cli_only_mode`: +- `x_disable_meta`: +- `x_disable_stats`: +- `x_disable_viewer`: +- `x_disable_machine_info`: +- `x_executable`: +- `x_extra_http_headers`: +- `x_file_stream_max_bytes`: +- `x_file_stream_max_line_bytes`: +- `x_file_stream_transmit_interval`: +- `x_file_stream_retry_max`: +- `x_file_stream_retry_wait_min_seconds`: +- `x_file_stream_retry_wait_max_seconds`: +- `x_file_stream_timeout_seconds`: +- `x_file_transfer_retry_max`: +- `x_file_transfer_retry_wait_min_seconds`: +- `x_file_transfer_retry_wait_max_seconds`: +- `x_file_transfer_timeout_seconds`: +- `x_files_dir`: +- `x_flow_control_custom`: +- `x_flow_control_disabled`: +- `x_graphql_retry_max`: +- `x_graphql_retry_wait_min_seconds`: +- `x_graphql_retry_wait_max_seconds`: +- `x_graphql_timeout_seconds`: +- `x_internal_check_process`: +- `x_jupyter_name`: +- `x_jupyter_path`: +- `x_jupyter_root`: +- `x_label`: +- `x_live_policy_rate_limit`: +- `x_live_policy_wait_time`: +- `x_log_level`: +- `x_network_buffer`: +- `x_primary`: +- `x_proxies`: +- `x_runqueue_item_id`: +- `x_save_requirements`: +- `x_server_side_derived_summary`: +- `x_server_side_expand_glob_metrics`: +- `x_service_transport`: +- `x_service_wait`: +- `x_skip_transaction_log`: +- `x_start_time`: +- `x_stats_pid`: +- `x_stats_sampling_interval`: +- `x_stats_neuron_monitor_config_path`: +- `x_stats_dcgm_exporter`: +- `x_stats_open_metrics_endpoints`: +- `x_stats_open_metrics_filters`: +- `x_stats_open_metrics_http_headers`: +- `x_stats_disk_paths`: +- `x_stats_cpu_count`: +- `x_stats_cpu_logical_count`: +- `x_stats_gpu_count`: +- `x_stats_gpu_type`: +- `x_stats_gpu_device_ids`: +- `x_stats_buffer_size`: +- `x_stats_coreweave_metadata_base_url`: +- `x_stats_coreweave_metadata_endpoint`: +- `x_stats_track_process_tree`: +- `x_stats_no_cgroup`: +- `x_sync`: +- `x_sync_dir_suffix`: +- `x_update_finish_state`: @@ -453,8 +454,8 @@ _fields_set: 'set[str] | None' = None, **values: 'Any' ##### Arguments -- **_fields_set**: -- **values**: +- `_fields_set`: +- `values`: @@ -484,10 +485,10 @@ copied = self.model_validate(data) ##### Arguments -- **include**: Optional set or mapping specifying which fields to include in the copied model. -- **exclude**: Optional set or mapping specifying which fields to exclude in the copied model. -- **update**: Optional dictionary of field-value pairs to override field values in the copied model. -- **deep**: If True, the values of fields that are Pydantic models will be deep-copied. +- `include`: Optional set or mapping specifying which fields to include in the copied model. +- `exclude`: Optional set or mapping specifying which fields to exclude in the copied model. +- `update`: Optional dictionary of field-value pairs to override field values in the copied model. +- `deep`: If True, the values of fields that are Pydantic models will be deep-copied. @@ -508,12 +509,12 @@ exclude_none: 'bool' = False ##### Arguments -- **include**: -- **exclude**: -- **by_alias**: -- **exclude_unset**: -- **exclude_defaults**: -- **exclude_none**: +- `include`: +- `exclude`: +- `by_alias`: +- `exclude_unset`: +- `exclude_defaults`: +- `exclude_none`: @@ -528,7 +529,7 @@ obj: 'Any' ##### Arguments -- **obj**: +- `obj`: @@ -551,15 +552,15 @@ models_as_dict: 'bool' = PydanticUndefined, **dumps_kwargs: 'Any' ##### Arguments -- **include**: -- **exclude**: -- **by_alias**: -- **exclude_unset**: -- **exclude_defaults**: -- **exclude_none**: -- **encoder**: -- **models_as_dict**: -- **dumps_kwargs**: +- `include`: +- `exclude`: +- `by_alias`: +- `exclude_unset`: +- `exclude_defaults`: +- `exclude_none`: +- `encoder`: +- `models_as_dict`: +- `dumps_kwargs`: @@ -584,8 +585,8 @@ Default values are respected, but no other validation is performed. ##### Arguments -- **_fields_set**: A set of field names that were originally explicitly set during instantiation. If provided, this is directly used for the [`model_fields_set`][pydantic.BaseModel.model_fields_set] attribute. Otherwise, the field names from the `values` argument will be used. -- **values**: Trusted or pre-validated data dictionary. +- `_fields_set`: A set of field names that were originally explicitly set during instantiation. If provided, this is directly used for the [`model_fields_set`][pydantic.BaseModel.model_fields_set] attribute. Otherwise, the field names from the `values` argument will be used. +- `values`: Trusted or pre-validated data dictionary. @@ -610,8 +611,8 @@ Returns a copy of the model. ##### Arguments -- **update**: Values to change/add in the new model. Note: the data is not validated before creating the new model. You should trust this data. -- **deep**: Set to `True` to make a deep copy of the model. +- `update`: Values to change/add in the new model. Note: the data is not validated before creating the new model. You should trust this data. +- `deep`: Set to `True` to make a deep copy of the model. @@ -641,18 +642,18 @@ Generate a dictionary representation of the model, optionally specifying which f ##### Arguments -- **mode**: The mode in which `to_python` should run. If mode is 'json', the output will only contain JSON serializable types. If mode is 'python', the output may contain non-JSON-serializable Python objects. -- **include**: A set of fields to include in the output. -- **exclude**: A set of fields to exclude from the output. -- **context**: Additional context to pass to the serializer. -- **by_alias**: Whether to use the field's alias in the dictionary key if defined. -- **exclude_unset**: Whether to exclude fields that have not been explicitly set. -- **exclude_defaults**: Whether to exclude fields that are set to their default value. -- **exclude_none**: Whether to exclude fields that have a value of `None`. -- **round_trip**: If True, dumped values should be valid as input for non-idempotent types such as Json[T]. -- **warnings**: How to handle serialization errors. False/"none" ignores them, True/"warn" logs errors, "error" raises a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError]. -- **fallback**: A function to call when an unknown value is encountered. If not provided, a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError] error is raised. -- **serialize_as_any**: Whether to serialize fields with duck-typing serialization behavior. +- `mode`: The mode in which `to_python` should run. If mode is 'json', the output will only contain JSON serializable types. If mode is 'python', the output may contain non-JSON-serializable Python objects. +- `include`: A set of fields to include in the output. +- `exclude`: A set of fields to exclude from the output. +- `context`: Additional context to pass to the serializer. +- `by_alias`: Whether to use the field's alias in the dictionary key if defined. +- `exclude_unset`: Whether to exclude fields that have not been explicitly set. +- `exclude_defaults`: Whether to exclude fields that are set to their default value. +- `exclude_none`: Whether to exclude fields that have a value of `None`. +- `round_trip`: If True, dumped values should be valid as input for non-idempotent types such as Json[T]. +- `warnings`: How to handle serialization errors. False/"none" ignores them, True/"warn" logs errors, "error" raises a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError]. +- `fallback`: A function to call when an unknown value is encountered. If not provided, a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError] error is raised. +- `serialize_as_any`: Whether to serialize fields with duck-typing serialization behavior. @@ -682,18 +683,18 @@ Generates a JSON representation of the model using Pydantic's `to_json` method. ##### Arguments -- **indent**: Indentation to use in the JSON output. If None is passed, the output will be compact. -- **include**: Field(s) to include in the JSON output. -- **exclude**: Field(s) to exclude from the JSON output. -- **context**: Additional context to pass to the serializer. -- **by_alias**: Whether to serialize using field aliases. -- **exclude_unset**: Whether to exclude fields that have not been explicitly set. -- **exclude_defaults**: Whether to exclude fields that are set to their default value. -- **exclude_none**: Whether to exclude fields that have a value of `None`. -- **round_trip**: If True, dumped values should be valid as input for non-idempotent types such as Json[T]. -- **warnings**: How to handle serialization errors. False/"none" ignores them, True/"warn" logs errors, "error" raises a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError]. -- **fallback**: A function to call when an unknown value is encountered. If not provided, a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError] error is raised. -- **serialize_as_any**: Whether to serialize fields with duck-typing serialization behavior. +- `indent`: Indentation to use in the JSON output. If None is passed, the output will be compact. +- `include`: Field(s) to include in the JSON output. +- `exclude`: Field(s) to exclude from the JSON output. +- `context`: Additional context to pass to the serializer. +- `by_alias`: Whether to serialize using field aliases. +- `exclude_unset`: Whether to exclude fields that have not been explicitly set. +- `exclude_defaults`: Whether to exclude fields that are set to their default value. +- `exclude_none`: Whether to exclude fields that have a value of `None`. +- `round_trip`: If True, dumped values should be valid as input for non-idempotent types such as Json[T]. +- `warnings`: How to handle serialization errors. False/"none" ignores them, True/"warn" logs errors, "error" raises a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError]. +- `fallback`: A function to call when an unknown value is encountered. If not provided, a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError] error is raised. +- `serialize_as_any`: Whether to serialize fields with duck-typing serialization behavior. @@ -711,10 +712,10 @@ Generates a JSON schema for a model class. ##### Arguments -- **by_alias**: Whether to use attribute aliases or not. -- **ref_template**: The reference template. -- **schema_generator**: To override the logic used to generate the JSON schema, as a subclass of `GenerateJsonSchema` with your desired modifications -- **mode**: The mode in which to generate the schema. +- `by_alias`: Whether to use attribute aliases or not. +- `ref_template`: The reference template. +- `schema_generator`: To override the logic used to generate the JSON schema, as a subclass of `GenerateJsonSchema` with your desired modifications +- `mode`: The mode in which to generate the schema. @@ -731,12 +732,12 @@ This method can be overridden to achieve a custom naming scheme for generic Base ##### Arguments -- **params**: Tuple of types of the class. Given a generic class `Model` with 2 type variables and a concrete model `Model[str, int]`, the value `(str, int)` would be passed to `params`. +- `params`: Tuple of types of the class. Given a generic class `Model` with 2 type variables and a concrete model `Model[str, int]`, the value `(str, int)` would be passed to `params`. ##### Raises -- **TypeError**: Raised when trying to generate concrete names for non-generic models. +- `TypeError`: Raised when trying to generate concrete names for non-generic models. ### method model_post_init @@ -751,7 +752,7 @@ This is useful if you want to do some validation that requires the entire model ##### Arguments -- **context**: +- `context`: @@ -773,10 +774,10 @@ the initial attempt to build the schema, and automatic rebuilding fails. ##### Arguments -- **force**: Whether to force the rebuilding of the model schema, defaults to `False`. -- **raise_errors**: Whether to raise errors, defaults to `True`. -- **_parent_namespace_depth**: The depth level of the parent namespace, defaults to 2. -- **_types_namespace**: The types namespace, defaults to `None`. +- `force`: Whether to force the rebuilding of the model schema, defaults to `False`. +- `raise_errors`: Whether to raise errors, defaults to `True`. +- `_parent_namespace_depth`: The depth level of the parent namespace, defaults to 2. +- `_types_namespace`: The types namespace, defaults to `None`. @@ -796,17 +797,17 @@ Validate a pydantic model instance. ##### Arguments -- **obj**: The object to validate. -- **strict**: Whether to enforce types strictly. -- **from_attributes**: Whether to extract data from object attributes. -- **context**: Additional context to pass to the validator. -- **by_alias**: Whether to use the field's alias when validating against the provided input data. -- **by_name**: Whether to use the field's name when validating against the provided input data. +- `obj`: The object to validate. +- `strict`: Whether to enforce types strictly. +- `from_attributes`: Whether to extract data from object attributes. +- `context`: Additional context to pass to the validator. +- `by_alias`: Whether to use the field's alias when validating against the provided input data. +- `by_name`: Whether to use the field's name when validating against the provided input data. ##### Raises -- **ValidationError**: If the object could not be validated. +- `ValidationError`: If the object could not be validated. ### method model_validate_json @@ -826,16 +827,16 @@ Validate the given JSON data against the Pydantic model. ##### Arguments -- **json_data**: The JSON data to validate. -- **strict**: Whether to enforce types strictly. -- **context**: Extra variables to pass to the validator. -- **by_alias**: Whether to use the field's alias when validating against the provided input data. -- **by_name**: Whether to use the field's name when validating against the provided input data. +- `json_data`: The JSON data to validate. +- `strict`: Whether to enforce types strictly. +- `context`: Extra variables to pass to the validator. +- `by_alias`: Whether to use the field's alias when validating against the provided input data. +- `by_name`: Whether to use the field's name when validating against the provided input data. ##### Raises -- **ValidationError**: If `json_data` is not a JSON string or the object could not be validated. +- `ValidationError`: If `json_data` is not a JSON string or the object could not be validated. ### method model_validate_strings @@ -852,11 +853,11 @@ Validate the given object with string data against the Pydantic model. ##### Arguments -- **obj**: The object containing string data to validate. -- **strict**: Whether to enforce types strictly. -- **context**: Extra variables to pass to the validator. -- **by_alias**: Whether to use the field's alias when validating against the provided input data. -- **by_name**: Whether to use the field's name when validating against the provided input data. +- `obj`: The object containing string data to validate. +- `strict`: Whether to enforce types strictly. +- `context`: Extra variables to pass to the validator. +- `by_alias`: Whether to use the field's alias when validating against the provided input data. +- `by_name`: Whether to use the field's name when validating against the provided input data. @@ -875,11 +876,11 @@ allow_pickle: 'bool' = False ##### Arguments -- **path**: -- **content_type**: -- **encoding**: -- **proto**: -- **allow_pickle**: +- `path`: +- `content_type`: +- `encoding`: +- `proto`: +- `allow_pickle`: @@ -894,7 +895,7 @@ obj: 'Any' ##### Arguments -- **obj**: +- `obj`: @@ -913,11 +914,11 @@ allow_pickle: 'bool' = False ##### Arguments -- **b**: -- **content_type**: -- **encoding**: -- **proto**: -- **allow_pickle**: +- `b`: +- `content_type`: +- `encoding`: +- `proto`: +- `allow_pickle`: @@ -933,8 +934,8 @@ ref_template: 'str' = '#/$defs/{model}' ##### Arguments -- **by_alias**: -- **ref_template**: +- `by_alias`: +- `ref_template`: @@ -951,9 +952,9 @@ ref_template: 'str' = '#/$defs/{model}', **dumps_kwargs: 'Any' ##### Arguments -- **by_alias**: -- **ref_template**: -- **dumps_kwargs**: +- `by_alias`: +- `ref_template`: +- `dumps_kwargs`: @@ -968,7 +969,7 @@ ref_template: 'str' = '#/$defs/{model}', **dumps_kwargs: 'Any' ##### Arguments -- **localns**: +- `localns`: @@ -983,7 +984,7 @@ value: 'Any' ##### Arguments -- **value**: +- `value`: @@ -998,7 +999,7 @@ value: 'object' ##### Arguments -- **value**: +- `value`: @@ -1013,7 +1014,7 @@ value: 'object' ##### Arguments -- **value**: +- `value`: @@ -1028,7 +1029,7 @@ value: 'object' ##### Arguments -- **value**: +- `value`: diff --git a/models/ref/python/functions/box3d.mdx b/models/ref/python/functions/box3d.mdx index 925ba94676..f70883606c 100644 --- a/models/ref/python/functions/box3d.mdx +++ b/models/ref/python/functions/box3d.mdx @@ -11,6 +11,7 @@ import { GitHubLink } from '/snippets/_includes/github-source-link.mdx'; +## function box3d ```python *, center: 'npt.ArrayLike', @@ -29,12 +30,12 @@ A 3D bounding box. The box is specified by its center, size and orientation. ## Args -- **center**: The center point of the box as a length-3 ndarray. -- **size**: The box's X, Y and Z dimensions as a length-3 ndarray. -- **orientation**: The rotation transforming global XYZ coordinates into the box's local XYZ coordinates, given as a length-4 ndarray [r, x, y, z] corresponding to the non-zero quaternion r + xi + yj + zk. -- **color**: The box's color as an (r, g, b) tuple with `0 <= r,g,b <= 1`. -- **label**: An optional label for the box. -- **score**: An optional score for the box. Typically used to indicate the confidence of a detection. +- `center`: The center point of the box as a length-3 ndarray. +- `size`: The box's X, Y and Z dimensions as a length-3 ndarray. +- `orientation`: The rotation transforming global XYZ coordinates into the box's local XYZ coordinates, given as a length-4 ndarray [r, x, y, z] corresponding to the non-zero quaternion r + xi + yj + zk. +- `color`: The box's color as an (r, g, b) tuple with `0 <= r,g,b <= 1`. +- `label`: An optional label for the box. +- `score`: An optional score for the box. Typically used to indicate the confidence of a detection. ## Returns diff --git a/models/ref/python/functions/controller.mdx b/models/ref/python/functions/controller.mdx index 2ed6cb88c0..5af6adb922 100644 --- a/models/ref/python/functions/controller.mdx +++ b/models/ref/python/functions/controller.mdx @@ -11,6 +11,7 @@ import { GitHubLink } from '/snippets/_includes/github-source-link.mdx'; +## function controller ```python sweep_id_or_config: 'str | dict | None' = None, entity: 'str | None' = None, @@ -25,9 +26,9 @@ Public sweep controller constructor. ## Args -- **sweep_id_or_config**: -- **entity**: -- **project**: +- `sweep_id_or_config`: +- `entity`: +- `project`: diff --git a/models/ref/python/functions/finish.mdx b/models/ref/python/functions/finish.mdx index 8f99ec1690..5b9becd47c 100644 --- a/models/ref/python/functions/finish.mdx +++ b/models/ref/python/functions/finish.mdx @@ -11,6 +11,7 @@ import { GitHubLink } from '/snippets/_includes/github-source-link.mdx'; +## function finish ```python exit_code: 'int | None' = None, quiet: 'bool | None' = None @@ -33,8 +34,8 @@ Run States: ## Args -- **exit_code**: Integer indicating the run's exit status. Use 0 for success, any other value marks the run as failed. -- **quiet**: Deprecated. Configure logging verbosity using `wandb.Settings(quiet=...)`. +- `exit_code`: Integer indicating the run's exit status. Use 0 for success, any other value marks the run as failed. +- `quiet`: Deprecated. Configure logging verbosity using `wandb.Settings(quiet=...)`. ## Returns diff --git a/models/ref/python/functions/init.mdx b/models/ref/python/functions/init.mdx index 6393100a3d..b7b5135458 100644 --- a/models/ref/python/functions/init.mdx +++ b/models/ref/python/functions/init.mdx @@ -11,6 +11,7 @@ import { GitHubLink } from '/snippets/_includes/github-source-link.mdx'; +## function init ```python entity: 'str | None' = None, project: 'str | None' = None, @@ -63,31 +64,31 @@ Run IDs must not contain any of the following special characters `/ \ # ? % :` ## Args -- **entity**: The username or team name the runs are logged to. The entity must already exist, so ensure you create your account or team in the UI before starting to log runs. If not specified, the run will default your default entity. To change the default entity, go to your settings and update the "Default location to create new projects" under "Default team". -- **project**: The name of the project under which this run will be logged. If not specified, we use a heuristic to infer the project name based on the system, such as checking the git root or the current program file. If we can't infer the project name, the project will default to `"uncategorized"`. -- **dir**: The absolute path to the directory where experiment logs and metadata files are stored. If not specified, this defaults to the `./wandb` directory. Note that this does not affect the location where artifacts are stored when calling `download()`. -- **id**: A unique identifier for this run, used for resuming. It must be unique within the project and cannot be reused once a run is deleted. For a short descriptive name, use the `name` field, or for saving hyperparameters to compare across runs, use `config`. -- **name**: A short display name for this run, which appears in the UI to help you identify it. By default, we generate a random two-word name allowing easy cross-reference runs from table to charts. Keeping these run names brief enhances readability in chart legends and tables. For saving hyperparameters, we recommend using the `config` field. -- **notes**: A detailed description of the run, similar to a commit message in Git. Use this argument to capture any context or details that may help you recall the purpose or setup of this run in the future. -- **tags**: A list of tags to label this run in the UI. Tags are helpful for organizing runs or adding temporary identifiers like "baseline" or "production." You can easily add, remove tags, or filter by tags in the UI. If resuming a run, the tags provided here will replace any existing tags. To add tags to a resumed run without overwriting the current tags, use `run.tags += ("new_tag",)` after calling `run = wandb.init()`. -- **config**: Sets `wandb.config`, a dictionary-like object for storing input parameters to your run, such as model hyperparameters or data preprocessing settings. The config appears in the UI in an overview page, allowing you to group, filter, and sort runs based on these parameters. Keys should not contain periods (`.`), and values should be smaller than 10 MB. If a dictionary, `argparse.Namespace`, or `absl.flags.FLAGS` is provided, the key-value pairs will be loaded directly into `wandb.config`. If a string is provided, it is interpreted as a path to a YAML file, from which configuration values will be loaded into `wandb.config`. -- **config_exclude_keys**: A list of specific keys to exclude from `wandb.config`. -- **config_include_keys**: A list of specific keys to include in `wandb.config`. -- **allow_val_change**: Controls whether config values can be modified after their initial set. By default, an exception is raised if a config value is overwritten. For tracking variables that change during training, such as a learning rate, consider using `wandb.log()` instead. By default, this is `False` in scripts and `True` in Notebook environments. -- **group**: Specify a group name to organize individual runs as part of a larger experiment. This is useful for cases like cross-validation or running multiple jobs that train and evaluate a model on different test sets. Grouping allows you to manage related runs collectively in the UI, making it easy to toggle and review results as a unified experiment. -- **job_type**: Specify the type of run, especially helpful when organizing runs within a group as part of a larger experiment. For example, in a group, you might label runs with job types such as "train" and "eval". Defining job types enables you to easily filter and group similar runs in the UI, facilitating direct comparisons. -- **mode**: Specifies how run data is managed, with the following options: -- **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. -- **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`. -- **resume_from**: Specifies a moment in a previous run to resume a run from, using the format `{run_id}?_step={step}`. This allows users to truncate the history logged to a run at an intermediate step and resume logging from that step. The target run must be in the same project. If an `id` argument is also provided, the `resume_from` argument will take precedence. `resume`, `resume_from` and `fork_from` cannot be used together, only one of them can be used at a time. Note that this feature is in beta and may change in the future. -- **fork_from**: Specifies a point in a previous run from which to fork a new run, using the format `{id}?_step={step}`. This creates a new run that resumes logging from the specified step in the target run’s history. The target run must be part of the current project. If an `id` argument is also provided, it must be different from the `fork_from` argument, an error will be raised if they are the same. `resume`, `resume_from` and `fork_from` cannot be used together, only one of them can be used at a time. Note that this feature is in beta and may change in the future. -- **save_code**: Enables saving the main script or notebook to W&B, aiding in experiment reproducibility and allowing code comparisons across runs in the UI. By default, this is disabled, but you can change the default to enable on your settings page. -- **tensorboard**: Deprecated. Use `sync_tensorboard` instead. -- **sync_tensorboard**: Enables automatic syncing of W&B logs from TensorBoard or TensorBoardX, saving relevant event files for viewing in the W&B UI. -- **monitor_gym**: Enables automatic logging of videos of the environment when using OpenAI Gym. -- **settings**: Specifies a dictionary or `wandb.Settings` object with advanced settings for the run. -- **anonymous**: +- `entity`: The username or team name the runs are logged to. The entity must already exist, so ensure you create your account or team in the UI before starting to log runs. If not specified, the run will default your default entity. To change the default entity, go to your settings and update the "Default location to create new projects" under "Default team". +- `project`: The name of the project under which this run will be logged. If not specified, we use a heuristic to infer the project name based on the system, such as checking the git root or the current program file. If we can't infer the project name, the project will default to `"uncategorized"`. +- `dir`: The absolute path to the directory where experiment logs and metadata files are stored. If not specified, this defaults to the `./wandb` directory. Note that this does not affect the location where artifacts are stored when calling `download()`. +- `id`: A unique identifier for this run, used for resuming. It must be unique within the project and cannot be reused once a run is deleted. For a short descriptive name, use the `name` field, or for saving hyperparameters to compare across runs, use `config`. +- `name`: A short display name for this run, which appears in the UI to help you identify it. By default, we generate a random two-word name allowing easy cross-reference runs from table to charts. Keeping these run names brief enhances readability in chart legends and tables. For saving hyperparameters, we recommend using the `config` field. +- `notes`: A detailed description of the run, similar to a commit message in Git. Use this argument to capture any context or details that may help you recall the purpose or setup of this run in the future. +- `tags`: A list of tags to label this run in the UI. Tags are helpful for organizing runs or adding temporary identifiers like "baseline" or "production." You can easily add, remove tags, or filter by tags in the UI. If resuming a run, the tags provided here will replace any existing tags. To add tags to a resumed run without overwriting the current tags, use `run.tags += ("new_tag",)` after calling `run = wandb.init()`. +- `config`: Sets `wandb.config`, a dictionary-like object for storing input parameters to your run, such as model hyperparameters or data preprocessing settings. The config appears in the UI in an overview page, allowing you to group, filter, and sort runs based on these parameters. Keys should not contain periods (`.`), and values should be smaller than 10 MB. If a dictionary, `argparse.Namespace`, or `absl.flags.FLAGS` is provided, the key-value pairs will be loaded directly into `wandb.config`. If a string is provided, it is interpreted as a path to a YAML file, from which configuration values will be loaded into `wandb.config`. +- `config_exclude_keys`: A list of specific keys to exclude from `wandb.config`. +- `config_include_keys`: A list of specific keys to include in `wandb.config`. +- `allow_val_change`: Controls whether config values can be modified after their initial set. By default, an exception is raised if a config value is overwritten. For tracking variables that change during training, such as a learning rate, consider using `wandb.log()` instead. By default, this is `False` in scripts and `True` in Notebook environments. +- `group`: Specify a group name to organize individual runs as part of a larger experiment. This is useful for cases like cross-validation or running multiple jobs that train and evaluate a model on different test sets. Grouping allows you to manage related runs collectively in the UI, making it easy to toggle and review results as a unified experiment. +- `job_type`: Specify the type of run, especially helpful when organizing runs within a group as part of a larger experiment. For example, in a group, you might label runs with job types such as "train" and "eval". Defining job types enables you to easily filter and group similar runs in the UI, facilitating direct comparisons. +- `mode`: Specifies how run data is managed, with the following options: +- `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. +- `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`. +- `resume_from`: Specifies a moment in a previous run to resume a run from, using the format `{run_id}?_step={step}`. This allows users to truncate the history logged to a run at an intermediate step and resume logging from that step. The target run must be in the same project. If an `id` argument is also provided, the `resume_from` argument will take precedence. `resume`, `resume_from` and `fork_from` cannot be used together, only one of them can be used at a time. Note that this feature is in beta and may change in the future. +- `fork_from`: Specifies a point in a previous run from which to fork a new run, using the format `{id}?_step={step}`. This creates a new run that resumes logging from the specified step in the target run’s history. The target run must be part of the current project. If an `id` argument is also provided, it must be different from the `fork_from` argument, an error will be raised if they are the same. `resume`, `resume_from` and `fork_from` cannot be used together, only one of them can be used at a time. Note that this feature is in beta and may change in the future. +- `save_code`: Enables saving the main script or notebook to W&B, aiding in experiment reproducibility and allowing code comparisons across runs in the UI. By default, this is disabled, but you can change the default to enable on your settings page. +- `tensorboard`: Deprecated. Use `sync_tensorboard` instead. +- `sync_tensorboard`: Enables automatic syncing of W&B logs from TensorBoard or TensorBoardX, saving relevant event files for viewing in the W&B UI. +- `monitor_gym`: Enables automatic logging of videos of the environment when using OpenAI Gym. +- `settings`: Specifies a dictionary or `wandb.Settings` object with advanced settings for the run. +- `anonymous`: ## Returns @@ -96,11 +97,11 @@ A `Run` object. ## Raises -- **Error**: If some unknown or internal error happened during the run initialization. -- **AuthenticationError**: If the user failed to provide valid credentials. -- **CommError**: If there was a problem communicating with the WandB server. -- **UsageError**: If the user provided invalid arguments. -- **KeyboardInterrupt**: If user interrupts the run. +- `Error`: If some unknown or internal error happened during the run initialization. +- `AuthenticationError`: If the user failed to provide valid credentials. +- `CommError`: If there was a problem communicating with the WandB server. +- `UsageError`: If the user provided invalid arguments. +- `KeyboardInterrupt`: If user interrupts the run. ## Examples diff --git a/models/ref/python/functions/login.mdx b/models/ref/python/functions/login.mdx index 3c6dffd6f3..ce5c8b3afa 100644 --- a/models/ref/python/functions/login.mdx +++ b/models/ref/python/functions/login.mdx @@ -11,6 +11,7 @@ import { GitHubLink } from '/snippets/_includes/github-source-link.mdx'; +## function login ```python key: 'str | None' = None, relogin: 'bool | None' = None, @@ -53,14 +54,14 @@ If none of the above is true, then this gets the API key from the first of: ## Args -- **key**: The API key to use. -- **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. -- **anonymous**: +- `key`: The API key to use. +- `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. +- `anonymous`: ## Returns @@ -70,8 +71,8 @@ If none of the above is true, then this gets the API key from the first of: ## Raises -- **AuthenticationError**: If `api_key` fails verification with the server. -- **UsageError**: If `api_key` cannot be configured and no tty. +- `AuthenticationError`: If `api_key` fails verification with the server. +- `UsageError`: If `api_key` cannot be configured and no tty. diff --git a/models/ref/python/functions/restore.mdx b/models/ref/python/functions/restore.mdx index cf0d335369..6a3ab982f2 100644 --- a/models/ref/python/functions/restore.mdx +++ b/models/ref/python/functions/restore.mdx @@ -11,6 +11,7 @@ import { GitHubLink } from '/snippets/_includes/github-source-link.mdx'; +## function restore ```python name: 'str', run_path: 'str | None' = None, @@ -29,10 +30,10 @@ By default, will only download the file if it doesn't already exist. ## Args -- **name**: The name of the file. -- **run_path**: Optional path to a run to pull files from, i.e. `username/project_name/run_id` if wandb.init has not been called, this is required. -- **replace**: Whether to download the file even if it already exists locally -- **root**: The directory to download the file to. Defaults to the current directory or the run directory if wandb.init was called. +- `name`: The name of the file. +- `run_path`: Optional path to a run to pull files from, i.e. `username/project_name/run_id` if wandb.init has not been called, this is required. +- `replace`: Whether to download the file even if it already exists locally +- `root`: The directory to download the file to. Defaults to the current directory or the run directory if wandb.init was called. ## Returns @@ -41,8 +42,8 @@ None if it can't find the file, otherwise a file object open for reading. ## Raises -- **CommError**: If W&B can't connect to the W&B backend. -- **ValueError**: If the file is not found or can't find run_path. +- `CommError`: If W&B can't connect to the W&B backend. +- `ValueError`: If the file is not found or can't find run_path. diff --git a/models/ref/python/functions/setup.mdx b/models/ref/python/functions/setup.mdx index bebb632a53..616425e9d1 100644 --- a/models/ref/python/functions/setup.mdx +++ b/models/ref/python/functions/setup.mdx @@ -11,6 +11,7 @@ import { GitHubLink } from '/snippets/_includes/github-source-link.mdx'; +## function setup ```python settings: 'Settings | None' = None ``` @@ -34,7 +35,7 @@ See also `wandb.teardown()`. ## Args -- **settings**: Configuration settings to apply globally. These can be overridden by subsequent `wandb.init()` calls. +- `settings`: Configuration settings to apply globally. These can be overridden by subsequent `wandb.init()` calls. diff --git a/models/ref/python/functions/sweep.mdx b/models/ref/python/functions/sweep.mdx index c154f02580..4cd733fa85 100644 --- a/models/ref/python/functions/sweep.mdx +++ b/models/ref/python/functions/sweep.mdx @@ -11,6 +11,7 @@ import { GitHubLink } from '/snippets/_includes/github-source-link.mdx'; +## function sweep ```python sweep: 'dict | Callable', entity: 'str | None' = None, @@ -35,10 +36,10 @@ for information on how to define your sweep. ## Args -- **sweep**: The configuration of a hyperparameter search. (or configuration generator). If you provide a callable, ensure that the callable does not take arguments and that it returns a dictionary that conforms to the W&B sweep config spec. -- **entity**: The username or team name where you want to send W&B runs created by the sweep to. Ensure that the entity you specify already exists. If you don't specify an entity, the run will be sent to your default entity, which is usually your username. -- **project**: The name of the project where W&B runs created from the sweep are sent to. If the project is not specified, the run is sent to a project labeled 'Uncategorized'. -- **prior_runs**: The run IDs of existing runs to add to this sweep. +- `sweep`: The configuration of a hyperparameter search. (or configuration generator). If you provide a callable, ensure that the callable does not take arguments and that it returns a dictionary that conforms to the W&B sweep config spec. +- `entity`: The username or team name where you want to send W&B runs created by the sweep to. Ensure that the entity you specify already exists. If you don't specify an entity, the run will be sent to your default entity, which is usually your username. +- `project`: The name of the project where W&B runs created from the sweep are sent to. If the project is not specified, the run is sent to a project labeled 'Uncategorized'. +- `prior_runs`: The run IDs of existing runs to add to this sweep. ## Returns diff --git a/models/ref/python/functions/teardown.mdx b/models/ref/python/functions/teardown.mdx index 180becfa0d..be6331d366 100644 --- a/models/ref/python/functions/teardown.mdx +++ b/models/ref/python/functions/teardown.mdx @@ -11,6 +11,7 @@ import { GitHubLink } from '/snippets/_includes/github-source-link.mdx'; +## function teardown ```python exit_code: 'int | None' = None ``` @@ -31,7 +32,7 @@ such as when using Python's `multiprocessing` module. ## Args -- **exit_code**: +- `exit_code`: ## Returns diff --git a/models/ref/python/public-api/agentruns.mdx b/models/ref/python/public-api/agentruns.mdx index 9fed19b5a7..5369ecd207 100644 --- a/models/ref/python/public-api/agentruns.mdx +++ b/models/ref/python/public-api/agentruns.mdx @@ -11,6 +11,7 @@ import { GitHubLink } from '/snippets/_includes/github-source-link.mdx'; +## class AgentRuns ```python service_api: 'ServiceApi', entity: 'str', @@ -32,14 +33,14 @@ A lazy iterator of `Run` objects for a single sweep agent. ## Args -- **service_api**: -- **entity**: -- **project**: -- **sweep_id**: -- **agent_key**: -- **total_runs**: -- **order**: -- **per_page**: +- `service_api`: +- `entity`: +- `project`: +- `sweep_id`: +- `agent_key`: +- `total_runs`: +- `order`: +- `per_page`: diff --git a/models/ref/python/public-api/api.mdx b/models/ref/python/public-api/api.mdx index c76d322c76..388cb83a5f 100644 --- a/models/ref/python/public-api/api.mdx +++ b/models/ref/python/public-api/api.mdx @@ -11,6 +11,7 @@ import { GitHubLink } from '/snippets/_includes/github-source-link.mdx'; +## class Api ```python overrides: 'dict[str, Any] | None' = None, timeout: 'int | None' = None, @@ -25,9 +26,9 @@ Used for querying the W&B server. ## Args -- **overrides**: -- **timeout**: -- **api_key**: +- `overrides`: +- `timeout`: +- `api_key`: ## Examples @@ -68,14 +69,14 @@ Returns a single artifact. ##### Arguments -- **name**: The artifact's name. The name of an artifact resembles a filepath that consists, at a minimum, the name of the project the artifact was logged to, the name of the artifact, and the artifact's version or alias. Optionally append the entity that logged the artifact as a prefix followed by a forward slash. If no entity is specified in the name, the Run or API setting's entity is used. -- **type**: The type of artifact to fetch. +- `name`: The artifact's name. The name of an artifact resembles a filepath that consists, at a minimum, the name of the project the artifact was logged to, the name of the artifact, and the artifact's version or alias. Optionally append the entity that logged the artifact as a prefix followed by a forward slash. If no entity is specified in the name, the Run or API setting's entity is used. +- `type`: The type of artifact to fetch. ##### Raises -- **ValueError**: If the artifact name is not specified. -- **ValueError**: If the artifact type is specified but does not match the type of the fetched artifact. +- `ValueError`: If the artifact name is not specified. +- `ValueError`: If the artifact type is specified but does not match the type of the fetched artifact. ##### Examples @@ -119,8 +120,8 @@ information about specific artifacts in that collection, and more. ##### Arguments -- **type_name**: The type of artifact collection to fetch. -- **name**: An artifact collection name. Optionally append the entity that logged the artifact as a prefix followed by a forward slash. +- `type_name`: The type of artifact collection to fetch. +- `name`: An artifact collection name. Optionally append the entity that logged the artifact as a prefix followed by a forward slash. @@ -158,8 +159,8 @@ Whether an artifact collection exists within a specified project and entity. ##### Arguments -- **name**: An artifact collection name. Optionally append the entity that logged the artifact as a prefix followed by a forward slash. If entity or project is not specified, infer the collection from the override params if they exist. Otherwise, entity is pulled from the user settings and project will default to "uncategorized". -- **type**: The type of artifact collection. +- `name`: An artifact collection name. Optionally append the entity that logged the artifact as a prefix followed by a forward slash. If entity or project is not specified, infer the collection from the override params if they exist. Otherwise, entity is pulled from the user settings and project will default to "uncategorized". +- `type`: The type of artifact collection. @@ -190,11 +191,11 @@ Returns a collection of matching artifact collections. ##### Arguments -- **project_name**: The name of the project to filter on. -- **type_name**: The name of the artifact type to filter on. -- **order**: Optional string to specify the order of the results. If prefixed with '+', sorts ascending (default). If prefixed with '-', sorts descending. -- **per_page**: Sets the page size for query pagination. Usually there is no reason to change this. -- **start**: Pagination cursor for resuming a past query, captured from a previous paginator's `.cursor` attribute. +- `project_name`: The name of the project to filter on. +- `type_name`: The name of the artifact type to filter on. +- `order`: Optional string to specify the order of the results. If prefixed with '+', sorts ascending (default). If prefixed with '-', sorts descending. +- `per_page`: Sets the page size for query pagination. Usually there is no reason to change this. +- `start`: Pagination cursor for resuming a past query, captured from a previous paginator's `.cursor` attribute. @@ -211,8 +212,8 @@ Whether an artifact version exists within the specified project and entity. ##### Arguments -- **name**: The name of artifact. Add the artifact's entity and project as a prefix. Append the version or the alias of the artifact with a colon. If the entity or project is not specified, W&B uses override parameters if populated. Otherwise, the entity is pulled from the user settings and the project is set to "Uncategorized". -- **type**: The type of artifact. +- `name`: The name of artifact. Add the artifact's entity and project as a prefix. Append the version or the alias of the artifact with a colon. If the entity or project is not specified, W&B uses override parameters if populated. Otherwise, the entity is pulled from the user settings and the project is set to "Uncategorized". +- `type`: The type of artifact. @@ -243,8 +244,8 @@ Returns the matching `ArtifactType`. ##### Arguments -- **type_name**: The name of the artifact type to retrieve. -- **project**: If given, a project name or path to filter on. +- `type_name`: The name of the artifact type to retrieve. +- `project`: If given, a project name or path to filter on. @@ -261,8 +262,8 @@ Returns a collection of matching artifact types. ##### Arguments -- **project**: The project name or path to filter on. -- **start**: Pagination cursor for resuming a past query, captured from a previous paginator's `.cursor` attribute. +- `project`: The project name or path to filter on. +- `start`: Pagination cursor for resuming a past query, captured from a previous paginator's `.cursor` attribute. @@ -277,9 +278,9 @@ Deprecated. Use `Api.artifacts(type_name, name)` method instead. ##### Arguments -- **type_name**: -- **name**: -- **per_page**: +- `type_name`: +- `name`: +- `per_page`: @@ -300,12 +301,12 @@ Return an `Artifacts` collection. ##### Arguments -- **type_name**: The type of artifacts to fetch. -- **name**: The artifact's collection name. Optionally append the entity that logged the artifact as a prefix followed by a forward slash. -- **order**: Optional string to specify the order of the results. If prefixed with '+', sorts ascending (default). If prefixed with '-', sorts descending. -- **per_page**: Sets the page size for query pagination. Usually there is no reason to change this. -- **tags**: Only return artifacts with all of these tags. -- **start**: Pagination cursor for resuming a past query, captured from a previous paginator's `.cursor` attribute. +- `type_name`: The type of artifacts to fetch. +- `name`: The artifact's collection name. Optionally append the entity that logged the artifact as a prefix followed by a forward slash. +- `order`: Optional string to specify the order of the results. If prefixed with '+', sorts ascending (default). If prefixed with '-', sorts descending. +- `per_page`: Sets the page size for query pagination. Usually there is no reason to change this. +- `tags`: Only return artifacts with all of these tags. +- `start`: Pagination cursor for resuming a past query, captured from a previous paginator's `.cursor` attribute. @@ -365,13 +366,13 @@ Returns the only Automation matching the parameters. ##### Arguments -- **name**: The name of the automation to fetch. -- **entity**: The entity to fetch the automation for. +- `name`: The name of the automation to fetch. +- `entity`: The entity to fetch the automation for. ##### Raises -- **ValueError**: If zero or multiple Automations match the search criteria. +- `ValueError`: If zero or multiple Automations match the search criteria. ##### Examples @@ -408,10 +409,10 @@ Automations that the user has access to. ##### Arguments -- **entity**: The entity to fetch the automations for. -- **name**: The name of the automation to fetch. -- **per_page**: The number of automations to fetch per page. Defaults to 50. Usually there is no reason to change this. -- **start**: Pagination cursor for resuming a past query, captured from a previous paginator's `.cursor` attribute. +- `entity`: The entity to fetch the automations for. +- `name`: The name of the automation to fetch. +- `per_page`: The number of automations to fetch per page. Defaults to 50. Usually there is no reason to change this. +- `start`: Pagination cursor for resuming a past query, captured from a previous paginator's `.cursor` attribute. @@ -439,9 +440,9 @@ Create a new Automation. ##### Arguments -- **obj**: The automation to create. -- **fetch_existing**: If True, and a conflicting automation already exists, attempt to fetch the existing automation instead of raising an error. -- **kwargs**: +- `obj`: The automation to create. +- `fetch_existing`: If True, and a conflicting automation already exists, attempt to fetch the existing automation instead of raising an error. +- `kwargs`: @@ -491,18 +492,18 @@ Create a custom chart preset and return its id. ##### Arguments -- **entity**: The entity (user or team) that owns the chart -- **name**: Unique identifier for the chart preset -- **display_name**: Human-readable name shown in the UI -- **spec_type**: Type of specification. Must be "vega2" for Vega-Lite v2 specifications. -- **access**: Access level for the chart: -- **spec**: The Vega/Vega-Lite specification as a dictionary or JSON string +- `entity`: The entity (user or team) that owns the chart +- `name`: Unique identifier for the chart preset +- `display_name`: Human-readable name shown in the UI +- `spec_type`: Type of specification. Must be "vega2" for Vega-Lite v2 specifications. +- `access`: Access level for the chart: +- `spec`: The Vega/Vega-Lite specification as a dictionary or JSON string ##### Raises -- **wandb.Error**: If chart creation fails -- **UnsupportedError**: If the server doesn't support custom charts +- `wandb.Error`: If chart creation fails +- `UnsupportedError`: If the server doesn't support custom charts ##### Examples @@ -553,8 +554,8 @@ Create a new project. ##### Arguments -- **name**: The name of the new project. -- **entity**: The entity of the new project. +- `name`: The name of the new project. +- `entity`: The entity of the new project. @@ -574,11 +575,11 @@ Create a new registry. ##### Arguments -- **name**: The name of the registry. Name must be unique within the organization. -- **visibility**: The visibility of the registry. -- **organization**: The organization of the registry. If no organization is set in the settings, the organization will be fetched from the entity if the entity only belongs to one organization. -- **description**: The description of the registry. -- **artifact_types**: The accepted artifact types of the registry. A type is no +- `name`: The name of the registry. Name must be unique within the organization. +- `visibility`: The visibility of the registry. +- `organization`: The organization of the registry. If no organization is set in the settings, the organization will be fetched from the entity if the entity only belongs to one organization. +- `description`: The description of the registry. +- `artifact_types`: The accepted artifact types of the registry. A type is no @@ -611,9 +612,9 @@ Create a new run. ##### Arguments -- **run_id**: The ID to assign to the run. If not specified, W&B creates a random ID. -- **project**: The project where to log the run to. If no project is specified, log the run to a project called "Uncategorized". -- **entity**: The entity that owns the project. If no entity is specified, log the run to the default entity. +- `run_id`: The ID to assign to the run. If not specified, W&B creates a random ID. +- `project`: The project where to log the run to. If no project is specified, log the run to a project called "Uncategorized". +- `entity`: The entity that owns the project. If no entity is specified, log the run to the default entity. @@ -634,12 +635,12 @@ Create a new run queue in W&B Launch. ##### Arguments -- **name**: Name of the queue to create -- **type**: Type of resource to be used for the queue. One of "local-container", "local-process", "kubernetes","sagemaker", or "gcp-vertex". -- **entity**: Name of the entity to create the queue. If `None`, use the configured or default entity. -- **prioritization_mode**: Version of prioritization to use. Either "V0" or `None`. -- **config**: Default resource configuration to be used for the queue. Use handlebars (eg. `{{var}}`) to specify template variables. -- **template_variables**: A dictionary of template variable schemas to use with the config. +- `name`: Name of the queue to create +- `type`: Type of resource to be used for the queue. One of "local-container", "local-process", "kubernetes","sagemaker", or "gcp-vertex". +- `entity`: Name of the entity to create the queue. If `None`, use the configured or default entity. +- `prioritization_mode`: Version of prioritization to use. Either "V0" or `None`. +- `config`: Default resource configuration to be used for the queue. Use handlebars (eg. `{{var}}`) to specify template variables. +- `template_variables`: A dictionary of template variable schemas to use with the config. @@ -656,8 +657,8 @@ Create a new team. ##### Arguments -- **team**: The name of the team -- **admin_username**: Username of the admin user of the team. Defaults to the current user. +- `team`: The name of the team +- `admin_username`: Username of the admin user of the team. Defaults to the current user. @@ -674,8 +675,8 @@ Create a new user. ##### Arguments -- **email**: The email address of the user. -- **admin**: Set user as a global instance administrator. +- `email`: The email address of the user. +- `admin`: Set user as a global instance administrator. @@ -691,7 +692,7 @@ Delete an automation. ##### Arguments -- **obj**: The automation to delete, or its ID. +- `obj`: The automation to delete, or its ID. @@ -723,7 +724,7 @@ Return a run, sweep, project or report from a path. ##### Arguments -- **path**: The path to the project, run, sweep or report +- `path`: The path to the project, run, sweep or report @@ -759,9 +760,9 @@ Return an iterator of all integrations for an entity. ##### Arguments -- **entity**: The entity (e.g. team name) for which to fetch integrations. If not provided, the user's default entity will be used. -- **per_page**: Number of integrations to fetch per page. Defaults to 50. Usually there is no reason to change this. -- **start**: +- `entity`: The entity (e.g. team name) for which to fetch integrations. If not provided, the user's default entity will be used. +- `per_page`: Number of integrations to fetch per page. Defaults to 50. Usually there is no reason to change this. +- `start`: @@ -778,8 +779,8 @@ Return a `Job` object. ##### Arguments -- **name**: The name of the job. -- **path**: The root path to download the job artifact. +- `name`: The name of the job. +- `path`: The root path to download the job artifact. @@ -796,8 +797,8 @@ Return a list of jobs, if any, for the given entity and project. ##### Arguments -- **entity**: The entity for the listed jobs. -- **project**: The project for the listed jobs. +- `entity`: The entity for the listed jobs. +- `project`: The project for the listed jobs. @@ -814,8 +815,8 @@ Return the `Project` with the given name (and entity, if given). ##### Arguments -- **name**: The project name. -- **entity**: Name of the entity requested. If None, will fall back to the default entity passed to `Api`. If no default entity, will raise a `ValueError`. +- `name`: The project name. +- `entity`: Name of the entity requested. If None, will fall back to the default entity passed to `Api`. If no default entity, will raise a `ValueError`. @@ -832,8 +833,8 @@ Get projects for a given entity. ##### Arguments -- **entity**: Name of the entity requested. If None, will fall back to the default entity passed to `Api`. If no default entity, will raise a `ValueError`. -- **per_page**: Sets the page size for query pagination. Usually there is no reason to change this. +- `entity`: Name of the entity requested. If None, will fall back to the default entity passed to `Api`. If no default entity, will raise a `ValueError`. +- `per_page`: Sets the page size for query pagination. Usually there is no reason to change this. @@ -854,12 +855,12 @@ Parses paths of the form `entity/project/queue_id/run_queue_item_id`. ##### Arguments -- **entity**: -- **project**: -- **queue_name**: -- **run_queue_item_id**: -- **project_queue**: -- **priority**: +- `entity`: +- `project`: +- `queue_name`: +- `run_queue_item_id`: +- `project_queue`: +- `priority`: @@ -882,11 +883,11 @@ or artifact versions across your organization's registry. ##### Arguments -- **organization**: The organization of the registry to fetch. If not specified, use the organization specified in the user's settings. -- **filter**: Optional MongoDB-style filter to apply to each object in the lazy registry iterator. Fields available to filter for registries are `name`, `description`, `created_at`, `updated_at`. Fields available to filter for collections are `name`, `tag`, `description`, `created_at`, `updated_at` Fields available to filter for versions are `tag`, `alias`, `created_at`, `updated_at`, `metadata` -- **order**: Optional string to specify the order of the results. If prefixed with '+', sorts ascending (default). If prefixed with '-', sorts descending. -- **per_page**: Sets the page size for query pagination. -- **start**: Pagination cursor for resuming a past query, captured from a previous paginator's `.cursor` attribute. +- `organization`: The organization of the registry to fetch. If not specified, use the organization specified in the user's settings. +- `filter`: Optional MongoDB-style filter to apply to each object in the lazy registry iterator. Fields available to filter for registries are `name`, `description`, `created_at`, `updated_at`. Fields available to filter for collections are `name`, `tag`, `description`, `created_at`, `updated_at` Fields available to filter for versions are `tag`, `alias`, `created_at`, `updated_at`, `metadata` +- `order`: Optional string to specify the order of the results. If prefixed with '+', sorts ascending (default). If prefixed with '-', sorts descending. +- `per_page`: Sets the page size for query pagination. +- `start`: Pagination cursor for resuming a past query, captured from a previous paginator's `.cursor` attribute. @@ -957,8 +958,8 @@ Return a registry given a registry name. ##### Arguments -- **name**: The name of the registry. This is without the `wandb-registry-` prefix. -- **organization**: The organization of the registry. If no organization is set in the settings, the organization will be fetched from the entity if the entity only belongs to one organization. +- `name`: The name of the registry. This is without the `wandb-registry-` prefix. +- `organization`: The organization of the registry. If no organization is set in the settings, the organization will be fetched from the entity if the entity only belongs to one organization. @@ -992,9 +993,9 @@ future releases. ##### Arguments -- **path**: The path to the project the report resides in. Specify the entity that created the project as a prefix followed by a forward slash. -- **name**: Name of the report requested. -- **per_page**: Sets the page size for query pagination. Usually there is no reason to change this. +- `path`: The path to the project the report resides in. Specify the entity that created the project as a prefix followed by a forward slash. +- `name`: Name of the report requested. +- `per_page`: Sets the page size for query pagination. Usually there is no reason to change this. @@ -1017,7 +1018,7 @@ Return a single run by parsing path in the form `entity/project/run_id`. ##### Arguments -- **path**: Path to run in the form `entity/project/run_id`. If `api.entity` is set, this can be in the form `project/run_id` and if `api.project` is set this can just be the run_id. +- `path`: Path to run in the form `entity/project/run_id`. If `api.entity` is set, this can be in the form `project/run_id` and if `api.project` is set this can just be the run_id. @@ -1036,8 +1037,8 @@ See `Api.create_run_queue` for more information on how to create a run queue. ##### Arguments -- **entity**: -- **name**: +- `entity`: +- `name`: @@ -1090,12 +1091,12 @@ The following operations are supported: ##### Arguments -- **path**: (str) path to project, should be in the form: "entity/project" -- **filters**: (dict) queries for specific runs using the MongoDB query language. You can filter by run properties such as config.key, summary_metrics.key, state, entity, createdAt, etc. -- **order**: (str) Order can be `created_at`, `heartbeat_at`, `config.*.value`, or `summary_metrics.*`. If you prepend order with a + order is ascending (default). If you prepend order with a - order is descending. The default order is run.created_at from oldest to newest. -- **per_page**: (int) Sets the page size for query pagination. -- **include_sweeps**: (bool) Whether to eagerly fetch the sweep object in each run result. -- **lazy**: (bool) Whether to use lazy loading for faster performance. When True (default), only essential run metadata is loaded initially. Heavy fields like config, summaryMetrics, and systemMetrics are loaded on-demand when accessed. Set to False for full data upfront. +- `path`: (str) path to project, should be in the form: "entity/project" +- `filters`: (dict) queries for specific runs using the MongoDB query language. You can filter by run properties such as config.key, summary_metrics.key, state, entity, createdAt, etc. +- `order`: (str) Order can be `created_at`, `heartbeat_at`, `config.*.value`, or `summary_metrics.*`. If you prepend order with a + order is ascending (default). If you prepend order with a - order is descending. The default order is run.created_at from oldest to newest. +- `per_page`: (int) Sets the page size for query pagination. +- `include_sweeps`: (bool) Whether to eagerly fetch the sweep object in each run result. +- `lazy`: (bool) Whether to use lazy loading for faster performance. When True (default), only essential run metadata is loaded initially. Heavy fields like config, summaryMetrics, and systemMetrics are loaded on-demand when accessed. Set to False for full data upfront. @@ -1158,9 +1159,9 @@ Returns an iterator of Slack integrations for an entity. ##### Arguments -- **entity**: The entity (e.g. team name) for which to fetch integrations. If not provided, the user's default entity will be used. -- **per_page**: Number of integrations to fetch per page. Defaults to 50. Usually there is no reason to change this. -- **start**: +- `entity`: The entity (e.g. team name) for which to fetch integrations. If not provided, the user's default entity will be used. +- `per_page`: Number of integrations to fetch per page. Defaults to 50. Usually there is no reason to change this. +- `start`: @@ -1197,7 +1198,7 @@ Return a sweep by parsing path in the form `entity/project/sweep_id`. ##### Arguments -- **path**: Path to sweep in the form entity/project/sweep_id. If `api.entity` is set, this can be in the form project/sweep_id and if `api.project` is set this can just be the sweep_id. +- `path`: Path to sweep in the form entity/project/sweep_id. If `api.entity` is set, this can be in the form project/sweep_id and if `api.project` is set this can just be the sweep_id. @@ -1212,10 +1213,10 @@ Sync a local directory containing tfevent files to wandb. ##### Arguments -- **root_dir**: -- **run_id**: -- **project**: -- **entity**: +- `root_dir`: +- `run_id`: +- `project`: +- `entity`: @@ -1231,7 +1232,7 @@ Return the matching `Team` with the given name. ##### Arguments -- **team**: The name of the team. +- `team`: The name of the team. @@ -1248,9 +1249,9 @@ Update an existing automation. ##### Arguments -- **obj**: The automation to update. Must be an existing automation. -- **create_missing**: If True, and the automation does not exist, create it. -- **kwargs**: +- `obj`: The automation to update. Must be an existing automation. +- `create_missing`: If True, and the automation does not exist, create it. +- `kwargs`: @@ -1304,13 +1305,13 @@ Upsert a run queue in W&B Launch. ##### Arguments -- **name**: Name of the queue to create -- **resource_config**: Optional default resource configuration to be used for the queue. Use handlebars (eg. `{{var}}`) to specify template variables. -- **resource_type**: Type of resource to be used for the queue. One of "local-container", "local-process", "kubernetes", "sagemaker", or "gcp-vertex". -- **entity**: Optional name of the entity to create the queue. If `None`, use the configured or default entity. -- **template_variables**: A dictionary of template variable schemas to be used with the config. -- **external_links**: Optional dictionary of external links to be used with the queue. -- **prioritization_mode**: Optional version of prioritization to use. Either "V0" or None +- `name`: Name of the queue to create +- `resource_config`: Optional default resource configuration to be used for the queue. Use handlebars (eg. `{{var}}`) to specify template variables. +- `resource_type`: Type of resource to be used for the queue. One of "local-container", "local-process", "kubernetes", "sagemaker", or "gcp-vertex". +- `entity`: Optional name of the entity to create the queue. If `None`, use the configured or default entity. +- `template_variables`: A dictionary of template variable schemas to be used with the config. +- `external_links`: Optional dictionary of external links to be used with the queue. +- `prioritization_mode`: Optional version of prioritization to use. Either "V0" or None @@ -1329,7 +1330,7 @@ This function only works for local administrators. Use `api.viewer` ##### Arguments -- **username_or_email**: The username or email address of the user. +- `username_or_email`: The username or email address of the user. @@ -1348,7 +1349,7 @@ This function only works for local administrators. Use `api.viewer` ##### Arguments -- **username_or_email**: The prefix or suffix of the user you want to find. +- `username_or_email`: The prefix or suffix of the user you want to find. @@ -1366,9 +1367,9 @@ Returns an iterator of webhook integrations for an entity. ##### Arguments -- **entity**: The entity (e.g. team name) for which to fetch integrations. If not provided, the user's default entity will be used. -- **per_page**: Number of integrations to fetch per page. Defaults to 50. Usually there is no reason to change this. -- **start**: +- `entity`: The entity (e.g. team name) for which to fetch integrations. If not provided, the user's default entity will be used. +- `per_page`: Number of integrations to fetch per page. Defaults to 50. Usually there is no reason to change this. +- `start`: diff --git a/models/ref/python/public-api/artifactcollection.mdx b/models/ref/python/public-api/artifactcollection.mdx index 47d6c65e7e..084b044e2e 100644 --- a/models/ref/python/public-api/artifactcollection.mdx +++ b/models/ref/python/public-api/artifactcollection.mdx @@ -11,6 +11,7 @@ import { GitHubLink } from '/snippets/_includes/github-source-link.mdx'; +## class ArtifactCollection ```python (service_api: 'ServiceApi', entity: 'str', @@ -29,13 +30,13 @@ An artifact collection that represents a group of related artifacts. ## Args -- **service_api**: Interface to the wandb-core service that performs W&B API calls for this collection. -- **entity**: The entity (user or team) that owns the project. -- **project**: The name of the project to query for artifact collections. -- **name**: The name of the artifact collection. -- **type**: The type of the artifact collection (e.g., "dataset", "model"). -- **organization**: Optional organization name if applicable. -- **attrs**: Optional mapping of attributes to initialize the artifact collection. If not provided, the object will load its attributes from W&B upon initialization. +- `service_api`: Interface to the wandb-core service that performs W&B API calls for this collection. +- `entity`: The entity (user or team) that owns the project. +- `project`: The name of the project to query for artifact collections. +- `name`: The name of the artifact collection. +- `type`: The type of the artifact collection (e.g., "dataset", "model"). +- `organization`: Optional organization name if applicable. +- `attrs`: Optional mapping of attributes to initialize the artifact collection. If not provided, the object will load its attributes from W&B upon initialization. @@ -98,8 +99,8 @@ Get all artifacts in the collection. ##### Arguments -- **per_page**: The number of artifacts to fetch per page. -- **start**: Pagination cursor for resuming a past query, captured from a previous paginator's `.cursor` attribute. +- `per_page`: The number of artifacts to fetch per page. +- `start`: Pagination cursor for resuming a past query, captured from a previous paginator's `.cursor` attribute. @@ -115,7 +116,7 @@ Deprecated, change type directly with `save` instead. ##### Arguments -- **new_type**: +- `new_type`: diff --git a/models/ref/python/public-api/artifactcollections.mdx b/models/ref/python/public-api/artifactcollections.mdx index 60d54dd3eb..90f62af1c2 100644 --- a/models/ref/python/public-api/artifactcollections.mdx +++ b/models/ref/python/public-api/artifactcollections.mdx @@ -11,6 +11,7 @@ import { GitHubLink } from '/snippets/_includes/github-source-link.mdx'; +## class ArtifactCollections ```python (service_api: 'ServiceApi', entity: 'str', @@ -30,14 +31,14 @@ Artifact collections of a specific type in a project. ## Args -- **service_api**: Interface to the wandb-core service that performs W&B API calls for this collection. -- **entity**: The entity (user or team) that owns the project. -- **project**: The name of the project to query for artifact collections. -- **type_name**: The name of the artifact type for which to fetch collections. -- **filters**: Optional mapping of filters to apply to the query. -- **order**: Optional string to specify the order of the results. If prefixed with '+', sorts ascending (default). If prefixed with '-', sorts descending. -- **per_page**: The number of artifact collections to fetch per page. Default is 50. -- **start**: +- `service_api`: Interface to the wandb-core service that performs W&B API calls for this collection. +- `entity`: The entity (user or team) that owns the project. +- `project`: The name of the project to query for artifact collections. +- `type_name`: The name of the artifact type for which to fetch collections. +- `filters`: Optional mapping of filters to apply to the query. +- `order`: Optional string to specify the order of the results. If prefixed with '+', sorts ascending (default). If prefixed with '-', sorts descending. +- `per_page`: The number of artifact collections to fetch per page. Default is 50. +- `start`: diff --git a/models/ref/python/public-api/artifactfiles.mdx b/models/ref/python/public-api/artifactfiles.mdx index 3614fd462b..a6427e0303 100644 --- a/models/ref/python/public-api/artifactfiles.mdx +++ b/models/ref/python/public-api/artifactfiles.mdx @@ -11,6 +11,7 @@ import { GitHubLink } from '/snippets/_includes/github-source-link.mdx'; +## class ArtifactFiles ```python (service_api: 'ServiceApi', artifact: 'Artifact', @@ -29,11 +30,11 @@ A paginator for files in an artifact. ## Args -- **service_api**: -- **artifact**: -- **names**: -- **per_page**: -- **start**: +- `service_api`: +- `artifact`: +- `names`: +- `per_page`: +- `start`: diff --git a/models/ref/python/public-api/artifacts.mdx b/models/ref/python/public-api/artifacts.mdx index 0a545bc702..718fdc7b74 100644 --- a/models/ref/python/public-api/artifacts.mdx +++ b/models/ref/python/public-api/artifacts.mdx @@ -11,6 +11,7 @@ import { GitHubLink } from '/snippets/_includes/github-source-link.mdx'; +## class Artifacts ```python (service_api: 'ServiceApi', entity: 'str', @@ -34,16 +35,16 @@ Optionally pass in filters to narrow down the results based on specific criteria ## Args -- **service_api**: Interface to the wandb-core service that performs W&B API calls for these artifact versions. -- **entity**: The entity (user or team) that owns the project. -- **project**: The name of the project to query for artifacts. -- **collection_name**: The name of the artifact collection to query. -- **type**: The type of the artifacts to query. Common examples include "dataset" or "model". -- **filters**: Optional mapping of filters to apply to the query. -- **order**: Optional string to specify the order of the results. If prefixed with '+', sorts ascending (default). If prefixed with '-', sorts descending. -- **per_page**: The number of artifact versions to fetch per page. Default is 50. -- **tags**: Optional string or list of strings to filter artifacts by tags. -- **start**: +- `service_api`: Interface to the wandb-core service that performs W&B API calls for these artifact versions. +- `entity`: The entity (user or team) that owns the project. +- `project`: The name of the project to query for artifacts. +- `collection_name`: The name of the artifact collection to query. +- `type`: The type of the artifacts to query. Common examples include "dataset" or "model". +- `filters`: Optional mapping of filters to apply to the query. +- `order`: Optional string to specify the order of the results. If prefixed with '+', sorts ascending (default). If prefixed with '-', sorts descending. +- `per_page`: The number of artifact versions to fetch per page. Default is 50. +- `tags`: Optional string or list of strings to filter artifacts by tags. +- `start`: diff --git a/models/ref/python/public-api/artifacttype.mdx b/models/ref/python/public-api/artifacttype.mdx index f541105869..83a753af41 100644 --- a/models/ref/python/public-api/artifacttype.mdx +++ b/models/ref/python/public-api/artifacttype.mdx @@ -11,6 +11,7 @@ import { GitHubLink } from '/snippets/_includes/github-source-link.mdx'; +## class ArtifactType ```python (service_api: 'ServiceApi', entity: 'str', @@ -27,11 +28,11 @@ An artifact object that satisfies query based on the specified type. ## Args -- **service_api**: Interface to the wandb-core service that performs W&B API calls for this artifact type. -- **entity**: The entity (user or team) that owns the project. -- **project**: The name of the project to query for artifact types. -- **type_name**: The name of the artifact type. -- **attrs**: Optional attributes to initialize the ArtifactType. If omitted, the object will load its attributes from W&B upon initialization. +- `service_api`: Interface to the wandb-core service that performs W&B API calls for this artifact type. +- `entity`: The entity (user or team) that owns the project. +- `project`: The name of the project to query for artifact types. +- `type_name`: The name of the artifact type. +- `attrs`: Optional attributes to initialize the ArtifactType. If omitted, the object will load its attributes from W&B upon initialization. @@ -61,7 +62,7 @@ Get a specific artifact collection by name. ##### Arguments -- **name**: The name of the artifact collection to retrieve. +- `name`: The name of the artifact collection to retrieve. @@ -80,10 +81,10 @@ Get all artifact collections associated with this artifact type. ##### Arguments -- **filters**: Optional mapping of filters to apply to the query. -- **order**: Optional string to specify the order of the results. If prefixed with '+', sorts ascending (default). If prefixed with '-', sorts descending. The default order is the collection ID in descending order. -- **per_page**: The number of artifact collections to fetch per page. Default is 50. -- **start**: Pagination cursor for resuming a past query, captured from a previous paginator's `.cursor` attribute. +- `filters`: Optional mapping of filters to apply to the query. +- `order`: Optional string to specify the order of the results. If prefixed with '+', sorts ascending (default). If prefixed with '-', sorts descending. The default order is the collection ID in descending order. +- `per_page`: The number of artifact collections to fetch per page. Default is 50. +- `start`: Pagination cursor for resuming a past query, captured from a previous paginator's `.cursor` attribute. diff --git a/models/ref/python/public-api/artifacttypes.mdx b/models/ref/python/public-api/artifacttypes.mdx index e23503acbd..68825a0002 100644 --- a/models/ref/python/public-api/artifacttypes.mdx +++ b/models/ref/python/public-api/artifacttypes.mdx @@ -11,6 +11,7 @@ import { GitHubLink } from '/snippets/_includes/github-source-link.mdx'; +## class ArtifactTypes ```python (service_api: 'ServiceApi', entity: 'str', @@ -29,11 +30,11 @@ An lazy iterator of `ArtifactType` objects for a specific project. ## Args -- **service_api**: -- **entity**: -- **project**: -- **per_page**: -- **start**: +- `service_api`: +- `entity`: +- `project`: +- `per_page`: +- `start`: diff --git a/models/ref/python/public-api/automations.mdx b/models/ref/python/public-api/automations.mdx index 63a6ec3b30..b54f34adc0 100644 --- a/models/ref/python/public-api/automations.mdx +++ b/models/ref/python/public-api/automations.mdx @@ -11,6 +11,7 @@ import { GitHubLink } from '/snippets/_includes/github-source-link.mdx'; +## class Automations ```python (service_api: 'ServiceApi', variables: 'Mapping[str, Any]', @@ -33,15 +34,15 @@ A lazy iterator of `Automation` objects. ## Args -- **service_api**: -- **variables**: -- **per_page**: -- **start**: -- **_query**: -- **omit_variables**: -- **omit_fragments**: -- **omit_fields**: -- **rename_fields**: +- `service_api`: +- `variables`: +- `per_page`: +- `start`: +- `_query`: +- `omit_variables`: +- `omit_fragments`: +- `omit_fields`: +- `rename_fields`: diff --git a/models/ref/python/public-api/betareport.mdx b/models/ref/python/public-api/betareport.mdx index b6c2d48f89..f150e414e4 100644 --- a/models/ref/python/public-api/betareport.mdx +++ b/models/ref/python/public-api/betareport.mdx @@ -11,6 +11,7 @@ import { GitHubLink } from '/snippets/_includes/github-source-link.mdx'; +## class BetaReport ```python (service_api: 'ServiceApi', attrs: 'dict', @@ -42,10 +43,10 @@ Attributes: ## Args -- **service_api**: -- **attrs**: -- **entity**: -- **project**: +- `service_api`: +- `attrs`: +- `entity`: +- `project`: @@ -109,9 +110,9 @@ Get runs associated with a section of the report. ##### Arguments -- **section**: -- **per_page**: -- **only_selected**: +- `section`: +- `per_page`: +- `only_selected`: @@ -128,8 +129,8 @@ Generate HTML containing an iframe displaying this report. ##### Arguments -- **height**: -- **hidden**: +- `height`: +- `hidden`: diff --git a/models/ref/python/public-api/downloadhistoryresult.mdx b/models/ref/python/public-api/downloadhistoryresult.mdx index bb7b87510a..34577b302c 100644 --- a/models/ref/python/public-api/downloadhistoryresult.mdx +++ b/models/ref/python/public-api/downloadhistoryresult.mdx @@ -11,6 +11,7 @@ import { GitHubLink } from '/snippets/_includes/github-source-link.mdx'; +## class DownloadHistoryResult ```python paths: 'list[pathlib.Path]', contains_live_data: 'bool', @@ -32,9 +33,9 @@ Attributes: ## Args -- **paths**: -- **contains_live_data**: -- **errors**: +- `paths`: +- `contains_live_data`: +- `errors`: diff --git a/models/ref/python/public-api/file.mdx b/models/ref/python/public-api/file.mdx index 7c5e362607..41652320a8 100644 --- a/models/ref/python/public-api/file.mdx +++ b/models/ref/python/public-api/file.mdx @@ -11,6 +11,7 @@ import { GitHubLink } from '/snippets/_includes/github-source-link.mdx'; +## class File ```python (service_api: 'ServiceApi', attrs: 'dict[str, Any]', @@ -44,9 +45,9 @@ file logged to a specific run. You can search using the following keys: ## Args -- **service_api**: The service API instance to use for querying W&B. -- **attrs**: A dictionary of attributes that define the file -- **run**: The run object that contains the file +- `service_api`: The service API instance to use for querying W&B. +- `attrs`: A dictionary of attributes that define the file +- `run`: The run object that contains the file @@ -91,10 +92,10 @@ Downloads a file previously saved by a run from the wandb server. ##### Arguments -- **root**: Local directory to save the file. Defaults to the current working directory ("."). -- **replace**: If `True`, download will overwrite a local file if it exists. Defaults to `False`. -- **exist_ok**: If `True`, will not raise ValueError if file already exists and will not re-download unless replace=True. Defaults to `False`. -- **api**: If specified, the `Api` instance used to download the file. +- `root`: Local directory to save the file. Defaults to the current working directory ("."). +- `replace`: If `True`, download will overwrite a local file if it exists. Defaults to `False`. +- `exist_ok`: If `True`, will not raise ValueError if file already exists and will not re-download unless replace=True. Defaults to `False`. +- `api`: If specified, the `Api` instance used to download the file. diff --git a/models/ref/python/public-api/files.mdx b/models/ref/python/public-api/files.mdx index a4ea9c5a40..7ad667e093 100644 --- a/models/ref/python/public-api/files.mdx +++ b/models/ref/python/public-api/files.mdx @@ -11,6 +11,7 @@ import { GitHubLink } from '/snippets/_includes/github-source-link.mdx'; +## class Files ```python (service_api: 'ServiceApi', run: 'Run', @@ -31,12 +32,12 @@ automatically when iterating through large collections of files. ## Args -- **service_api**: -- **run**: -- **names**: -- **per_page**: -- **upload**: -- **pattern**: +- `service_api`: +- `run`: +- `names`: +- `per_page`: +- `upload`: +- `pattern`: ## Examples diff --git a/models/ref/python/public-api/incompleterunhistoryerror.mdx b/models/ref/python/public-api/incompleterunhistoryerror.mdx index ec8b02c1b1..dee5d369cf 100644 --- a/models/ref/python/public-api/incompleterunhistoryerror.mdx +++ b/models/ref/python/public-api/incompleterunhistoryerror.mdx @@ -11,6 +11,7 @@ import { GitHubLink } from '/snippets/_includes/github-source-link.mdx'; +## class IncompleteRunHistoryError ## Description diff --git a/models/ref/python/public-api/member.mdx b/models/ref/python/public-api/member.mdx index b924c40da3..389f3a8878 100644 --- a/models/ref/python/public-api/member.mdx +++ b/models/ref/python/public-api/member.mdx @@ -11,6 +11,7 @@ import { GitHubLink } from '/snippets/_includes/github-source-link.mdx'; +## class Member ```python (service_api: 'ServiceApi', team: 'str', @@ -25,9 +26,9 @@ A member of a team. ## Args -- **service_api**: The service API instance to use for querying W&B. -- **team**: The name of the team this member belongs to -- **attrs**: The member attributes +- `service_api`: The service API instance to use for querying W&B. +- `team`: The name of the team this member belongs to +- `attrs`: The member attributes diff --git a/models/ref/python/public-api/project.mdx b/models/ref/python/public-api/project.mdx index 9f35e66459..6df36bc6e1 100644 --- a/models/ref/python/public-api/project.mdx +++ b/models/ref/python/public-api/project.mdx @@ -11,6 +11,7 @@ import { GitHubLink } from '/snippets/_includes/github-source-link.mdx'; +## class Project ```python service_api: 'ServiceApi', entity: 'str', @@ -26,10 +27,10 @@ A project is a namespace for runs. ## Args -- **service_api**: Interface to the wandb-core service that performs W&B API calls for this project. -- **entity**: The entity name that owns the project. -- **project**: -- **attrs**: +- `service_api`: Interface to the wandb-core service that performs W&B API calls for this project. +- `entity`: The entity name that owns the project. +- `project`: +- `attrs`: @@ -68,7 +69,7 @@ Returns all artifact types associated with this project. ##### Arguments -- **per_page**: +- `per_page`: @@ -86,9 +87,9 @@ Returns all artifact collections associated with this project. ##### Arguments -- **filters**: Optional mapping of filters to apply to the query. -- **order**: Optional string to specify the order of the results. If you prepend order with a + order is ascending (default). If you prepend order with a - order is descending. -- **per_page**: The number of artifact collections to fetch per page. Default is 50. +- `filters`: Optional mapping of filters to apply to the query. +- `order`: Optional string to specify the order of the results. If you prepend order with a + order is ascending (default). If you prepend order with a - order is descending. +- `per_page`: The number of artifact collections to fetch per page. Default is 50. @@ -104,7 +105,7 @@ Return a paginated collection of sweeps in this project. ##### Arguments -- **per_page**: The number of sweeps to fetch per request to the API. +- `per_page`: The number of sweeps to fetch per request to the API. diff --git a/models/ref/python/public-api/projectartifactcollections.mdx b/models/ref/python/public-api/projectartifactcollections.mdx index a0520912dd..a4d91f0242 100644 --- a/models/ref/python/public-api/projectartifactcollections.mdx +++ b/models/ref/python/public-api/projectartifactcollections.mdx @@ -11,6 +11,7 @@ import { GitHubLink } from '/snippets/_includes/github-source-link.mdx'; +## class ProjectArtifactCollections ```python (service_api: 'ServiceApi', entity: 'str', @@ -29,13 +30,13 @@ Artifact collections in a project. ## Args -- **service_api**: Interface to the wandb-core service that performs W&B API calls for this collection. -- **entity**: The entity (user or team) that owns the project. -- **project**: The name of the project to query for artifact collections. -- **filters**: Optional mapping of filters to apply to the query. -- **order**: Optional string to specify the order of the results. If prefixed with '+', sorts ascending (default). If prefixed with '-', sorts descending. -- **per_page**: The number of artifact collections to fetch per page. Default is 50. -- **start**: +- `service_api`: Interface to the wandb-core service that performs W&B API calls for this collection. +- `entity`: The entity (user or team) that owns the project. +- `project`: The name of the project to query for artifact collections. +- `filters`: Optional mapping of filters to apply to the query. +- `order`: Optional string to specify the order of the results. If prefixed with '+', sorts ascending (default). If prefixed with '-', sorts descending. +- `per_page`: The number of artifact collections to fetch per page. Default is 50. +- `start`: diff --git a/models/ref/python/public-api/projects.mdx b/models/ref/python/public-api/projects.mdx index e45c111cca..b002fdc01c 100644 --- a/models/ref/python/public-api/projects.mdx +++ b/models/ref/python/public-api/projects.mdx @@ -11,6 +11,7 @@ import { GitHubLink } from '/snippets/_includes/github-source-link.mdx'; +## class Projects ```python service_api: 'ServiceApi', entity: 'str', @@ -27,9 +28,9 @@ An iterable interface to access projects created and saved by the entity. ## Args -- **service_api**: Interface to the wandb-core service that performs W&B API calls for this collection. -- **entity**: The entity name (username or team) to fetch projects for. -- **per_page**: Number of projects to fetch per request (default is 50). +- `service_api`: Interface to the wandb-core service that performs W&B API calls for this collection. +- `entity`: The entity name (username or team) to fetch projects for. +- `per_page`: Number of projects to fetch per request (default is 50). ## Examples diff --git a/models/ref/python/public-api/registry.mdx b/models/ref/python/public-api/registry.mdx index e7510981ad..11f6d406ab 100644 --- a/models/ref/python/public-api/registry.mdx +++ b/models/ref/python/public-api/registry.mdx @@ -11,6 +11,7 @@ import { GitHubLink } from '/snippets/_includes/github-source-link.mdx'; +## class Registry ```python (service_api: 'ServiceApi', organization: 'str', @@ -27,11 +28,11 @@ A single registry in the Registry. ## Args -- **service_api**: -- **organization**: -- **entity**: -- **name**: -- **attrs**: +- `service_api`: +- `organization`: +- `entity`: +- `name`: +- `attrs`: @@ -111,13 +112,13 @@ Adds users or teams to this registry. ##### Arguments -- **members**: The users or teams to add to the registry. Accepts `User` objects, `Team` objects, or their string IDs. +- `members`: The users or teams to add to the registry. Accepts `User` objects, `Team` objects, or their string IDs. ##### Raises -- **TypeError**: If no members are passed as arguments. -- **ValueError**: If unable to infer or parse the user or team IDs. +- `TypeError`: If no members are passed as arguments. +- `ValueError`: If unable to infer or parse the user or team IDs. ##### Examples @@ -152,10 +153,10 @@ Returns the collections belonging to this registry. ##### Arguments -- **filter**: Optional mapping of filters to apply to the collections query. -- **order**: Optional string to specify the order of the results. If prefixed with '+', sorts ascending (default). If prefixed with '-', sorts descending. -- **per_page**: The number of results to fetch per page. Usually there is no reason to change this. -- **start**: Pagination cursor for resuming a past query, captured from a previous paginator's `.cursor` attribute. +- `filter`: Optional mapping of filters to apply to the collections query. +- `order`: Optional string to specify the order of the results. If prefixed with '+', sorts ascending (default). If prefixed with '-', sorts descending. +- `per_page`: The number of results to fetch per page. Usually there is no reason to change this. +- `start`: Pagination cursor for resuming a past query, captured from a previous paginator's `.cursor` attribute. @@ -178,17 +179,17 @@ This function should be called using `api.create_registry()` ##### Arguments -- **api**: The W&B API instance. -- **organization**: The name of the organization. -- **name**: The name of the registry (without the `wandb-registry-` prefix). -- **visibility**: The visibility level ('organization' or 'restricted'). -- **description**: An optional description for the registry. -- **artifact_types**: An optional list of allowed artifact types. +- `api`: The W&B API instance. +- `organization`: The name of the organization. +- `name`: The name of the registry (without the `wandb-registry-` prefix). +- `visibility`: The visibility level ('organization' or 'restricted'). +- `description`: An optional description for the registry. +- `artifact_types`: An optional list of allowed artifact types. ##### Raises -- **ValueError**: If a registry with the same name already exists in the organization or if the creation fails. +- `ValueError`: If a registry with the same name already exists in the organization or if the creation fails. ### method delete @@ -237,13 +238,13 @@ Removes users or teams from this registry. ##### Arguments -- **members**: The users or teams to remove from the registry. Accepts `User` objects, `Team` objects, or their string IDs. +- `members`: The users or teams to remove from the registry. Accepts `User` objects, `Team` objects, or their string IDs. ##### Raises -- **TypeError**: If no members are passed as arguments. -- **ValueError**: If unable to infer or parse the user or team IDs. +- `TypeError`: If no members are passed as arguments. +- `ValueError`: If unable to infer or parse the user or team IDs. ##### Examples @@ -300,13 +301,13 @@ Updates the role of a member (user or team) within this registry. ##### Arguments -- **member**: The user or team to update the role of. Accepts a `User` object, `Team` object, or their string ID. -- **role**: The new role to assign to the member. May be one of: - "admin" - "member" - "viewer" - "restricted_viewer" (if supported by the W&B server) +- `member`: The user or team to update the role of. Accepts a `User` object, `Team` object, or their string ID. +- `role`: The new role to assign to the member. May be one of: - "admin" - "member" - "viewer" - "restricted_viewer" (if supported by the W&B server) ##### Raises -- **ValueError**: If unable to infer the user or team ID. +- `ValueError`: If unable to infer the user or team ID. ##### Examples @@ -349,9 +350,9 @@ Returns the artifact versions belonging to this registry. ##### Arguments -- **filter**: Optional mapping of filters to apply to the artifact versions query. -- **per_page**: The number of results to fetch per page. Usually there is no reason to change this. -- **start**: Pagination cursor for resuming a past query, captured from a previous paginator's `.cursor` attribute. +- `filter`: Optional mapping of filters to apply to the artifact versions query. +- `per_page`: The number of results to fetch per page. Usually there is no reason to change this. +- `start`: Pagination cursor for resuming a past query, captured from a previous paginator's `.cursor` attribute. diff --git a/models/ref/python/public-api/reports.mdx b/models/ref/python/public-api/reports.mdx index 87e64087ca..2f5108a17e 100644 --- a/models/ref/python/public-api/reports.mdx +++ b/models/ref/python/public-api/reports.mdx @@ -11,6 +11,7 @@ import { GitHubLink } from '/snippets/_includes/github-source-link.mdx'; +## class Reports ```python (service_api: 'ServiceApi', project: 'Project', @@ -27,11 +28,11 @@ Reports is a lazy iterator of `BetaReport` objects. ## Args -- **service_api**: Interface to the wandb-core service that performs W&B API calls for this collection. -- **project**: The project to fetch reports from. -- **name**: The name of the report to filter by. If `None`, fetches all reports. -- **entity**: The entity name for the project. Defaults to the project entity. -- **per_page**: Number of reports to fetch per page (default is 50). +- `service_api`: Interface to the wandb-core service that performs W&B API calls for this collection. +- `project`: The project to fetch reports from. +- `name`: The name of the report to filter by. If `None`, fetches all reports. +- `entity`: The entity name for the project. Defaults to the project entity. +- `per_page`: Number of reports to fetch per page (default is 50). diff --git a/models/ref/python/public-api/run.mdx b/models/ref/python/public-api/run.mdx index 1bf8b258de..db977ea359 100644 --- a/models/ref/python/public-api/run.mdx +++ b/models/ref/python/public-api/run.mdx @@ -11,6 +11,7 @@ import { GitHubLink } from '/snippets/_includes/github-source-link.mdx'; +## class Run ```python (service_api: 'ServiceApi', entity: 'str', @@ -30,14 +31,14 @@ A single run associated with an entity and project. ## Args -- **service_api**: Interface to the wandb-core service that performs W&B API calls for this run. -- **entity**: the name of the entity associated with the run -- **project**: the project associated with the run -- **run_id**: The unique identifier for the run. -- **attrs**: The attributes of the run. -- **include_sweeps**: Whether to include sweeps in the run. -- **lazy**: -- **api_key**: +- `service_api`: Interface to the wandb-core service that performs W&B API calls for this run. +- `entity`: the name of the entity associated with the run +- `project`: the project associated with the run +- `run_id`: The unique identifier for the run. +- `attrs`: The attributes of the run. +- `include_sweeps`: Whether to include sweeps in the run. +- `lazy`: +- `api_key`: @@ -148,11 +149,11 @@ use_cache: 'bool' = True ##### Arguments -- **keys**: -- **page_size**: -- **min_step**: -- **max_step**: -- **use_cache**: +- `keys`: +- `page_size`: +- `min_step`: +- `max_step`: +- `use_cache`: @@ -181,11 +182,11 @@ Runs created with this method have limited functionality. Calling ##### Arguments -- **api**: The W&B API instance. -- **run_id**: Optional run ID. If not provided, a random ID will be generated. -- **project**: Optional project name. Defaults to the project in API settings or "uncategorized". -- **entity**: Optional entity (user or team) name. -- **state**: Initial state of the run. Use "pending" for runs that will be resumed later, or "running" for immediate execution. +- `api`: The W&B API instance. +- `run_id`: Optional run ID. If not provided, a random ID will be generated. +- `project`: Optional project name. Defaults to the project in API settings or "uncategorized". +- `entity`: Optional entity (user or team) name. +- `state`: Initial state of the run. Use "pending" for runs that will be resumed later, or "running" for immediate execution. @@ -221,7 +222,7 @@ Delete the given run from the wandb backend. ##### Arguments -- **delete_artifacts**: Whether to delete the artifacts associated with the run. +- `delete_artifacts`: Whether to delete the artifacts associated with the run. @@ -238,14 +239,14 @@ Download any parquet history files for the run to the provided directory. ##### Arguments -- **download_dir**: The directory to download the history files to. -- **require_complete_history**: Whether to require the complete history to be downloaded. If true, and the run contains data that has not been exported to parquet files yet, an IncompleteRunHistoryError will be raised. +- `download_dir`: The directory to download the history files to. +- `require_complete_history`: Whether to require the complete history to be downloaded. If true, and the run contains data that has not been exported to parquet files yet, an IncompleteRunHistoryError will be raised. ##### Raises -- **IncompleteRunHistoryError**: If require_complete_history is True and the run contains data not yet exported to parquet files. -- **WandbApiFailedError**: If the API request fails for reasons other than incomplete history. +- `IncompleteRunHistoryError`: If require_complete_history is True and the run contains data not yet exported to parquet files. +- `WandbApiFailedError`: If the API request fails for reasons other than incomplete history. ### method file @@ -259,7 +260,7 @@ Return the path of a file with a given name in the artifact. ##### Arguments -- **name**: name of requested file. +- `name`: name of requested file. @@ -280,9 +281,9 @@ If both are provided, the pattern will be ignored. ##### Arguments -- **names**: names of the requested files, if empty returns all files -- **pattern**: Pattern to match when returning files from W&B. This pattern uses mySQL's LIKE syntax, so matching all files that end with .json would be "%.json". If both names and pattern are provided, a ValueError will be raised. -- **per_page**: number of results per page. +- `names`: names of the requested files, if empty returns all files +- `pattern`: Pattern to match when returning files from W&B. This pattern uses mySQL's LIKE syntax, so matching all files that end with .json would be "%.json". If both names and pattern are provided, a ValueError will be raised. +- `per_page`: number of results per page. @@ -304,11 +305,11 @@ This is simpler and faster if you are ok with the history records being sampled. ##### Arguments -- **samples**: (int, optional) The number of samples to return -- **keys**: (list, optional) Only return metrics for specific keys -- **x_axis**: (str, optional) Use this metric as the xAxis defaults to _step -- **pandas**: (bool, optional) Return a pandas dataframe -- **stream**: (str, optional) "default" for metrics, "system" for machine metrics +- `samples`: (int, optional) The number of samples to return +- `keys`: (list, optional) Only return metrics for specific keys +- `x_axis`: (str, optional) Use this metric as the xAxis defaults to _step +- `pandas`: (bool, optional) Return a pandas dataframe +- `stream`: (str, optional) "default" for metrics, "system" for machine metrics @@ -324,7 +325,7 @@ Load run data using appropriate fragment based on lazy mode. ##### Arguments -- **force**: +- `force`: @@ -343,7 +344,7 @@ but need access to the full data for specific runs. ##### Arguments -- **force**: Force reload even if data is already loaded +- `force`: Force reload even if data is already loaded @@ -361,9 +362,9 @@ Declare an artifact as output of a run. ##### Arguments -- **artifact**: An artifact returned from `wandb.Api().artifact(name)`. -- **aliases**: Aliases to apply to this artifact. -- **tags**: (list, optional) Tags to apply to this artifact, if any. +- `artifact`: An artifact returned from `wandb.Api().artifact(name)`. +- `aliases`: Aliases to apply to this artifact. +- `tags`: (list, optional) Tags to apply to this artifact, if any. @@ -382,7 +383,7 @@ paginated result that can be iterated over or collected into a single list. ##### Arguments -- **per_page**: Number of artifacts to fetch per API request. +- `per_page`: Number of artifacts to fetch per API request. @@ -437,11 +438,11 @@ Returns an iterable collection of all history records for a run. ##### Arguments -- **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. +- `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. @@ -458,8 +459,8 @@ Generate HTML containing an iframe displaying this run. ##### Arguments -- **height**: -- **hidden**: +- `height`: +- `hidden`: @@ -497,12 +498,12 @@ See `Run.state` for the list of possible run states. ##### Arguments -- **state**: The target run state. One of `"pending"` or `"failed"`. +- `state`: The target run state. One of `"pending"` or `"failed"`. ##### Raises -- **`wandb.Error`**: If the requested state transition is not allowed, or the server does not support this operation. +- ``wandb.Error``: If the requested state transition is not allowed, or the server does not support this operation. ### method upload_file @@ -517,8 +518,8 @@ Upload a local file to W&B, associating it with this run. ##### Arguments -- **path**: Path to the file to upload. Can be absolute or relative. -- **root**: The root path to save the file relative to. For example, if you want to have the file saved in the run as "my_dir/file.txt" and you're currently in "my_dir" you would set root to "../". Defaults to current directory ("."). +- `path`: Path to the file to upload. Can be absolute or relative. +- `root`: The root path to save the file relative to. For example, if you want to have the file saved in the run as "my_dir/file.txt" and you're currently in "my_dir" you would set root to "../". Defaults to current directory ("."). @@ -535,8 +536,8 @@ Declare an artifact as an input to a run. ##### Arguments -- **artifact**: An artifact returned from `wandb.Api().artifact(name)` -- **use_as**: A string identifying how the artifact is used in the script. Used to easily differentiate artifacts used in a run, when using the beta wandb launch feature's artifact swapping functionality. +- `artifact`: An artifact returned from `wandb.Api().artifact(name)` +- `use_as`: A string identifying how the artifact is used in the script. Used to easily differentiate artifacts used in a run, when using the beta wandb launch feature's artifact swapping functionality. @@ -556,7 +557,7 @@ result that can be iterated over or collected into a single list. ##### Arguments -- **per_page**: Number of artifacts to fetch per API request. +- `per_page`: Number of artifacts to fetch per API request. diff --git a/models/ref/python/public-api/runartifacts.mdx b/models/ref/python/public-api/runartifacts.mdx index 5d4d696b7b..b426485a2a 100644 --- a/models/ref/python/public-api/runartifacts.mdx +++ b/models/ref/python/public-api/runartifacts.mdx @@ -11,6 +11,7 @@ import { GitHubLink } from '/snippets/_includes/github-source-link.mdx'; +## class RunArtifacts ```python (service_api: 'ServiceApi', run: 'Run', @@ -29,11 +30,11 @@ An iterable collection of artifacts associated with a specific run. ## Args -- **service_api**: -- **run**: -- **mode**: -- **per_page**: -- **start**: +- `service_api`: +- `run`: +- `mode`: +- `per_page`: +- `start`: diff --git a/models/ref/python/public-api/runs.mdx b/models/ref/python/public-api/runs.mdx index 636d90d631..d7f4e4d645 100644 --- a/models/ref/python/public-api/runs.mdx +++ b/models/ref/python/public-api/runs.mdx @@ -11,6 +11,7 @@ import { GitHubLink } from '/snippets/_includes/github-source-link.mdx'; +## class Runs ```python (service_api: 'ServiceApi', entity: 'str', @@ -35,15 +36,15 @@ This is generally used indirectly using the `Api.runs` namespace. ## Args -- **service_api**: The service API to use for requests. -- **entity**: The entity (username or team) that owns the project. -- **project**: The name of the project to fetch runs from. -- **filters**: Filters to apply to the runs query. -- **order**: Order can be `created_at`, `heartbeat_at`, `config.*.value`, or `summary_metrics.*`. If you prepend order with a + order is ascending (default). If you prepend order with a - order is descending. The default order is run.created_at from oldest to newest. -- **per_page**: The number of runs to fetch per request (default is 50). -- **include_sweeps**: Whether to include sweep information in the runs. Defaults to True. -- **lazy**: -- **api_key**: +- `service_api`: The service API to use for requests. +- `entity`: The entity (username or team) that owns the project. +- `project`: The name of the project to fetch runs from. +- `filters`: Filters to apply to the runs query. +- `order`: Order can be `created_at`, `heartbeat_at`, `config.*.value`, or `summary_metrics.*`. If you prepend order with a + order is ascending (default). If you prepend order with a - order is descending. The default order is run.created_at from oldest to newest. +- `per_page`: The number of runs to fetch per request (default is 50). +- `include_sweeps`: Whether to include sweep information in the runs. Defaults to True. +- `lazy`: +- `api_key`: @@ -67,11 +68,11 @@ Return sampled history metrics for all runs that fit the filters conditions. ##### Arguments -- **samples**: The number of samples to return per run -- **keys**: Only return metrics for specific keys -- **x_axis**: Use this metric as the xAxis defaults to _step -- **format**: Format to return data in, options are "default", "pandas", "polars" -- **stream**: "default" for metrics, "system" for machine metrics +- `samples`: The number of samples to return per run +- `keys`: Only return metrics for specific keys +- `x_axis`: Use this metric as the xAxis defaults to _step +- `format`: Format to return data in, options are "default", "pandas", "polars" +- `stream`: "default" for metrics, "system" for machine metrics diff --git a/models/ref/python/public-api/sweep.mdx b/models/ref/python/public-api/sweep.mdx index 20ec11bd65..38aaeffc69 100644 --- a/models/ref/python/public-api/sweep.mdx +++ b/models/ref/python/public-api/sweep.mdx @@ -11,6 +11,7 @@ import { GitHubLink } from '/snippets/_includes/github-source-link.mdx'; +## class Sweep ```python (service_api: 'ServiceApi', entity: 'str', @@ -36,11 +37,11 @@ Attributes: ## Args -- **service_api**: -- **entity**: -- **project**: -- **sweep_id**: -- **attrs**: +- `service_api`: +- `entity`: +- `project`: +- `sweep_id`: +- `attrs`: @@ -107,7 +108,7 @@ Query an agent by ID for this sweep. ##### Arguments -- **agent_id**: The ID of the agent to look up. +- `agent_id`: The ID of the agent to look up. @@ -134,7 +135,7 @@ Return the best run sorted by the metric defined in config or the order passed i ##### Arguments -- **order**: +- `order`: @@ -154,13 +155,13 @@ Execute a query against the cloud backend. ##### Arguments -- **api**: The W&B API instance. -- **entity**: The entity (username or team) that owns the project. -- **project**: The name of the project to fetch sweep from. -- **sid**: The sweep ID to query. -- **order**: The order in which the sweep's runs are returned. -- **query**: The query to use to execute the query. -- **kwargs**: +- `api`: The W&B API instance. +- `entity`: The entity (username or team) that owns the project. +- `project`: The name of the project to fetch sweep from. +- `sid`: The sweep ID to query. +- `order`: The order in which the sweep's runs are returned. +- `query`: The query to use to execute the query. +- `kwargs`: @@ -177,8 +178,8 @@ Generate HTML containing an iframe displaying this sweep. ##### Arguments -- **height**: -- **hidden**: +- `height`: +- `hidden`: diff --git a/models/ref/python/public-api/sweeps.mdx b/models/ref/python/public-api/sweeps.mdx index 30be4de65d..b42e2b2d7a 100644 --- a/models/ref/python/public-api/sweeps.mdx +++ b/models/ref/python/public-api/sweeps.mdx @@ -11,6 +11,7 @@ import { GitHubLink } from '/snippets/_includes/github-source-link.mdx'; +## class Sweeps ```python service_api: 'ServiceApi', entity: 'str', @@ -26,10 +27,10 @@ A lazy iterator over a collection of `Sweep` objects. ## Args -- **service_api**: -- **entity**: -- **project**: -- **per_page**: +- `service_api`: +- `entity`: +- `project`: +- `per_page`: ## Examples diff --git a/models/ref/python/public-api/team.mdx b/models/ref/python/public-api/team.mdx index 5e79460b82..c2136d2565 100644 --- a/models/ref/python/public-api/team.mdx +++ b/models/ref/python/public-api/team.mdx @@ -11,6 +11,7 @@ import { GitHubLink } from '/snippets/_includes/github-source-link.mdx'; +## class Team ```python (service_api: 'ServiceApi', name: 'str', @@ -29,9 +30,9 @@ to handle team attributes. ## Args -- **service_api**: The service API instance to use for querying W&B. -- **name**: The name of the team -- **attrs**: Optional dictionary of team attributes +- `service_api`: The service API instance to use for querying W&B. +- `name`: The name of the team +- `attrs`: Optional dictionary of team attributes @@ -52,9 +53,9 @@ Create a new team. ##### Arguments -- **api**: (`Api`) The api instance to use -- **team**: (str) The name of the team -- **admin_username**: (str) optional username of the admin user of the team, defaults to the current user. +- `api`: (`Api`) The api instance to use +- `team`: (str) The name of the team +- `admin_username`: (str) optional username of the admin user of the team, defaults to the current user. @@ -70,7 +71,7 @@ Create a service account for the team. ##### Arguments -- **description**: (str) A description for this service account +- `description`: (str) A description for this service account @@ -87,8 +88,8 @@ Invite a user to a team. ##### Arguments -- **username_or_email**: (str) The username or email address of the user you want to invite. -- **admin**: (bool) Whether to make this user a team admin. Defaults to `False`. +- `username_or_email`: (str) The username or email address of the user you want to invite. +- `admin`: (bool) Whether to make this user a team admin. Defaults to `False`. diff --git a/models/ref/python/public-api/user.mdx b/models/ref/python/public-api/user.mdx index 8b81c2a4d3..47df6050e5 100644 --- a/models/ref/python/public-api/user.mdx +++ b/models/ref/python/public-api/user.mdx @@ -11,6 +11,7 @@ import { GitHubLink } from '/snippets/_includes/github-source-link.mdx'; +## class User ```python (service_api: 'ServiceApi', attrs: 'MutableMapping[str, Any]', @@ -29,9 +30,9 @@ user. ## Args -- **service_api**: The service API instance to use for querying W&B. -- **attrs**: A subset of the User type in the GraphQL schema. -- **api_key**: +- `service_api`: The service API instance to use for querying W&B. +- `attrs`: A subset of the User type in the GraphQL schema. +- `api_key`: @@ -79,9 +80,9 @@ This is an internal method. Use the `create_user()` method of ##### Arguments -- **api**: The API instance to use to create the user. -- **email**: The email for the user. -- **admin**: Whether this user should be a global instance admin. +- `api`: The API instance to use to create the user. +- `email`: The email for the user. +- `admin`: Whether this user should be a global instance admin. @@ -99,7 +100,7 @@ Only the owner of the key or an admin can delete it. ##### Arguments -- **api_key**: The name of the API key to delete. Use one of the names returned by the `api_keys` property. +- `api_key`: The name of the API key to delete. Use one of the names returned by the `api_keys` property. @@ -115,7 +116,7 @@ Generate a new API key. ##### Arguments -- **description**: A description for the new API key. This can be used to identify the purpose of the API key. +- `description`: A description for the new API key. This can be used to identify the purpose of the API key. From 59c5a6b7b3d6088f1def0ee84d8f30632964d153 Mon Sep 17 00:00:00 2001 From: Noah Luna <15202580+ngrayluna@users.noreply.github.com> Date: Wed, 24 Jun 2026 14:41:18 -0700 Subject: [PATCH 4/9] remove pydantic, attrs --- models/ref/python/automations/automation.mdx | 463 --------------- models/ref/python/automations/donothing.mdx | 463 --------------- .../python/automations/metricchangefilter.mdx | 463 --------------- .../automations/metricthresholdfilter.mdx | 463 --------------- .../python/automations/metriczscorefilter.mdx | 463 --------------- .../ref/python/automations/newautomation.mdx | 463 --------------- .../python/automations/onaddartifactalias.mdx | 463 --------------- .../python/automations/onaddartifacttag.mdx | 463 --------------- .../python/automations/onaddcollectiontag.mdx | 463 --------------- .../python/automations/oncreateartifact.mdx | 463 --------------- .../ref/python/automations/onlinkartifact.mdx | 463 --------------- .../automations/onremoveartifacttag.mdx | 463 --------------- .../automations/onremovecollectiontag.mdx | 463 --------------- models/ref/python/automations/onrunmetric.mdx | 463 --------------- models/ref/python/automations/onrunstate.mdx | 463 --------------- .../python/automations/onunlinkartifact.mdx | 463 --------------- .../ref/python/automations/runstatefilter.mdx | 463 --------------- .../python/automations/sendnotification.mdx | 463 --------------- models/ref/python/automations/sendwebhook.mdx | 463 --------------- models/ref/python/data-types/audio.mdx | 102 ---- models/ref/python/data-types/evaltable.mdx | 117 ---- models/ref/python/data-types/histogram.mdx | 85 --- models/ref/python/data-types/html.mdx | 146 ----- models/ref/python/data-types/image.mdx | 107 ---- models/ref/python/data-types/molecule.mdx | 161 ------ models/ref/python/data-types/object3d.mdx | 161 ------ models/ref/python/data-types/plotly.mdx | 163 ------ models/ref/python/data-types/table.mdx | 117 ---- models/ref/python/data-types/video.mdx | 163 ------ models/ref/python/experiments/settings.mdx | 547 +----------------- 30 files changed, 1 insertion(+), 10665 deletions(-) diff --git a/models/ref/python/automations/automation.mdx b/models/ref/python/automations/automation.mdx index 5b54edc6bd..08532d8645 100644 --- a/models/ref/python/automations/automation.mdx +++ b/models/ref/python/automations/automation.mdx @@ -52,179 +52,6 @@ A local instance of a saved W&B automation that supports editing. ## Methods -### method construct - -```python -_fields_set: 'set[str] | None' = None, **values: 'Any' -``` - - - -##### Arguments - -- `_fields_set`: -- `values`: - - - - -### method copy - -```python -self, *, -include: 'AbstractSetIntStr | MappingIntStrAny | None' = None, -exclude: 'AbstractSetIntStr | MappingIntStrAny | None' = None, -update: 'Dict[str, Any] | None' = None, -deep: 'bool' = False -``` - -Returns a copy of the model. - -!!! warning "Deprecated" - This method is now deprecated; use `model_copy` instead. - -If you need `include` or `exclude`, use: - -```python {test="skip" lint="skip"} -data = self.model_dump(include=include, exclude=exclude, round_trip=True) -data = {**data, **(update or {})} -copied = self.model_validate(data) -``` - -##### Arguments - -- `include`: Optional set or mapping specifying which fields to include in the copied model. -- `exclude`: Optional set or mapping specifying which fields to exclude in the copied model. -- `update`: Optional dictionary of field-value pairs to override field values in the copied model. -- `deep`: If True, the values of fields that are Pydantic models will be deep-copied. - - - - -### method dict - -```python -self, *, -include: 'IncEx | None' = None, -exclude: 'IncEx | None' = None, -by_alias: 'bool' = False, -exclude_unset: 'bool' = False, -exclude_defaults: 'bool' = False, -exclude_none: 'bool' = False -``` - - - -##### Arguments - -- `include`: -- `exclude`: -- `by_alias`: -- `exclude_unset`: -- `exclude_defaults`: -- `exclude_none`: - - - - -### method from_orm - -```python -obj: 'Any' -``` - - - -##### Arguments - -- `obj`: - - - - -### method json - -```python -self, *, -include: 'IncEx | None' = None, -exclude: 'IncEx | None' = None, -by_alias: 'bool' = False, -exclude_unset: 'bool' = False, -exclude_defaults: 'bool' = False, -exclude_none: 'bool' = False, -encoder: 'Callable[[Any], Any] | None' = PydanticUndefined, -models_as_dict: 'bool' = PydanticUndefined, **dumps_kwargs: 'Any' -``` - - - -##### Arguments - -- `include`: -- `exclude`: -- `by_alias`: -- `exclude_unset`: -- `exclude_defaults`: -- `exclude_none`: -- `encoder`: -- `models_as_dict`: -- `dumps_kwargs`: - - - - -### method model_construct - -```python -_fields_set: 'set[str] | None' = None, **values: 'Any' -``` - -Creates a new instance of the `Model` class with validated data. - -Creates a new model setting `__dict__` and `__pydantic_fields_set__` from trusted or pre-validated data. -Default values are respected, but no other validation is performed. - -!!! note - `model_construct()` generally respects the `model_config.extra` setting on the provided model. - That is, if `model_config.extra == 'allow'`, then all extra passed values are added to the model instance's `__dict__` - and `__pydantic_extra__` fields. If `model_config.extra == 'ignore'` (the default), then all extra passed values are ignored. - Because no validation is performed with a call to `model_construct()`, having `model_config.extra == 'forbid'` does not result in - an error if extra values are passed, but they will be ignored. - -##### Arguments - -- `_fields_set`: A set of field names that were originally explicitly set during instantiation. If provided, this is directly used for the [`model_fields_set`][pydantic.BaseModel.model_fields_set] attribute. Otherwise, the field names from the `values` argument will be used. -- `values`: Trusted or pre-validated data dictionary. - - - - -### method model_copy - -```python -self, *, -update: 'Mapping[str, Any] | None' = None, -deep: 'bool' = False -``` - -!!! abstract "Usage Documentation" - [`model_copy`](../concepts/serialization.md#model_copy) - -Returns a copy of the model. - -!!! note - The underlying instance's [`__dict__`][object.__dict__] attribute is copied. This - might have unexpected side effects if you store anything in it, on top of the model - fields (e.g. the value of [cached properties][functools.cached_property]). - -##### Arguments - -- `update`: Values to change/add in the new model. Note: the data is not validated before creating the new model. You should trust this data. -- `deep`: Set to `True` to make a deep copy of the model. - - - - ### method model_dump ```python @@ -265,295 +92,5 @@ Generates a JSON representation of the model using Pydantic's `to_json` method. -### method model_json_schema - -```python -by_alias: 'bool' = True, -ref_template: 'str' = '#/$defs/{model}', -schema_generator: 'type[GenerateJsonSchema]' = , -mode: 'JsonSchemaMode' = 'validation' -``` - -Generates a JSON schema for a model class. - -##### Arguments - -- `by_alias`: Whether to use attribute aliases or not. -- `ref_template`: The reference template. -- `schema_generator`: To override the logic used to generate the JSON schema, as a subclass of `GenerateJsonSchema` with your desired modifications -- `mode`: The mode in which to generate the schema. - - - - -### method model_parametrized_name - -```python -params: 'tuple[type[Any], ...]' -``` - -Compute the class name for parametrizations of generic classes. - -This method can be overridden to achieve a custom naming scheme for generic BaseModels. - -##### Arguments - -- `params`: Tuple of types of the class. Given a generic class `Model` with 2 type variables and a concrete model `Model[str, int]`, the value `(str, int)` would be passed to `params`. - - -##### Raises - -- `TypeError`: Raised when trying to generate concrete names for non-generic models. - - -### method model_post_init - -```python -self, -context: 'Any', / -``` - -Override this method to perform additional initialization after `__init__` and `model_construct`. -This is useful if you want to do some validation that requires the entire model to be initialized. - -##### Arguments - -- `context`: - - - - -### method model_rebuild - -```python -*, -force: 'bool' = False, -raise_errors: 'bool' = True, -_parent_namespace_depth: 'int' = 2, -_types_namespace: 'MappingNamespace | None' = None -``` - -Try to rebuild the pydantic-core schema for the model. - -This may be necessary when one of the annotations is a ForwardRef which could not be resolved during -the initial attempt to build the schema, and automatic rebuilding fails. - -##### Arguments - -- `force`: Whether to force the rebuilding of the model schema, defaults to `False`. -- `raise_errors`: Whether to raise errors, defaults to `True`. -- `_parent_namespace_depth`: The depth level of the parent namespace, defaults to 2. -- `_types_namespace`: The types namespace, defaults to `None`. - - - - -### method model_validate - -```python -obj: 'Any', *, -strict: 'bool | None' = None, -from_attributes: 'bool | None' = None, -context: 'Any | None' = None, -by_alias: 'bool | None' = None, -by_name: 'bool | None' = None -``` - -Validate a pydantic model instance. - -##### Arguments - -- `obj`: The object to validate. -- `strict`: Whether to enforce types strictly. -- `from_attributes`: Whether to extract data from object attributes. -- `context`: Additional context to pass to the validator. -- `by_alias`: Whether to use the field's alias when validating against the provided input data. -- `by_name`: Whether to use the field's name when validating against the provided input data. - - -##### Raises - -- `ValidationError`: If the object could not be validated. - - -### method model_validate_json - -```python -json_data: 'str | bytes | bytearray', *, -strict: 'bool | None' = None, -context: 'Any | None' = None, -by_alias: 'bool | None' = None, -by_name: 'bool | None' = None -``` - -!!! abstract "Usage Documentation" - [JSON Parsing](../concepts/json.md#json-parsing) - -Validate the given JSON data against the Pydantic model. - -##### Arguments - -- `json_data`: The JSON data to validate. -- `strict`: Whether to enforce types strictly. -- `context`: Extra variables to pass to the validator. -- `by_alias`: Whether to use the field's alias when validating against the provided input data. -- `by_name`: Whether to use the field's name when validating against the provided input data. - - -##### Raises - -- `ValidationError`: If `json_data` is not a JSON string or the object could not be validated. - - -### method model_validate_strings - -```python -obj: 'Any', *, -strict: 'bool | None' = None, -context: 'Any | None' = None, -by_alias: 'bool | None' = None, -by_name: 'bool | None' = None -``` - -Validate the given object with string data against the Pydantic model. - -##### Arguments - -- `obj`: The object containing string data to validate. -- `strict`: Whether to enforce types strictly. -- `context`: Extra variables to pass to the validator. -- `by_alias`: Whether to use the field's alias when validating against the provided input data. -- `by_name`: Whether to use the field's name when validating against the provided input data. - - - - -### method parse_file - -```python -path: 'str | Path', *, -content_type: 'str | None' = None, -encoding: 'str' = 'utf8', -proto: 'DeprecatedParseProtocol | None' = None, -allow_pickle: 'bool' = False -``` - - - -##### Arguments - -- `path`: -- `content_type`: -- `encoding`: -- `proto`: -- `allow_pickle`: - - - - -### method parse_obj - -```python -obj: 'Any' -``` - - - -##### Arguments - -- `obj`: - - - - -### method parse_raw - -```python -b: 'str | bytes', *, -content_type: 'str | None' = None, -encoding: 'str' = 'utf8', -proto: 'DeprecatedParseProtocol | None' = None, -allow_pickle: 'bool' = False -``` - - - -##### Arguments - -- `b`: -- `content_type`: -- `encoding`: -- `proto`: -- `allow_pickle`: - - - - -### method schema - -```python -by_alias: 'bool' = True, -ref_template: 'str' = '#/$defs/{model}' -``` - - - -##### Arguments - -- `by_alias`: -- `ref_template`: - - - - -### method schema_json - -```python -*, -by_alias: 'bool' = True, -ref_template: 'str' = '#/$defs/{model}', **dumps_kwargs: 'Any' -``` - - - -##### Arguments - -- `by_alias`: -- `ref_template`: -- `dumps_kwargs`: - - - - -### method update_forward_refs - -```python -**localns: 'Any' -``` - - - -##### Arguments - -- `localns`: - - - - -### method validate - -```python -value: 'Any' -``` - - - -##### Arguments - -- `value`: - - - - diff --git a/models/ref/python/automations/donothing.mdx b/models/ref/python/automations/donothing.mdx index f4757c6d38..609166ab93 100644 --- a/models/ref/python/automations/donothing.mdx +++ b/models/ref/python/automations/donothing.mdx @@ -36,179 +36,6 @@ Defines an automation action that intentionally does nothing. ## Methods -### method construct - -```python -_fields_set: 'set[str] | None' = None, **values: 'Any' -``` - - - -##### Arguments - -- `_fields_set`: -- `values`: - - - - -### method copy - -```python -self, *, -include: 'AbstractSetIntStr | MappingIntStrAny | None' = None, -exclude: 'AbstractSetIntStr | MappingIntStrAny | None' = None, -update: 'Dict[str, Any] | None' = None, -deep: 'bool' = False -``` - -Returns a copy of the model. - -!!! warning "Deprecated" - This method is now deprecated; use `model_copy` instead. - -If you need `include` or `exclude`, use: - -```python {test="skip" lint="skip"} -data = self.model_dump(include=include, exclude=exclude, round_trip=True) -data = {**data, **(update or {})} -copied = self.model_validate(data) -``` - -##### Arguments - -- `include`: Optional set or mapping specifying which fields to include in the copied model. -- `exclude`: Optional set or mapping specifying which fields to exclude in the copied model. -- `update`: Optional dictionary of field-value pairs to override field values in the copied model. -- `deep`: If True, the values of fields that are Pydantic models will be deep-copied. - - - - -### method dict - -```python -self, *, -include: 'IncEx | None' = None, -exclude: 'IncEx | None' = None, -by_alias: 'bool' = False, -exclude_unset: 'bool' = False, -exclude_defaults: 'bool' = False, -exclude_none: 'bool' = False -``` - - - -##### Arguments - -- `include`: -- `exclude`: -- `by_alias`: -- `exclude_unset`: -- `exclude_defaults`: -- `exclude_none`: - - - - -### method from_orm - -```python -obj: 'Any' -``` - - - -##### Arguments - -- `obj`: - - - - -### method json - -```python -self, *, -include: 'IncEx | None' = None, -exclude: 'IncEx | None' = None, -by_alias: 'bool' = False, -exclude_unset: 'bool' = False, -exclude_defaults: 'bool' = False, -exclude_none: 'bool' = False, -encoder: 'Callable[[Any], Any] | None' = PydanticUndefined, -models_as_dict: 'bool' = PydanticUndefined, **dumps_kwargs: 'Any' -``` - - - -##### Arguments - -- `include`: -- `exclude`: -- `by_alias`: -- `exclude_unset`: -- `exclude_defaults`: -- `exclude_none`: -- `encoder`: -- `models_as_dict`: -- `dumps_kwargs`: - - - - -### method model_construct - -```python -_fields_set: 'set[str] | None' = None, **values: 'Any' -``` - -Creates a new instance of the `Model` class with validated data. - -Creates a new model setting `__dict__` and `__pydantic_fields_set__` from trusted or pre-validated data. -Default values are respected, but no other validation is performed. - -!!! note - `model_construct()` generally respects the `model_config.extra` setting on the provided model. - That is, if `model_config.extra == 'allow'`, then all extra passed values are added to the model instance's `__dict__` - and `__pydantic_extra__` fields. If `model_config.extra == 'ignore'` (the default), then all extra passed values are ignored. - Because no validation is performed with a call to `model_construct()`, having `model_config.extra == 'forbid'` does not result in - an error if extra values are passed, but they will be ignored. - -##### Arguments - -- `_fields_set`: A set of field names that were originally explicitly set during instantiation. If provided, this is directly used for the [`model_fields_set`][pydantic.BaseModel.model_fields_set] attribute. Otherwise, the field names from the `values` argument will be used. -- `values`: Trusted or pre-validated data dictionary. - - - - -### method model_copy - -```python -self, *, -update: 'Mapping[str, Any] | None' = None, -deep: 'bool' = False -``` - -!!! abstract "Usage Documentation" - [`model_copy`](../concepts/serialization.md#model_copy) - -Returns a copy of the model. - -!!! note - The underlying instance's [`__dict__`][object.__dict__] attribute is copied. This - might have unexpected side effects if you store anything in it, on top of the model - fields (e.g. the value of [cached properties][functools.cached_property]). - -##### Arguments - -- `update`: Values to change/add in the new model. Note: the data is not validated before creating the new model. You should trust this data. -- `deep`: Set to `True` to make a deep copy of the model. - - - - ### method model_dump ```python @@ -249,295 +76,5 @@ Generates a JSON representation of the model using Pydantic's `to_json` method. -### method model_json_schema - -```python -by_alias: 'bool' = True, -ref_template: 'str' = '#/$defs/{model}', -schema_generator: 'type[GenerateJsonSchema]' = , -mode: 'JsonSchemaMode' = 'validation' -``` - -Generates a JSON schema for a model class. - -##### Arguments - -- `by_alias`: Whether to use attribute aliases or not. -- `ref_template`: The reference template. -- `schema_generator`: To override the logic used to generate the JSON schema, as a subclass of `GenerateJsonSchema` with your desired modifications -- `mode`: The mode in which to generate the schema. - - - - -### method model_parametrized_name - -```python -params: 'tuple[type[Any], ...]' -``` - -Compute the class name for parametrizations of generic classes. - -This method can be overridden to achieve a custom naming scheme for generic BaseModels. - -##### Arguments - -- `params`: Tuple of types of the class. Given a generic class `Model` with 2 type variables and a concrete model `Model[str, int]`, the value `(str, int)` would be passed to `params`. - - -##### Raises - -- `TypeError`: Raised when trying to generate concrete names for non-generic models. - - -### method model_post_init - -```python -self, -context: 'Any', / -``` - -Override this method to perform additional initialization after `__init__` and `model_construct`. -This is useful if you want to do some validation that requires the entire model to be initialized. - -##### Arguments - -- `context`: - - - - -### method model_rebuild - -```python -*, -force: 'bool' = False, -raise_errors: 'bool' = True, -_parent_namespace_depth: 'int' = 2, -_types_namespace: 'MappingNamespace | None' = None -``` - -Try to rebuild the pydantic-core schema for the model. - -This may be necessary when one of the annotations is a ForwardRef which could not be resolved during -the initial attempt to build the schema, and automatic rebuilding fails. - -##### Arguments - -- `force`: Whether to force the rebuilding of the model schema, defaults to `False`. -- `raise_errors`: Whether to raise errors, defaults to `True`. -- `_parent_namespace_depth`: The depth level of the parent namespace, defaults to 2. -- `_types_namespace`: The types namespace, defaults to `None`. - - - - -### method model_validate - -```python -obj: 'Any', *, -strict: 'bool | None' = None, -from_attributes: 'bool | None' = None, -context: 'Any | None' = None, -by_alias: 'bool | None' = None, -by_name: 'bool | None' = None -``` - -Validate a pydantic model instance. - -##### Arguments - -- `obj`: The object to validate. -- `strict`: Whether to enforce types strictly. -- `from_attributes`: Whether to extract data from object attributes. -- `context`: Additional context to pass to the validator. -- `by_alias`: Whether to use the field's alias when validating against the provided input data. -- `by_name`: Whether to use the field's name when validating against the provided input data. - - -##### Raises - -- `ValidationError`: If the object could not be validated. - - -### method model_validate_json - -```python -json_data: 'str | bytes | bytearray', *, -strict: 'bool | None' = None, -context: 'Any | None' = None, -by_alias: 'bool | None' = None, -by_name: 'bool | None' = None -``` - -!!! abstract "Usage Documentation" - [JSON Parsing](../concepts/json.md#json-parsing) - -Validate the given JSON data against the Pydantic model. - -##### Arguments - -- `json_data`: The JSON data to validate. -- `strict`: Whether to enforce types strictly. -- `context`: Extra variables to pass to the validator. -- `by_alias`: Whether to use the field's alias when validating against the provided input data. -- `by_name`: Whether to use the field's name when validating against the provided input data. - - -##### Raises - -- `ValidationError`: If `json_data` is not a JSON string or the object could not be validated. - - -### method model_validate_strings - -```python -obj: 'Any', *, -strict: 'bool | None' = None, -context: 'Any | None' = None, -by_alias: 'bool | None' = None, -by_name: 'bool | None' = None -``` - -Validate the given object with string data against the Pydantic model. - -##### Arguments - -- `obj`: The object containing string data to validate. -- `strict`: Whether to enforce types strictly. -- `context`: Extra variables to pass to the validator. -- `by_alias`: Whether to use the field's alias when validating against the provided input data. -- `by_name`: Whether to use the field's name when validating against the provided input data. - - - - -### method parse_file - -```python -path: 'str | Path', *, -content_type: 'str | None' = None, -encoding: 'str' = 'utf8', -proto: 'DeprecatedParseProtocol | None' = None, -allow_pickle: 'bool' = False -``` - - - -##### Arguments - -- `path`: -- `content_type`: -- `encoding`: -- `proto`: -- `allow_pickle`: - - - - -### method parse_obj - -```python -obj: 'Any' -``` - - - -##### Arguments - -- `obj`: - - - - -### method parse_raw - -```python -b: 'str | bytes', *, -content_type: 'str | None' = None, -encoding: 'str' = 'utf8', -proto: 'DeprecatedParseProtocol | None' = None, -allow_pickle: 'bool' = False -``` - - - -##### Arguments - -- `b`: -- `content_type`: -- `encoding`: -- `proto`: -- `allow_pickle`: - - - - -### method schema - -```python -by_alias: 'bool' = True, -ref_template: 'str' = '#/$defs/{model}' -``` - - - -##### Arguments - -- `by_alias`: -- `ref_template`: - - - - -### method schema_json - -```python -*, -by_alias: 'bool' = True, -ref_template: 'str' = '#/$defs/{model}', **dumps_kwargs: 'Any' -``` - - - -##### Arguments - -- `by_alias`: -- `ref_template`: -- `dumps_kwargs`: - - - - -### method update_forward_refs - -```python -**localns: 'Any' -``` - - - -##### Arguments - -- `localns`: - - - - -### method validate - -```python -value: 'Any' -``` - - - -##### Arguments - -- `value`: - - - - diff --git a/models/ref/python/automations/metricchangefilter.mdx b/models/ref/python/automations/metricchangefilter.mdx index 2d536b2549..2a74b0d5df 100644 --- a/models/ref/python/automations/metricchangefilter.mdx +++ b/models/ref/python/automations/metricchangefilter.mdx @@ -51,179 +51,6 @@ between the current window and the non-overlapping prior window. ## Methods -### method construct - -```python -_fields_set: 'set[str] | None' = None, **values: 'Any' -``` - - - -##### Arguments - -- `_fields_set`: -- `values`: - - - - -### method copy - -```python -self, *, -include: 'AbstractSetIntStr | MappingIntStrAny | None' = None, -exclude: 'AbstractSetIntStr | MappingIntStrAny | None' = None, -update: 'Dict[str, Any] | None' = None, -deep: 'bool' = False -``` - -Returns a copy of the model. - -!!! warning "Deprecated" - This method is now deprecated; use `model_copy` instead. - -If you need `include` or `exclude`, use: - -```python {test="skip" lint="skip"} -data = self.model_dump(include=include, exclude=exclude, round_trip=True) -data = {**data, **(update or {})} -copied = self.model_validate(data) -``` - -##### Arguments - -- `include`: Optional set or mapping specifying which fields to include in the copied model. -- `exclude`: Optional set or mapping specifying which fields to exclude in the copied model. -- `update`: Optional dictionary of field-value pairs to override field values in the copied model. -- `deep`: If True, the values of fields that are Pydantic models will be deep-copied. - - - - -### method dict - -```python -self, *, -include: 'IncEx | None' = None, -exclude: 'IncEx | None' = None, -by_alias: 'bool' = False, -exclude_unset: 'bool' = False, -exclude_defaults: 'bool' = False, -exclude_none: 'bool' = False -``` - - - -##### Arguments - -- `include`: -- `exclude`: -- `by_alias`: -- `exclude_unset`: -- `exclude_defaults`: -- `exclude_none`: - - - - -### method from_orm - -```python -obj: 'Any' -``` - - - -##### Arguments - -- `obj`: - - - - -### method json - -```python -self, *, -include: 'IncEx | None' = None, -exclude: 'IncEx | None' = None, -by_alias: 'bool' = False, -exclude_unset: 'bool' = False, -exclude_defaults: 'bool' = False, -exclude_none: 'bool' = False, -encoder: 'Callable[[Any], Any] | None' = PydanticUndefined, -models_as_dict: 'bool' = PydanticUndefined, **dumps_kwargs: 'Any' -``` - - - -##### Arguments - -- `include`: -- `exclude`: -- `by_alias`: -- `exclude_unset`: -- `exclude_defaults`: -- `exclude_none`: -- `encoder`: -- `models_as_dict`: -- `dumps_kwargs`: - - - - -### method model_construct - -```python -_fields_set: 'set[str] | None' = None, **values: 'Any' -``` - -Creates a new instance of the `Model` class with validated data. - -Creates a new model setting `__dict__` and `__pydantic_fields_set__` from trusted or pre-validated data. -Default values are respected, but no other validation is performed. - -!!! note - `model_construct()` generally respects the `model_config.extra` setting on the provided model. - That is, if `model_config.extra == 'allow'`, then all extra passed values are added to the model instance's `__dict__` - and `__pydantic_extra__` fields. If `model_config.extra == 'ignore'` (the default), then all extra passed values are ignored. - Because no validation is performed with a call to `model_construct()`, having `model_config.extra == 'forbid'` does not result in - an error if extra values are passed, but they will be ignored. - -##### Arguments - -- `_fields_set`: A set of field names that were originally explicitly set during instantiation. If provided, this is directly used for the [`model_fields_set`][pydantic.BaseModel.model_fields_set] attribute. Otherwise, the field names from the `values` argument will be used. -- `values`: Trusted or pre-validated data dictionary. - - - - -### method model_copy - -```python -self, *, -update: 'Mapping[str, Any] | None' = None, -deep: 'bool' = False -``` - -!!! abstract "Usage Documentation" - [`model_copy`](../concepts/serialization.md#model_copy) - -Returns a copy of the model. - -!!! note - The underlying instance's [`__dict__`][object.__dict__] attribute is copied. This - might have unexpected side effects if you store anything in it, on top of the model - fields (e.g. the value of [cached properties][functools.cached_property]). - -##### Arguments - -- `update`: Values to change/add in the new model. Note: the data is not validated before creating the new model. You should trust this data. -- `deep`: Set to `True` to make a deep copy of the model. - - - - ### method model_dump ```python @@ -264,295 +91,5 @@ Generates a JSON representation of the model using Pydantic's `to_json` method. -### method model_json_schema - -```python -by_alias: 'bool' = True, -ref_template: 'str' = '#/$defs/{model}', -schema_generator: 'type[GenerateJsonSchema]' = , -mode: 'JsonSchemaMode' = 'validation' -``` - -Generates a JSON schema for a model class. - -##### Arguments - -- `by_alias`: Whether to use attribute aliases or not. -- `ref_template`: The reference template. -- `schema_generator`: To override the logic used to generate the JSON schema, as a subclass of `GenerateJsonSchema` with your desired modifications -- `mode`: The mode in which to generate the schema. - - - - -### method model_parametrized_name - -```python -params: 'tuple[type[Any], ...]' -``` - -Compute the class name for parametrizations of generic classes. - -This method can be overridden to achieve a custom naming scheme for generic BaseModels. - -##### Arguments - -- `params`: Tuple of types of the class. Given a generic class `Model` with 2 type variables and a concrete model `Model[str, int]`, the value `(str, int)` would be passed to `params`. - - -##### Raises - -- `TypeError`: Raised when trying to generate concrete names for non-generic models. - - -### method model_post_init - -```python -self, -context: 'Any', / -``` - -Override this method to perform additional initialization after `__init__` and `model_construct`. -This is useful if you want to do some validation that requires the entire model to be initialized. - -##### Arguments - -- `context`: - - - - -### method model_rebuild - -```python -*, -force: 'bool' = False, -raise_errors: 'bool' = True, -_parent_namespace_depth: 'int' = 2, -_types_namespace: 'MappingNamespace | None' = None -``` - -Try to rebuild the pydantic-core schema for the model. - -This may be necessary when one of the annotations is a ForwardRef which could not be resolved during -the initial attempt to build the schema, and automatic rebuilding fails. - -##### Arguments - -- `force`: Whether to force the rebuilding of the model schema, defaults to `False`. -- `raise_errors`: Whether to raise errors, defaults to `True`. -- `_parent_namespace_depth`: The depth level of the parent namespace, defaults to 2. -- `_types_namespace`: The types namespace, defaults to `None`. - - - - -### method model_validate - -```python -obj: 'Any', *, -strict: 'bool | None' = None, -from_attributes: 'bool | None' = None, -context: 'Any | None' = None, -by_alias: 'bool | None' = None, -by_name: 'bool | None' = None -``` - -Validate a pydantic model instance. - -##### Arguments - -- `obj`: The object to validate. -- `strict`: Whether to enforce types strictly. -- `from_attributes`: Whether to extract data from object attributes. -- `context`: Additional context to pass to the validator. -- `by_alias`: Whether to use the field's alias when validating against the provided input data. -- `by_name`: Whether to use the field's name when validating against the provided input data. - - -##### Raises - -- `ValidationError`: If the object could not be validated. - - -### method model_validate_json - -```python -json_data: 'str | bytes | bytearray', *, -strict: 'bool | None' = None, -context: 'Any | None' = None, -by_alias: 'bool | None' = None, -by_name: 'bool | None' = None -``` - -!!! abstract "Usage Documentation" - [JSON Parsing](../concepts/json.md#json-parsing) - -Validate the given JSON data against the Pydantic model. - -##### Arguments - -- `json_data`: The JSON data to validate. -- `strict`: Whether to enforce types strictly. -- `context`: Extra variables to pass to the validator. -- `by_alias`: Whether to use the field's alias when validating against the provided input data. -- `by_name`: Whether to use the field's name when validating against the provided input data. - - -##### Raises - -- `ValidationError`: If `json_data` is not a JSON string or the object could not be validated. - - -### method model_validate_strings - -```python -obj: 'Any', *, -strict: 'bool | None' = None, -context: 'Any | None' = None, -by_alias: 'bool | None' = None, -by_name: 'bool | None' = None -``` - -Validate the given object with string data against the Pydantic model. - -##### Arguments - -- `obj`: The object containing string data to validate. -- `strict`: Whether to enforce types strictly. -- `context`: Extra variables to pass to the validator. -- `by_alias`: Whether to use the field's alias when validating against the provided input data. -- `by_name`: Whether to use the field's name when validating against the provided input data. - - - - -### method parse_file - -```python -path: 'str | Path', *, -content_type: 'str | None' = None, -encoding: 'str' = 'utf8', -proto: 'DeprecatedParseProtocol | None' = None, -allow_pickle: 'bool' = False -``` - - - -##### Arguments - -- `path`: -- `content_type`: -- `encoding`: -- `proto`: -- `allow_pickle`: - - - - -### method parse_obj - -```python -obj: 'Any' -``` - - - -##### Arguments - -- `obj`: - - - - -### method parse_raw - -```python -b: 'str | bytes', *, -content_type: 'str | None' = None, -encoding: 'str' = 'utf8', -proto: 'DeprecatedParseProtocol | None' = None, -allow_pickle: 'bool' = False -``` - - - -##### Arguments - -- `b`: -- `content_type`: -- `encoding`: -- `proto`: -- `allow_pickle`: - - - - -### method schema - -```python -by_alias: 'bool' = True, -ref_template: 'str' = '#/$defs/{model}' -``` - - - -##### Arguments - -- `by_alias`: -- `ref_template`: - - - - -### method schema_json - -```python -*, -by_alias: 'bool' = True, -ref_template: 'str' = '#/$defs/{model}', **dumps_kwargs: 'Any' -``` - - - -##### Arguments - -- `by_alias`: -- `ref_template`: -- `dumps_kwargs`: - - - - -### method update_forward_refs - -```python -**localns: 'Any' -``` - - - -##### Arguments - -- `localns`: - - - - -### method validate - -```python -value: 'Any' -``` - - - -##### Arguments - -- `value`: - - - - diff --git a/models/ref/python/automations/metricthresholdfilter.mdx b/models/ref/python/automations/metricthresholdfilter.mdx index 06cea07a16..147f20f414 100644 --- a/models/ref/python/automations/metricthresholdfilter.mdx +++ b/models/ref/python/automations/metricthresholdfilter.mdx @@ -45,179 +45,6 @@ multiple values. ## Methods -### method construct - -```python -_fields_set: 'set[str] | None' = None, **values: 'Any' -``` - - - -##### Arguments - -- `_fields_set`: -- `values`: - - - - -### method copy - -```python -self, *, -include: 'AbstractSetIntStr | MappingIntStrAny | None' = None, -exclude: 'AbstractSetIntStr | MappingIntStrAny | None' = None, -update: 'Dict[str, Any] | None' = None, -deep: 'bool' = False -``` - -Returns a copy of the model. - -!!! warning "Deprecated" - This method is now deprecated; use `model_copy` instead. - -If you need `include` or `exclude`, use: - -```python {test="skip" lint="skip"} -data = self.model_dump(include=include, exclude=exclude, round_trip=True) -data = {**data, **(update or {})} -copied = self.model_validate(data) -``` - -##### Arguments - -- `include`: Optional set or mapping specifying which fields to include in the copied model. -- `exclude`: Optional set or mapping specifying which fields to exclude in the copied model. -- `update`: Optional dictionary of field-value pairs to override field values in the copied model. -- `deep`: If True, the values of fields that are Pydantic models will be deep-copied. - - - - -### method dict - -```python -self, *, -include: 'IncEx | None' = None, -exclude: 'IncEx | None' = None, -by_alias: 'bool' = False, -exclude_unset: 'bool' = False, -exclude_defaults: 'bool' = False, -exclude_none: 'bool' = False -``` - - - -##### Arguments - -- `include`: -- `exclude`: -- `by_alias`: -- `exclude_unset`: -- `exclude_defaults`: -- `exclude_none`: - - - - -### method from_orm - -```python -obj: 'Any' -``` - - - -##### Arguments - -- `obj`: - - - - -### method json - -```python -self, *, -include: 'IncEx | None' = None, -exclude: 'IncEx | None' = None, -by_alias: 'bool' = False, -exclude_unset: 'bool' = False, -exclude_defaults: 'bool' = False, -exclude_none: 'bool' = False, -encoder: 'Callable[[Any], Any] | None' = PydanticUndefined, -models_as_dict: 'bool' = PydanticUndefined, **dumps_kwargs: 'Any' -``` - - - -##### Arguments - -- `include`: -- `exclude`: -- `by_alias`: -- `exclude_unset`: -- `exclude_defaults`: -- `exclude_none`: -- `encoder`: -- `models_as_dict`: -- `dumps_kwargs`: - - - - -### method model_construct - -```python -_fields_set: 'set[str] | None' = None, **values: 'Any' -``` - -Creates a new instance of the `Model` class with validated data. - -Creates a new model setting `__dict__` and `__pydantic_fields_set__` from trusted or pre-validated data. -Default values are respected, but no other validation is performed. - -!!! note - `model_construct()` generally respects the `model_config.extra` setting on the provided model. - That is, if `model_config.extra == 'allow'`, then all extra passed values are added to the model instance's `__dict__` - and `__pydantic_extra__` fields. If `model_config.extra == 'ignore'` (the default), then all extra passed values are ignored. - Because no validation is performed with a call to `model_construct()`, having `model_config.extra == 'forbid'` does not result in - an error if extra values are passed, but they will be ignored. - -##### Arguments - -- `_fields_set`: A set of field names that were originally explicitly set during instantiation. If provided, this is directly used for the [`model_fields_set`][pydantic.BaseModel.model_fields_set] attribute. Otherwise, the field names from the `values` argument will be used. -- `values`: Trusted or pre-validated data dictionary. - - - - -### method model_copy - -```python -self, *, -update: 'Mapping[str, Any] | None' = None, -deep: 'bool' = False -``` - -!!! abstract "Usage Documentation" - [`model_copy`](../concepts/serialization.md#model_copy) - -Returns a copy of the model. - -!!! note - The underlying instance's [`__dict__`][object.__dict__] attribute is copied. This - might have unexpected side effects if you store anything in it, on top of the model - fields (e.g. the value of [cached properties][functools.cached_property]). - -##### Arguments - -- `update`: Values to change/add in the new model. Note: the data is not validated before creating the new model. You should trust this data. -- `deep`: Set to `True` to make a deep copy of the model. - - - - ### method model_dump ```python @@ -258,295 +85,5 @@ Generates a JSON representation of the model using Pydantic's `to_json` method. -### method model_json_schema - -```python -by_alias: 'bool' = True, -ref_template: 'str' = '#/$defs/{model}', -schema_generator: 'type[GenerateJsonSchema]' = , -mode: 'JsonSchemaMode' = 'validation' -``` - -Generates a JSON schema for a model class. - -##### Arguments - -- `by_alias`: Whether to use attribute aliases or not. -- `ref_template`: The reference template. -- `schema_generator`: To override the logic used to generate the JSON schema, as a subclass of `GenerateJsonSchema` with your desired modifications -- `mode`: The mode in which to generate the schema. - - - - -### method model_parametrized_name - -```python -params: 'tuple[type[Any], ...]' -``` - -Compute the class name for parametrizations of generic classes. - -This method can be overridden to achieve a custom naming scheme for generic BaseModels. - -##### Arguments - -- `params`: Tuple of types of the class. Given a generic class `Model` with 2 type variables and a concrete model `Model[str, int]`, the value `(str, int)` would be passed to `params`. - - -##### Raises - -- `TypeError`: Raised when trying to generate concrete names for non-generic models. - - -### method model_post_init - -```python -self, -context: 'Any', / -``` - -Override this method to perform additional initialization after `__init__` and `model_construct`. -This is useful if you want to do some validation that requires the entire model to be initialized. - -##### Arguments - -- `context`: - - - - -### method model_rebuild - -```python -*, -force: 'bool' = False, -raise_errors: 'bool' = True, -_parent_namespace_depth: 'int' = 2, -_types_namespace: 'MappingNamespace | None' = None -``` - -Try to rebuild the pydantic-core schema for the model. - -This may be necessary when one of the annotations is a ForwardRef which could not be resolved during -the initial attempt to build the schema, and automatic rebuilding fails. - -##### Arguments - -- `force`: Whether to force the rebuilding of the model schema, defaults to `False`. -- `raise_errors`: Whether to raise errors, defaults to `True`. -- `_parent_namespace_depth`: The depth level of the parent namespace, defaults to 2. -- `_types_namespace`: The types namespace, defaults to `None`. - - - - -### method model_validate - -```python -obj: 'Any', *, -strict: 'bool | None' = None, -from_attributes: 'bool | None' = None, -context: 'Any | None' = None, -by_alias: 'bool | None' = None, -by_name: 'bool | None' = None -``` - -Validate a pydantic model instance. - -##### Arguments - -- `obj`: The object to validate. -- `strict`: Whether to enforce types strictly. -- `from_attributes`: Whether to extract data from object attributes. -- `context`: Additional context to pass to the validator. -- `by_alias`: Whether to use the field's alias when validating against the provided input data. -- `by_name`: Whether to use the field's name when validating against the provided input data. - - -##### Raises - -- `ValidationError`: If the object could not be validated. - - -### method model_validate_json - -```python -json_data: 'str | bytes | bytearray', *, -strict: 'bool | None' = None, -context: 'Any | None' = None, -by_alias: 'bool | None' = None, -by_name: 'bool | None' = None -``` - -!!! abstract "Usage Documentation" - [JSON Parsing](../concepts/json.md#json-parsing) - -Validate the given JSON data against the Pydantic model. - -##### Arguments - -- `json_data`: The JSON data to validate. -- `strict`: Whether to enforce types strictly. -- `context`: Extra variables to pass to the validator. -- `by_alias`: Whether to use the field's alias when validating against the provided input data. -- `by_name`: Whether to use the field's name when validating against the provided input data. - - -##### Raises - -- `ValidationError`: If `json_data` is not a JSON string or the object could not be validated. - - -### method model_validate_strings - -```python -obj: 'Any', *, -strict: 'bool | None' = None, -context: 'Any | None' = None, -by_alias: 'bool | None' = None, -by_name: 'bool | None' = None -``` - -Validate the given object with string data against the Pydantic model. - -##### Arguments - -- `obj`: The object containing string data to validate. -- `strict`: Whether to enforce types strictly. -- `context`: Extra variables to pass to the validator. -- `by_alias`: Whether to use the field's alias when validating against the provided input data. -- `by_name`: Whether to use the field's name when validating against the provided input data. - - - - -### method parse_file - -```python -path: 'str | Path', *, -content_type: 'str | None' = None, -encoding: 'str' = 'utf8', -proto: 'DeprecatedParseProtocol | None' = None, -allow_pickle: 'bool' = False -``` - - - -##### Arguments - -- `path`: -- `content_type`: -- `encoding`: -- `proto`: -- `allow_pickle`: - - - - -### method parse_obj - -```python -obj: 'Any' -``` - - - -##### Arguments - -- `obj`: - - - - -### method parse_raw - -```python -b: 'str | bytes', *, -content_type: 'str | None' = None, -encoding: 'str' = 'utf8', -proto: 'DeprecatedParseProtocol | None' = None, -allow_pickle: 'bool' = False -``` - - - -##### Arguments - -- `b`: -- `content_type`: -- `encoding`: -- `proto`: -- `allow_pickle`: - - - - -### method schema - -```python -by_alias: 'bool' = True, -ref_template: 'str' = '#/$defs/{model}' -``` - - - -##### Arguments - -- `by_alias`: -- `ref_template`: - - - - -### method schema_json - -```python -*, -by_alias: 'bool' = True, -ref_template: 'str' = '#/$defs/{model}', **dumps_kwargs: 'Any' -``` - - - -##### Arguments - -- `by_alias`: -- `ref_template`: -- `dumps_kwargs`: - - - - -### method update_forward_refs - -```python -**localns: 'Any' -``` - - - -##### Arguments - -- `localns`: - - - - -### method validate - -```python -value: 'Any' -``` - - - -##### Arguments - -- `value`: - - - - diff --git a/models/ref/python/automations/metriczscorefilter.mdx b/models/ref/python/automations/metriczscorefilter.mdx index d69703c976..219990a74c 100644 --- a/models/ref/python/automations/metriczscorefilter.mdx +++ b/models/ref/python/automations/metriczscorefilter.mdx @@ -40,179 +40,6 @@ Filter that compares a metric's z-score against a user-defined threshold. ## Methods -### method construct - -```python -_fields_set: 'set[str] | None' = None, **values: 'Any' -``` - - - -##### Arguments - -- `_fields_set`: -- `values`: - - - - -### method copy - -```python -self, *, -include: 'AbstractSetIntStr | MappingIntStrAny | None' = None, -exclude: 'AbstractSetIntStr | MappingIntStrAny | None' = None, -update: 'Dict[str, Any] | None' = None, -deep: 'bool' = False -``` - -Returns a copy of the model. - -!!! warning "Deprecated" - This method is now deprecated; use `model_copy` instead. - -If you need `include` or `exclude`, use: - -```python {test="skip" lint="skip"} -data = self.model_dump(include=include, exclude=exclude, round_trip=True) -data = {**data, **(update or {})} -copied = self.model_validate(data) -``` - -##### Arguments - -- `include`: Optional set or mapping specifying which fields to include in the copied model. -- `exclude`: Optional set or mapping specifying which fields to exclude in the copied model. -- `update`: Optional dictionary of field-value pairs to override field values in the copied model. -- `deep`: If True, the values of fields that are Pydantic models will be deep-copied. - - - - -### method dict - -```python -self, *, -include: 'IncEx | None' = None, -exclude: 'IncEx | None' = None, -by_alias: 'bool' = False, -exclude_unset: 'bool' = False, -exclude_defaults: 'bool' = False, -exclude_none: 'bool' = False -``` - - - -##### Arguments - -- `include`: -- `exclude`: -- `by_alias`: -- `exclude_unset`: -- `exclude_defaults`: -- `exclude_none`: - - - - -### method from_orm - -```python -obj: 'Any' -``` - - - -##### Arguments - -- `obj`: - - - - -### method json - -```python -self, *, -include: 'IncEx | None' = None, -exclude: 'IncEx | None' = None, -by_alias: 'bool' = False, -exclude_unset: 'bool' = False, -exclude_defaults: 'bool' = False, -exclude_none: 'bool' = False, -encoder: 'Callable[[Any], Any] | None' = PydanticUndefined, -models_as_dict: 'bool' = PydanticUndefined, **dumps_kwargs: 'Any' -``` - - - -##### Arguments - -- `include`: -- `exclude`: -- `by_alias`: -- `exclude_unset`: -- `exclude_defaults`: -- `exclude_none`: -- `encoder`: -- `models_as_dict`: -- `dumps_kwargs`: - - - - -### method model_construct - -```python -_fields_set: 'set[str] | None' = None, **values: 'Any' -``` - -Creates a new instance of the `Model` class with validated data. - -Creates a new model setting `__dict__` and `__pydantic_fields_set__` from trusted or pre-validated data. -Default values are respected, but no other validation is performed. - -!!! note - `model_construct()` generally respects the `model_config.extra` setting on the provided model. - That is, if `model_config.extra == 'allow'`, then all extra passed values are added to the model instance's `__dict__` - and `__pydantic_extra__` fields. If `model_config.extra == 'ignore'` (the default), then all extra passed values are ignored. - Because no validation is performed with a call to `model_construct()`, having `model_config.extra == 'forbid'` does not result in - an error if extra values are passed, but they will be ignored. - -##### Arguments - -- `_fields_set`: A set of field names that were originally explicitly set during instantiation. If provided, this is directly used for the [`model_fields_set`][pydantic.BaseModel.model_fields_set] attribute. Otherwise, the field names from the `values` argument will be used. -- `values`: Trusted or pre-validated data dictionary. - - - - -### method model_copy - -```python -self, *, -update: 'Mapping[str, Any] | None' = None, -deep: 'bool' = False -``` - -!!! abstract "Usage Documentation" - [`model_copy`](../concepts/serialization.md#model_copy) - -Returns a copy of the model. - -!!! note - The underlying instance's [`__dict__`][object.__dict__] attribute is copied. This - might have unexpected side effects if you store anything in it, on top of the model - fields (e.g. the value of [cached properties][functools.cached_property]). - -##### Arguments - -- `update`: Values to change/add in the new model. Note: the data is not validated before creating the new model. You should trust this data. -- `deep`: Set to `True` to make a deep copy of the model. - - - - ### method model_dump ```python @@ -253,295 +80,5 @@ Generates a JSON representation of the model using Pydantic's `to_json` method. -### method model_json_schema - -```python -by_alias: 'bool' = True, -ref_template: 'str' = '#/$defs/{model}', -schema_generator: 'type[GenerateJsonSchema]' = , -mode: 'JsonSchemaMode' = 'validation' -``` - -Generates a JSON schema for a model class. - -##### Arguments - -- `by_alias`: Whether to use attribute aliases or not. -- `ref_template`: The reference template. -- `schema_generator`: To override the logic used to generate the JSON schema, as a subclass of `GenerateJsonSchema` with your desired modifications -- `mode`: The mode in which to generate the schema. - - - - -### method model_parametrized_name - -```python -params: 'tuple[type[Any], ...]' -``` - -Compute the class name for parametrizations of generic classes. - -This method can be overridden to achieve a custom naming scheme for generic BaseModels. - -##### Arguments - -- `params`: Tuple of types of the class. Given a generic class `Model` with 2 type variables and a concrete model `Model[str, int]`, the value `(str, int)` would be passed to `params`. - - -##### Raises - -- `TypeError`: Raised when trying to generate concrete names for non-generic models. - - -### method model_post_init - -```python -self, -context: 'Any', / -``` - -Override this method to perform additional initialization after `__init__` and `model_construct`. -This is useful if you want to do some validation that requires the entire model to be initialized. - -##### Arguments - -- `context`: - - - - -### method model_rebuild - -```python -*, -force: 'bool' = False, -raise_errors: 'bool' = True, -_parent_namespace_depth: 'int' = 2, -_types_namespace: 'MappingNamespace | None' = None -``` - -Try to rebuild the pydantic-core schema for the model. - -This may be necessary when one of the annotations is a ForwardRef which could not be resolved during -the initial attempt to build the schema, and automatic rebuilding fails. - -##### Arguments - -- `force`: Whether to force the rebuilding of the model schema, defaults to `False`. -- `raise_errors`: Whether to raise errors, defaults to `True`. -- `_parent_namespace_depth`: The depth level of the parent namespace, defaults to 2. -- `_types_namespace`: The types namespace, defaults to `None`. - - - - -### method model_validate - -```python -obj: 'Any', *, -strict: 'bool | None' = None, -from_attributes: 'bool | None' = None, -context: 'Any | None' = None, -by_alias: 'bool | None' = None, -by_name: 'bool | None' = None -``` - -Validate a pydantic model instance. - -##### Arguments - -- `obj`: The object to validate. -- `strict`: Whether to enforce types strictly. -- `from_attributes`: Whether to extract data from object attributes. -- `context`: Additional context to pass to the validator. -- `by_alias`: Whether to use the field's alias when validating against the provided input data. -- `by_name`: Whether to use the field's name when validating against the provided input data. - - -##### Raises - -- `ValidationError`: If the object could not be validated. - - -### method model_validate_json - -```python -json_data: 'str | bytes | bytearray', *, -strict: 'bool | None' = None, -context: 'Any | None' = None, -by_alias: 'bool | None' = None, -by_name: 'bool | None' = None -``` - -!!! abstract "Usage Documentation" - [JSON Parsing](../concepts/json.md#json-parsing) - -Validate the given JSON data against the Pydantic model. - -##### Arguments - -- `json_data`: The JSON data to validate. -- `strict`: Whether to enforce types strictly. -- `context`: Extra variables to pass to the validator. -- `by_alias`: Whether to use the field's alias when validating against the provided input data. -- `by_name`: Whether to use the field's name when validating against the provided input data. - - -##### Raises - -- `ValidationError`: If `json_data` is not a JSON string or the object could not be validated. - - -### method model_validate_strings - -```python -obj: 'Any', *, -strict: 'bool | None' = None, -context: 'Any | None' = None, -by_alias: 'bool | None' = None, -by_name: 'bool | None' = None -``` - -Validate the given object with string data against the Pydantic model. - -##### Arguments - -- `obj`: The object containing string data to validate. -- `strict`: Whether to enforce types strictly. -- `context`: Extra variables to pass to the validator. -- `by_alias`: Whether to use the field's alias when validating against the provided input data. -- `by_name`: Whether to use the field's name when validating against the provided input data. - - - - -### method parse_file - -```python -path: 'str | Path', *, -content_type: 'str | None' = None, -encoding: 'str' = 'utf8', -proto: 'DeprecatedParseProtocol | None' = None, -allow_pickle: 'bool' = False -``` - - - -##### Arguments - -- `path`: -- `content_type`: -- `encoding`: -- `proto`: -- `allow_pickle`: - - - - -### method parse_obj - -```python -obj: 'Any' -``` - - - -##### Arguments - -- `obj`: - - - - -### method parse_raw - -```python -b: 'str | bytes', *, -content_type: 'str | None' = None, -encoding: 'str' = 'utf8', -proto: 'DeprecatedParseProtocol | None' = None, -allow_pickle: 'bool' = False -``` - - - -##### Arguments - -- `b`: -- `content_type`: -- `encoding`: -- `proto`: -- `allow_pickle`: - - - - -### method schema - -```python -by_alias: 'bool' = True, -ref_template: 'str' = '#/$defs/{model}' -``` - - - -##### Arguments - -- `by_alias`: -- `ref_template`: - - - - -### method schema_json - -```python -*, -by_alias: 'bool' = True, -ref_template: 'str' = '#/$defs/{model}', **dumps_kwargs: 'Any' -``` - - - -##### Arguments - -- `by_alias`: -- `ref_template`: -- `dumps_kwargs`: - - - - -### method update_forward_refs - -```python -**localns: 'Any' -``` - - - -##### Arguments - -- `localns`: - - - - -### method validate - -```python -value: 'Any' -``` - - - -##### Arguments - -- `value`: - - - - diff --git a/models/ref/python/automations/newautomation.mdx b/models/ref/python/automations/newautomation.mdx index d27cbd92ab..7754533fe9 100644 --- a/models/ref/python/automations/newautomation.mdx +++ b/models/ref/python/automations/newautomation.mdx @@ -48,179 +48,6 @@ The scope in which the triggering event must occur. ## Methods -### method construct - -```python -_fields_set: 'set[str] | None' = None, **values: 'Any' -``` - - - -##### Arguments - -- `_fields_set`: -- `values`: - - - - -### method copy - -```python -self, *, -include: 'AbstractSetIntStr | MappingIntStrAny | None' = None, -exclude: 'AbstractSetIntStr | MappingIntStrAny | None' = None, -update: 'Dict[str, Any] | None' = None, -deep: 'bool' = False -``` - -Returns a copy of the model. - -!!! warning "Deprecated" - This method is now deprecated; use `model_copy` instead. - -If you need `include` or `exclude`, use: - -```python {test="skip" lint="skip"} -data = self.model_dump(include=include, exclude=exclude, round_trip=True) -data = {**data, **(update or {})} -copied = self.model_validate(data) -``` - -##### Arguments - -- `include`: Optional set or mapping specifying which fields to include in the copied model. -- `exclude`: Optional set or mapping specifying which fields to exclude in the copied model. -- `update`: Optional dictionary of field-value pairs to override field values in the copied model. -- `deep`: If True, the values of fields that are Pydantic models will be deep-copied. - - - - -### method dict - -```python -self, *, -include: 'IncEx | None' = None, -exclude: 'IncEx | None' = None, -by_alias: 'bool' = False, -exclude_unset: 'bool' = False, -exclude_defaults: 'bool' = False, -exclude_none: 'bool' = False -``` - - - -##### Arguments - -- `include`: -- `exclude`: -- `by_alias`: -- `exclude_unset`: -- `exclude_defaults`: -- `exclude_none`: - - - - -### method from_orm - -```python -obj: 'Any' -``` - - - -##### Arguments - -- `obj`: - - - - -### method json - -```python -self, *, -include: 'IncEx | None' = None, -exclude: 'IncEx | None' = None, -by_alias: 'bool' = False, -exclude_unset: 'bool' = False, -exclude_defaults: 'bool' = False, -exclude_none: 'bool' = False, -encoder: 'Callable[[Any], Any] | None' = PydanticUndefined, -models_as_dict: 'bool' = PydanticUndefined, **dumps_kwargs: 'Any' -``` - - - -##### Arguments - -- `include`: -- `exclude`: -- `by_alias`: -- `exclude_unset`: -- `exclude_defaults`: -- `exclude_none`: -- `encoder`: -- `models_as_dict`: -- `dumps_kwargs`: - - - - -### method model_construct - -```python -_fields_set: 'set[str] | None' = None, **values: 'Any' -``` - -Creates a new instance of the `Model` class with validated data. - -Creates a new model setting `__dict__` and `__pydantic_fields_set__` from trusted or pre-validated data. -Default values are respected, but no other validation is performed. - -!!! note - `model_construct()` generally respects the `model_config.extra` setting on the provided model. - That is, if `model_config.extra == 'allow'`, then all extra passed values are added to the model instance's `__dict__` - and `__pydantic_extra__` fields. If `model_config.extra == 'ignore'` (the default), then all extra passed values are ignored. - Because no validation is performed with a call to `model_construct()`, having `model_config.extra == 'forbid'` does not result in - an error if extra values are passed, but they will be ignored. - -##### Arguments - -- `_fields_set`: A set of field names that were originally explicitly set during instantiation. If provided, this is directly used for the [`model_fields_set`][pydantic.BaseModel.model_fields_set] attribute. Otherwise, the field names from the `values` argument will be used. -- `values`: Trusted or pre-validated data dictionary. - - - - -### method model_copy - -```python -self, *, -update: 'Mapping[str, Any] | None' = None, -deep: 'bool' = False -``` - -!!! abstract "Usage Documentation" - [`model_copy`](../concepts/serialization.md#model_copy) - -Returns a copy of the model. - -!!! note - The underlying instance's [`__dict__`][object.__dict__] attribute is copied. This - might have unexpected side effects if you store anything in it, on top of the model - fields (e.g. the value of [cached properties][functools.cached_property]). - -##### Arguments - -- `update`: Values to change/add in the new model. Note: the data is not validated before creating the new model. You should trust this data. -- `deep`: Set to `True` to make a deep copy of the model. - - - - ### method model_dump ```python @@ -261,295 +88,5 @@ Generates a JSON representation of the model using Pydantic's `to_json` method. -### method model_json_schema - -```python -by_alias: 'bool' = True, -ref_template: 'str' = '#/$defs/{model}', -schema_generator: 'type[GenerateJsonSchema]' = , -mode: 'JsonSchemaMode' = 'validation' -``` - -Generates a JSON schema for a model class. - -##### Arguments - -- `by_alias`: Whether to use attribute aliases or not. -- `ref_template`: The reference template. -- `schema_generator`: To override the logic used to generate the JSON schema, as a subclass of `GenerateJsonSchema` with your desired modifications -- `mode`: The mode in which to generate the schema. - - - - -### method model_parametrized_name - -```python -params: 'tuple[type[Any], ...]' -``` - -Compute the class name for parametrizations of generic classes. - -This method can be overridden to achieve a custom naming scheme for generic BaseModels. - -##### Arguments - -- `params`: Tuple of types of the class. Given a generic class `Model` with 2 type variables and a concrete model `Model[str, int]`, the value `(str, int)` would be passed to `params`. - - -##### Raises - -- `TypeError`: Raised when trying to generate concrete names for non-generic models. - - -### method model_post_init - -```python -self, -context: 'Any', / -``` - -Override this method to perform additional initialization after `__init__` and `model_construct`. -This is useful if you want to do some validation that requires the entire model to be initialized. - -##### Arguments - -- `context`: - - - - -### method model_rebuild - -```python -*, -force: 'bool' = False, -raise_errors: 'bool' = True, -_parent_namespace_depth: 'int' = 2, -_types_namespace: 'MappingNamespace | None' = None -``` - -Try to rebuild the pydantic-core schema for the model. - -This may be necessary when one of the annotations is a ForwardRef which could not be resolved during -the initial attempt to build the schema, and automatic rebuilding fails. - -##### Arguments - -- `force`: Whether to force the rebuilding of the model schema, defaults to `False`. -- `raise_errors`: Whether to raise errors, defaults to `True`. -- `_parent_namespace_depth`: The depth level of the parent namespace, defaults to 2. -- `_types_namespace`: The types namespace, defaults to `None`. - - - - -### method model_validate - -```python -obj: 'Any', *, -strict: 'bool | None' = None, -from_attributes: 'bool | None' = None, -context: 'Any | None' = None, -by_alias: 'bool | None' = None, -by_name: 'bool | None' = None -``` - -Validate a pydantic model instance. - -##### Arguments - -- `obj`: The object to validate. -- `strict`: Whether to enforce types strictly. -- `from_attributes`: Whether to extract data from object attributes. -- `context`: Additional context to pass to the validator. -- `by_alias`: Whether to use the field's alias when validating against the provided input data. -- `by_name`: Whether to use the field's name when validating against the provided input data. - - -##### Raises - -- `ValidationError`: If the object could not be validated. - - -### method model_validate_json - -```python -json_data: 'str | bytes | bytearray', *, -strict: 'bool | None' = None, -context: 'Any | None' = None, -by_alias: 'bool | None' = None, -by_name: 'bool | None' = None -``` - -!!! abstract "Usage Documentation" - [JSON Parsing](../concepts/json.md#json-parsing) - -Validate the given JSON data against the Pydantic model. - -##### Arguments - -- `json_data`: The JSON data to validate. -- `strict`: Whether to enforce types strictly. -- `context`: Extra variables to pass to the validator. -- `by_alias`: Whether to use the field's alias when validating against the provided input data. -- `by_name`: Whether to use the field's name when validating against the provided input data. - - -##### Raises - -- `ValidationError`: If `json_data` is not a JSON string or the object could not be validated. - - -### method model_validate_strings - -```python -obj: 'Any', *, -strict: 'bool | None' = None, -context: 'Any | None' = None, -by_alias: 'bool | None' = None, -by_name: 'bool | None' = None -``` - -Validate the given object with string data against the Pydantic model. - -##### Arguments - -- `obj`: The object containing string data to validate. -- `strict`: Whether to enforce types strictly. -- `context`: Extra variables to pass to the validator. -- `by_alias`: Whether to use the field's alias when validating against the provided input data. -- `by_name`: Whether to use the field's name when validating against the provided input data. - - - - -### method parse_file - -```python -path: 'str | Path', *, -content_type: 'str | None' = None, -encoding: 'str' = 'utf8', -proto: 'DeprecatedParseProtocol | None' = None, -allow_pickle: 'bool' = False -``` - - - -##### Arguments - -- `path`: -- `content_type`: -- `encoding`: -- `proto`: -- `allow_pickle`: - - - - -### method parse_obj - -```python -obj: 'Any' -``` - - - -##### Arguments - -- `obj`: - - - - -### method parse_raw - -```python -b: 'str | bytes', *, -content_type: 'str | None' = None, -encoding: 'str' = 'utf8', -proto: 'DeprecatedParseProtocol | None' = None, -allow_pickle: 'bool' = False -``` - - - -##### Arguments - -- `b`: -- `content_type`: -- `encoding`: -- `proto`: -- `allow_pickle`: - - - - -### method schema - -```python -by_alias: 'bool' = True, -ref_template: 'str' = '#/$defs/{model}' -``` - - - -##### Arguments - -- `by_alias`: -- `ref_template`: - - - - -### method schema_json - -```python -*, -by_alias: 'bool' = True, -ref_template: 'str' = '#/$defs/{model}', **dumps_kwargs: 'Any' -``` - - - -##### Arguments - -- `by_alias`: -- `ref_template`: -- `dumps_kwargs`: - - - - -### method update_forward_refs - -```python -**localns: 'Any' -``` - - - -##### Arguments - -- `localns`: - - - - -### method validate - -```python -value: 'Any' -``` - - - -##### Arguments - -- `value`: - - - - diff --git a/models/ref/python/automations/onaddartifactalias.mdx b/models/ref/python/automations/onaddartifactalias.mdx index e501327d9b..a7cbcbbd0a 100644 --- a/models/ref/python/automations/onaddartifactalias.mdx +++ b/models/ref/python/automations/onaddartifactalias.mdx @@ -54,179 +54,6 @@ event = OnAddArtifactAlias( ## Methods -### method construct - -```python -_fields_set: 'set[str] | None' = None, **values: 'Any' -``` - - - -##### Arguments - -- `_fields_set`: -- `values`: - - - - -### method copy - -```python -self, *, -include: 'AbstractSetIntStr | MappingIntStrAny | None' = None, -exclude: 'AbstractSetIntStr | MappingIntStrAny | None' = None, -update: 'Dict[str, Any] | None' = None, -deep: 'bool' = False -``` - -Returns a copy of the model. - -!!! warning "Deprecated" - This method is now deprecated; use `model_copy` instead. - -If you need `include` or `exclude`, use: - -```python {test="skip" lint="skip"} -data = self.model_dump(include=include, exclude=exclude, round_trip=True) -data = {**data, **(update or {})} -copied = self.model_validate(data) -``` - -##### Arguments - -- `include`: Optional set or mapping specifying which fields to include in the copied model. -- `exclude`: Optional set or mapping specifying which fields to exclude in the copied model. -- `update`: Optional dictionary of field-value pairs to override field values in the copied model. -- `deep`: If True, the values of fields that are Pydantic models will be deep-copied. - - - - -### method dict - -```python -self, *, -include: 'IncEx | None' = None, -exclude: 'IncEx | None' = None, -by_alias: 'bool' = False, -exclude_unset: 'bool' = False, -exclude_defaults: 'bool' = False, -exclude_none: 'bool' = False -``` - - - -##### Arguments - -- `include`: -- `exclude`: -- `by_alias`: -- `exclude_unset`: -- `exclude_defaults`: -- `exclude_none`: - - - - -### method from_orm - -```python -obj: 'Any' -``` - - - -##### Arguments - -- `obj`: - - - - -### method json - -```python -self, *, -include: 'IncEx | None' = None, -exclude: 'IncEx | None' = None, -by_alias: 'bool' = False, -exclude_unset: 'bool' = False, -exclude_defaults: 'bool' = False, -exclude_none: 'bool' = False, -encoder: 'Callable[[Any], Any] | None' = PydanticUndefined, -models_as_dict: 'bool' = PydanticUndefined, **dumps_kwargs: 'Any' -``` - - - -##### Arguments - -- `include`: -- `exclude`: -- `by_alias`: -- `exclude_unset`: -- `exclude_defaults`: -- `exclude_none`: -- `encoder`: -- `models_as_dict`: -- `dumps_kwargs`: - - - - -### method model_construct - -```python -_fields_set: 'set[str] | None' = None, **values: 'Any' -``` - -Creates a new instance of the `Model` class with validated data. - -Creates a new model setting `__dict__` and `__pydantic_fields_set__` from trusted or pre-validated data. -Default values are respected, but no other validation is performed. - -!!! note - `model_construct()` generally respects the `model_config.extra` setting on the provided model. - That is, if `model_config.extra == 'allow'`, then all extra passed values are added to the model instance's `__dict__` - and `__pydantic_extra__` fields. If `model_config.extra == 'ignore'` (the default), then all extra passed values are ignored. - Because no validation is performed with a call to `model_construct()`, having `model_config.extra == 'forbid'` does not result in - an error if extra values are passed, but they will be ignored. - -##### Arguments - -- `_fields_set`: A set of field names that were originally explicitly set during instantiation. If provided, this is directly used for the [`model_fields_set`][pydantic.BaseModel.model_fields_set] attribute. Otherwise, the field names from the `values` argument will be used. -- `values`: Trusted or pre-validated data dictionary. - - - - -### method model_copy - -```python -self, *, -update: 'Mapping[str, Any] | None' = None, -deep: 'bool' = False -``` - -!!! abstract "Usage Documentation" - [`model_copy`](../concepts/serialization.md#model_copy) - -Returns a copy of the model. - -!!! note - The underlying instance's [`__dict__`][object.__dict__] attribute is copied. This - might have unexpected side effects if you store anything in it, on top of the model - fields (e.g. the value of [cached properties][functools.cached_property]). - -##### Arguments - -- `update`: Values to change/add in the new model. Note: the data is not validated before creating the new model. You should trust this data. -- `deep`: Set to `True` to make a deep copy of the model. - - - - ### method model_dump ```python @@ -267,266 +94,6 @@ Generates a JSON representation of the model using Pydantic's `to_json` method. -### method model_json_schema - -```python -by_alias: 'bool' = True, -ref_template: 'str' = '#/$defs/{model}', -schema_generator: 'type[GenerateJsonSchema]' = , -mode: 'JsonSchemaMode' = 'validation' -``` - -Generates a JSON schema for a model class. - -##### Arguments - -- `by_alias`: Whether to use attribute aliases or not. -- `ref_template`: The reference template. -- `schema_generator`: To override the logic used to generate the JSON schema, as a subclass of `GenerateJsonSchema` with your desired modifications -- `mode`: The mode in which to generate the schema. - - - - -### method model_parametrized_name - -```python -params: 'tuple[type[Any], ...]' -``` - -Compute the class name for parametrizations of generic classes. - -This method can be overridden to achieve a custom naming scheme for generic BaseModels. - -##### Arguments - -- `params`: Tuple of types of the class. Given a generic class `Model` with 2 type variables and a concrete model `Model[str, int]`, the value `(str, int)` would be passed to `params`. - - -##### Raises - -- `TypeError`: Raised when trying to generate concrete names for non-generic models. - - -### method model_post_init - -```python -self, -context: 'Any', / -``` - -Override this method to perform additional initialization after `__init__` and `model_construct`. -This is useful if you want to do some validation that requires the entire model to be initialized. - -##### Arguments - -- `context`: - - - - -### method model_rebuild - -```python -*, -force: 'bool' = False, -raise_errors: 'bool' = True, -_parent_namespace_depth: 'int' = 2, -_types_namespace: 'MappingNamespace | None' = None -``` - -Try to rebuild the pydantic-core schema for the model. - -This may be necessary when one of the annotations is a ForwardRef which could not be resolved during -the initial attempt to build the schema, and automatic rebuilding fails. - -##### Arguments - -- `force`: Whether to force the rebuilding of the model schema, defaults to `False`. -- `raise_errors`: Whether to raise errors, defaults to `True`. -- `_parent_namespace_depth`: The depth level of the parent namespace, defaults to 2. -- `_types_namespace`: The types namespace, defaults to `None`. - - - - -### method model_validate - -```python -obj: 'Any', *, -strict: 'bool | None' = None, -from_attributes: 'bool | None' = None, -context: 'Any | None' = None, -by_alias: 'bool | None' = None, -by_name: 'bool | None' = None -``` - -Validate a pydantic model instance. - -##### Arguments - -- `obj`: The object to validate. -- `strict`: Whether to enforce types strictly. -- `from_attributes`: Whether to extract data from object attributes. -- `context`: Additional context to pass to the validator. -- `by_alias`: Whether to use the field's alias when validating against the provided input data. -- `by_name`: Whether to use the field's name when validating against the provided input data. - - -##### Raises - -- `ValidationError`: If the object could not be validated. - - -### method model_validate_json - -```python -json_data: 'str | bytes | bytearray', *, -strict: 'bool | None' = None, -context: 'Any | None' = None, -by_alias: 'bool | None' = None, -by_name: 'bool | None' = None -``` - -!!! abstract "Usage Documentation" - [JSON Parsing](../concepts/json.md#json-parsing) - -Validate the given JSON data against the Pydantic model. - -##### Arguments - -- `json_data`: The JSON data to validate. -- `strict`: Whether to enforce types strictly. -- `context`: Extra variables to pass to the validator. -- `by_alias`: Whether to use the field's alias when validating against the provided input data. -- `by_name`: Whether to use the field's name when validating against the provided input data. - - -##### Raises - -- `ValidationError`: If `json_data` is not a JSON string or the object could not be validated. - - -### method model_validate_strings - -```python -obj: 'Any', *, -strict: 'bool | None' = None, -context: 'Any | None' = None, -by_alias: 'bool | None' = None, -by_name: 'bool | None' = None -``` - -Validate the given object with string data against the Pydantic model. - -##### Arguments - -- `obj`: The object containing string data to validate. -- `strict`: Whether to enforce types strictly. -- `context`: Extra variables to pass to the validator. -- `by_alias`: Whether to use the field's alias when validating against the provided input data. -- `by_name`: Whether to use the field's name when validating against the provided input data. - - - - -### method parse_file - -```python -path: 'str | Path', *, -content_type: 'str | None' = None, -encoding: 'str' = 'utf8', -proto: 'DeprecatedParseProtocol | None' = None, -allow_pickle: 'bool' = False -``` - - - -##### Arguments - -- `path`: -- `content_type`: -- `encoding`: -- `proto`: -- `allow_pickle`: - - - - -### method parse_obj - -```python -obj: 'Any' -``` - - - -##### Arguments - -- `obj`: - - - - -### method parse_raw - -```python -b: 'str | bytes', *, -content_type: 'str | None' = None, -encoding: 'str' = 'utf8', -proto: 'DeprecatedParseProtocol | None' = None, -allow_pickle: 'bool' = False -``` - - - -##### Arguments - -- `b`: -- `content_type`: -- `encoding`: -- `proto`: -- `allow_pickle`: - - - - -### method schema - -```python -by_alias: 'bool' = True, -ref_template: 'str' = '#/$defs/{model}' -``` - - - -##### Arguments - -- `by_alias`: -- `ref_template`: - - - - -### method schema_json - -```python -*, -by_alias: 'bool' = True, -ref_template: 'str' = '#/$defs/{model}', **dumps_kwargs: 'Any' -``` - - - -##### Arguments - -- `by_alias`: -- `ref_template`: -- `dumps_kwargs`: - - - - ### method then ```python @@ -543,35 +110,5 @@ Define a new Automation in which this event triggers the given action. -### method update_forward_refs - -```python -**localns: 'Any' -``` - - - -##### Arguments - -- `localns`: - - - - -### method validate - -```python -value: 'Any' -``` - - - -##### Arguments - -- `value`: - - - - diff --git a/models/ref/python/automations/onaddartifacttag.mdx b/models/ref/python/automations/onaddartifacttag.mdx index 72d6b7bcf2..d05fc63ec7 100644 --- a/models/ref/python/automations/onaddartifacttag.mdx +++ b/models/ref/python/automations/onaddartifacttag.mdx @@ -54,179 +54,6 @@ event = OnAddArtifactTag( ## Methods -### method construct - -```python -_fields_set: 'set[str] | None' = None, **values: 'Any' -``` - - - -##### Arguments - -- `_fields_set`: -- `values`: - - - - -### method copy - -```python -self, *, -include: 'AbstractSetIntStr | MappingIntStrAny | None' = None, -exclude: 'AbstractSetIntStr | MappingIntStrAny | None' = None, -update: 'Dict[str, Any] | None' = None, -deep: 'bool' = False -``` - -Returns a copy of the model. - -!!! warning "Deprecated" - This method is now deprecated; use `model_copy` instead. - -If you need `include` or `exclude`, use: - -```python {test="skip" lint="skip"} -data = self.model_dump(include=include, exclude=exclude, round_trip=True) -data = {**data, **(update or {})} -copied = self.model_validate(data) -``` - -##### Arguments - -- `include`: Optional set or mapping specifying which fields to include in the copied model. -- `exclude`: Optional set or mapping specifying which fields to exclude in the copied model. -- `update`: Optional dictionary of field-value pairs to override field values in the copied model. -- `deep`: If True, the values of fields that are Pydantic models will be deep-copied. - - - - -### method dict - -```python -self, *, -include: 'IncEx | None' = None, -exclude: 'IncEx | None' = None, -by_alias: 'bool' = False, -exclude_unset: 'bool' = False, -exclude_defaults: 'bool' = False, -exclude_none: 'bool' = False -``` - - - -##### Arguments - -- `include`: -- `exclude`: -- `by_alias`: -- `exclude_unset`: -- `exclude_defaults`: -- `exclude_none`: - - - - -### method from_orm - -```python -obj: 'Any' -``` - - - -##### Arguments - -- `obj`: - - - - -### method json - -```python -self, *, -include: 'IncEx | None' = None, -exclude: 'IncEx | None' = None, -by_alias: 'bool' = False, -exclude_unset: 'bool' = False, -exclude_defaults: 'bool' = False, -exclude_none: 'bool' = False, -encoder: 'Callable[[Any], Any] | None' = PydanticUndefined, -models_as_dict: 'bool' = PydanticUndefined, **dumps_kwargs: 'Any' -``` - - - -##### Arguments - -- `include`: -- `exclude`: -- `by_alias`: -- `exclude_unset`: -- `exclude_defaults`: -- `exclude_none`: -- `encoder`: -- `models_as_dict`: -- `dumps_kwargs`: - - - - -### method model_construct - -```python -_fields_set: 'set[str] | None' = None, **values: 'Any' -``` - -Creates a new instance of the `Model` class with validated data. - -Creates a new model setting `__dict__` and `__pydantic_fields_set__` from trusted or pre-validated data. -Default values are respected, but no other validation is performed. - -!!! note - `model_construct()` generally respects the `model_config.extra` setting on the provided model. - That is, if `model_config.extra == 'allow'`, then all extra passed values are added to the model instance's `__dict__` - and `__pydantic_extra__` fields. If `model_config.extra == 'ignore'` (the default), then all extra passed values are ignored. - Because no validation is performed with a call to `model_construct()`, having `model_config.extra == 'forbid'` does not result in - an error if extra values are passed, but they will be ignored. - -##### Arguments - -- `_fields_set`: A set of field names that were originally explicitly set during instantiation. If provided, this is directly used for the [`model_fields_set`][pydantic.BaseModel.model_fields_set] attribute. Otherwise, the field names from the `values` argument will be used. -- `values`: Trusted or pre-validated data dictionary. - - - - -### method model_copy - -```python -self, *, -update: 'Mapping[str, Any] | None' = None, -deep: 'bool' = False -``` - -!!! abstract "Usage Documentation" - [`model_copy`](../concepts/serialization.md#model_copy) - -Returns a copy of the model. - -!!! note - The underlying instance's [`__dict__`][object.__dict__] attribute is copied. This - might have unexpected side effects if you store anything in it, on top of the model - fields (e.g. the value of [cached properties][functools.cached_property]). - -##### Arguments - -- `update`: Values to change/add in the new model. Note: the data is not validated before creating the new model. You should trust this data. -- `deep`: Set to `True` to make a deep copy of the model. - - - - ### method model_dump ```python @@ -267,266 +94,6 @@ Generates a JSON representation of the model using Pydantic's `to_json` method. -### method model_json_schema - -```python -by_alias: 'bool' = True, -ref_template: 'str' = '#/$defs/{model}', -schema_generator: 'type[GenerateJsonSchema]' = , -mode: 'JsonSchemaMode' = 'validation' -``` - -Generates a JSON schema for a model class. - -##### Arguments - -- `by_alias`: Whether to use attribute aliases or not. -- `ref_template`: The reference template. -- `schema_generator`: To override the logic used to generate the JSON schema, as a subclass of `GenerateJsonSchema` with your desired modifications -- `mode`: The mode in which to generate the schema. - - - - -### method model_parametrized_name - -```python -params: 'tuple[type[Any], ...]' -``` - -Compute the class name for parametrizations of generic classes. - -This method can be overridden to achieve a custom naming scheme for generic BaseModels. - -##### Arguments - -- `params`: Tuple of types of the class. Given a generic class `Model` with 2 type variables and a concrete model `Model[str, int]`, the value `(str, int)` would be passed to `params`. - - -##### Raises - -- `TypeError`: Raised when trying to generate concrete names for non-generic models. - - -### method model_post_init - -```python -self, -context: 'Any', / -``` - -Override this method to perform additional initialization after `__init__` and `model_construct`. -This is useful if you want to do some validation that requires the entire model to be initialized. - -##### Arguments - -- `context`: - - - - -### method model_rebuild - -```python -*, -force: 'bool' = False, -raise_errors: 'bool' = True, -_parent_namespace_depth: 'int' = 2, -_types_namespace: 'MappingNamespace | None' = None -``` - -Try to rebuild the pydantic-core schema for the model. - -This may be necessary when one of the annotations is a ForwardRef which could not be resolved during -the initial attempt to build the schema, and automatic rebuilding fails. - -##### Arguments - -- `force`: Whether to force the rebuilding of the model schema, defaults to `False`. -- `raise_errors`: Whether to raise errors, defaults to `True`. -- `_parent_namespace_depth`: The depth level of the parent namespace, defaults to 2. -- `_types_namespace`: The types namespace, defaults to `None`. - - - - -### method model_validate - -```python -obj: 'Any', *, -strict: 'bool | None' = None, -from_attributes: 'bool | None' = None, -context: 'Any | None' = None, -by_alias: 'bool | None' = None, -by_name: 'bool | None' = None -``` - -Validate a pydantic model instance. - -##### Arguments - -- `obj`: The object to validate. -- `strict`: Whether to enforce types strictly. -- `from_attributes`: Whether to extract data from object attributes. -- `context`: Additional context to pass to the validator. -- `by_alias`: Whether to use the field's alias when validating against the provided input data. -- `by_name`: Whether to use the field's name when validating against the provided input data. - - -##### Raises - -- `ValidationError`: If the object could not be validated. - - -### method model_validate_json - -```python -json_data: 'str | bytes | bytearray', *, -strict: 'bool | None' = None, -context: 'Any | None' = None, -by_alias: 'bool | None' = None, -by_name: 'bool | None' = None -``` - -!!! abstract "Usage Documentation" - [JSON Parsing](../concepts/json.md#json-parsing) - -Validate the given JSON data against the Pydantic model. - -##### Arguments - -- `json_data`: The JSON data to validate. -- `strict`: Whether to enforce types strictly. -- `context`: Extra variables to pass to the validator. -- `by_alias`: Whether to use the field's alias when validating against the provided input data. -- `by_name`: Whether to use the field's name when validating against the provided input data. - - -##### Raises - -- `ValidationError`: If `json_data` is not a JSON string or the object could not be validated. - - -### method model_validate_strings - -```python -obj: 'Any', *, -strict: 'bool | None' = None, -context: 'Any | None' = None, -by_alias: 'bool | None' = None, -by_name: 'bool | None' = None -``` - -Validate the given object with string data against the Pydantic model. - -##### Arguments - -- `obj`: The object containing string data to validate. -- `strict`: Whether to enforce types strictly. -- `context`: Extra variables to pass to the validator. -- `by_alias`: Whether to use the field's alias when validating against the provided input data. -- `by_name`: Whether to use the field's name when validating against the provided input data. - - - - -### method parse_file - -```python -path: 'str | Path', *, -content_type: 'str | None' = None, -encoding: 'str' = 'utf8', -proto: 'DeprecatedParseProtocol | None' = None, -allow_pickle: 'bool' = False -``` - - - -##### Arguments - -- `path`: -- `content_type`: -- `encoding`: -- `proto`: -- `allow_pickle`: - - - - -### method parse_obj - -```python -obj: 'Any' -``` - - - -##### Arguments - -- `obj`: - - - - -### method parse_raw - -```python -b: 'str | bytes', *, -content_type: 'str | None' = None, -encoding: 'str' = 'utf8', -proto: 'DeprecatedParseProtocol | None' = None, -allow_pickle: 'bool' = False -``` - - - -##### Arguments - -- `b`: -- `content_type`: -- `encoding`: -- `proto`: -- `allow_pickle`: - - - - -### method schema - -```python -by_alias: 'bool' = True, -ref_template: 'str' = '#/$defs/{model}' -``` - - - -##### Arguments - -- `by_alias`: -- `ref_template`: - - - - -### method schema_json - -```python -*, -by_alias: 'bool' = True, -ref_template: 'str' = '#/$defs/{model}', **dumps_kwargs: 'Any' -``` - - - -##### Arguments - -- `by_alias`: -- `ref_template`: -- `dumps_kwargs`: - - - - ### method then ```python @@ -543,35 +110,5 @@ Define a new Automation in which this event triggers the given action. -### method update_forward_refs - -```python -**localns: 'Any' -``` - - - -##### Arguments - -- `localns`: - - - - -### method validate - -```python -value: 'Any' -``` - - - -##### Arguments - -- `value`: - - - - diff --git a/models/ref/python/automations/onaddcollectiontag.mdx b/models/ref/python/automations/onaddcollectiontag.mdx index 3bd6e30a70..dcdd716375 100644 --- a/models/ref/python/automations/onaddcollectiontag.mdx +++ b/models/ref/python/automations/onaddcollectiontag.mdx @@ -38,179 +38,6 @@ A new tag is assigned to an artifact collection. ## Methods -### method construct - -```python -_fields_set: 'set[str] | None' = None, **values: 'Any' -``` - - - -##### Arguments - -- `_fields_set`: -- `values`: - - - - -### method copy - -```python -self, *, -include: 'AbstractSetIntStr | MappingIntStrAny | None' = None, -exclude: 'AbstractSetIntStr | MappingIntStrAny | None' = None, -update: 'Dict[str, Any] | None' = None, -deep: 'bool' = False -``` - -Returns a copy of the model. - -!!! warning "Deprecated" - This method is now deprecated; use `model_copy` instead. - -If you need `include` or `exclude`, use: - -```python {test="skip" lint="skip"} -data = self.model_dump(include=include, exclude=exclude, round_trip=True) -data = {**data, **(update or {})} -copied = self.model_validate(data) -``` - -##### Arguments - -- `include`: Optional set or mapping specifying which fields to include in the copied model. -- `exclude`: Optional set or mapping specifying which fields to exclude in the copied model. -- `update`: Optional dictionary of field-value pairs to override field values in the copied model. -- `deep`: If True, the values of fields that are Pydantic models will be deep-copied. - - - - -### method dict - -```python -self, *, -include: 'IncEx | None' = None, -exclude: 'IncEx | None' = None, -by_alias: 'bool' = False, -exclude_unset: 'bool' = False, -exclude_defaults: 'bool' = False, -exclude_none: 'bool' = False -``` - - - -##### Arguments - -- `include`: -- `exclude`: -- `by_alias`: -- `exclude_unset`: -- `exclude_defaults`: -- `exclude_none`: - - - - -### method from_orm - -```python -obj: 'Any' -``` - - - -##### Arguments - -- `obj`: - - - - -### method json - -```python -self, *, -include: 'IncEx | None' = None, -exclude: 'IncEx | None' = None, -by_alias: 'bool' = False, -exclude_unset: 'bool' = False, -exclude_defaults: 'bool' = False, -exclude_none: 'bool' = False, -encoder: 'Callable[[Any], Any] | None' = PydanticUndefined, -models_as_dict: 'bool' = PydanticUndefined, **dumps_kwargs: 'Any' -``` - - - -##### Arguments - -- `include`: -- `exclude`: -- `by_alias`: -- `exclude_unset`: -- `exclude_defaults`: -- `exclude_none`: -- `encoder`: -- `models_as_dict`: -- `dumps_kwargs`: - - - - -### method model_construct - -```python -_fields_set: 'set[str] | None' = None, **values: 'Any' -``` - -Creates a new instance of the `Model` class with validated data. - -Creates a new model setting `__dict__` and `__pydantic_fields_set__` from trusted or pre-validated data. -Default values are respected, but no other validation is performed. - -!!! note - `model_construct()` generally respects the `model_config.extra` setting on the provided model. - That is, if `model_config.extra == 'allow'`, then all extra passed values are added to the model instance's `__dict__` - and `__pydantic_extra__` fields. If `model_config.extra == 'ignore'` (the default), then all extra passed values are ignored. - Because no validation is performed with a call to `model_construct()`, having `model_config.extra == 'forbid'` does not result in - an error if extra values are passed, but they will be ignored. - -##### Arguments - -- `_fields_set`: A set of field names that were originally explicitly set during instantiation. If provided, this is directly used for the [`model_fields_set`][pydantic.BaseModel.model_fields_set] attribute. Otherwise, the field names from the `values` argument will be used. -- `values`: Trusted or pre-validated data dictionary. - - - - -### method model_copy - -```python -self, *, -update: 'Mapping[str, Any] | None' = None, -deep: 'bool' = False -``` - -!!! abstract "Usage Documentation" - [`model_copy`](../concepts/serialization.md#model_copy) - -Returns a copy of the model. - -!!! note - The underlying instance's [`__dict__`][object.__dict__] attribute is copied. This - might have unexpected side effects if you store anything in it, on top of the model - fields (e.g. the value of [cached properties][functools.cached_property]). - -##### Arguments - -- `update`: Values to change/add in the new model. Note: the data is not validated before creating the new model. You should trust this data. -- `deep`: Set to `True` to make a deep copy of the model. - - - - ### method model_dump ```python @@ -251,266 +78,6 @@ Generates a JSON representation of the model using Pydantic's `to_json` method. -### method model_json_schema - -```python -by_alias: 'bool' = True, -ref_template: 'str' = '#/$defs/{model}', -schema_generator: 'type[GenerateJsonSchema]' = , -mode: 'JsonSchemaMode' = 'validation' -``` - -Generates a JSON schema for a model class. - -##### Arguments - -- `by_alias`: Whether to use attribute aliases or not. -- `ref_template`: The reference template. -- `schema_generator`: To override the logic used to generate the JSON schema, as a subclass of `GenerateJsonSchema` with your desired modifications -- `mode`: The mode in which to generate the schema. - - - - -### method model_parametrized_name - -```python -params: 'tuple[type[Any], ...]' -``` - -Compute the class name for parametrizations of generic classes. - -This method can be overridden to achieve a custom naming scheme for generic BaseModels. - -##### Arguments - -- `params`: Tuple of types of the class. Given a generic class `Model` with 2 type variables and a concrete model `Model[str, int]`, the value `(str, int)` would be passed to `params`. - - -##### Raises - -- `TypeError`: Raised when trying to generate concrete names for non-generic models. - - -### method model_post_init - -```python -self, -context: 'Any', / -``` - -Override this method to perform additional initialization after `__init__` and `model_construct`. -This is useful if you want to do some validation that requires the entire model to be initialized. - -##### Arguments - -- `context`: - - - - -### method model_rebuild - -```python -*, -force: 'bool' = False, -raise_errors: 'bool' = True, -_parent_namespace_depth: 'int' = 2, -_types_namespace: 'MappingNamespace | None' = None -``` - -Try to rebuild the pydantic-core schema for the model. - -This may be necessary when one of the annotations is a ForwardRef which could not be resolved during -the initial attempt to build the schema, and automatic rebuilding fails. - -##### Arguments - -- `force`: Whether to force the rebuilding of the model schema, defaults to `False`. -- `raise_errors`: Whether to raise errors, defaults to `True`. -- `_parent_namespace_depth`: The depth level of the parent namespace, defaults to 2. -- `_types_namespace`: The types namespace, defaults to `None`. - - - - -### method model_validate - -```python -obj: 'Any', *, -strict: 'bool | None' = None, -from_attributes: 'bool | None' = None, -context: 'Any | None' = None, -by_alias: 'bool | None' = None, -by_name: 'bool | None' = None -``` - -Validate a pydantic model instance. - -##### Arguments - -- `obj`: The object to validate. -- `strict`: Whether to enforce types strictly. -- `from_attributes`: Whether to extract data from object attributes. -- `context`: Additional context to pass to the validator. -- `by_alias`: Whether to use the field's alias when validating against the provided input data. -- `by_name`: Whether to use the field's name when validating against the provided input data. - - -##### Raises - -- `ValidationError`: If the object could not be validated. - - -### method model_validate_json - -```python -json_data: 'str | bytes | bytearray', *, -strict: 'bool | None' = None, -context: 'Any | None' = None, -by_alias: 'bool | None' = None, -by_name: 'bool | None' = None -``` - -!!! abstract "Usage Documentation" - [JSON Parsing](../concepts/json.md#json-parsing) - -Validate the given JSON data against the Pydantic model. - -##### Arguments - -- `json_data`: The JSON data to validate. -- `strict`: Whether to enforce types strictly. -- `context`: Extra variables to pass to the validator. -- `by_alias`: Whether to use the field's alias when validating against the provided input data. -- `by_name`: Whether to use the field's name when validating against the provided input data. - - -##### Raises - -- `ValidationError`: If `json_data` is not a JSON string or the object could not be validated. - - -### method model_validate_strings - -```python -obj: 'Any', *, -strict: 'bool | None' = None, -context: 'Any | None' = None, -by_alias: 'bool | None' = None, -by_name: 'bool | None' = None -``` - -Validate the given object with string data against the Pydantic model. - -##### Arguments - -- `obj`: The object containing string data to validate. -- `strict`: Whether to enforce types strictly. -- `context`: Extra variables to pass to the validator. -- `by_alias`: Whether to use the field's alias when validating against the provided input data. -- `by_name`: Whether to use the field's name when validating against the provided input data. - - - - -### method parse_file - -```python -path: 'str | Path', *, -content_type: 'str | None' = None, -encoding: 'str' = 'utf8', -proto: 'DeprecatedParseProtocol | None' = None, -allow_pickle: 'bool' = False -``` - - - -##### Arguments - -- `path`: -- `content_type`: -- `encoding`: -- `proto`: -- `allow_pickle`: - - - - -### method parse_obj - -```python -obj: 'Any' -``` - - - -##### Arguments - -- `obj`: - - - - -### method parse_raw - -```python -b: 'str | bytes', *, -content_type: 'str | None' = None, -encoding: 'str' = 'utf8', -proto: 'DeprecatedParseProtocol | None' = None, -allow_pickle: 'bool' = False -``` - - - -##### Arguments - -- `b`: -- `content_type`: -- `encoding`: -- `proto`: -- `allow_pickle`: - - - - -### method schema - -```python -by_alias: 'bool' = True, -ref_template: 'str' = '#/$defs/{model}' -``` - - - -##### Arguments - -- `by_alias`: -- `ref_template`: - - - - -### method schema_json - -```python -*, -by_alias: 'bool' = True, -ref_template: 'str' = '#/$defs/{model}', **dumps_kwargs: 'Any' -``` - - - -##### Arguments - -- `by_alias`: -- `ref_template`: -- `dumps_kwargs`: - - - - ### method then ```python @@ -527,35 +94,5 @@ Define a new Automation in which this event triggers the given action. -### method update_forward_refs - -```python -**localns: 'Any' -``` - - - -##### Arguments - -- `localns`: - - - - -### method validate - -```python -value: 'Any' -``` - - - -##### Arguments - -- `value`: - - - - diff --git a/models/ref/python/automations/oncreateartifact.mdx b/models/ref/python/automations/oncreateartifact.mdx index f6ced11f1b..653023a8cc 100644 --- a/models/ref/python/automations/oncreateartifact.mdx +++ b/models/ref/python/automations/oncreateartifact.mdx @@ -51,179 +51,6 @@ event = OnCreateArtifact(scope=collection) ## Methods -### method construct - -```python -_fields_set: 'set[str] | None' = None, **values: 'Any' -``` - - - -##### Arguments - -- `_fields_set`: -- `values`: - - - - -### method copy - -```python -self, *, -include: 'AbstractSetIntStr | MappingIntStrAny | None' = None, -exclude: 'AbstractSetIntStr | MappingIntStrAny | None' = None, -update: 'Dict[str, Any] | None' = None, -deep: 'bool' = False -``` - -Returns a copy of the model. - -!!! warning "Deprecated" - This method is now deprecated; use `model_copy` instead. - -If you need `include` or `exclude`, use: - -```python {test="skip" lint="skip"} -data = self.model_dump(include=include, exclude=exclude, round_trip=True) -data = {**data, **(update or {})} -copied = self.model_validate(data) -``` - -##### Arguments - -- `include`: Optional set or mapping specifying which fields to include in the copied model. -- `exclude`: Optional set or mapping specifying which fields to exclude in the copied model. -- `update`: Optional dictionary of field-value pairs to override field values in the copied model. -- `deep`: If True, the values of fields that are Pydantic models will be deep-copied. - - - - -### method dict - -```python -self, *, -include: 'IncEx | None' = None, -exclude: 'IncEx | None' = None, -by_alias: 'bool' = False, -exclude_unset: 'bool' = False, -exclude_defaults: 'bool' = False, -exclude_none: 'bool' = False -``` - - - -##### Arguments - -- `include`: -- `exclude`: -- `by_alias`: -- `exclude_unset`: -- `exclude_defaults`: -- `exclude_none`: - - - - -### method from_orm - -```python -obj: 'Any' -``` - - - -##### Arguments - -- `obj`: - - - - -### method json - -```python -self, *, -include: 'IncEx | None' = None, -exclude: 'IncEx | None' = None, -by_alias: 'bool' = False, -exclude_unset: 'bool' = False, -exclude_defaults: 'bool' = False, -exclude_none: 'bool' = False, -encoder: 'Callable[[Any], Any] | None' = PydanticUndefined, -models_as_dict: 'bool' = PydanticUndefined, **dumps_kwargs: 'Any' -``` - - - -##### Arguments - -- `include`: -- `exclude`: -- `by_alias`: -- `exclude_unset`: -- `exclude_defaults`: -- `exclude_none`: -- `encoder`: -- `models_as_dict`: -- `dumps_kwargs`: - - - - -### method model_construct - -```python -_fields_set: 'set[str] | None' = None, **values: 'Any' -``` - -Creates a new instance of the `Model` class with validated data. - -Creates a new model setting `__dict__` and `__pydantic_fields_set__` from trusted or pre-validated data. -Default values are respected, but no other validation is performed. - -!!! note - `model_construct()` generally respects the `model_config.extra` setting on the provided model. - That is, if `model_config.extra == 'allow'`, then all extra passed values are added to the model instance's `__dict__` - and `__pydantic_extra__` fields. If `model_config.extra == 'ignore'` (the default), then all extra passed values are ignored. - Because no validation is performed with a call to `model_construct()`, having `model_config.extra == 'forbid'` does not result in - an error if extra values are passed, but they will be ignored. - -##### Arguments - -- `_fields_set`: A set of field names that were originally explicitly set during instantiation. If provided, this is directly used for the [`model_fields_set`][pydantic.BaseModel.model_fields_set] attribute. Otherwise, the field names from the `values` argument will be used. -- `values`: Trusted or pre-validated data dictionary. - - - - -### method model_copy - -```python -self, *, -update: 'Mapping[str, Any] | None' = None, -deep: 'bool' = False -``` - -!!! abstract "Usage Documentation" - [`model_copy`](../concepts/serialization.md#model_copy) - -Returns a copy of the model. - -!!! note - The underlying instance's [`__dict__`][object.__dict__] attribute is copied. This - might have unexpected side effects if you store anything in it, on top of the model - fields (e.g. the value of [cached properties][functools.cached_property]). - -##### Arguments - -- `update`: Values to change/add in the new model. Note: the data is not validated before creating the new model. You should trust this data. -- `deep`: Set to `True` to make a deep copy of the model. - - - - ### method model_dump ```python @@ -264,266 +91,6 @@ Generates a JSON representation of the model using Pydantic's `to_json` method. -### method model_json_schema - -```python -by_alias: 'bool' = True, -ref_template: 'str' = '#/$defs/{model}', -schema_generator: 'type[GenerateJsonSchema]' = , -mode: 'JsonSchemaMode' = 'validation' -``` - -Generates a JSON schema for a model class. - -##### Arguments - -- `by_alias`: Whether to use attribute aliases or not. -- `ref_template`: The reference template. -- `schema_generator`: To override the logic used to generate the JSON schema, as a subclass of `GenerateJsonSchema` with your desired modifications -- `mode`: The mode in which to generate the schema. - - - - -### method model_parametrized_name - -```python -params: 'tuple[type[Any], ...]' -``` - -Compute the class name for parametrizations of generic classes. - -This method can be overridden to achieve a custom naming scheme for generic BaseModels. - -##### Arguments - -- `params`: Tuple of types of the class. Given a generic class `Model` with 2 type variables and a concrete model `Model[str, int]`, the value `(str, int)` would be passed to `params`. - - -##### Raises - -- `TypeError`: Raised when trying to generate concrete names for non-generic models. - - -### method model_post_init - -```python -self, -context: 'Any', / -``` - -Override this method to perform additional initialization after `__init__` and `model_construct`. -This is useful if you want to do some validation that requires the entire model to be initialized. - -##### Arguments - -- `context`: - - - - -### method model_rebuild - -```python -*, -force: 'bool' = False, -raise_errors: 'bool' = True, -_parent_namespace_depth: 'int' = 2, -_types_namespace: 'MappingNamespace | None' = None -``` - -Try to rebuild the pydantic-core schema for the model. - -This may be necessary when one of the annotations is a ForwardRef which could not be resolved during -the initial attempt to build the schema, and automatic rebuilding fails. - -##### Arguments - -- `force`: Whether to force the rebuilding of the model schema, defaults to `False`. -- `raise_errors`: Whether to raise errors, defaults to `True`. -- `_parent_namespace_depth`: The depth level of the parent namespace, defaults to 2. -- `_types_namespace`: The types namespace, defaults to `None`. - - - - -### method model_validate - -```python -obj: 'Any', *, -strict: 'bool | None' = None, -from_attributes: 'bool | None' = None, -context: 'Any | None' = None, -by_alias: 'bool | None' = None, -by_name: 'bool | None' = None -``` - -Validate a pydantic model instance. - -##### Arguments - -- `obj`: The object to validate. -- `strict`: Whether to enforce types strictly. -- `from_attributes`: Whether to extract data from object attributes. -- `context`: Additional context to pass to the validator. -- `by_alias`: Whether to use the field's alias when validating against the provided input data. -- `by_name`: Whether to use the field's name when validating against the provided input data. - - -##### Raises - -- `ValidationError`: If the object could not be validated. - - -### method model_validate_json - -```python -json_data: 'str | bytes | bytearray', *, -strict: 'bool | None' = None, -context: 'Any | None' = None, -by_alias: 'bool | None' = None, -by_name: 'bool | None' = None -``` - -!!! abstract "Usage Documentation" - [JSON Parsing](../concepts/json.md#json-parsing) - -Validate the given JSON data against the Pydantic model. - -##### Arguments - -- `json_data`: The JSON data to validate. -- `strict`: Whether to enforce types strictly. -- `context`: Extra variables to pass to the validator. -- `by_alias`: Whether to use the field's alias when validating against the provided input data. -- `by_name`: Whether to use the field's name when validating against the provided input data. - - -##### Raises - -- `ValidationError`: If `json_data` is not a JSON string or the object could not be validated. - - -### method model_validate_strings - -```python -obj: 'Any', *, -strict: 'bool | None' = None, -context: 'Any | None' = None, -by_alias: 'bool | None' = None, -by_name: 'bool | None' = None -``` - -Validate the given object with string data against the Pydantic model. - -##### Arguments - -- `obj`: The object containing string data to validate. -- `strict`: Whether to enforce types strictly. -- `context`: Extra variables to pass to the validator. -- `by_alias`: Whether to use the field's alias when validating against the provided input data. -- `by_name`: Whether to use the field's name when validating against the provided input data. - - - - -### method parse_file - -```python -path: 'str | Path', *, -content_type: 'str | None' = None, -encoding: 'str' = 'utf8', -proto: 'DeprecatedParseProtocol | None' = None, -allow_pickle: 'bool' = False -``` - - - -##### Arguments - -- `path`: -- `content_type`: -- `encoding`: -- `proto`: -- `allow_pickle`: - - - - -### method parse_obj - -```python -obj: 'Any' -``` - - - -##### Arguments - -- `obj`: - - - - -### method parse_raw - -```python -b: 'str | bytes', *, -content_type: 'str | None' = None, -encoding: 'str' = 'utf8', -proto: 'DeprecatedParseProtocol | None' = None, -allow_pickle: 'bool' = False -``` - - - -##### Arguments - -- `b`: -- `content_type`: -- `encoding`: -- `proto`: -- `allow_pickle`: - - - - -### method schema - -```python -by_alias: 'bool' = True, -ref_template: 'str' = '#/$defs/{model}' -``` - - - -##### Arguments - -- `by_alias`: -- `ref_template`: - - - - -### method schema_json - -```python -*, -by_alias: 'bool' = True, -ref_template: 'str' = '#/$defs/{model}', **dumps_kwargs: 'Any' -``` - - - -##### Arguments - -- `by_alias`: -- `ref_template`: -- `dumps_kwargs`: - - - - ### method then ```python @@ -540,35 +107,5 @@ Define a new Automation in which this event triggers the given action. -### method update_forward_refs - -```python -**localns: 'Any' -``` - - - -##### Arguments - -- `localns`: - - - - -### method validate - -```python -value: 'Any' -``` - - - -##### Arguments - -- `value`: - - - - diff --git a/models/ref/python/automations/onlinkartifact.mdx b/models/ref/python/automations/onlinkartifact.mdx index 34d5d1c80e..b45e0b8ddc 100644 --- a/models/ref/python/automations/onlinkartifact.mdx +++ b/models/ref/python/automations/onlinkartifact.mdx @@ -54,179 +54,6 @@ event = OnLinkArtifact( ## Methods -### method construct - -```python -_fields_set: 'set[str] | None' = None, **values: 'Any' -``` - - - -##### Arguments - -- `_fields_set`: -- `values`: - - - - -### method copy - -```python -self, *, -include: 'AbstractSetIntStr | MappingIntStrAny | None' = None, -exclude: 'AbstractSetIntStr | MappingIntStrAny | None' = None, -update: 'Dict[str, Any] | None' = None, -deep: 'bool' = False -``` - -Returns a copy of the model. - -!!! warning "Deprecated" - This method is now deprecated; use `model_copy` instead. - -If you need `include` or `exclude`, use: - -```python {test="skip" lint="skip"} -data = self.model_dump(include=include, exclude=exclude, round_trip=True) -data = {**data, **(update or {})} -copied = self.model_validate(data) -``` - -##### Arguments - -- `include`: Optional set or mapping specifying which fields to include in the copied model. -- `exclude`: Optional set or mapping specifying which fields to exclude in the copied model. -- `update`: Optional dictionary of field-value pairs to override field values in the copied model. -- `deep`: If True, the values of fields that are Pydantic models will be deep-copied. - - - - -### method dict - -```python -self, *, -include: 'IncEx | None' = None, -exclude: 'IncEx | None' = None, -by_alias: 'bool' = False, -exclude_unset: 'bool' = False, -exclude_defaults: 'bool' = False, -exclude_none: 'bool' = False -``` - - - -##### Arguments - -- `include`: -- `exclude`: -- `by_alias`: -- `exclude_unset`: -- `exclude_defaults`: -- `exclude_none`: - - - - -### method from_orm - -```python -obj: 'Any' -``` - - - -##### Arguments - -- `obj`: - - - - -### method json - -```python -self, *, -include: 'IncEx | None' = None, -exclude: 'IncEx | None' = None, -by_alias: 'bool' = False, -exclude_unset: 'bool' = False, -exclude_defaults: 'bool' = False, -exclude_none: 'bool' = False, -encoder: 'Callable[[Any], Any] | None' = PydanticUndefined, -models_as_dict: 'bool' = PydanticUndefined, **dumps_kwargs: 'Any' -``` - - - -##### Arguments - -- `include`: -- `exclude`: -- `by_alias`: -- `exclude_unset`: -- `exclude_defaults`: -- `exclude_none`: -- `encoder`: -- `models_as_dict`: -- `dumps_kwargs`: - - - - -### method model_construct - -```python -_fields_set: 'set[str] | None' = None, **values: 'Any' -``` - -Creates a new instance of the `Model` class with validated data. - -Creates a new model setting `__dict__` and `__pydantic_fields_set__` from trusted or pre-validated data. -Default values are respected, but no other validation is performed. - -!!! note - `model_construct()` generally respects the `model_config.extra` setting on the provided model. - That is, if `model_config.extra == 'allow'`, then all extra passed values are added to the model instance's `__dict__` - and `__pydantic_extra__` fields. If `model_config.extra == 'ignore'` (the default), then all extra passed values are ignored. - Because no validation is performed with a call to `model_construct()`, having `model_config.extra == 'forbid'` does not result in - an error if extra values are passed, but they will be ignored. - -##### Arguments - -- `_fields_set`: A set of field names that were originally explicitly set during instantiation. If provided, this is directly used for the [`model_fields_set`][pydantic.BaseModel.model_fields_set] attribute. Otherwise, the field names from the `values` argument will be used. -- `values`: Trusted or pre-validated data dictionary. - - - - -### method model_copy - -```python -self, *, -update: 'Mapping[str, Any] | None' = None, -deep: 'bool' = False -``` - -!!! abstract "Usage Documentation" - [`model_copy`](../concepts/serialization.md#model_copy) - -Returns a copy of the model. - -!!! note - The underlying instance's [`__dict__`][object.__dict__] attribute is copied. This - might have unexpected side effects if you store anything in it, on top of the model - fields (e.g. the value of [cached properties][functools.cached_property]). - -##### Arguments - -- `update`: Values to change/add in the new model. Note: the data is not validated before creating the new model. You should trust this data. -- `deep`: Set to `True` to make a deep copy of the model. - - - - ### method model_dump ```python @@ -267,266 +94,6 @@ Generates a JSON representation of the model using Pydantic's `to_json` method. -### method model_json_schema - -```python -by_alias: 'bool' = True, -ref_template: 'str' = '#/$defs/{model}', -schema_generator: 'type[GenerateJsonSchema]' = , -mode: 'JsonSchemaMode' = 'validation' -``` - -Generates a JSON schema for a model class. - -##### Arguments - -- `by_alias`: Whether to use attribute aliases or not. -- `ref_template`: The reference template. -- `schema_generator`: To override the logic used to generate the JSON schema, as a subclass of `GenerateJsonSchema` with your desired modifications -- `mode`: The mode in which to generate the schema. - - - - -### method model_parametrized_name - -```python -params: 'tuple[type[Any], ...]' -``` - -Compute the class name for parametrizations of generic classes. - -This method can be overridden to achieve a custom naming scheme for generic BaseModels. - -##### Arguments - -- `params`: Tuple of types of the class. Given a generic class `Model` with 2 type variables and a concrete model `Model[str, int]`, the value `(str, int)` would be passed to `params`. - - -##### Raises - -- `TypeError`: Raised when trying to generate concrete names for non-generic models. - - -### method model_post_init - -```python -self, -context: 'Any', / -``` - -Override this method to perform additional initialization after `__init__` and `model_construct`. -This is useful if you want to do some validation that requires the entire model to be initialized. - -##### Arguments - -- `context`: - - - - -### method model_rebuild - -```python -*, -force: 'bool' = False, -raise_errors: 'bool' = True, -_parent_namespace_depth: 'int' = 2, -_types_namespace: 'MappingNamespace | None' = None -``` - -Try to rebuild the pydantic-core schema for the model. - -This may be necessary when one of the annotations is a ForwardRef which could not be resolved during -the initial attempt to build the schema, and automatic rebuilding fails. - -##### Arguments - -- `force`: Whether to force the rebuilding of the model schema, defaults to `False`. -- `raise_errors`: Whether to raise errors, defaults to `True`. -- `_parent_namespace_depth`: The depth level of the parent namespace, defaults to 2. -- `_types_namespace`: The types namespace, defaults to `None`. - - - - -### method model_validate - -```python -obj: 'Any', *, -strict: 'bool | None' = None, -from_attributes: 'bool | None' = None, -context: 'Any | None' = None, -by_alias: 'bool | None' = None, -by_name: 'bool | None' = None -``` - -Validate a pydantic model instance. - -##### Arguments - -- `obj`: The object to validate. -- `strict`: Whether to enforce types strictly. -- `from_attributes`: Whether to extract data from object attributes. -- `context`: Additional context to pass to the validator. -- `by_alias`: Whether to use the field's alias when validating against the provided input data. -- `by_name`: Whether to use the field's name when validating against the provided input data. - - -##### Raises - -- `ValidationError`: If the object could not be validated. - - -### method model_validate_json - -```python -json_data: 'str | bytes | bytearray', *, -strict: 'bool | None' = None, -context: 'Any | None' = None, -by_alias: 'bool | None' = None, -by_name: 'bool | None' = None -``` - -!!! abstract "Usage Documentation" - [JSON Parsing](../concepts/json.md#json-parsing) - -Validate the given JSON data against the Pydantic model. - -##### Arguments - -- `json_data`: The JSON data to validate. -- `strict`: Whether to enforce types strictly. -- `context`: Extra variables to pass to the validator. -- `by_alias`: Whether to use the field's alias when validating against the provided input data. -- `by_name`: Whether to use the field's name when validating against the provided input data. - - -##### Raises - -- `ValidationError`: If `json_data` is not a JSON string or the object could not be validated. - - -### method model_validate_strings - -```python -obj: 'Any', *, -strict: 'bool | None' = None, -context: 'Any | None' = None, -by_alias: 'bool | None' = None, -by_name: 'bool | None' = None -``` - -Validate the given object with string data against the Pydantic model. - -##### Arguments - -- `obj`: The object containing string data to validate. -- `strict`: Whether to enforce types strictly. -- `context`: Extra variables to pass to the validator. -- `by_alias`: Whether to use the field's alias when validating against the provided input data. -- `by_name`: Whether to use the field's name when validating against the provided input data. - - - - -### method parse_file - -```python -path: 'str | Path', *, -content_type: 'str | None' = None, -encoding: 'str' = 'utf8', -proto: 'DeprecatedParseProtocol | None' = None, -allow_pickle: 'bool' = False -``` - - - -##### Arguments - -- `path`: -- `content_type`: -- `encoding`: -- `proto`: -- `allow_pickle`: - - - - -### method parse_obj - -```python -obj: 'Any' -``` - - - -##### Arguments - -- `obj`: - - - - -### method parse_raw - -```python -b: 'str | bytes', *, -content_type: 'str | None' = None, -encoding: 'str' = 'utf8', -proto: 'DeprecatedParseProtocol | None' = None, -allow_pickle: 'bool' = False -``` - - - -##### Arguments - -- `b`: -- `content_type`: -- `encoding`: -- `proto`: -- `allow_pickle`: - - - - -### method schema - -```python -by_alias: 'bool' = True, -ref_template: 'str' = '#/$defs/{model}' -``` - - - -##### Arguments - -- `by_alias`: -- `ref_template`: - - - - -### method schema_json - -```python -*, -by_alias: 'bool' = True, -ref_template: 'str' = '#/$defs/{model}', **dumps_kwargs: 'Any' -``` - - - -##### Arguments - -- `by_alias`: -- `ref_template`: -- `dumps_kwargs`: - - - - ### method then ```python @@ -543,35 +110,5 @@ Define a new Automation in which this event triggers the given action. -### method update_forward_refs - -```python -**localns: 'Any' -``` - - - -##### Arguments - -- `localns`: - - - - -### method validate - -```python -value: 'Any' -``` - - - -##### Arguments - -- `value`: - - - - diff --git a/models/ref/python/automations/onremoveartifacttag.mdx b/models/ref/python/automations/onremoveartifacttag.mdx index c2514e110a..164d29e4fa 100644 --- a/models/ref/python/automations/onremoveartifacttag.mdx +++ b/models/ref/python/automations/onremoveartifacttag.mdx @@ -38,179 +38,6 @@ A tag is removed from an artifact version. ## Methods -### method construct - -```python -_fields_set: 'set[str] | None' = None, **values: 'Any' -``` - - - -##### Arguments - -- `_fields_set`: -- `values`: - - - - -### method copy - -```python -self, *, -include: 'AbstractSetIntStr | MappingIntStrAny | None' = None, -exclude: 'AbstractSetIntStr | MappingIntStrAny | None' = None, -update: 'Dict[str, Any] | None' = None, -deep: 'bool' = False -``` - -Returns a copy of the model. - -!!! warning "Deprecated" - This method is now deprecated; use `model_copy` instead. - -If you need `include` or `exclude`, use: - -```python {test="skip" lint="skip"} -data = self.model_dump(include=include, exclude=exclude, round_trip=True) -data = {**data, **(update or {})} -copied = self.model_validate(data) -``` - -##### Arguments - -- `include`: Optional set or mapping specifying which fields to include in the copied model. -- `exclude`: Optional set or mapping specifying which fields to exclude in the copied model. -- `update`: Optional dictionary of field-value pairs to override field values in the copied model. -- `deep`: If True, the values of fields that are Pydantic models will be deep-copied. - - - - -### method dict - -```python -self, *, -include: 'IncEx | None' = None, -exclude: 'IncEx | None' = None, -by_alias: 'bool' = False, -exclude_unset: 'bool' = False, -exclude_defaults: 'bool' = False, -exclude_none: 'bool' = False -``` - - - -##### Arguments - -- `include`: -- `exclude`: -- `by_alias`: -- `exclude_unset`: -- `exclude_defaults`: -- `exclude_none`: - - - - -### method from_orm - -```python -obj: 'Any' -``` - - - -##### Arguments - -- `obj`: - - - - -### method json - -```python -self, *, -include: 'IncEx | None' = None, -exclude: 'IncEx | None' = None, -by_alias: 'bool' = False, -exclude_unset: 'bool' = False, -exclude_defaults: 'bool' = False, -exclude_none: 'bool' = False, -encoder: 'Callable[[Any], Any] | None' = PydanticUndefined, -models_as_dict: 'bool' = PydanticUndefined, **dumps_kwargs: 'Any' -``` - - - -##### Arguments - -- `include`: -- `exclude`: -- `by_alias`: -- `exclude_unset`: -- `exclude_defaults`: -- `exclude_none`: -- `encoder`: -- `models_as_dict`: -- `dumps_kwargs`: - - - - -### method model_construct - -```python -_fields_set: 'set[str] | None' = None, **values: 'Any' -``` - -Creates a new instance of the `Model` class with validated data. - -Creates a new model setting `__dict__` and `__pydantic_fields_set__` from trusted or pre-validated data. -Default values are respected, but no other validation is performed. - -!!! note - `model_construct()` generally respects the `model_config.extra` setting on the provided model. - That is, if `model_config.extra == 'allow'`, then all extra passed values are added to the model instance's `__dict__` - and `__pydantic_extra__` fields. If `model_config.extra == 'ignore'` (the default), then all extra passed values are ignored. - Because no validation is performed with a call to `model_construct()`, having `model_config.extra == 'forbid'` does not result in - an error if extra values are passed, but they will be ignored. - -##### Arguments - -- `_fields_set`: A set of field names that were originally explicitly set during instantiation. If provided, this is directly used for the [`model_fields_set`][pydantic.BaseModel.model_fields_set] attribute. Otherwise, the field names from the `values` argument will be used. -- `values`: Trusted or pre-validated data dictionary. - - - - -### method model_copy - -```python -self, *, -update: 'Mapping[str, Any] | None' = None, -deep: 'bool' = False -``` - -!!! abstract "Usage Documentation" - [`model_copy`](../concepts/serialization.md#model_copy) - -Returns a copy of the model. - -!!! note - The underlying instance's [`__dict__`][object.__dict__] attribute is copied. This - might have unexpected side effects if you store anything in it, on top of the model - fields (e.g. the value of [cached properties][functools.cached_property]). - -##### Arguments - -- `update`: Values to change/add in the new model. Note: the data is not validated before creating the new model. You should trust this data. -- `deep`: Set to `True` to make a deep copy of the model. - - - - ### method model_dump ```python @@ -251,266 +78,6 @@ Generates a JSON representation of the model using Pydantic's `to_json` method. -### method model_json_schema - -```python -by_alias: 'bool' = True, -ref_template: 'str' = '#/$defs/{model}', -schema_generator: 'type[GenerateJsonSchema]' = , -mode: 'JsonSchemaMode' = 'validation' -``` - -Generates a JSON schema for a model class. - -##### Arguments - -- `by_alias`: Whether to use attribute aliases or not. -- `ref_template`: The reference template. -- `schema_generator`: To override the logic used to generate the JSON schema, as a subclass of `GenerateJsonSchema` with your desired modifications -- `mode`: The mode in which to generate the schema. - - - - -### method model_parametrized_name - -```python -params: 'tuple[type[Any], ...]' -``` - -Compute the class name for parametrizations of generic classes. - -This method can be overridden to achieve a custom naming scheme for generic BaseModels. - -##### Arguments - -- `params`: Tuple of types of the class. Given a generic class `Model` with 2 type variables and a concrete model `Model[str, int]`, the value `(str, int)` would be passed to `params`. - - -##### Raises - -- `TypeError`: Raised when trying to generate concrete names for non-generic models. - - -### method model_post_init - -```python -self, -context: 'Any', / -``` - -Override this method to perform additional initialization after `__init__` and `model_construct`. -This is useful if you want to do some validation that requires the entire model to be initialized. - -##### Arguments - -- `context`: - - - - -### method model_rebuild - -```python -*, -force: 'bool' = False, -raise_errors: 'bool' = True, -_parent_namespace_depth: 'int' = 2, -_types_namespace: 'MappingNamespace | None' = None -``` - -Try to rebuild the pydantic-core schema for the model. - -This may be necessary when one of the annotations is a ForwardRef which could not be resolved during -the initial attempt to build the schema, and automatic rebuilding fails. - -##### Arguments - -- `force`: Whether to force the rebuilding of the model schema, defaults to `False`. -- `raise_errors`: Whether to raise errors, defaults to `True`. -- `_parent_namespace_depth`: The depth level of the parent namespace, defaults to 2. -- `_types_namespace`: The types namespace, defaults to `None`. - - - - -### method model_validate - -```python -obj: 'Any', *, -strict: 'bool | None' = None, -from_attributes: 'bool | None' = None, -context: 'Any | None' = None, -by_alias: 'bool | None' = None, -by_name: 'bool | None' = None -``` - -Validate a pydantic model instance. - -##### Arguments - -- `obj`: The object to validate. -- `strict`: Whether to enforce types strictly. -- `from_attributes`: Whether to extract data from object attributes. -- `context`: Additional context to pass to the validator. -- `by_alias`: Whether to use the field's alias when validating against the provided input data. -- `by_name`: Whether to use the field's name when validating against the provided input data. - - -##### Raises - -- `ValidationError`: If the object could not be validated. - - -### method model_validate_json - -```python -json_data: 'str | bytes | bytearray', *, -strict: 'bool | None' = None, -context: 'Any | None' = None, -by_alias: 'bool | None' = None, -by_name: 'bool | None' = None -``` - -!!! abstract "Usage Documentation" - [JSON Parsing](../concepts/json.md#json-parsing) - -Validate the given JSON data against the Pydantic model. - -##### Arguments - -- `json_data`: The JSON data to validate. -- `strict`: Whether to enforce types strictly. -- `context`: Extra variables to pass to the validator. -- `by_alias`: Whether to use the field's alias when validating against the provided input data. -- `by_name`: Whether to use the field's name when validating against the provided input data. - - -##### Raises - -- `ValidationError`: If `json_data` is not a JSON string or the object could not be validated. - - -### method model_validate_strings - -```python -obj: 'Any', *, -strict: 'bool | None' = None, -context: 'Any | None' = None, -by_alias: 'bool | None' = None, -by_name: 'bool | None' = None -``` - -Validate the given object with string data against the Pydantic model. - -##### Arguments - -- `obj`: The object containing string data to validate. -- `strict`: Whether to enforce types strictly. -- `context`: Extra variables to pass to the validator. -- `by_alias`: Whether to use the field's alias when validating against the provided input data. -- `by_name`: Whether to use the field's name when validating against the provided input data. - - - - -### method parse_file - -```python -path: 'str | Path', *, -content_type: 'str | None' = None, -encoding: 'str' = 'utf8', -proto: 'DeprecatedParseProtocol | None' = None, -allow_pickle: 'bool' = False -``` - - - -##### Arguments - -- `path`: -- `content_type`: -- `encoding`: -- `proto`: -- `allow_pickle`: - - - - -### method parse_obj - -```python -obj: 'Any' -``` - - - -##### Arguments - -- `obj`: - - - - -### method parse_raw - -```python -b: 'str | bytes', *, -content_type: 'str | None' = None, -encoding: 'str' = 'utf8', -proto: 'DeprecatedParseProtocol | None' = None, -allow_pickle: 'bool' = False -``` - - - -##### Arguments - -- `b`: -- `content_type`: -- `encoding`: -- `proto`: -- `allow_pickle`: - - - - -### method schema - -```python -by_alias: 'bool' = True, -ref_template: 'str' = '#/$defs/{model}' -``` - - - -##### Arguments - -- `by_alias`: -- `ref_template`: - - - - -### method schema_json - -```python -*, -by_alias: 'bool' = True, -ref_template: 'str' = '#/$defs/{model}', **dumps_kwargs: 'Any' -``` - - - -##### Arguments - -- `by_alias`: -- `ref_template`: -- `dumps_kwargs`: - - - - ### method then ```python @@ -527,35 +94,5 @@ Define a new Automation in which this event triggers the given action. -### method update_forward_refs - -```python -**localns: 'Any' -``` - - - -##### Arguments - -- `localns`: - - - - -### method validate - -```python -value: 'Any' -``` - - - -##### Arguments - -- `value`: - - - - diff --git a/models/ref/python/automations/onremovecollectiontag.mdx b/models/ref/python/automations/onremovecollectiontag.mdx index 8f2580f16e..4d2644cd1f 100644 --- a/models/ref/python/automations/onremovecollectiontag.mdx +++ b/models/ref/python/automations/onremovecollectiontag.mdx @@ -38,179 +38,6 @@ A tag is removed from an artifact collection. ## Methods -### method construct - -```python -_fields_set: 'set[str] | None' = None, **values: 'Any' -``` - - - -##### Arguments - -- `_fields_set`: -- `values`: - - - - -### method copy - -```python -self, *, -include: 'AbstractSetIntStr | MappingIntStrAny | None' = None, -exclude: 'AbstractSetIntStr | MappingIntStrAny | None' = None, -update: 'Dict[str, Any] | None' = None, -deep: 'bool' = False -``` - -Returns a copy of the model. - -!!! warning "Deprecated" - This method is now deprecated; use `model_copy` instead. - -If you need `include` or `exclude`, use: - -```python {test="skip" lint="skip"} -data = self.model_dump(include=include, exclude=exclude, round_trip=True) -data = {**data, **(update or {})} -copied = self.model_validate(data) -``` - -##### Arguments - -- `include`: Optional set or mapping specifying which fields to include in the copied model. -- `exclude`: Optional set or mapping specifying which fields to exclude in the copied model. -- `update`: Optional dictionary of field-value pairs to override field values in the copied model. -- `deep`: If True, the values of fields that are Pydantic models will be deep-copied. - - - - -### method dict - -```python -self, *, -include: 'IncEx | None' = None, -exclude: 'IncEx | None' = None, -by_alias: 'bool' = False, -exclude_unset: 'bool' = False, -exclude_defaults: 'bool' = False, -exclude_none: 'bool' = False -``` - - - -##### Arguments - -- `include`: -- `exclude`: -- `by_alias`: -- `exclude_unset`: -- `exclude_defaults`: -- `exclude_none`: - - - - -### method from_orm - -```python -obj: 'Any' -``` - - - -##### Arguments - -- `obj`: - - - - -### method json - -```python -self, *, -include: 'IncEx | None' = None, -exclude: 'IncEx | None' = None, -by_alias: 'bool' = False, -exclude_unset: 'bool' = False, -exclude_defaults: 'bool' = False, -exclude_none: 'bool' = False, -encoder: 'Callable[[Any], Any] | None' = PydanticUndefined, -models_as_dict: 'bool' = PydanticUndefined, **dumps_kwargs: 'Any' -``` - - - -##### Arguments - -- `include`: -- `exclude`: -- `by_alias`: -- `exclude_unset`: -- `exclude_defaults`: -- `exclude_none`: -- `encoder`: -- `models_as_dict`: -- `dumps_kwargs`: - - - - -### method model_construct - -```python -_fields_set: 'set[str] | None' = None, **values: 'Any' -``` - -Creates a new instance of the `Model` class with validated data. - -Creates a new model setting `__dict__` and `__pydantic_fields_set__` from trusted or pre-validated data. -Default values are respected, but no other validation is performed. - -!!! note - `model_construct()` generally respects the `model_config.extra` setting on the provided model. - That is, if `model_config.extra == 'allow'`, then all extra passed values are added to the model instance's `__dict__` - and `__pydantic_extra__` fields. If `model_config.extra == 'ignore'` (the default), then all extra passed values are ignored. - Because no validation is performed with a call to `model_construct()`, having `model_config.extra == 'forbid'` does not result in - an error if extra values are passed, but they will be ignored. - -##### Arguments - -- `_fields_set`: A set of field names that were originally explicitly set during instantiation. If provided, this is directly used for the [`model_fields_set`][pydantic.BaseModel.model_fields_set] attribute. Otherwise, the field names from the `values` argument will be used. -- `values`: Trusted or pre-validated data dictionary. - - - - -### method model_copy - -```python -self, *, -update: 'Mapping[str, Any] | None' = None, -deep: 'bool' = False -``` - -!!! abstract "Usage Documentation" - [`model_copy`](../concepts/serialization.md#model_copy) - -Returns a copy of the model. - -!!! note - The underlying instance's [`__dict__`][object.__dict__] attribute is copied. This - might have unexpected side effects if you store anything in it, on top of the model - fields (e.g. the value of [cached properties][functools.cached_property]). - -##### Arguments - -- `update`: Values to change/add in the new model. Note: the data is not validated before creating the new model. You should trust this data. -- `deep`: Set to `True` to make a deep copy of the model. - - - - ### method model_dump ```python @@ -251,266 +78,6 @@ Generates a JSON representation of the model using Pydantic's `to_json` method. -### method model_json_schema - -```python -by_alias: 'bool' = True, -ref_template: 'str' = '#/$defs/{model}', -schema_generator: 'type[GenerateJsonSchema]' = , -mode: 'JsonSchemaMode' = 'validation' -``` - -Generates a JSON schema for a model class. - -##### Arguments - -- `by_alias`: Whether to use attribute aliases or not. -- `ref_template`: The reference template. -- `schema_generator`: To override the logic used to generate the JSON schema, as a subclass of `GenerateJsonSchema` with your desired modifications -- `mode`: The mode in which to generate the schema. - - - - -### method model_parametrized_name - -```python -params: 'tuple[type[Any], ...]' -``` - -Compute the class name for parametrizations of generic classes. - -This method can be overridden to achieve a custom naming scheme for generic BaseModels. - -##### Arguments - -- `params`: Tuple of types of the class. Given a generic class `Model` with 2 type variables and a concrete model `Model[str, int]`, the value `(str, int)` would be passed to `params`. - - -##### Raises - -- `TypeError`: Raised when trying to generate concrete names for non-generic models. - - -### method model_post_init - -```python -self, -context: 'Any', / -``` - -Override this method to perform additional initialization after `__init__` and `model_construct`. -This is useful if you want to do some validation that requires the entire model to be initialized. - -##### Arguments - -- `context`: - - - - -### method model_rebuild - -```python -*, -force: 'bool' = False, -raise_errors: 'bool' = True, -_parent_namespace_depth: 'int' = 2, -_types_namespace: 'MappingNamespace | None' = None -``` - -Try to rebuild the pydantic-core schema for the model. - -This may be necessary when one of the annotations is a ForwardRef which could not be resolved during -the initial attempt to build the schema, and automatic rebuilding fails. - -##### Arguments - -- `force`: Whether to force the rebuilding of the model schema, defaults to `False`. -- `raise_errors`: Whether to raise errors, defaults to `True`. -- `_parent_namespace_depth`: The depth level of the parent namespace, defaults to 2. -- `_types_namespace`: The types namespace, defaults to `None`. - - - - -### method model_validate - -```python -obj: 'Any', *, -strict: 'bool | None' = None, -from_attributes: 'bool | None' = None, -context: 'Any | None' = None, -by_alias: 'bool | None' = None, -by_name: 'bool | None' = None -``` - -Validate a pydantic model instance. - -##### Arguments - -- `obj`: The object to validate. -- `strict`: Whether to enforce types strictly. -- `from_attributes`: Whether to extract data from object attributes. -- `context`: Additional context to pass to the validator. -- `by_alias`: Whether to use the field's alias when validating against the provided input data. -- `by_name`: Whether to use the field's name when validating against the provided input data. - - -##### Raises - -- `ValidationError`: If the object could not be validated. - - -### method model_validate_json - -```python -json_data: 'str | bytes | bytearray', *, -strict: 'bool | None' = None, -context: 'Any | None' = None, -by_alias: 'bool | None' = None, -by_name: 'bool | None' = None -``` - -!!! abstract "Usage Documentation" - [JSON Parsing](../concepts/json.md#json-parsing) - -Validate the given JSON data against the Pydantic model. - -##### Arguments - -- `json_data`: The JSON data to validate. -- `strict`: Whether to enforce types strictly. -- `context`: Extra variables to pass to the validator. -- `by_alias`: Whether to use the field's alias when validating against the provided input data. -- `by_name`: Whether to use the field's name when validating against the provided input data. - - -##### Raises - -- `ValidationError`: If `json_data` is not a JSON string or the object could not be validated. - - -### method model_validate_strings - -```python -obj: 'Any', *, -strict: 'bool | None' = None, -context: 'Any | None' = None, -by_alias: 'bool | None' = None, -by_name: 'bool | None' = None -``` - -Validate the given object with string data against the Pydantic model. - -##### Arguments - -- `obj`: The object containing string data to validate. -- `strict`: Whether to enforce types strictly. -- `context`: Extra variables to pass to the validator. -- `by_alias`: Whether to use the field's alias when validating against the provided input data. -- `by_name`: Whether to use the field's name when validating against the provided input data. - - - - -### method parse_file - -```python -path: 'str | Path', *, -content_type: 'str | None' = None, -encoding: 'str' = 'utf8', -proto: 'DeprecatedParseProtocol | None' = None, -allow_pickle: 'bool' = False -``` - - - -##### Arguments - -- `path`: -- `content_type`: -- `encoding`: -- `proto`: -- `allow_pickle`: - - - - -### method parse_obj - -```python -obj: 'Any' -``` - - - -##### Arguments - -- `obj`: - - - - -### method parse_raw - -```python -b: 'str | bytes', *, -content_type: 'str | None' = None, -encoding: 'str' = 'utf8', -proto: 'DeprecatedParseProtocol | None' = None, -allow_pickle: 'bool' = False -``` - - - -##### Arguments - -- `b`: -- `content_type`: -- `encoding`: -- `proto`: -- `allow_pickle`: - - - - -### method schema - -```python -by_alias: 'bool' = True, -ref_template: 'str' = '#/$defs/{model}' -``` - - - -##### Arguments - -- `by_alias`: -- `ref_template`: - - - - -### method schema_json - -```python -*, -by_alias: 'bool' = True, -ref_template: 'str' = '#/$defs/{model}', **dumps_kwargs: 'Any' -``` - - - -##### Arguments - -- `by_alias`: -- `ref_template`: -- `dumps_kwargs`: - - - - ### method then ```python @@ -527,35 +94,5 @@ Define a new Automation in which this event triggers the given action. -### method update_forward_refs - -```python -**localns: 'Any' -``` - - - -##### Arguments - -- `localns`: - - - - -### method validate - -```python -value: 'Any' -``` - - - -##### Arguments - -- `value`: - - - - diff --git a/models/ref/python/automations/onrunmetric.mdx b/models/ref/python/automations/onrunmetric.mdx index 267182fe67..682fb78d53 100644 --- a/models/ref/python/automations/onrunmetric.mdx +++ b/models/ref/python/automations/onrunmetric.mdx @@ -54,179 +54,6 @@ event = OnRunMetric( ## Methods -### method construct - -```python -_fields_set: 'set[str] | None' = None, **values: 'Any' -``` - - - -##### Arguments - -- `_fields_set`: -- `values`: - - - - -### method copy - -```python -self, *, -include: 'AbstractSetIntStr | MappingIntStrAny | None' = None, -exclude: 'AbstractSetIntStr | MappingIntStrAny | None' = None, -update: 'Dict[str, Any] | None' = None, -deep: 'bool' = False -``` - -Returns a copy of the model. - -!!! warning "Deprecated" - This method is now deprecated; use `model_copy` instead. - -If you need `include` or `exclude`, use: - -```python {test="skip" lint="skip"} -data = self.model_dump(include=include, exclude=exclude, round_trip=True) -data = {**data, **(update or {})} -copied = self.model_validate(data) -``` - -##### Arguments - -- `include`: Optional set or mapping specifying which fields to include in the copied model. -- `exclude`: Optional set or mapping specifying which fields to exclude in the copied model. -- `update`: Optional dictionary of field-value pairs to override field values in the copied model. -- `deep`: If True, the values of fields that are Pydantic models will be deep-copied. - - - - -### method dict - -```python -self, *, -include: 'IncEx | None' = None, -exclude: 'IncEx | None' = None, -by_alias: 'bool' = False, -exclude_unset: 'bool' = False, -exclude_defaults: 'bool' = False, -exclude_none: 'bool' = False -``` - - - -##### Arguments - -- `include`: -- `exclude`: -- `by_alias`: -- `exclude_unset`: -- `exclude_defaults`: -- `exclude_none`: - - - - -### method from_orm - -```python -obj: 'Any' -``` - - - -##### Arguments - -- `obj`: - - - - -### method json - -```python -self, *, -include: 'IncEx | None' = None, -exclude: 'IncEx | None' = None, -by_alias: 'bool' = False, -exclude_unset: 'bool' = False, -exclude_defaults: 'bool' = False, -exclude_none: 'bool' = False, -encoder: 'Callable[[Any], Any] | None' = PydanticUndefined, -models_as_dict: 'bool' = PydanticUndefined, **dumps_kwargs: 'Any' -``` - - - -##### Arguments - -- `include`: -- `exclude`: -- `by_alias`: -- `exclude_unset`: -- `exclude_defaults`: -- `exclude_none`: -- `encoder`: -- `models_as_dict`: -- `dumps_kwargs`: - - - - -### method model_construct - -```python -_fields_set: 'set[str] | None' = None, **values: 'Any' -``` - -Creates a new instance of the `Model` class with validated data. - -Creates a new model setting `__dict__` and `__pydantic_fields_set__` from trusted or pre-validated data. -Default values are respected, but no other validation is performed. - -!!! note - `model_construct()` generally respects the `model_config.extra` setting on the provided model. - That is, if `model_config.extra == 'allow'`, then all extra passed values are added to the model instance's `__dict__` - and `__pydantic_extra__` fields. If `model_config.extra == 'ignore'` (the default), then all extra passed values are ignored. - Because no validation is performed with a call to `model_construct()`, having `model_config.extra == 'forbid'` does not result in - an error if extra values are passed, but they will be ignored. - -##### Arguments - -- `_fields_set`: A set of field names that were originally explicitly set during instantiation. If provided, this is directly used for the [`model_fields_set`][pydantic.BaseModel.model_fields_set] attribute. Otherwise, the field names from the `values` argument will be used. -- `values`: Trusted or pre-validated data dictionary. - - - - -### method model_copy - -```python -self, *, -update: 'Mapping[str, Any] | None' = None, -deep: 'bool' = False -``` - -!!! abstract "Usage Documentation" - [`model_copy`](../concepts/serialization.md#model_copy) - -Returns a copy of the model. - -!!! note - The underlying instance's [`__dict__`][object.__dict__] attribute is copied. This - might have unexpected side effects if you store anything in it, on top of the model - fields (e.g. the value of [cached properties][functools.cached_property]). - -##### Arguments - -- `update`: Values to change/add in the new model. Note: the data is not validated before creating the new model. You should trust this data. -- `deep`: Set to `True` to make a deep copy of the model. - - - - ### method model_dump ```python @@ -267,266 +94,6 @@ Generates a JSON representation of the model using Pydantic's `to_json` method. -### method model_json_schema - -```python -by_alias: 'bool' = True, -ref_template: 'str' = '#/$defs/{model}', -schema_generator: 'type[GenerateJsonSchema]' = , -mode: 'JsonSchemaMode' = 'validation' -``` - -Generates a JSON schema for a model class. - -##### Arguments - -- `by_alias`: Whether to use attribute aliases or not. -- `ref_template`: The reference template. -- `schema_generator`: To override the logic used to generate the JSON schema, as a subclass of `GenerateJsonSchema` with your desired modifications -- `mode`: The mode in which to generate the schema. - - - - -### method model_parametrized_name - -```python -params: 'tuple[type[Any], ...]' -``` - -Compute the class name for parametrizations of generic classes. - -This method can be overridden to achieve a custom naming scheme for generic BaseModels. - -##### Arguments - -- `params`: Tuple of types of the class. Given a generic class `Model` with 2 type variables and a concrete model `Model[str, int]`, the value `(str, int)` would be passed to `params`. - - -##### Raises - -- `TypeError`: Raised when trying to generate concrete names for non-generic models. - - -### method model_post_init - -```python -self, -context: 'Any', / -``` - -Override this method to perform additional initialization after `__init__` and `model_construct`. -This is useful if you want to do some validation that requires the entire model to be initialized. - -##### Arguments - -- `context`: - - - - -### method model_rebuild - -```python -*, -force: 'bool' = False, -raise_errors: 'bool' = True, -_parent_namespace_depth: 'int' = 2, -_types_namespace: 'MappingNamespace | None' = None -``` - -Try to rebuild the pydantic-core schema for the model. - -This may be necessary when one of the annotations is a ForwardRef which could not be resolved during -the initial attempt to build the schema, and automatic rebuilding fails. - -##### Arguments - -- `force`: Whether to force the rebuilding of the model schema, defaults to `False`. -- `raise_errors`: Whether to raise errors, defaults to `True`. -- `_parent_namespace_depth`: The depth level of the parent namespace, defaults to 2. -- `_types_namespace`: The types namespace, defaults to `None`. - - - - -### method model_validate - -```python -obj: 'Any', *, -strict: 'bool | None' = None, -from_attributes: 'bool | None' = None, -context: 'Any | None' = None, -by_alias: 'bool | None' = None, -by_name: 'bool | None' = None -``` - -Validate a pydantic model instance. - -##### Arguments - -- `obj`: The object to validate. -- `strict`: Whether to enforce types strictly. -- `from_attributes`: Whether to extract data from object attributes. -- `context`: Additional context to pass to the validator. -- `by_alias`: Whether to use the field's alias when validating against the provided input data. -- `by_name`: Whether to use the field's name when validating against the provided input data. - - -##### Raises - -- `ValidationError`: If the object could not be validated. - - -### method model_validate_json - -```python -json_data: 'str | bytes | bytearray', *, -strict: 'bool | None' = None, -context: 'Any | None' = None, -by_alias: 'bool | None' = None, -by_name: 'bool | None' = None -``` - -!!! abstract "Usage Documentation" - [JSON Parsing](../concepts/json.md#json-parsing) - -Validate the given JSON data against the Pydantic model. - -##### Arguments - -- `json_data`: The JSON data to validate. -- `strict`: Whether to enforce types strictly. -- `context`: Extra variables to pass to the validator. -- `by_alias`: Whether to use the field's alias when validating against the provided input data. -- `by_name`: Whether to use the field's name when validating against the provided input data. - - -##### Raises - -- `ValidationError`: If `json_data` is not a JSON string or the object could not be validated. - - -### method model_validate_strings - -```python -obj: 'Any', *, -strict: 'bool | None' = None, -context: 'Any | None' = None, -by_alias: 'bool | None' = None, -by_name: 'bool | None' = None -``` - -Validate the given object with string data against the Pydantic model. - -##### Arguments - -- `obj`: The object containing string data to validate. -- `strict`: Whether to enforce types strictly. -- `context`: Extra variables to pass to the validator. -- `by_alias`: Whether to use the field's alias when validating against the provided input data. -- `by_name`: Whether to use the field's name when validating against the provided input data. - - - - -### method parse_file - -```python -path: 'str | Path', *, -content_type: 'str | None' = None, -encoding: 'str' = 'utf8', -proto: 'DeprecatedParseProtocol | None' = None, -allow_pickle: 'bool' = False -``` - - - -##### Arguments - -- `path`: -- `content_type`: -- `encoding`: -- `proto`: -- `allow_pickle`: - - - - -### method parse_obj - -```python -obj: 'Any' -``` - - - -##### Arguments - -- `obj`: - - - - -### method parse_raw - -```python -b: 'str | bytes', *, -content_type: 'str | None' = None, -encoding: 'str' = 'utf8', -proto: 'DeprecatedParseProtocol | None' = None, -allow_pickle: 'bool' = False -``` - - - -##### Arguments - -- `b`: -- `content_type`: -- `encoding`: -- `proto`: -- `allow_pickle`: - - - - -### method schema - -```python -by_alias: 'bool' = True, -ref_template: 'str' = '#/$defs/{model}' -``` - - - -##### Arguments - -- `by_alias`: -- `ref_template`: - - - - -### method schema_json - -```python -*, -by_alias: 'bool' = True, -ref_template: 'str' = '#/$defs/{model}', **dumps_kwargs: 'Any' -``` - - - -##### Arguments - -- `by_alias`: -- `ref_template`: -- `dumps_kwargs`: - - - - ### method then ```python @@ -543,35 +110,5 @@ Define a new Automation in which this event triggers the given action. -### method update_forward_refs - -```python -**localns: 'Any' -``` - - - -##### Arguments - -- `localns`: - - - - -### method validate - -```python -value: 'Any' -``` - - - -##### Arguments - -- `value`: - - - - diff --git a/models/ref/python/automations/onrunstate.mdx b/models/ref/python/automations/onrunstate.mdx index 104959da66..811e86c597 100644 --- a/models/ref/python/automations/onrunstate.mdx +++ b/models/ref/python/automations/onrunstate.mdx @@ -54,179 +54,6 @@ event = OnRunState( ## Methods -### method construct - -```python -_fields_set: 'set[str] | None' = None, **values: 'Any' -``` - - - -##### Arguments - -- `_fields_set`: -- `values`: - - - - -### method copy - -```python -self, *, -include: 'AbstractSetIntStr | MappingIntStrAny | None' = None, -exclude: 'AbstractSetIntStr | MappingIntStrAny | None' = None, -update: 'Dict[str, Any] | None' = None, -deep: 'bool' = False -``` - -Returns a copy of the model. - -!!! warning "Deprecated" - This method is now deprecated; use `model_copy` instead. - -If you need `include` or `exclude`, use: - -```python {test="skip" lint="skip"} -data = self.model_dump(include=include, exclude=exclude, round_trip=True) -data = {**data, **(update or {})} -copied = self.model_validate(data) -``` - -##### Arguments - -- `include`: Optional set or mapping specifying which fields to include in the copied model. -- `exclude`: Optional set or mapping specifying which fields to exclude in the copied model. -- `update`: Optional dictionary of field-value pairs to override field values in the copied model. -- `deep`: If True, the values of fields that are Pydantic models will be deep-copied. - - - - -### method dict - -```python -self, *, -include: 'IncEx | None' = None, -exclude: 'IncEx | None' = None, -by_alias: 'bool' = False, -exclude_unset: 'bool' = False, -exclude_defaults: 'bool' = False, -exclude_none: 'bool' = False -``` - - - -##### Arguments - -- `include`: -- `exclude`: -- `by_alias`: -- `exclude_unset`: -- `exclude_defaults`: -- `exclude_none`: - - - - -### method from_orm - -```python -obj: 'Any' -``` - - - -##### Arguments - -- `obj`: - - - - -### method json - -```python -self, *, -include: 'IncEx | None' = None, -exclude: 'IncEx | None' = None, -by_alias: 'bool' = False, -exclude_unset: 'bool' = False, -exclude_defaults: 'bool' = False, -exclude_none: 'bool' = False, -encoder: 'Callable[[Any], Any] | None' = PydanticUndefined, -models_as_dict: 'bool' = PydanticUndefined, **dumps_kwargs: 'Any' -``` - - - -##### Arguments - -- `include`: -- `exclude`: -- `by_alias`: -- `exclude_unset`: -- `exclude_defaults`: -- `exclude_none`: -- `encoder`: -- `models_as_dict`: -- `dumps_kwargs`: - - - - -### method model_construct - -```python -_fields_set: 'set[str] | None' = None, **values: 'Any' -``` - -Creates a new instance of the `Model` class with validated data. - -Creates a new model setting `__dict__` and `__pydantic_fields_set__` from trusted or pre-validated data. -Default values are respected, but no other validation is performed. - -!!! note - `model_construct()` generally respects the `model_config.extra` setting on the provided model. - That is, if `model_config.extra == 'allow'`, then all extra passed values are added to the model instance's `__dict__` - and `__pydantic_extra__` fields. If `model_config.extra == 'ignore'` (the default), then all extra passed values are ignored. - Because no validation is performed with a call to `model_construct()`, having `model_config.extra == 'forbid'` does not result in - an error if extra values are passed, but they will be ignored. - -##### Arguments - -- `_fields_set`: A set of field names that were originally explicitly set during instantiation. If provided, this is directly used for the [`model_fields_set`][pydantic.BaseModel.model_fields_set] attribute. Otherwise, the field names from the `values` argument will be used. -- `values`: Trusted or pre-validated data dictionary. - - - - -### method model_copy - -```python -self, *, -update: 'Mapping[str, Any] | None' = None, -deep: 'bool' = False -``` - -!!! abstract "Usage Documentation" - [`model_copy`](../concepts/serialization.md#model_copy) - -Returns a copy of the model. - -!!! note - The underlying instance's [`__dict__`][object.__dict__] attribute is copied. This - might have unexpected side effects if you store anything in it, on top of the model - fields (e.g. the value of [cached properties][functools.cached_property]). - -##### Arguments - -- `update`: Values to change/add in the new model. Note: the data is not validated before creating the new model. You should trust this data. -- `deep`: Set to `True` to make a deep copy of the model. - - - - ### method model_dump ```python @@ -267,266 +94,6 @@ Generates a JSON representation of the model using Pydantic's `to_json` method. -### method model_json_schema - -```python -by_alias: 'bool' = True, -ref_template: 'str' = '#/$defs/{model}', -schema_generator: 'type[GenerateJsonSchema]' = , -mode: 'JsonSchemaMode' = 'validation' -``` - -Generates a JSON schema for a model class. - -##### Arguments - -- `by_alias`: Whether to use attribute aliases or not. -- `ref_template`: The reference template. -- `schema_generator`: To override the logic used to generate the JSON schema, as a subclass of `GenerateJsonSchema` with your desired modifications -- `mode`: The mode in which to generate the schema. - - - - -### method model_parametrized_name - -```python -params: 'tuple[type[Any], ...]' -``` - -Compute the class name for parametrizations of generic classes. - -This method can be overridden to achieve a custom naming scheme for generic BaseModels. - -##### Arguments - -- `params`: Tuple of types of the class. Given a generic class `Model` with 2 type variables and a concrete model `Model[str, int]`, the value `(str, int)` would be passed to `params`. - - -##### Raises - -- `TypeError`: Raised when trying to generate concrete names for non-generic models. - - -### method model_post_init - -```python -self, -context: 'Any', / -``` - -Override this method to perform additional initialization after `__init__` and `model_construct`. -This is useful if you want to do some validation that requires the entire model to be initialized. - -##### Arguments - -- `context`: - - - - -### method model_rebuild - -```python -*, -force: 'bool' = False, -raise_errors: 'bool' = True, -_parent_namespace_depth: 'int' = 2, -_types_namespace: 'MappingNamespace | None' = None -``` - -Try to rebuild the pydantic-core schema for the model. - -This may be necessary when one of the annotations is a ForwardRef which could not be resolved during -the initial attempt to build the schema, and automatic rebuilding fails. - -##### Arguments - -- `force`: Whether to force the rebuilding of the model schema, defaults to `False`. -- `raise_errors`: Whether to raise errors, defaults to `True`. -- `_parent_namespace_depth`: The depth level of the parent namespace, defaults to 2. -- `_types_namespace`: The types namespace, defaults to `None`. - - - - -### method model_validate - -```python -obj: 'Any', *, -strict: 'bool | None' = None, -from_attributes: 'bool | None' = None, -context: 'Any | None' = None, -by_alias: 'bool | None' = None, -by_name: 'bool | None' = None -``` - -Validate a pydantic model instance. - -##### Arguments - -- `obj`: The object to validate. -- `strict`: Whether to enforce types strictly. -- `from_attributes`: Whether to extract data from object attributes. -- `context`: Additional context to pass to the validator. -- `by_alias`: Whether to use the field's alias when validating against the provided input data. -- `by_name`: Whether to use the field's name when validating against the provided input data. - - -##### Raises - -- `ValidationError`: If the object could not be validated. - - -### method model_validate_json - -```python -json_data: 'str | bytes | bytearray', *, -strict: 'bool | None' = None, -context: 'Any | None' = None, -by_alias: 'bool | None' = None, -by_name: 'bool | None' = None -``` - -!!! abstract "Usage Documentation" - [JSON Parsing](../concepts/json.md#json-parsing) - -Validate the given JSON data against the Pydantic model. - -##### Arguments - -- `json_data`: The JSON data to validate. -- `strict`: Whether to enforce types strictly. -- `context`: Extra variables to pass to the validator. -- `by_alias`: Whether to use the field's alias when validating against the provided input data. -- `by_name`: Whether to use the field's name when validating against the provided input data. - - -##### Raises - -- `ValidationError`: If `json_data` is not a JSON string or the object could not be validated. - - -### method model_validate_strings - -```python -obj: 'Any', *, -strict: 'bool | None' = None, -context: 'Any | None' = None, -by_alias: 'bool | None' = None, -by_name: 'bool | None' = None -``` - -Validate the given object with string data against the Pydantic model. - -##### Arguments - -- `obj`: The object containing string data to validate. -- `strict`: Whether to enforce types strictly. -- `context`: Extra variables to pass to the validator. -- `by_alias`: Whether to use the field's alias when validating against the provided input data. -- `by_name`: Whether to use the field's name when validating against the provided input data. - - - - -### method parse_file - -```python -path: 'str | Path', *, -content_type: 'str | None' = None, -encoding: 'str' = 'utf8', -proto: 'DeprecatedParseProtocol | None' = None, -allow_pickle: 'bool' = False -``` - - - -##### Arguments - -- `path`: -- `content_type`: -- `encoding`: -- `proto`: -- `allow_pickle`: - - - - -### method parse_obj - -```python -obj: 'Any' -``` - - - -##### Arguments - -- `obj`: - - - - -### method parse_raw - -```python -b: 'str | bytes', *, -content_type: 'str | None' = None, -encoding: 'str' = 'utf8', -proto: 'DeprecatedParseProtocol | None' = None, -allow_pickle: 'bool' = False -``` - - - -##### Arguments - -- `b`: -- `content_type`: -- `encoding`: -- `proto`: -- `allow_pickle`: - - - - -### method schema - -```python -by_alias: 'bool' = True, -ref_template: 'str' = '#/$defs/{model}' -``` - - - -##### Arguments - -- `by_alias`: -- `ref_template`: - - - - -### method schema_json - -```python -*, -by_alias: 'bool' = True, -ref_template: 'str' = '#/$defs/{model}', **dumps_kwargs: 'Any' -``` - - - -##### Arguments - -- `by_alias`: -- `ref_template`: -- `dumps_kwargs`: - - - - ### method then ```python @@ -543,35 +110,5 @@ Define a new Automation in which this event triggers the given action. -### method update_forward_refs - -```python -**localns: 'Any' -``` - - - -##### Arguments - -- `localns`: - - - - -### method validate - -```python -value: 'Any' -``` - - - -##### Arguments - -- `value`: - - - - diff --git a/models/ref/python/automations/onunlinkartifact.mdx b/models/ref/python/automations/onunlinkartifact.mdx index c397dee8b6..a34a53c7fe 100644 --- a/models/ref/python/automations/onunlinkartifact.mdx +++ b/models/ref/python/automations/onunlinkartifact.mdx @@ -38,179 +38,6 @@ An artifact version is unlinked from a collection. ## Methods -### method construct - -```python -_fields_set: 'set[str] | None' = None, **values: 'Any' -``` - - - -##### Arguments - -- `_fields_set`: -- `values`: - - - - -### method copy - -```python -self, *, -include: 'AbstractSetIntStr | MappingIntStrAny | None' = None, -exclude: 'AbstractSetIntStr | MappingIntStrAny | None' = None, -update: 'Dict[str, Any] | None' = None, -deep: 'bool' = False -``` - -Returns a copy of the model. - -!!! warning "Deprecated" - This method is now deprecated; use `model_copy` instead. - -If you need `include` or `exclude`, use: - -```python {test="skip" lint="skip"} -data = self.model_dump(include=include, exclude=exclude, round_trip=True) -data = {**data, **(update or {})} -copied = self.model_validate(data) -``` - -##### Arguments - -- `include`: Optional set or mapping specifying which fields to include in the copied model. -- `exclude`: Optional set or mapping specifying which fields to exclude in the copied model. -- `update`: Optional dictionary of field-value pairs to override field values in the copied model. -- `deep`: If True, the values of fields that are Pydantic models will be deep-copied. - - - - -### method dict - -```python -self, *, -include: 'IncEx | None' = None, -exclude: 'IncEx | None' = None, -by_alias: 'bool' = False, -exclude_unset: 'bool' = False, -exclude_defaults: 'bool' = False, -exclude_none: 'bool' = False -``` - - - -##### Arguments - -- `include`: -- `exclude`: -- `by_alias`: -- `exclude_unset`: -- `exclude_defaults`: -- `exclude_none`: - - - - -### method from_orm - -```python -obj: 'Any' -``` - - - -##### Arguments - -- `obj`: - - - - -### method json - -```python -self, *, -include: 'IncEx | None' = None, -exclude: 'IncEx | None' = None, -by_alias: 'bool' = False, -exclude_unset: 'bool' = False, -exclude_defaults: 'bool' = False, -exclude_none: 'bool' = False, -encoder: 'Callable[[Any], Any] | None' = PydanticUndefined, -models_as_dict: 'bool' = PydanticUndefined, **dumps_kwargs: 'Any' -``` - - - -##### Arguments - -- `include`: -- `exclude`: -- `by_alias`: -- `exclude_unset`: -- `exclude_defaults`: -- `exclude_none`: -- `encoder`: -- `models_as_dict`: -- `dumps_kwargs`: - - - - -### method model_construct - -```python -_fields_set: 'set[str] | None' = None, **values: 'Any' -``` - -Creates a new instance of the `Model` class with validated data. - -Creates a new model setting `__dict__` and `__pydantic_fields_set__` from trusted or pre-validated data. -Default values are respected, but no other validation is performed. - -!!! note - `model_construct()` generally respects the `model_config.extra` setting on the provided model. - That is, if `model_config.extra == 'allow'`, then all extra passed values are added to the model instance's `__dict__` - and `__pydantic_extra__` fields. If `model_config.extra == 'ignore'` (the default), then all extra passed values are ignored. - Because no validation is performed with a call to `model_construct()`, having `model_config.extra == 'forbid'` does not result in - an error if extra values are passed, but they will be ignored. - -##### Arguments - -- `_fields_set`: A set of field names that were originally explicitly set during instantiation. If provided, this is directly used for the [`model_fields_set`][pydantic.BaseModel.model_fields_set] attribute. Otherwise, the field names from the `values` argument will be used. -- `values`: Trusted or pre-validated data dictionary. - - - - -### method model_copy - -```python -self, *, -update: 'Mapping[str, Any] | None' = None, -deep: 'bool' = False -``` - -!!! abstract "Usage Documentation" - [`model_copy`](../concepts/serialization.md#model_copy) - -Returns a copy of the model. - -!!! note - The underlying instance's [`__dict__`][object.__dict__] attribute is copied. This - might have unexpected side effects if you store anything in it, on top of the model - fields (e.g. the value of [cached properties][functools.cached_property]). - -##### Arguments - -- `update`: Values to change/add in the new model. Note: the data is not validated before creating the new model. You should trust this data. -- `deep`: Set to `True` to make a deep copy of the model. - - - - ### method model_dump ```python @@ -251,266 +78,6 @@ Generates a JSON representation of the model using Pydantic's `to_json` method. -### method model_json_schema - -```python -by_alias: 'bool' = True, -ref_template: 'str' = '#/$defs/{model}', -schema_generator: 'type[GenerateJsonSchema]' = , -mode: 'JsonSchemaMode' = 'validation' -``` - -Generates a JSON schema for a model class. - -##### Arguments - -- `by_alias`: Whether to use attribute aliases or not. -- `ref_template`: The reference template. -- `schema_generator`: To override the logic used to generate the JSON schema, as a subclass of `GenerateJsonSchema` with your desired modifications -- `mode`: The mode in which to generate the schema. - - - - -### method model_parametrized_name - -```python -params: 'tuple[type[Any], ...]' -``` - -Compute the class name for parametrizations of generic classes. - -This method can be overridden to achieve a custom naming scheme for generic BaseModels. - -##### Arguments - -- `params`: Tuple of types of the class. Given a generic class `Model` with 2 type variables and a concrete model `Model[str, int]`, the value `(str, int)` would be passed to `params`. - - -##### Raises - -- `TypeError`: Raised when trying to generate concrete names for non-generic models. - - -### method model_post_init - -```python -self, -context: 'Any', / -``` - -Override this method to perform additional initialization after `__init__` and `model_construct`. -This is useful if you want to do some validation that requires the entire model to be initialized. - -##### Arguments - -- `context`: - - - - -### method model_rebuild - -```python -*, -force: 'bool' = False, -raise_errors: 'bool' = True, -_parent_namespace_depth: 'int' = 2, -_types_namespace: 'MappingNamespace | None' = None -``` - -Try to rebuild the pydantic-core schema for the model. - -This may be necessary when one of the annotations is a ForwardRef which could not be resolved during -the initial attempt to build the schema, and automatic rebuilding fails. - -##### Arguments - -- `force`: Whether to force the rebuilding of the model schema, defaults to `False`. -- `raise_errors`: Whether to raise errors, defaults to `True`. -- `_parent_namespace_depth`: The depth level of the parent namespace, defaults to 2. -- `_types_namespace`: The types namespace, defaults to `None`. - - - - -### method model_validate - -```python -obj: 'Any', *, -strict: 'bool | None' = None, -from_attributes: 'bool | None' = None, -context: 'Any | None' = None, -by_alias: 'bool | None' = None, -by_name: 'bool | None' = None -``` - -Validate a pydantic model instance. - -##### Arguments - -- `obj`: The object to validate. -- `strict`: Whether to enforce types strictly. -- `from_attributes`: Whether to extract data from object attributes. -- `context`: Additional context to pass to the validator. -- `by_alias`: Whether to use the field's alias when validating against the provided input data. -- `by_name`: Whether to use the field's name when validating against the provided input data. - - -##### Raises - -- `ValidationError`: If the object could not be validated. - - -### method model_validate_json - -```python -json_data: 'str | bytes | bytearray', *, -strict: 'bool | None' = None, -context: 'Any | None' = None, -by_alias: 'bool | None' = None, -by_name: 'bool | None' = None -``` - -!!! abstract "Usage Documentation" - [JSON Parsing](../concepts/json.md#json-parsing) - -Validate the given JSON data against the Pydantic model. - -##### Arguments - -- `json_data`: The JSON data to validate. -- `strict`: Whether to enforce types strictly. -- `context`: Extra variables to pass to the validator. -- `by_alias`: Whether to use the field's alias when validating against the provided input data. -- `by_name`: Whether to use the field's name when validating against the provided input data. - - -##### Raises - -- `ValidationError`: If `json_data` is not a JSON string or the object could not be validated. - - -### method model_validate_strings - -```python -obj: 'Any', *, -strict: 'bool | None' = None, -context: 'Any | None' = None, -by_alias: 'bool | None' = None, -by_name: 'bool | None' = None -``` - -Validate the given object with string data against the Pydantic model. - -##### Arguments - -- `obj`: The object containing string data to validate. -- `strict`: Whether to enforce types strictly. -- `context`: Extra variables to pass to the validator. -- `by_alias`: Whether to use the field's alias when validating against the provided input data. -- `by_name`: Whether to use the field's name when validating against the provided input data. - - - - -### method parse_file - -```python -path: 'str | Path', *, -content_type: 'str | None' = None, -encoding: 'str' = 'utf8', -proto: 'DeprecatedParseProtocol | None' = None, -allow_pickle: 'bool' = False -``` - - - -##### Arguments - -- `path`: -- `content_type`: -- `encoding`: -- `proto`: -- `allow_pickle`: - - - - -### method parse_obj - -```python -obj: 'Any' -``` - - - -##### Arguments - -- `obj`: - - - - -### method parse_raw - -```python -b: 'str | bytes', *, -content_type: 'str | None' = None, -encoding: 'str' = 'utf8', -proto: 'DeprecatedParseProtocol | None' = None, -allow_pickle: 'bool' = False -``` - - - -##### Arguments - -- `b`: -- `content_type`: -- `encoding`: -- `proto`: -- `allow_pickle`: - - - - -### method schema - -```python -by_alias: 'bool' = True, -ref_template: 'str' = '#/$defs/{model}' -``` - - - -##### Arguments - -- `by_alias`: -- `ref_template`: - - - - -### method schema_json - -```python -*, -by_alias: 'bool' = True, -ref_template: 'str' = '#/$defs/{model}', **dumps_kwargs: 'Any' -``` - - - -##### Arguments - -- `by_alias`: -- `ref_template`: -- `dumps_kwargs`: - - - - ### method then ```python @@ -527,35 +94,5 @@ Define a new Automation in which this event triggers the given action. -### method update_forward_refs - -```python -**localns: 'Any' -``` - - - -##### Arguments - -- `localns`: - - - - -### method validate - -```python -value: 'Any' -``` - - - -##### Arguments - -- `value`: - - - - diff --git a/models/ref/python/automations/runstatefilter.mdx b/models/ref/python/automations/runstatefilter.mdx index 2f173f5976..f569f9939d 100644 --- a/models/ref/python/automations/runstatefilter.mdx +++ b/models/ref/python/automations/runstatefilter.mdx @@ -36,179 +36,6 @@ Represents a filter for triggering events based on changes in run states. ## Methods -### method construct - -```python -_fields_set: 'set[str] | None' = None, **values: 'Any' -``` - - - -##### Arguments - -- `_fields_set`: -- `values`: - - - - -### method copy - -```python -self, *, -include: 'AbstractSetIntStr | MappingIntStrAny | None' = None, -exclude: 'AbstractSetIntStr | MappingIntStrAny | None' = None, -update: 'Dict[str, Any] | None' = None, -deep: 'bool' = False -``` - -Returns a copy of the model. - -!!! warning "Deprecated" - This method is now deprecated; use `model_copy` instead. - -If you need `include` or `exclude`, use: - -```python {test="skip" lint="skip"} -data = self.model_dump(include=include, exclude=exclude, round_trip=True) -data = {**data, **(update or {})} -copied = self.model_validate(data) -``` - -##### Arguments - -- `include`: Optional set or mapping specifying which fields to include in the copied model. -- `exclude`: Optional set or mapping specifying which fields to exclude in the copied model. -- `update`: Optional dictionary of field-value pairs to override field values in the copied model. -- `deep`: If True, the values of fields that are Pydantic models will be deep-copied. - - - - -### method dict - -```python -self, *, -include: 'IncEx | None' = None, -exclude: 'IncEx | None' = None, -by_alias: 'bool' = False, -exclude_unset: 'bool' = False, -exclude_defaults: 'bool' = False, -exclude_none: 'bool' = False -``` - - - -##### Arguments - -- `include`: -- `exclude`: -- `by_alias`: -- `exclude_unset`: -- `exclude_defaults`: -- `exclude_none`: - - - - -### method from_orm - -```python -obj: 'Any' -``` - - - -##### Arguments - -- `obj`: - - - - -### method json - -```python -self, *, -include: 'IncEx | None' = None, -exclude: 'IncEx | None' = None, -by_alias: 'bool' = False, -exclude_unset: 'bool' = False, -exclude_defaults: 'bool' = False, -exclude_none: 'bool' = False, -encoder: 'Callable[[Any], Any] | None' = PydanticUndefined, -models_as_dict: 'bool' = PydanticUndefined, **dumps_kwargs: 'Any' -``` - - - -##### Arguments - -- `include`: -- `exclude`: -- `by_alias`: -- `exclude_unset`: -- `exclude_defaults`: -- `exclude_none`: -- `encoder`: -- `models_as_dict`: -- `dumps_kwargs`: - - - - -### method model_construct - -```python -_fields_set: 'set[str] | None' = None, **values: 'Any' -``` - -Creates a new instance of the `Model` class with validated data. - -Creates a new model setting `__dict__` and `__pydantic_fields_set__` from trusted or pre-validated data. -Default values are respected, but no other validation is performed. - -!!! note - `model_construct()` generally respects the `model_config.extra` setting on the provided model. - That is, if `model_config.extra == 'allow'`, then all extra passed values are added to the model instance's `__dict__` - and `__pydantic_extra__` fields. If `model_config.extra == 'ignore'` (the default), then all extra passed values are ignored. - Because no validation is performed with a call to `model_construct()`, having `model_config.extra == 'forbid'` does not result in - an error if extra values are passed, but they will be ignored. - -##### Arguments - -- `_fields_set`: A set of field names that were originally explicitly set during instantiation. If provided, this is directly used for the [`model_fields_set`][pydantic.BaseModel.model_fields_set] attribute. Otherwise, the field names from the `values` argument will be used. -- `values`: Trusted or pre-validated data dictionary. - - - - -### method model_copy - -```python -self, *, -update: 'Mapping[str, Any] | None' = None, -deep: 'bool' = False -``` - -!!! abstract "Usage Documentation" - [`model_copy`](../concepts/serialization.md#model_copy) - -Returns a copy of the model. - -!!! note - The underlying instance's [`__dict__`][object.__dict__] attribute is copied. This - might have unexpected side effects if you store anything in it, on top of the model - fields (e.g. the value of [cached properties][functools.cached_property]). - -##### Arguments - -- `update`: Values to change/add in the new model. Note: the data is not validated before creating the new model. You should trust this data. -- `deep`: Set to `True` to make a deep copy of the model. - - - - ### method model_dump ```python @@ -249,295 +76,5 @@ Generates a JSON representation of the model using Pydantic's `to_json` method. -### method model_json_schema - -```python -by_alias: 'bool' = True, -ref_template: 'str' = '#/$defs/{model}', -schema_generator: 'type[GenerateJsonSchema]' = , -mode: 'JsonSchemaMode' = 'validation' -``` - -Generates a JSON schema for a model class. - -##### Arguments - -- `by_alias`: Whether to use attribute aliases or not. -- `ref_template`: The reference template. -- `schema_generator`: To override the logic used to generate the JSON schema, as a subclass of `GenerateJsonSchema` with your desired modifications -- `mode`: The mode in which to generate the schema. - - - - -### method model_parametrized_name - -```python -params: 'tuple[type[Any], ...]' -``` - -Compute the class name for parametrizations of generic classes. - -This method can be overridden to achieve a custom naming scheme for generic BaseModels. - -##### Arguments - -- `params`: Tuple of types of the class. Given a generic class `Model` with 2 type variables and a concrete model `Model[str, int]`, the value `(str, int)` would be passed to `params`. - - -##### Raises - -- `TypeError`: Raised when trying to generate concrete names for non-generic models. - - -### method model_post_init - -```python -self, -context: 'Any', / -``` - -Override this method to perform additional initialization after `__init__` and `model_construct`. -This is useful if you want to do some validation that requires the entire model to be initialized. - -##### Arguments - -- `context`: - - - - -### method model_rebuild - -```python -*, -force: 'bool' = False, -raise_errors: 'bool' = True, -_parent_namespace_depth: 'int' = 2, -_types_namespace: 'MappingNamespace | None' = None -``` - -Try to rebuild the pydantic-core schema for the model. - -This may be necessary when one of the annotations is a ForwardRef which could not be resolved during -the initial attempt to build the schema, and automatic rebuilding fails. - -##### Arguments - -- `force`: Whether to force the rebuilding of the model schema, defaults to `False`. -- `raise_errors`: Whether to raise errors, defaults to `True`. -- `_parent_namespace_depth`: The depth level of the parent namespace, defaults to 2. -- `_types_namespace`: The types namespace, defaults to `None`. - - - - -### method model_validate - -```python -obj: 'Any', *, -strict: 'bool | None' = None, -from_attributes: 'bool | None' = None, -context: 'Any | None' = None, -by_alias: 'bool | None' = None, -by_name: 'bool | None' = None -``` - -Validate a pydantic model instance. - -##### Arguments - -- `obj`: The object to validate. -- `strict`: Whether to enforce types strictly. -- `from_attributes`: Whether to extract data from object attributes. -- `context`: Additional context to pass to the validator. -- `by_alias`: Whether to use the field's alias when validating against the provided input data. -- `by_name`: Whether to use the field's name when validating against the provided input data. - - -##### Raises - -- `ValidationError`: If the object could not be validated. - - -### method model_validate_json - -```python -json_data: 'str | bytes | bytearray', *, -strict: 'bool | None' = None, -context: 'Any | None' = None, -by_alias: 'bool | None' = None, -by_name: 'bool | None' = None -``` - -!!! abstract "Usage Documentation" - [JSON Parsing](../concepts/json.md#json-parsing) - -Validate the given JSON data against the Pydantic model. - -##### Arguments - -- `json_data`: The JSON data to validate. -- `strict`: Whether to enforce types strictly. -- `context`: Extra variables to pass to the validator. -- `by_alias`: Whether to use the field's alias when validating against the provided input data. -- `by_name`: Whether to use the field's name when validating against the provided input data. - - -##### Raises - -- `ValidationError`: If `json_data` is not a JSON string or the object could not be validated. - - -### method model_validate_strings - -```python -obj: 'Any', *, -strict: 'bool | None' = None, -context: 'Any | None' = None, -by_alias: 'bool | None' = None, -by_name: 'bool | None' = None -``` - -Validate the given object with string data against the Pydantic model. - -##### Arguments - -- `obj`: The object containing string data to validate. -- `strict`: Whether to enforce types strictly. -- `context`: Extra variables to pass to the validator. -- `by_alias`: Whether to use the field's alias when validating against the provided input data. -- `by_name`: Whether to use the field's name when validating against the provided input data. - - - - -### method parse_file - -```python -path: 'str | Path', *, -content_type: 'str | None' = None, -encoding: 'str' = 'utf8', -proto: 'DeprecatedParseProtocol | None' = None, -allow_pickle: 'bool' = False -``` - - - -##### Arguments - -- `path`: -- `content_type`: -- `encoding`: -- `proto`: -- `allow_pickle`: - - - - -### method parse_obj - -```python -obj: 'Any' -``` - - - -##### Arguments - -- `obj`: - - - - -### method parse_raw - -```python -b: 'str | bytes', *, -content_type: 'str | None' = None, -encoding: 'str' = 'utf8', -proto: 'DeprecatedParseProtocol | None' = None, -allow_pickle: 'bool' = False -``` - - - -##### Arguments - -- `b`: -- `content_type`: -- `encoding`: -- `proto`: -- `allow_pickle`: - - - - -### method schema - -```python -by_alias: 'bool' = True, -ref_template: 'str' = '#/$defs/{model}' -``` - - - -##### Arguments - -- `by_alias`: -- `ref_template`: - - - - -### method schema_json - -```python -*, -by_alias: 'bool' = True, -ref_template: 'str' = '#/$defs/{model}', **dumps_kwargs: 'Any' -``` - - - -##### Arguments - -- `by_alias`: -- `ref_template`: -- `dumps_kwargs`: - - - - -### method update_forward_refs - -```python -**localns: 'Any' -``` - - - -##### Arguments - -- `localns`: - - - - -### method validate - -```python -value: 'Any' -``` - - - -##### Arguments - -- `value`: - - - - diff --git a/models/ref/python/automations/sendnotification.mdx b/models/ref/python/automations/sendnotification.mdx index d0c332531b..fc6b1ae8b7 100644 --- a/models/ref/python/automations/sendnotification.mdx +++ b/models/ref/python/automations/sendnotification.mdx @@ -42,81 +42,6 @@ Defines an automation action that sends a (Slack) notification. ## Methods -### method construct - -```python -_fields_set: 'set[str] | None' = None, **values: 'Any' -``` - - - -##### Arguments - -- `_fields_set`: -- `values`: - - - - -### method copy - -```python -self, *, -include: 'AbstractSetIntStr | MappingIntStrAny | None' = None, -exclude: 'AbstractSetIntStr | MappingIntStrAny | None' = None, -update: 'Dict[str, Any] | None' = None, -deep: 'bool' = False -``` - -Returns a copy of the model. - -!!! warning "Deprecated" - This method is now deprecated; use `model_copy` instead. - -If you need `include` or `exclude`, use: - -```python {test="skip" lint="skip"} -data = self.model_dump(include=include, exclude=exclude, round_trip=True) -data = {**data, **(update or {})} -copied = self.model_validate(data) -``` - -##### Arguments - -- `include`: Optional set or mapping specifying which fields to include in the copied model. -- `exclude`: Optional set or mapping specifying which fields to exclude in the copied model. -- `update`: Optional dictionary of field-value pairs to override field values in the copied model. -- `deep`: If True, the values of fields that are Pydantic models will be deep-copied. - - - - -### method dict - -```python -self, *, -include: 'IncEx | None' = None, -exclude: 'IncEx | None' = None, -by_alias: 'bool' = False, -exclude_unset: 'bool' = False, -exclude_defaults: 'bool' = False, -exclude_none: 'bool' = False -``` - - - -##### Arguments - -- `include`: -- `exclude`: -- `by_alias`: -- `exclude_unset`: -- `exclude_defaults`: -- `exclude_none`: - - - - ### method from_integration ```python @@ -138,104 +63,6 @@ Define a notification action that sends to the given (Slack) integration. -### method from_orm - -```python -obj: 'Any' -``` - - - -##### Arguments - -- `obj`: - - - - -### method json - -```python -self, *, -include: 'IncEx | None' = None, -exclude: 'IncEx | None' = None, -by_alias: 'bool' = False, -exclude_unset: 'bool' = False, -exclude_defaults: 'bool' = False, -exclude_none: 'bool' = False, -encoder: 'Callable[[Any], Any] | None' = PydanticUndefined, -models_as_dict: 'bool' = PydanticUndefined, **dumps_kwargs: 'Any' -``` - - - -##### Arguments - -- `include`: -- `exclude`: -- `by_alias`: -- `exclude_unset`: -- `exclude_defaults`: -- `exclude_none`: -- `encoder`: -- `models_as_dict`: -- `dumps_kwargs`: - - - - -### method model_construct - -```python -_fields_set: 'set[str] | None' = None, **values: 'Any' -``` - -Creates a new instance of the `Model` class with validated data. - -Creates a new model setting `__dict__` and `__pydantic_fields_set__` from trusted or pre-validated data. -Default values are respected, but no other validation is performed. - -!!! note - `model_construct()` generally respects the `model_config.extra` setting on the provided model. - That is, if `model_config.extra == 'allow'`, then all extra passed values are added to the model instance's `__dict__` - and `__pydantic_extra__` fields. If `model_config.extra == 'ignore'` (the default), then all extra passed values are ignored. - Because no validation is performed with a call to `model_construct()`, having `model_config.extra == 'forbid'` does not result in - an error if extra values are passed, but they will be ignored. - -##### Arguments - -- `_fields_set`: A set of field names that were originally explicitly set during instantiation. If provided, this is directly used for the [`model_fields_set`][pydantic.BaseModel.model_fields_set] attribute. Otherwise, the field names from the `values` argument will be used. -- `values`: Trusted or pre-validated data dictionary. - - - - -### method model_copy - -```python -self, *, -update: 'Mapping[str, Any] | None' = None, -deep: 'bool' = False -``` - -!!! abstract "Usage Documentation" - [`model_copy`](../concepts/serialization.md#model_copy) - -Returns a copy of the model. - -!!! note - The underlying instance's [`__dict__`][object.__dict__] attribute is copied. This - might have unexpected side effects if you store anything in it, on top of the model - fields (e.g. the value of [cached properties][functools.cached_property]). - -##### Arguments - -- `update`: Values to change/add in the new model. Note: the data is not validated before creating the new model. You should trust this data. -- `deep`: Set to `True` to make a deep copy of the model. - - - - ### method model_dump ```python @@ -276,295 +103,5 @@ Generates a JSON representation of the model using Pydantic's `to_json` method. -### method model_json_schema - -```python -by_alias: 'bool' = True, -ref_template: 'str' = '#/$defs/{model}', -schema_generator: 'type[GenerateJsonSchema]' = , -mode: 'JsonSchemaMode' = 'validation' -``` - -Generates a JSON schema for a model class. - -##### Arguments - -- `by_alias`: Whether to use attribute aliases or not. -- `ref_template`: The reference template. -- `schema_generator`: To override the logic used to generate the JSON schema, as a subclass of `GenerateJsonSchema` with your desired modifications -- `mode`: The mode in which to generate the schema. - - - - -### method model_parametrized_name - -```python -params: 'tuple[type[Any], ...]' -``` - -Compute the class name for parametrizations of generic classes. - -This method can be overridden to achieve a custom naming scheme for generic BaseModels. - -##### Arguments - -- `params`: Tuple of types of the class. Given a generic class `Model` with 2 type variables and a concrete model `Model[str, int]`, the value `(str, int)` would be passed to `params`. - - -##### Raises - -- `TypeError`: Raised when trying to generate concrete names for non-generic models. - - -### method model_post_init - -```python -self, -context: 'Any', / -``` - -Override this method to perform additional initialization after `__init__` and `model_construct`. -This is useful if you want to do some validation that requires the entire model to be initialized. - -##### Arguments - -- `context`: - - - - -### method model_rebuild - -```python -*, -force: 'bool' = False, -raise_errors: 'bool' = True, -_parent_namespace_depth: 'int' = 2, -_types_namespace: 'MappingNamespace | None' = None -``` - -Try to rebuild the pydantic-core schema for the model. - -This may be necessary when one of the annotations is a ForwardRef which could not be resolved during -the initial attempt to build the schema, and automatic rebuilding fails. - -##### Arguments - -- `force`: Whether to force the rebuilding of the model schema, defaults to `False`. -- `raise_errors`: Whether to raise errors, defaults to `True`. -- `_parent_namespace_depth`: The depth level of the parent namespace, defaults to 2. -- `_types_namespace`: The types namespace, defaults to `None`. - - - - -### method model_validate - -```python -obj: 'Any', *, -strict: 'bool | None' = None, -from_attributes: 'bool | None' = None, -context: 'Any | None' = None, -by_alias: 'bool | None' = None, -by_name: 'bool | None' = None -``` - -Validate a pydantic model instance. - -##### Arguments - -- `obj`: The object to validate. -- `strict`: Whether to enforce types strictly. -- `from_attributes`: Whether to extract data from object attributes. -- `context`: Additional context to pass to the validator. -- `by_alias`: Whether to use the field's alias when validating against the provided input data. -- `by_name`: Whether to use the field's name when validating against the provided input data. - - -##### Raises - -- `ValidationError`: If the object could not be validated. - - -### method model_validate_json - -```python -json_data: 'str | bytes | bytearray', *, -strict: 'bool | None' = None, -context: 'Any | None' = None, -by_alias: 'bool | None' = None, -by_name: 'bool | None' = None -``` - -!!! abstract "Usage Documentation" - [JSON Parsing](../concepts/json.md#json-parsing) - -Validate the given JSON data against the Pydantic model. - -##### Arguments - -- `json_data`: The JSON data to validate. -- `strict`: Whether to enforce types strictly. -- `context`: Extra variables to pass to the validator. -- `by_alias`: Whether to use the field's alias when validating against the provided input data. -- `by_name`: Whether to use the field's name when validating against the provided input data. - - -##### Raises - -- `ValidationError`: If `json_data` is not a JSON string or the object could not be validated. - - -### method model_validate_strings - -```python -obj: 'Any', *, -strict: 'bool | None' = None, -context: 'Any | None' = None, -by_alias: 'bool | None' = None, -by_name: 'bool | None' = None -``` - -Validate the given object with string data against the Pydantic model. - -##### Arguments - -- `obj`: The object containing string data to validate. -- `strict`: Whether to enforce types strictly. -- `context`: Extra variables to pass to the validator. -- `by_alias`: Whether to use the field's alias when validating against the provided input data. -- `by_name`: Whether to use the field's name when validating against the provided input data. - - - - -### method parse_file - -```python -path: 'str | Path', *, -content_type: 'str | None' = None, -encoding: 'str' = 'utf8', -proto: 'DeprecatedParseProtocol | None' = None, -allow_pickle: 'bool' = False -``` - - - -##### Arguments - -- `path`: -- `content_type`: -- `encoding`: -- `proto`: -- `allow_pickle`: - - - - -### method parse_obj - -```python -obj: 'Any' -``` - - - -##### Arguments - -- `obj`: - - - - -### method parse_raw - -```python -b: 'str | bytes', *, -content_type: 'str | None' = None, -encoding: 'str' = 'utf8', -proto: 'DeprecatedParseProtocol | None' = None, -allow_pickle: 'bool' = False -``` - - - -##### Arguments - -- `b`: -- `content_type`: -- `encoding`: -- `proto`: -- `allow_pickle`: - - - - -### method schema - -```python -by_alias: 'bool' = True, -ref_template: 'str' = '#/$defs/{model}' -``` - - - -##### Arguments - -- `by_alias`: -- `ref_template`: - - - - -### method schema_json - -```python -*, -by_alias: 'bool' = True, -ref_template: 'str' = '#/$defs/{model}', **dumps_kwargs: 'Any' -``` - - - -##### Arguments - -- `by_alias`: -- `ref_template`: -- `dumps_kwargs`: - - - - -### method update_forward_refs - -```python -**localns: 'Any' -``` - - - -##### Arguments - -- `localns`: - - - - -### method validate - -```python -value: 'Any' -``` - - - -##### Arguments - -- `value`: - - - - diff --git a/models/ref/python/automations/sendwebhook.mdx b/models/ref/python/automations/sendwebhook.mdx index 9423f35396..83eb4ff622 100644 --- a/models/ref/python/automations/sendwebhook.mdx +++ b/models/ref/python/automations/sendwebhook.mdx @@ -38,81 +38,6 @@ Defines an automation action that sends a webhook request. ## Methods -### method construct - -```python -_fields_set: 'set[str] | None' = None, **values: 'Any' -``` - - - -##### Arguments - -- `_fields_set`: -- `values`: - - - - -### method copy - -```python -self, *, -include: 'AbstractSetIntStr | MappingIntStrAny | None' = None, -exclude: 'AbstractSetIntStr | MappingIntStrAny | None' = None, -update: 'Dict[str, Any] | None' = None, -deep: 'bool' = False -``` - -Returns a copy of the model. - -!!! warning "Deprecated" - This method is now deprecated; use `model_copy` instead. - -If you need `include` or `exclude`, use: - -```python {test="skip" lint="skip"} -data = self.model_dump(include=include, exclude=exclude, round_trip=True) -data = {**data, **(update or {})} -copied = self.model_validate(data) -``` - -##### Arguments - -- `include`: Optional set or mapping specifying which fields to include in the copied model. -- `exclude`: Optional set or mapping specifying which fields to exclude in the copied model. -- `update`: Optional dictionary of field-value pairs to override field values in the copied model. -- `deep`: If True, the values of fields that are Pydantic models will be deep-copied. - - - - -### method dict - -```python -self, *, -include: 'IncEx | None' = None, -exclude: 'IncEx | None' = None, -by_alias: 'bool' = False, -exclude_unset: 'bool' = False, -exclude_defaults: 'bool' = False, -exclude_none: 'bool' = False -``` - - - -##### Arguments - -- `include`: -- `exclude`: -- `by_alias`: -- `exclude_unset`: -- `exclude_defaults`: -- `exclude_none`: - - - - ### method from_integration ```python @@ -130,104 +55,6 @@ Define a webhook action that sends to the given (webhook) integration. -### method from_orm - -```python -obj: 'Any' -``` - - - -##### Arguments - -- `obj`: - - - - -### method json - -```python -self, *, -include: 'IncEx | None' = None, -exclude: 'IncEx | None' = None, -by_alias: 'bool' = False, -exclude_unset: 'bool' = False, -exclude_defaults: 'bool' = False, -exclude_none: 'bool' = False, -encoder: 'Callable[[Any], Any] | None' = PydanticUndefined, -models_as_dict: 'bool' = PydanticUndefined, **dumps_kwargs: 'Any' -``` - - - -##### Arguments - -- `include`: -- `exclude`: -- `by_alias`: -- `exclude_unset`: -- `exclude_defaults`: -- `exclude_none`: -- `encoder`: -- `models_as_dict`: -- `dumps_kwargs`: - - - - -### method model_construct - -```python -_fields_set: 'set[str] | None' = None, **values: 'Any' -``` - -Creates a new instance of the `Model` class with validated data. - -Creates a new model setting `__dict__` and `__pydantic_fields_set__` from trusted or pre-validated data. -Default values are respected, but no other validation is performed. - -!!! note - `model_construct()` generally respects the `model_config.extra` setting on the provided model. - That is, if `model_config.extra == 'allow'`, then all extra passed values are added to the model instance's `__dict__` - and `__pydantic_extra__` fields. If `model_config.extra == 'ignore'` (the default), then all extra passed values are ignored. - Because no validation is performed with a call to `model_construct()`, having `model_config.extra == 'forbid'` does not result in - an error if extra values are passed, but they will be ignored. - -##### Arguments - -- `_fields_set`: A set of field names that were originally explicitly set during instantiation. If provided, this is directly used for the [`model_fields_set`][pydantic.BaseModel.model_fields_set] attribute. Otherwise, the field names from the `values` argument will be used. -- `values`: Trusted or pre-validated data dictionary. - - - - -### method model_copy - -```python -self, *, -update: 'Mapping[str, Any] | None' = None, -deep: 'bool' = False -``` - -!!! abstract "Usage Documentation" - [`model_copy`](../concepts/serialization.md#model_copy) - -Returns a copy of the model. - -!!! note - The underlying instance's [`__dict__`][object.__dict__] attribute is copied. This - might have unexpected side effects if you store anything in it, on top of the model - fields (e.g. the value of [cached properties][functools.cached_property]). - -##### Arguments - -- `update`: Values to change/add in the new model. Note: the data is not validated before creating the new model. You should trust this data. -- `deep`: Set to `True` to make a deep copy of the model. - - - - ### method model_dump ```python @@ -268,295 +95,5 @@ Generates a JSON representation of the model using Pydantic's `to_json` method. -### method model_json_schema - -```python -by_alias: 'bool' = True, -ref_template: 'str' = '#/$defs/{model}', -schema_generator: 'type[GenerateJsonSchema]' = , -mode: 'JsonSchemaMode' = 'validation' -``` - -Generates a JSON schema for a model class. - -##### Arguments - -- `by_alias`: Whether to use attribute aliases or not. -- `ref_template`: The reference template. -- `schema_generator`: To override the logic used to generate the JSON schema, as a subclass of `GenerateJsonSchema` with your desired modifications -- `mode`: The mode in which to generate the schema. - - - - -### method model_parametrized_name - -```python -params: 'tuple[type[Any], ...]' -``` - -Compute the class name for parametrizations of generic classes. - -This method can be overridden to achieve a custom naming scheme for generic BaseModels. - -##### Arguments - -- `params`: Tuple of types of the class. Given a generic class `Model` with 2 type variables and a concrete model `Model[str, int]`, the value `(str, int)` would be passed to `params`. - - -##### Raises - -- `TypeError`: Raised when trying to generate concrete names for non-generic models. - - -### method model_post_init - -```python -self, -context: 'Any', / -``` - -Override this method to perform additional initialization after `__init__` and `model_construct`. -This is useful if you want to do some validation that requires the entire model to be initialized. - -##### Arguments - -- `context`: - - - - -### method model_rebuild - -```python -*, -force: 'bool' = False, -raise_errors: 'bool' = True, -_parent_namespace_depth: 'int' = 2, -_types_namespace: 'MappingNamespace | None' = None -``` - -Try to rebuild the pydantic-core schema for the model. - -This may be necessary when one of the annotations is a ForwardRef which could not be resolved during -the initial attempt to build the schema, and automatic rebuilding fails. - -##### Arguments - -- `force`: Whether to force the rebuilding of the model schema, defaults to `False`. -- `raise_errors`: Whether to raise errors, defaults to `True`. -- `_parent_namespace_depth`: The depth level of the parent namespace, defaults to 2. -- `_types_namespace`: The types namespace, defaults to `None`. - - - - -### method model_validate - -```python -obj: 'Any', *, -strict: 'bool | None' = None, -from_attributes: 'bool | None' = None, -context: 'Any | None' = None, -by_alias: 'bool | None' = None, -by_name: 'bool | None' = None -``` - -Validate a pydantic model instance. - -##### Arguments - -- `obj`: The object to validate. -- `strict`: Whether to enforce types strictly. -- `from_attributes`: Whether to extract data from object attributes. -- `context`: Additional context to pass to the validator. -- `by_alias`: Whether to use the field's alias when validating against the provided input data. -- `by_name`: Whether to use the field's name when validating against the provided input data. - - -##### Raises - -- `ValidationError`: If the object could not be validated. - - -### method model_validate_json - -```python -json_data: 'str | bytes | bytearray', *, -strict: 'bool | None' = None, -context: 'Any | None' = None, -by_alias: 'bool | None' = None, -by_name: 'bool | None' = None -``` - -!!! abstract "Usage Documentation" - [JSON Parsing](../concepts/json.md#json-parsing) - -Validate the given JSON data against the Pydantic model. - -##### Arguments - -- `json_data`: The JSON data to validate. -- `strict`: Whether to enforce types strictly. -- `context`: Extra variables to pass to the validator. -- `by_alias`: Whether to use the field's alias when validating against the provided input data. -- `by_name`: Whether to use the field's name when validating against the provided input data. - - -##### Raises - -- `ValidationError`: If `json_data` is not a JSON string or the object could not be validated. - - -### method model_validate_strings - -```python -obj: 'Any', *, -strict: 'bool | None' = None, -context: 'Any | None' = None, -by_alias: 'bool | None' = None, -by_name: 'bool | None' = None -``` - -Validate the given object with string data against the Pydantic model. - -##### Arguments - -- `obj`: The object containing string data to validate. -- `strict`: Whether to enforce types strictly. -- `context`: Extra variables to pass to the validator. -- `by_alias`: Whether to use the field's alias when validating against the provided input data. -- `by_name`: Whether to use the field's name when validating against the provided input data. - - - - -### method parse_file - -```python -path: 'str | Path', *, -content_type: 'str | None' = None, -encoding: 'str' = 'utf8', -proto: 'DeprecatedParseProtocol | None' = None, -allow_pickle: 'bool' = False -``` - - - -##### Arguments - -- `path`: -- `content_type`: -- `encoding`: -- `proto`: -- `allow_pickle`: - - - - -### method parse_obj - -```python -obj: 'Any' -``` - - - -##### Arguments - -- `obj`: - - - - -### method parse_raw - -```python -b: 'str | bytes', *, -content_type: 'str | None' = None, -encoding: 'str' = 'utf8', -proto: 'DeprecatedParseProtocol | None' = None, -allow_pickle: 'bool' = False -``` - - - -##### Arguments - -- `b`: -- `content_type`: -- `encoding`: -- `proto`: -- `allow_pickle`: - - - - -### method schema - -```python -by_alias: 'bool' = True, -ref_template: 'str' = '#/$defs/{model}' -``` - - - -##### Arguments - -- `by_alias`: -- `ref_template`: - - - - -### method schema_json - -```python -*, -by_alias: 'bool' = True, -ref_template: 'str' = '#/$defs/{model}', **dumps_kwargs: 'Any' -``` - - - -##### Arguments - -- `by_alias`: -- `ref_template`: -- `dumps_kwargs`: - - - - -### method update_forward_refs - -```python -**localns: 'Any' -``` - - - -##### Arguments - -- `localns`: - - - - -### method validate - -```python -value: 'Any' -``` - - - -##### Arguments - -- `value`: - - - - diff --git a/models/ref/python/data-types/audio.mdx b/models/ref/python/data-types/audio.mdx index a3591f2b59..c9d91fa2d4 100644 --- a/models/ref/python/data-types/audio.mdx +++ b/models/ref/python/data-types/audio.mdx @@ -52,69 +52,6 @@ Calculate the duration of the audio files. -### method file_is_set - -```python -self -``` - - - - - - - -### method init_from_json - -```python -json_obj: 'dict', -source_artifact: 'Artifact' -``` - -Initialize a `WBValue` from a JSON blob based on the class that created it. - -Looks through all subclasses and tries to match the json obj with the class -which created it. It will then call that subclass' `from_json` method. -Importantly, this function will set the return object's `source_artifact` -attribute to the passed in source artifact. This is critical for artifact -bookkeeping. If you choose to create a wandb.Value via it's `from_json` method, -make sure to properly set this `artifact_source` to avoid data duplication. - -##### Arguments - -- `json_obj`: A JSON dictionary to deserialize. It must contain a `_type` key. This is used to lookup the correct subclass to use. -- `source_artifact`: An artifact which will hold any additional resources which were stored during the `to_json` function. - - - - -### method is_bound - -```python -self -``` - - - - - - - -### method path_is_reference - -```python -path: 'str | pathlib.Path | None' -``` - - - -##### Arguments - -- `path`: - - - - ### method sample_rates ```python @@ -130,44 +67,5 @@ Get sample rates of the audio files. -### method to_data_array - -```python -self -``` - -Convert the object to a list of primitives representing the underlying data. - - - - - -### method type_mapping - - - -Return a map from `_log_type` to subclass. Used to lookup correct types for deserialization. - - - - - -### method with_suffix - -```python -name: 'str', -filetype: 'str' = 'json' -``` - -Get the name with the appropriate suffix. - -##### Arguments - -- `name`: the name of the file -- `filetype`: the filetype to use. Defaults to "json". - - - - diff --git a/models/ref/python/data-types/evaltable.mdx b/models/ref/python/data-types/evaltable.mdx index 5a892d4feb..eef187e042 100644 --- a/models/ref/python/data-types/evaltable.mdx +++ b/models/ref/python/data-types/evaltable.mdx @@ -133,21 +133,6 @@ Deprecated. Use `Table.add_data` method instead. -### method captions - -```python -media_items: 'Sequence[Media]' -``` - - - -##### Arguments - -- `media_items`: - - - - ### method cast ```python @@ -169,18 +154,6 @@ wandb.Classes. -### method file_is_set - -```python -self -``` - - - - - - - ### method get_column ```python @@ -221,95 +194,5 @@ Returns an array of row indexes for use in other tables to create links. -### method init_from_json - -```python -json_obj: 'dict', -source_artifact: 'Artifact' -``` - -Initialize a `WBValue` from a JSON blob based on the class that created it. - -Looks through all subclasses and tries to match the json obj with the class -which created it. It will then call that subclass' `from_json` method. -Importantly, this function will set the return object's `source_artifact` -attribute to the passed in source artifact. This is critical for artifact -bookkeeping. If you choose to create a wandb.Value via it's `from_json` method, -make sure to properly set this `artifact_source` to avoid data duplication. - -##### Arguments - -- `json_obj`: A JSON dictionary to deserialize. It must contain a `_type` key. This is used to lookup the correct subclass to use. -- `source_artifact`: An artifact which will hold any additional resources which were stored during the `to_json` function. - - - - -### method is_bound - -```python -self -``` - - - - - - - -### method path_is_reference - -```python -path: 'str | pathlib.Path | None' -``` - - - -##### Arguments - -- `path`: - - - - -### method to_data_array - -```python -self -``` - -Convert the object to a list of primitives representing the underlying data. - - - - - -### method type_mapping - - - -Return a map from `_log_type` to subclass. Used to lookup correct types for deserialization. - - - - - -### method with_suffix - -```python -name: 'str', -filetype: 'str' = 'json' -``` - -Get the name with the appropriate suffix. - -##### Arguments - -- `name`: the name of the file -- `filetype`: the filetype to use. Defaults to "json". - - - - diff --git a/models/ref/python/data-types/histogram.mdx b/models/ref/python/data-types/histogram.mdx index 323f37a002..09edc46a31 100644 --- a/models/ref/python/data-types/histogram.mdx +++ b/models/ref/python/data-types/histogram.mdx @@ -42,90 +42,5 @@ Attributes: -## Methods - -### method from_json - -```python -json_obj: 'dict', -source_artifact: 'Artifact' -``` - -Deserialize a `json_obj` into it's class representation. - -If additional resources were stored in the `run_or_artifact` artifact during the -`to_json` call, then those resources should be in the `source_artifact`. - -##### Arguments - -- `json_obj`: A JSON dictionary to deserialize source_artifact -- `source_artifact`: - - - - -### method init_from_json - -```python -json_obj: 'dict', -source_artifact: 'Artifact' -``` - -Initialize a `WBValue` from a JSON blob based on the class that created it. - -Looks through all subclasses and tries to match the json obj with the class -which created it. It will then call that subclass' `from_json` method. -Importantly, this function will set the return object's `source_artifact` -attribute to the passed in source artifact. This is critical for artifact -bookkeeping. If you choose to create a wandb.Value via it's `from_json` method, -make sure to properly set this `artifact_source` to avoid data duplication. - -##### Arguments - -- `json_obj`: A JSON dictionary to deserialize. It must contain a `_type` key. This is used to lookup the correct subclass to use. -- `source_artifact`: An artifact which will hold any additional resources which were stored during the `to_json` function. - - - - -### method to_data_array - -```python -self -``` - -Convert the object to a list of primitives representing the underlying data. - - - - - -### method type_mapping - - - -Return a map from `_log_type` to subclass. Used to lookup correct types for deserialization. - - - - - -### method with_suffix - -```python -name: 'str', -filetype: 'str' = 'json' -``` - -Get the name with the appropriate suffix. - -##### Arguments - -- `name`: the name of the file -- `filetype`: the filetype to use. Defaults to "json". - - - - diff --git a/models/ref/python/data-types/html.mdx b/models/ref/python/data-types/html.mdx index e974ab0efe..3141dd028d 100644 --- a/models/ref/python/data-types/html.mdx +++ b/models/ref/python/data-types/html.mdx @@ -35,151 +35,5 @@ W&B class for logging HTML content to W&B. -## Methods - -### method bind_to_run - -```python -self, -run: 'wandb.Run', -key: 'int | str', -step: 'int | str', -id_: 'int | str | None' = None, -ignore_copy_err: 'bool | None' = None -``` - -Bind this object to a particular Run. - -Calling this function is necessary so that we have somewhere specific to put the -file associated with this object, from which other Runs can refer to it. - -##### Arguments - -- `run`: -- `key`: -- `step`: -- `id_`: -- `ignore_copy_err`: - - - - -### method captions - -```python -media_items: 'Sequence[Media]' -``` - - - -##### Arguments - -- `media_items`: - - - - -### method file_is_set - -```python -self -``` - - - - - - - -### method init_from_json - -```python -json_obj: 'dict', -source_artifact: 'Artifact' -``` - -Initialize a `WBValue` from a JSON blob based on the class that created it. - -Looks through all subclasses and tries to match the json obj with the class -which created it. It will then call that subclass' `from_json` method. -Importantly, this function will set the return object's `source_artifact` -attribute to the passed in source artifact. This is critical for artifact -bookkeeping. If you choose to create a wandb.Value via it's `from_json` method, -make sure to properly set this `artifact_source` to avoid data duplication. - -##### Arguments - -- `json_obj`: A JSON dictionary to deserialize. It must contain a `_type` key. This is used to lookup the correct subclass to use. -- `source_artifact`: An artifact which will hold any additional resources which were stored during the `to_json` function. - - - - -### method is_bound - -```python -self -``` - - - - - - - -### method path_is_reference - -```python -path: 'str | pathlib.Path | None' -``` - - - -##### Arguments - -- `path`: - - - - -### method to_data_array - -```python -self -``` - -Convert the object to a list of primitives representing the underlying data. - - - - - -### method type_mapping - - - -Return a map from `_log_type` to subclass. Used to lookup correct types for deserialization. - - - - - -### method with_suffix - -```python -name: 'str', -filetype: 'str' = 'json' -``` - -Get the name with the appropriate suffix. - -##### Arguments - -- `name`: the name of the file -- `filetype`: the filetype to use. Defaults to "json". - - - - diff --git a/models/ref/python/data-types/image.mdx b/models/ref/python/data-types/image.mdx index 428cf22bfd..f84a8bbc70 100644 --- a/models/ref/python/data-types/image.mdx +++ b/models/ref/python/data-types/image.mdx @@ -53,112 +53,5 @@ A class for logging images to W&B. -## Methods - -### method captions - -```python -media_items: 'Sequence[Media]' -``` - - - -##### Arguments - -- `media_items`: - - - - -### method file_is_set - -```python -self -``` - - - - - - - -### method init_from_json - -```python -json_obj: 'dict', -source_artifact: 'Artifact' -``` - -Initialize a `WBValue` from a JSON blob based on the class that created it. - -Looks through all subclasses and tries to match the json obj with the class -which created it. It will then call that subclass' `from_json` method. -Importantly, this function will set the return object's `source_artifact` -attribute to the passed in source artifact. This is critical for artifact -bookkeeping. If you choose to create a wandb.Value via it's `from_json` method, -make sure to properly set this `artifact_source` to avoid data duplication. - -##### Arguments - -- `json_obj`: A JSON dictionary to deserialize. It must contain a `_type` key. This is used to lookup the correct subclass to use. -- `source_artifact`: An artifact which will hold any additional resources which were stored during the `to_json` function. - - - - -### method is_bound - -```python -self -``` - - - - - - - -### method path_is_reference - -```python -path: 'str | pathlib.Path | None' -``` - - - -##### Arguments - -- `path`: - - - - -### method type_mapping - - - -Return a map from `_log_type` to subclass. Used to lookup correct types for deserialization. - - - - - -### method with_suffix - -```python -name: 'str', -filetype: 'str' = 'json' -``` - -Get the name with the appropriate suffix. - -##### Arguments - -- `name`: the name of the file -- `filetype`: the filetype to use. Defaults to "json". - - - - diff --git a/models/ref/python/data-types/molecule.mdx b/models/ref/python/data-types/molecule.mdx index 3be5a893aa..06b8485a6b 100644 --- a/models/ref/python/data-types/molecule.mdx +++ b/models/ref/python/data-types/molecule.mdx @@ -36,77 +36,6 @@ W&B class for 3D Molecular data. ## Methods -### method bind_to_run - -```python -self, -run: 'wandb.Run', -key: 'int | str', -step: 'int | str', -id_: 'int | str | None' = None, -ignore_copy_err: 'bool | None' = None -``` - -Bind this object to a particular Run. - -Calling this function is necessary so that we have somewhere specific to put the -file associated with this object, from which other Runs can refer to it. - -##### Arguments - -- `run`: -- `key`: -- `step`: -- `id_`: -- `ignore_copy_err`: - - - - -### method captions - -```python -media_items: 'Sequence[Media]' -``` - - - -##### Arguments - -- `media_items`: - - - - -### method file_is_set - -```python -self -``` - - - - - - - -### method from_json - -```python -json_obj: 'dict', -source_artifact: 'Artifact' -``` - -Likely will need to override for any more complicated media objects. - -##### Arguments - -- `json_obj`: -- `source_artifact`: - - - - ### method from_rdkit ```python @@ -151,95 +80,5 @@ Convert SMILES string to wandb.Molecule. -### method init_from_json - -```python -json_obj: 'dict', -source_artifact: 'Artifact' -``` - -Initialize a `WBValue` from a JSON blob based on the class that created it. - -Looks through all subclasses and tries to match the json obj with the class -which created it. It will then call that subclass' `from_json` method. -Importantly, this function will set the return object's `source_artifact` -attribute to the passed in source artifact. This is critical for artifact -bookkeeping. If you choose to create a wandb.Value via it's `from_json` method, -make sure to properly set this `artifact_source` to avoid data duplication. - -##### Arguments - -- `json_obj`: A JSON dictionary to deserialize. It must contain a `_type` key. This is used to lookup the correct subclass to use. -- `source_artifact`: An artifact which will hold any additional resources which were stored during the `to_json` function. - - - - -### method is_bound - -```python -self -``` - - - - - - - -### method path_is_reference - -```python -path: 'str | pathlib.Path | None' -``` - - - -##### Arguments - -- `path`: - - - - -### method to_data_array - -```python -self -``` - -Convert the object to a list of primitives representing the underlying data. - - - - - -### method type_mapping - - - -Return a map from `_log_type` to subclass. Used to lookup correct types for deserialization. - - - - - -### method with_suffix - -```python -name: 'str', -filetype: 'str' = 'json' -``` - -Get the name with the appropriate suffix. - -##### Arguments - -- `name`: the name of the file -- `filetype`: the filetype to use. Defaults to "json". - - - - diff --git a/models/ref/python/data-types/object3d.mdx b/models/ref/python/data-types/object3d.mdx index ef1a60f8ac..5122ce03ac 100644 --- a/models/ref/python/data-types/object3d.mdx +++ b/models/ref/python/data-types/object3d.mdx @@ -36,60 +36,6 @@ W&B class for 3D point clouds. ## Methods -### method bind_to_run - -```python -self, -run: 'wandb.Run', -key: 'int | str', -step: 'int | str', -id_: 'int | str | None' = None, -ignore_copy_err: 'bool | None' = None -``` - -Bind this object to a particular Run. - -Calling this function is necessary so that we have somewhere specific to put the -file associated with this object, from which other Runs can refer to it. - -##### Arguments - -- `run`: -- `key`: -- `step`: -- `id_`: -- `ignore_copy_err`: - - - - -### method captions - -```python -media_items: 'Sequence[Media]' -``` - - - -##### Arguments - -- `media_items`: - - - - -### method file_is_set - -```python -self -``` - - - - - - - ### method from_file ```python @@ -107,23 +53,6 @@ Initializes Object3D from a file or stream. -### method from_json - -```python -json_obj: 'dict', -source_artifact: 'Artifact' -``` - -Likely will need to override for any more complicated media objects. - -##### Arguments - -- `json_obj`: -- `source_artifact`: - - - - ### method from_numpy ```python @@ -160,95 +89,5 @@ Initializes Object3D from a python object. -### method init_from_json - -```python -json_obj: 'dict', -source_artifact: 'Artifact' -``` - -Initialize a `WBValue` from a JSON blob based on the class that created it. - -Looks through all subclasses and tries to match the json obj with the class -which created it. It will then call that subclass' `from_json` method. -Importantly, this function will set the return object's `source_artifact` -attribute to the passed in source artifact. This is critical for artifact -bookkeeping. If you choose to create a wandb.Value via it's `from_json` method, -make sure to properly set this `artifact_source` to avoid data duplication. - -##### Arguments - -- `json_obj`: A JSON dictionary to deserialize. It must contain a `_type` key. This is used to lookup the correct subclass to use. -- `source_artifact`: An artifact which will hold any additional resources which were stored during the `to_json` function. - - - - -### method is_bound - -```python -self -``` - - - - - - - -### method path_is_reference - -```python -path: 'str | pathlib.Path | None' -``` - - - -##### Arguments - -- `path`: - - - - -### method to_data_array - -```python -self -``` - -Convert the object to a list of primitives representing the underlying data. - - - - - -### method type_mapping - - - -Return a map from `_log_type` to subclass. Used to lookup correct types for deserialization. - - - - - -### method with_suffix - -```python -name: 'str', -filetype: 'str' = 'json' -``` - -Get the name with the appropriate suffix. - -##### Arguments - -- `name`: the name of the file -- `filetype`: the filetype to use. Defaults to "json". - - - - diff --git a/models/ref/python/data-types/plotly.mdx b/models/ref/python/data-types/plotly.mdx index 92f24682f0..af15720659 100644 --- a/models/ref/python/data-types/plotly.mdx +++ b/models/ref/python/data-types/plotly.mdx @@ -31,168 +31,5 @@ W&B class for Plotly plots. -## Methods - -### method bind_to_run - -```python -self, -run: 'wandb.Run', -key: 'int | str', -step: 'int | str', -id_: 'int | str | None' = None, -ignore_copy_err: 'bool | None' = None -``` - -Bind this object to a particular Run. - -Calling this function is necessary so that we have somewhere specific to put the -file associated with this object, from which other Runs can refer to it. - -##### Arguments - -- `run`: -- `key`: -- `step`: -- `id_`: -- `ignore_copy_err`: - - - - -### method captions - -```python -media_items: 'Sequence[Media]' -``` - - - -##### Arguments - -- `media_items`: - - - - -### method file_is_set - -```python -self -``` - - - - - - - -### method from_json - -```python -json_obj: 'dict', -source_artifact: 'Artifact' -``` - -Likely will need to override for any more complicated media objects. - -##### Arguments - -- `json_obj`: -- `source_artifact`: - - - - -### method init_from_json - -```python -json_obj: 'dict', -source_artifact: 'Artifact' -``` - -Initialize a `WBValue` from a JSON blob based on the class that created it. - -Looks through all subclasses and tries to match the json obj with the class -which created it. It will then call that subclass' `from_json` method. -Importantly, this function will set the return object's `source_artifact` -attribute to the passed in source artifact. This is critical for artifact -bookkeeping. If you choose to create a wandb.Value via it's `from_json` method, -make sure to properly set this `artifact_source` to avoid data duplication. - -##### Arguments - -- `json_obj`: A JSON dictionary to deserialize. It must contain a `_type` key. This is used to lookup the correct subclass to use. -- `source_artifact`: An artifact which will hold any additional resources which were stored during the `to_json` function. - - - - -### method is_bound - -```python -self -``` - - - - - - - -### method path_is_reference - -```python -path: 'str | pathlib.Path | None' -``` - - - -##### Arguments - -- `path`: - - - - -### method to_data_array - -```python -self -``` - -Convert the object to a list of primitives representing the underlying data. - - - - - -### method type_mapping - - - -Return a map from `_log_type` to subclass. Used to lookup correct types for deserialization. - - - - - -### method with_suffix - -```python -name: 'str', -filetype: 'str' = 'json' -``` - -Get the name with the appropriate suffix. - -##### Arguments - -- `name`: the name of the file -- `filetype`: the filetype to use. Defaults to "json". - - - - diff --git a/models/ref/python/data-types/table.mdx b/models/ref/python/data-types/table.mdx index c251a710e9..8258f299b8 100644 --- a/models/ref/python/data-types/table.mdx +++ b/models/ref/python/data-types/table.mdx @@ -116,21 +116,6 @@ Deprecated. Use `Table.add_data` method instead. -### method captions - -```python -media_items: 'Sequence[Media]' -``` - - - -##### Arguments - -- `media_items`: - - - - ### method cast ```python @@ -152,18 +137,6 @@ wandb.Classes. -### method file_is_set - -```python -self -``` - - - - - - - ### method get_column ```python @@ -204,95 +177,5 @@ Returns an array of row indexes for use in other tables to create links. -### method init_from_json - -```python -json_obj: 'dict', -source_artifact: 'Artifact' -``` - -Initialize a `WBValue` from a JSON blob based on the class that created it. - -Looks through all subclasses and tries to match the json obj with the class -which created it. It will then call that subclass' `from_json` method. -Importantly, this function will set the return object's `source_artifact` -attribute to the passed in source artifact. This is critical for artifact -bookkeeping. If you choose to create a wandb.Value via it's `from_json` method, -make sure to properly set this `artifact_source` to avoid data duplication. - -##### Arguments - -- `json_obj`: A JSON dictionary to deserialize. It must contain a `_type` key. This is used to lookup the correct subclass to use. -- `source_artifact`: An artifact which will hold any additional resources which were stored during the `to_json` function. - - - - -### method is_bound - -```python -self -``` - - - - - - - -### method path_is_reference - -```python -path: 'str | pathlib.Path | None' -``` - - - -##### Arguments - -- `path`: - - - - -### method to_data_array - -```python -self -``` - -Convert the object to a list of primitives representing the underlying data. - - - - - -### method type_mapping - - - -Return a map from `_log_type` to subclass. Used to lookup correct types for deserialization. - - - - - -### method with_suffix - -```python -name: 'str', -filetype: 'str' = 'json' -``` - -Get the name with the appropriate suffix. - -##### Arguments - -- `name`: the name of the file -- `filetype`: the filetype to use. Defaults to "json". - - - - diff --git a/models/ref/python/data-types/video.mdx b/models/ref/python/data-types/video.mdx index e5590999b9..7d7b796203 100644 --- a/models/ref/python/data-types/video.mdx +++ b/models/ref/python/data-types/video.mdx @@ -37,168 +37,5 @@ A class for logging videos to W&B. -## Methods - -### method bind_to_run - -```python -self, -run: 'wandb.Run', -key: 'int | str', -step: 'int | str', -id_: 'int | str | None' = None, -ignore_copy_err: 'bool | None' = None -``` - -Bind this object to a particular Run. - -Calling this function is necessary so that we have somewhere specific to put the -file associated with this object, from which other Runs can refer to it. - -##### Arguments - -- `run`: -- `key`: -- `step`: -- `id_`: -- `ignore_copy_err`: - - - - -### method captions - -```python -media_items: 'Sequence[Media]' -``` - - - -##### Arguments - -- `media_items`: - - - - -### method file_is_set - -```python -self -``` - - - - - - - -### method from_json - -```python -json_obj: 'dict', -source_artifact: 'Artifact' -``` - -Likely will need to override for any more complicated media objects. - -##### Arguments - -- `json_obj`: -- `source_artifact`: - - - - -### method init_from_json - -```python -json_obj: 'dict', -source_artifact: 'Artifact' -``` - -Initialize a `WBValue` from a JSON blob based on the class that created it. - -Looks through all subclasses and tries to match the json obj with the class -which created it. It will then call that subclass' `from_json` method. -Importantly, this function will set the return object's `source_artifact` -attribute to the passed in source artifact. This is critical for artifact -bookkeeping. If you choose to create a wandb.Value via it's `from_json` method, -make sure to properly set this `artifact_source` to avoid data duplication. - -##### Arguments - -- `json_obj`: A JSON dictionary to deserialize. It must contain a `_type` key. This is used to lookup the correct subclass to use. -- `source_artifact`: An artifact which will hold any additional resources which were stored during the `to_json` function. - - - - -### method is_bound - -```python -self -``` - - - - - - - -### method path_is_reference - -```python -path: 'str | pathlib.Path | None' -``` - - - -##### Arguments - -- `path`: - - - - -### method to_data_array - -```python -self -``` - -Convert the object to a list of primitives representing the underlying data. - - - - - -### method type_mapping - - - -Return a map from `_log_type` to subclass. Used to lookup correct types for deserialization. - - - - - -### method with_suffix - -```python -name: 'str', -filetype: 'str' = 'json' -``` - -Get the name with the appropriate suffix. - -##### Arguments - -- `name`: the name of the file -- `filetype`: the filetype to use. Defaults to "json". - - - - diff --git a/models/ref/python/experiments/settings.mdx b/models/ref/python/experiments/settings.mdx index 9ee11de053..eb1a0d6a5e 100644 --- a/models/ref/python/experiments/settings.mdx +++ b/models/ref/python/experiments/settings.mdx @@ -147,7 +147,7 @@ x_service_transport: str | None = None, x_service_wait: float = 30.0, x_skip_transaction_log: bool = False, x_start_time: float | None = None, -x_stats_pid: int = 96128, +x_stats_pid: int = 79119, x_stats_sampling_interval: float = 15.0, x_stats_neuron_monitor_config_path: str | None = None, x_stats_dcgm_exporter: str | None = None, @@ -444,551 +444,6 @@ Full path to the wandb directory. ## Methods -### method construct - -```python -_fields_set: 'set[str] | None' = None, **values: 'Any' -``` - - - -##### Arguments - -- `_fields_set`: -- `values`: - - - - -### method copy - -```python -self, *, -include: 'AbstractSetIntStr | MappingIntStrAny | None' = None, -exclude: 'AbstractSetIntStr | MappingIntStrAny | None' = None, -update: 'Dict[str, Any] | None' = None, -deep: 'bool' = False -``` - -Returns a copy of the model. - -!!! warning "Deprecated" - This method is now deprecated; use `model_copy` instead. - -If you need `include` or `exclude`, use: - -```python {test="skip" lint="skip"} -data = self.model_dump(include=include, exclude=exclude, round_trip=True) -data = {**data, **(update or {})} -copied = self.model_validate(data) -``` - -##### Arguments - -- `include`: Optional set or mapping specifying which fields to include in the copied model. -- `exclude`: Optional set or mapping specifying which fields to exclude in the copied model. -- `update`: Optional dictionary of field-value pairs to override field values in the copied model. -- `deep`: If True, the values of fields that are Pydantic models will be deep-copied. - - - - -### method dict - -```python -self, *, -include: 'IncEx | None' = None, -exclude: 'IncEx | None' = None, -by_alias: 'bool' = False, -exclude_unset: 'bool' = False, -exclude_defaults: 'bool' = False, -exclude_none: 'bool' = False -``` - - - -##### Arguments - -- `include`: -- `exclude`: -- `by_alias`: -- `exclude_unset`: -- `exclude_defaults`: -- `exclude_none`: - - - - -### method from_orm - -```python -obj: 'Any' -``` - - - -##### Arguments - -- `obj`: - - - - -### method json - -```python -self, *, -include: 'IncEx | None' = None, -exclude: 'IncEx | None' = None, -by_alias: 'bool' = False, -exclude_unset: 'bool' = False, -exclude_defaults: 'bool' = False, -exclude_none: 'bool' = False, -encoder: 'Callable[[Any], Any] | None' = PydanticUndefined, -models_as_dict: 'bool' = PydanticUndefined, **dumps_kwargs: 'Any' -``` - - - -##### Arguments - -- `include`: -- `exclude`: -- `by_alias`: -- `exclude_unset`: -- `exclude_defaults`: -- `exclude_none`: -- `encoder`: -- `models_as_dict`: -- `dumps_kwargs`: - - - - -### method model_construct - -```python -_fields_set: 'set[str] | None' = None, **values: 'Any' -``` - -Creates a new instance of the `Model` class with validated data. - -Creates a new model setting `__dict__` and `__pydantic_fields_set__` from trusted or pre-validated data. -Default values are respected, but no other validation is performed. - -!!! note - `model_construct()` generally respects the `model_config.extra` setting on the provided model. - That is, if `model_config.extra == 'allow'`, then all extra passed values are added to the model instance's `__dict__` - and `__pydantic_extra__` fields. If `model_config.extra == 'ignore'` (the default), then all extra passed values are ignored. - Because no validation is performed with a call to `model_construct()`, having `model_config.extra == 'forbid'` does not result in - an error if extra values are passed, but they will be ignored. - -##### Arguments - -- `_fields_set`: A set of field names that were originally explicitly set during instantiation. If provided, this is directly used for the [`model_fields_set`][pydantic.BaseModel.model_fields_set] attribute. Otherwise, the field names from the `values` argument will be used. -- `values`: Trusted or pre-validated data dictionary. - - - - -### method model_copy - -```python -self, *, -update: 'Mapping[str, Any] | None' = None, -deep: 'bool' = False -``` - -!!! abstract "Usage Documentation" - [`model_copy`](../concepts/serialization.md#model_copy) - -Returns a copy of the model. - -!!! note - The underlying instance's [`__dict__`][object.__dict__] attribute is copied. This - might have unexpected side effects if you store anything in it, on top of the model - fields (e.g. the value of [cached properties][functools.cached_property]). - -##### Arguments - -- `update`: Values to change/add in the new model. Note: the data is not validated before creating the new model. You should trust this data. -- `deep`: Set to `True` to make a deep copy of the model. - - - - -### method model_dump - -```python -self, *, -mode: "Literal['json', 'python'] | str" = 'python', -include: 'IncEx | None' = None, -exclude: 'IncEx | None' = None, -context: 'Any | None' = None, -by_alias: 'bool | None' = None, -exclude_unset: 'bool' = False, -exclude_defaults: 'bool' = False, -exclude_none: 'bool' = False, -round_trip: 'bool' = False, -warnings: "bool | Literal['none', 'warn', 'error']" = True, -fallback: 'Callable[[Any], Any] | None' = None, -serialize_as_any: 'bool' = False -``` - -!!! abstract "Usage Documentation" - [`model_dump`](../concepts/serialization.md#modelmodel_dump) - -Generate a dictionary representation of the model, optionally specifying which fields to include or exclude. - -##### Arguments - -- `mode`: The mode in which `to_python` should run. If mode is 'json', the output will only contain JSON serializable types. If mode is 'python', the output may contain non-JSON-serializable Python objects. -- `include`: A set of fields to include in the output. -- `exclude`: A set of fields to exclude from the output. -- `context`: Additional context to pass to the serializer. -- `by_alias`: Whether to use the field's alias in the dictionary key if defined. -- `exclude_unset`: Whether to exclude fields that have not been explicitly set. -- `exclude_defaults`: Whether to exclude fields that are set to their default value. -- `exclude_none`: Whether to exclude fields that have a value of `None`. -- `round_trip`: If True, dumped values should be valid as input for non-idempotent types such as Json[T]. -- `warnings`: How to handle serialization errors. False/"none" ignores them, True/"warn" logs errors, "error" raises a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError]. -- `fallback`: A function to call when an unknown value is encountered. If not provided, a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError] error is raised. -- `serialize_as_any`: Whether to serialize fields with duck-typing serialization behavior. - - - - -### method model_dump_json - -```python -self, *, -indent: 'int | None' = None, -include: 'IncEx | None' = None, -exclude: 'IncEx | None' = None, -context: 'Any | None' = None, -by_alias: 'bool | None' = None, -exclude_unset: 'bool' = False, -exclude_defaults: 'bool' = False, -exclude_none: 'bool' = False, -round_trip: 'bool' = False, -warnings: "bool | Literal['none', 'warn', 'error']" = True, -fallback: 'Callable[[Any], Any] | None' = None, -serialize_as_any: 'bool' = False -``` - -!!! abstract "Usage Documentation" - [`model_dump_json`](../concepts/serialization.md#modelmodel_dump_json) - -Generates a JSON representation of the model using Pydantic's `to_json` method. - -##### Arguments - -- `indent`: Indentation to use in the JSON output. If None is passed, the output will be compact. -- `include`: Field(s) to include in the JSON output. -- `exclude`: Field(s) to exclude from the JSON output. -- `context`: Additional context to pass to the serializer. -- `by_alias`: Whether to serialize using field aliases. -- `exclude_unset`: Whether to exclude fields that have not been explicitly set. -- `exclude_defaults`: Whether to exclude fields that are set to their default value. -- `exclude_none`: Whether to exclude fields that have a value of `None`. -- `round_trip`: If True, dumped values should be valid as input for non-idempotent types such as Json[T]. -- `warnings`: How to handle serialization errors. False/"none" ignores them, True/"warn" logs errors, "error" raises a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError]. -- `fallback`: A function to call when an unknown value is encountered. If not provided, a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError] error is raised. -- `serialize_as_any`: Whether to serialize fields with duck-typing serialization behavior. - - - - -### method model_json_schema - -```python -by_alias: 'bool' = True, -ref_template: 'str' = '#/$defs/{model}', -schema_generator: 'type[GenerateJsonSchema]' = , -mode: 'JsonSchemaMode' = 'validation' -``` - -Generates a JSON schema for a model class. - -##### Arguments - -- `by_alias`: Whether to use attribute aliases or not. -- `ref_template`: The reference template. -- `schema_generator`: To override the logic used to generate the JSON schema, as a subclass of `GenerateJsonSchema` with your desired modifications -- `mode`: The mode in which to generate the schema. - - - - -### method model_parametrized_name - -```python -params: 'tuple[type[Any], ...]' -``` - -Compute the class name for parametrizations of generic classes. - -This method can be overridden to achieve a custom naming scheme for generic BaseModels. - -##### Arguments - -- `params`: Tuple of types of the class. Given a generic class `Model` with 2 type variables and a concrete model `Model[str, int]`, the value `(str, int)` would be passed to `params`. - - -##### Raises - -- `TypeError`: Raised when trying to generate concrete names for non-generic models. - - -### method model_post_init - -```python -self, -context: 'Any', / -``` - -Override this method to perform additional initialization after `__init__` and `model_construct`. -This is useful if you want to do some validation that requires the entire model to be initialized. - -##### Arguments - -- `context`: - - - - -### method model_rebuild - -```python -*, -force: 'bool' = False, -raise_errors: 'bool' = True, -_parent_namespace_depth: 'int' = 2, -_types_namespace: 'MappingNamespace | None' = None -``` - -Try to rebuild the pydantic-core schema for the model. - -This may be necessary when one of the annotations is a ForwardRef which could not be resolved during -the initial attempt to build the schema, and automatic rebuilding fails. - -##### Arguments - -- `force`: Whether to force the rebuilding of the model schema, defaults to `False`. -- `raise_errors`: Whether to raise errors, defaults to `True`. -- `_parent_namespace_depth`: The depth level of the parent namespace, defaults to 2. -- `_types_namespace`: The types namespace, defaults to `None`. - - - - -### method model_validate - -```python -obj: 'Any', *, -strict: 'bool | None' = None, -from_attributes: 'bool | None' = None, -context: 'Any | None' = None, -by_alias: 'bool | None' = None, -by_name: 'bool | None' = None -``` - -Validate a pydantic model instance. - -##### Arguments - -- `obj`: The object to validate. -- `strict`: Whether to enforce types strictly. -- `from_attributes`: Whether to extract data from object attributes. -- `context`: Additional context to pass to the validator. -- `by_alias`: Whether to use the field's alias when validating against the provided input data. -- `by_name`: Whether to use the field's name when validating against the provided input data. - - -##### Raises - -- `ValidationError`: If the object could not be validated. - - -### method model_validate_json - -```python -json_data: 'str | bytes | bytearray', *, -strict: 'bool | None' = None, -context: 'Any | None' = None, -by_alias: 'bool | None' = None, -by_name: 'bool | None' = None -``` - -!!! abstract "Usage Documentation" - [JSON Parsing](../concepts/json.md#json-parsing) - -Validate the given JSON data against the Pydantic model. - -##### Arguments - -- `json_data`: The JSON data to validate. -- `strict`: Whether to enforce types strictly. -- `context`: Extra variables to pass to the validator. -- `by_alias`: Whether to use the field's alias when validating against the provided input data. -- `by_name`: Whether to use the field's name when validating against the provided input data. - - -##### Raises - -- `ValidationError`: If `json_data` is not a JSON string or the object could not be validated. - - -### method model_validate_strings - -```python -obj: 'Any', *, -strict: 'bool | None' = None, -context: 'Any | None' = None, -by_alias: 'bool | None' = None, -by_name: 'bool | None' = None -``` - -Validate the given object with string data against the Pydantic model. - -##### Arguments - -- `obj`: The object containing string data to validate. -- `strict`: Whether to enforce types strictly. -- `context`: Extra variables to pass to the validator. -- `by_alias`: Whether to use the field's alias when validating against the provided input data. -- `by_name`: Whether to use the field's name when validating against the provided input data. - - - - -### method parse_file - -```python -path: 'str | Path', *, -content_type: 'str | None' = None, -encoding: 'str' = 'utf8', -proto: 'DeprecatedParseProtocol | None' = None, -allow_pickle: 'bool' = False -``` - - - -##### Arguments - -- `path`: -- `content_type`: -- `encoding`: -- `proto`: -- `allow_pickle`: - - - - -### method parse_obj - -```python -obj: 'Any' -``` - - - -##### Arguments - -- `obj`: - - - - -### method parse_raw - -```python -b: 'str | bytes', *, -content_type: 'str | None' = None, -encoding: 'str' = 'utf8', -proto: 'DeprecatedParseProtocol | None' = None, -allow_pickle: 'bool' = False -``` - - - -##### Arguments - -- `b`: -- `content_type`: -- `encoding`: -- `proto`: -- `allow_pickle`: - - - - -### method schema - -```python -by_alias: 'bool' = True, -ref_template: 'str' = '#/$defs/{model}' -``` - - - -##### Arguments - -- `by_alias`: -- `ref_template`: - - - - -### method schema_json - -```python -*, -by_alias: 'bool' = True, -ref_template: 'str' = '#/$defs/{model}', **dumps_kwargs: 'Any' -``` - - - -##### Arguments - -- `by_alias`: -- `ref_template`: -- `dumps_kwargs`: - - - - -### method update_forward_refs - -```python -**localns: 'Any' -``` - - - -##### Arguments - -- `localns`: - - - - -### method validate - -```python -value: 'Any' -``` - - - -##### Arguments - -- `value`: - - - - ### method validate_anonymous ```python From f8a2e7d47fab51a244f6274febdaf2579b0a889c Mon Sep 17 00:00:00 2001 From: Noah Luna <15202580+ngrayluna@users.noreply.github.com> Date: Wed, 24 Jun 2026 16:25:06 -0700 Subject: [PATCH 5/9] latest --- models/ref/python/data-types/audio.mdx | 6 +++--- models/ref/python/data-types/evaltable.mdx | 12 ++++++------ models/ref/python/data-types/histogram.mdx | 6 +++--- models/ref/python/data-types/html.mdx | 6 +++--- models/ref/python/data-types/image.mdx | 18 +++++++++--------- models/ref/python/data-types/molecule.mdx | 4 ++-- models/ref/python/data-types/object3d.mdx | 4 ++-- models/ref/python/data-types/plotly.mdx | 2 +- models/ref/python/data-types/table.mdx | 14 +++++++------- models/ref/python/data-types/video.mdx | 8 ++++---- models/ref/python/experiments/settings.mdx | 2 +- models/ref/python/public-api/api.mdx | 6 +++--- models/ref/python/public-api/files.mdx | 12 ++++++------ models/ref/python/public-api/project.mdx | 8 ++++---- models/ref/python/public-api/projects.mdx | 6 +++--- models/ref/python/public-api/sweeps.mdx | 8 ++++---- 16 files changed, 61 insertions(+), 61 deletions(-) diff --git a/models/ref/python/data-types/audio.mdx b/models/ref/python/data-types/audio.mdx index c9d91fa2d4..f7bba2cd0d 100644 --- a/models/ref/python/data-types/audio.mdx +++ b/models/ref/python/data-types/audio.mdx @@ -26,9 +26,9 @@ W&B class for audio clips. ## Args -- `data_or_path`: -- `sample_rate`: -- `caption`: +- `data_or_path`: A path to an audio file or a NumPy array of audio data. +- `sample_rate`: Sample rate, required when passing in raw NumPy array of audio data. +- `caption`: Caption to display with audio. diff --git a/models/ref/python/data-types/evaltable.mdx b/models/ref/python/data-types/evaltable.mdx index eef187e042..1694a7dedb 100644 --- a/models/ref/python/data-types/evaltable.mdx +++ b/models/ref/python/data-types/evaltable.mdx @@ -43,18 +43,18 @@ supported. ## Args -- `columns`: +- `columns`: Names of the columns in the table. If unset, but input_columns, output_columns, or score_columns are set, then we'll just set columns to the union of those, in that order. - `data`: - `rows`: - `dataframe`: - `dtype`: - `optional`: - `allow_mixed_types`: -- `log_mode`: -- `input_columns`: -- `output_columns`: -- `score_columns`: -- `unsupported_media_mode`: +- `log_mode`: Controls how the table is logged when the same EvalTable is passed to `run.log()` more than once. +- `input_columns`: Names of the input columns. If set, designates these columns as inputs. Eval comparisons will match rows based on matching values from input columns. If unset, we will inject a "row" index input column so comparisons can match against that. +- `output_columns`: Names of the output columns. These represents the values to be compared. Any columns not designated as input, output, or score will default to being output columns. +- `score_columns`: Names of the score columns. These represent derived scores for the outputs. By default, we will auto-summarize any numeric and boolean scores. +- `unsupported_media_mode`: How to handle unsupported wandb media/value types. diff --git a/models/ref/python/data-types/histogram.mdx b/models/ref/python/data-types/histogram.mdx index 09edc46a31..86be5ee936 100644 --- a/models/ref/python/data-types/histogram.mdx +++ b/models/ref/python/data-types/histogram.mdx @@ -33,9 +33,9 @@ Attributes: ## Args -- `sequence`: -- `np_histogram`: -- `num_bins`: +- `sequence`: Input data for histogram. +- `np_histogram`: Alternative input of a precomputed histogram. +- `num_bins`: Number of bins for the histogram. The default number of bins is 64. The maximum number of bins is 512. diff --git a/models/ref/python/data-types/html.mdx b/models/ref/python/data-types/html.mdx index 3141dd028d..f419b8b23d 100644 --- a/models/ref/python/data-types/html.mdx +++ b/models/ref/python/data-types/html.mdx @@ -26,9 +26,9 @@ W&B class for logging HTML content to W&B. ## Args -- `data`: -- `inject`: -- `data_is_not_path`: +- `data`: A string that is a path to a file with the extension ".html", or a string or IO object containing literal HTML. +- `inject`: Add a stylesheet to the HTML object. If set to False the HTML will pass through unchanged. +- `data_is_not_path`: If set to False, the data will be treated as a path to a file. diff --git a/models/ref/python/data-types/image.mdx b/models/ref/python/data-types/image.mdx index f84a8bbc70..3d3cbcd3f8 100644 --- a/models/ref/python/data-types/image.mdx +++ b/models/ref/python/data-types/image.mdx @@ -32,15 +32,15 @@ A class for logging images to W&B. ## Args -- `data_or_path`: -- `mode`: -- `caption`: -- `grouping`: -- `classes`: -- `boxes`: -- `masks`: -- `file_type`: -- `normalize`: +- `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`. - pytorch tensor should be in the format (channel, height, width) - NumPy array should be in the format (height, width, channel) +- `mode`: The PIL mode for an image. Most common are "L", "RGB", "RGBA". +- `caption`: Label for display of image. +- `grouping`: The grouping number for the image. +- `classes`: A list of class information for the image, used for labeling bounding boxes, and image masks. +- `boxes`: A dictionary containing bounding box information for the image. +- `masks`: A dictionary containing mask information for the image. +- `file_type`: The file type to save the image as. This parameter has no effect if `data_or_path` is a path to an image file. +- `normalize`: If `True`, normalize the image pixel values to fall within the range of [0, 255]. Normalize is only applied if `data_or_path` is a numpy array or pytorch tensor. diff --git a/models/ref/python/data-types/molecule.mdx b/models/ref/python/data-types/molecule.mdx index 06b8485a6b..c9646247e8 100644 --- a/models/ref/python/data-types/molecule.mdx +++ b/models/ref/python/data-types/molecule.mdx @@ -25,8 +25,8 @@ W&B class for 3D Molecular data. ## Args -- `data_or_path`: -- `caption`: +- `data_or_path`: Molecule can be initialized from a file name or an io object. +- `caption`: Caption associated with the molecule for display. - `kwargs`: diff --git a/models/ref/python/data-types/object3d.mdx b/models/ref/python/data-types/object3d.mdx index 5122ce03ac..4428213493 100644 --- a/models/ref/python/data-types/object3d.mdx +++ b/models/ref/python/data-types/object3d.mdx @@ -25,8 +25,8 @@ W&B class for 3D point clouds. ## Args -- `data_or_path`: -- `caption`: +- `data_or_path`: Object3D can be initialized from a file or a numpy array. +- `caption`: Caption associated with the object for display. - `kwargs`: diff --git a/models/ref/python/data-types/plotly.mdx b/models/ref/python/data-types/plotly.mdx index af15720659..35c2771028 100644 --- a/models/ref/python/data-types/plotly.mdx +++ b/models/ref/python/data-types/plotly.mdx @@ -24,7 +24,7 @@ W&B class for Plotly plots. ## Args -- `val`: +- `val`: Matplotlib or Plotly figure. diff --git a/models/ref/python/data-types/table.mdx b/models/ref/python/data-types/table.mdx index 8258f299b8..f5084855a4 100644 --- a/models/ref/python/data-types/table.mdx +++ b/models/ref/python/data-types/table.mdx @@ -33,14 +33,14 @@ https://docs.wandb.ai/models/tables ## Args -- `columns`: -- `data`: -- `rows`: -- `dataframe`: +- `columns`: (List[str]) Names of the columns in the table. Defaults to ["Input", "Output", "Expected"]. +- `data`: (List[List[any]]) 2D row-oriented array of values. +- `rows`: (List[List[any]]) 2D row-oriented array of values. +- `dataframe`: (pandas.DataFrame) DataFrame object used to create the table. When set, `data` and `columns` arguments are ignored. - `dtype`: -- `optional`: -- `allow_mixed_types`: -- `log_mode`: +- `optional`: (Union[bool,List[bool]]) Determines if `None` values are allowed. Default to True - If a singular bool value, then the optionality is enforced for all columns specified at construction time - If a list of bool values, then the optionality is applied to each column - should be the same length as `columns` applies to all columns. A list of bool values applies to each respective column. +- `allow_mixed_types`: (bool) Determines if columns are allowed to have mixed types (disables type validation). Defaults to False +- `log_mode`: Optional[str] Controls how the Table is logged when mutations occur. diff --git a/models/ref/python/data-types/video.mdx b/models/ref/python/data-types/video.mdx index 7d7b796203..ee364f54d5 100644 --- a/models/ref/python/data-types/video.mdx +++ b/models/ref/python/data-types/video.mdx @@ -27,10 +27,10 @@ A class for logging videos to W&B. ## Args -- `data_or_path`: -- `caption`: -- `fps`: -- `format`: +- `data_or_path`: Video can be initialized with a path to a file or an io object. Video can be initialized with a numpy tensor. The numpy tensor must be either 4 dimensional or 5 dimensional. The dimensions should be (number of frames, channel, height, width) or (batch, number of frames, channel, height, width) The format parameter must be specified with the format argument when initializing with a numpy array or io object. +- `caption`: Caption associated with the video for display. +- `fps`: The frame rate to use when encoding raw video frames. Default value is 4. This parameter has no effect when data_or_path is a string, or bytes. +- `format`: Format of video, necessary if initializing with a numpy array or io object. This parameter will be used to determine the format to use when encoding the video data. Accepted values are "gif", "mp4", "webm", or "ogg". If no value is provided, the default format will be "gif". diff --git a/models/ref/python/experiments/settings.mdx b/models/ref/python/experiments/settings.mdx index eb1a0d6a5e..b41d6aa0bb 100644 --- a/models/ref/python/experiments/settings.mdx +++ b/models/ref/python/experiments/settings.mdx @@ -147,7 +147,7 @@ x_service_transport: str | None = None, x_service_wait: float = 30.0, x_skip_transaction_log: bool = False, x_start_time: float | None = None, -x_stats_pid: int = 79119, +x_stats_pid: int = 99231, x_stats_sampling_interval: float = 15.0, x_stats_neuron_monitor_config_path: str | None = None, x_stats_dcgm_exporter: str | None = None, diff --git a/models/ref/python/public-api/api.mdx b/models/ref/python/public-api/api.mdx index 388cb83a5f..61362bd40d 100644 --- a/models/ref/python/public-api/api.mdx +++ b/models/ref/python/public-api/api.mdx @@ -26,9 +26,9 @@ Used for querying the W&B server. ## Args -- `overrides`: -- `timeout`: -- `api_key`: +- `overrides`: You can set `base_url` if you are +- `timeout`: HTTP timeout in seconds for API requests. If not specified, the default timeout will be used. +- `api_key`: API key to use for authentication. If not provided, the API key from the current environment or configuration will be used. Prompts for an API key if none is provided or configured in the environment. ## Examples diff --git a/models/ref/python/public-api/files.mdx b/models/ref/python/public-api/files.mdx index 7ad667e093..3a88c5ad51 100644 --- a/models/ref/python/public-api/files.mdx +++ b/models/ref/python/public-api/files.mdx @@ -32,12 +32,12 @@ automatically when iterating through large collections of files. ## Args -- `service_api`: -- `run`: -- `names`: -- `per_page`: -- `upload`: -- `pattern`: +- `service_api`: The service API instance to use for querying W&B. +- `run`: The run object that contains the files +- `names`: A list of file names to filter the files +- `per_page`: The number of files to fetch per page +- `upload`: If `True`, fetch the upload URL for each file +- `pattern`: Pattern to match when returning files from W&B This pattern uses mySQL's LIKE syntax, so matching all files that end with .json would be "%.json". If both names and pattern are provided, a ValueError will be raised. ## Examples diff --git a/models/ref/python/public-api/project.mdx b/models/ref/python/public-api/project.mdx index 6df36bc6e1..0274c8e303 100644 --- a/models/ref/python/public-api/project.mdx +++ b/models/ref/python/public-api/project.mdx @@ -27,10 +27,10 @@ A project is a namespace for runs. ## Args -- `service_api`: Interface to the wandb-core service that performs W&B API calls for this project. -- `entity`: The entity name that owns the project. -- `project`: -- `attrs`: +- `service_api`: The service API used to query W&B. +- `entity`: The entity which owns the project. +- `project`: The name of the project to query. +- `attrs`: The attributes of the project. diff --git a/models/ref/python/public-api/projects.mdx b/models/ref/python/public-api/projects.mdx index b002fdc01c..9b759c2243 100644 --- a/models/ref/python/public-api/projects.mdx +++ b/models/ref/python/public-api/projects.mdx @@ -28,9 +28,9 @@ An iterable interface to access projects created and saved by the entity. ## Args -- `service_api`: Interface to the wandb-core service that performs W&B API calls for this collection. -- `entity`: The entity name (username or team) to fetch projects for. -- `per_page`: Number of projects to fetch per request (default is 50). +- `service_api`: The service API used to query W&B. +- `entity`: The entity which owns the projects. +- `per_page`: The number of projects to fetch per request to the API. ## Examples diff --git a/models/ref/python/public-api/sweeps.mdx b/models/ref/python/public-api/sweeps.mdx index b42e2b2d7a..3526a8a62c 100644 --- a/models/ref/python/public-api/sweeps.mdx +++ b/models/ref/python/public-api/sweeps.mdx @@ -27,10 +27,10 @@ A lazy iterator over a collection of `Sweep` objects. ## Args -- `service_api`: -- `entity`: -- `project`: -- `per_page`: +- `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 f45f950063a696920157bdd9dbb646dcf931283e Mon Sep 17 00:00:00 2001 From: Noah Luna <15202580+ngrayluna@users.noreply.github.com> Date: Wed, 24 Jun 2026 16:30:01 -0700 Subject: [PATCH 6/9] Removed more hidden --- models/ref/python/automations/automation.mdx | 42 ------------------- models/ref/python/automations/donothing.mdx | 42 ------------------- .../python/automations/metricchangefilter.mdx | 42 ------------------- .../automations/metricthresholdfilter.mdx | 42 ------------------- .../python/automations/metriczscorefilter.mdx | 42 ------------------- .../ref/python/automations/newautomation.mdx | 42 ------------------- .../python/automations/onaddartifactalias.mdx | 40 ------------------ .../python/automations/onaddartifacttag.mdx | 40 ------------------ .../python/automations/onaddcollectiontag.mdx | 40 ------------------ .../python/automations/oncreateartifact.mdx | 40 ------------------ .../ref/python/automations/onlinkartifact.mdx | 40 ------------------ .../automations/onremoveartifacttag.mdx | 40 ------------------ .../automations/onremovecollectiontag.mdx | 40 ------------------ models/ref/python/automations/onrunmetric.mdx | 40 ------------------ models/ref/python/automations/onrunstate.mdx | 40 ------------------ .../python/automations/onunlinkartifact.mdx | 40 ------------------ .../ref/python/automations/runstatefilter.mdx | 42 ------------------- .../python/automations/sendnotification.mdx | 40 ------------------ models/ref/python/automations/sendwebhook.mdx | 40 ------------------ models/ref/python/experiments/settings.mdx | 2 +- 20 files changed, 1 insertion(+), 775 deletions(-) diff --git a/models/ref/python/automations/automation.mdx b/models/ref/python/automations/automation.mdx index 08532d8645..7265ccd474 100644 --- a/models/ref/python/automations/automation.mdx +++ b/models/ref/python/automations/automation.mdx @@ -50,47 +50,5 @@ A local instance of a saved W&B automation that supports editing. -## Methods - -### method model_dump - -```python -self, *, -mode: 'str' = 'json', **kwargs: 'Any' -``` - -!!! abstract "Usage Documentation" - [`model_dump`](../concepts/serialization.md#modelmodel_dump) - -Generate a dictionary representation of the model, optionally specifying which fields to include or exclude. - -##### Arguments - -- `mode`: The mode in which `to_python` should run. If mode is 'json', the output will only contain JSON serializable types. If mode is 'python', the output may contain non-JSON-serializable Python objects. -- `kwargs`: - - - - -### method model_dump_json - -```python -self, *, -indent: 'int | None' = None, **kwargs: 'Any' -``` - -!!! abstract "Usage Documentation" - [`model_dump_json`](../concepts/serialization.md#modelmodel_dump_json) - -Generates a JSON representation of the model using Pydantic's `to_json` method. - -##### Arguments - -- `indent`: Indentation to use in the JSON output. If None is passed, the output will be compact. -- `kwargs`: - - - - diff --git a/models/ref/python/automations/donothing.mdx b/models/ref/python/automations/donothing.mdx index 609166ab93..4a1fdd562d 100644 --- a/models/ref/python/automations/donothing.mdx +++ b/models/ref/python/automations/donothing.mdx @@ -34,47 +34,5 @@ Defines an automation action that intentionally does nothing. -## Methods - -### method model_dump - -```python -self, *, -mode: 'str' = 'json', **kwargs: 'Any' -``` - -!!! abstract "Usage Documentation" - [`model_dump`](../concepts/serialization.md#modelmodel_dump) - -Generate a dictionary representation of the model, optionally specifying which fields to include or exclude. - -##### Arguments - -- `mode`: The mode in which `to_python` should run. If mode is 'json', the output will only contain JSON serializable types. If mode is 'python', the output may contain non-JSON-serializable Python objects. -- `kwargs`: - - - - -### method model_dump_json - -```python -self, *, -indent: 'int | None' = None, **kwargs: 'Any' -``` - -!!! abstract "Usage Documentation" - [`model_dump_json`](../concepts/serialization.md#modelmodel_dump_json) - -Generates a JSON representation of the model using Pydantic's `to_json` method. - -##### Arguments - -- `indent`: Indentation to use in the JSON output. If None is passed, the output will be compact. -- `kwargs`: - - - - diff --git a/models/ref/python/automations/metricchangefilter.mdx b/models/ref/python/automations/metricchangefilter.mdx index 2a74b0d5df..15d123a287 100644 --- a/models/ref/python/automations/metricchangefilter.mdx +++ b/models/ref/python/automations/metricchangefilter.mdx @@ -49,47 +49,5 @@ between the current window and the non-overlapping prior window. -## Methods - -### method model_dump - -```python -self, *, -mode: 'str' = 'json', **kwargs: 'Any' -``` - -!!! abstract "Usage Documentation" - [`model_dump`](../concepts/serialization.md#modelmodel_dump) - -Generate a dictionary representation of the model, optionally specifying which fields to include or exclude. - -##### Arguments - -- `mode`: The mode in which `to_python` should run. If mode is 'json', the output will only contain JSON serializable types. If mode is 'python', the output may contain non-JSON-serializable Python objects. -- `kwargs`: - - - - -### method model_dump_json - -```python -self, *, -indent: 'int | None' = None, **kwargs: 'Any' -``` - -!!! abstract "Usage Documentation" - [`model_dump_json`](../concepts/serialization.md#modelmodel_dump_json) - -Generates a JSON representation of the model using Pydantic's `to_json` method. - -##### Arguments - -- `indent`: Indentation to use in the JSON output. If None is passed, the output will be compact. -- `kwargs`: - - - - diff --git a/models/ref/python/automations/metricthresholdfilter.mdx b/models/ref/python/automations/metricthresholdfilter.mdx index 147f20f414..6564a64c84 100644 --- a/models/ref/python/automations/metricthresholdfilter.mdx +++ b/models/ref/python/automations/metricthresholdfilter.mdx @@ -43,47 +43,5 @@ multiple values. -## Methods - -### method model_dump - -```python -self, *, -mode: 'str' = 'json', **kwargs: 'Any' -``` - -!!! abstract "Usage Documentation" - [`model_dump`](../concepts/serialization.md#modelmodel_dump) - -Generate a dictionary representation of the model, optionally specifying which fields to include or exclude. - -##### Arguments - -- `mode`: The mode in which `to_python` should run. If mode is 'json', the output will only contain JSON serializable types. If mode is 'python', the output may contain non-JSON-serializable Python objects. -- `kwargs`: - - - - -### method model_dump_json - -```python -self, *, -indent: 'int | None' = None, **kwargs: 'Any' -``` - -!!! abstract "Usage Documentation" - [`model_dump_json`](../concepts/serialization.md#modelmodel_dump_json) - -Generates a JSON representation of the model using Pydantic's `to_json` method. - -##### Arguments - -- `indent`: Indentation to use in the JSON output. If None is passed, the output will be compact. -- `kwargs`: - - - - diff --git a/models/ref/python/automations/metriczscorefilter.mdx b/models/ref/python/automations/metriczscorefilter.mdx index 219990a74c..7d75b931e9 100644 --- a/models/ref/python/automations/metriczscorefilter.mdx +++ b/models/ref/python/automations/metriczscorefilter.mdx @@ -38,47 +38,5 @@ Filter that compares a metric's z-score against a user-defined threshold. -## Methods - -### method model_dump - -```python -self, *, -mode: 'str' = 'json', **kwargs: 'Any' -``` - -!!! abstract "Usage Documentation" - [`model_dump`](../concepts/serialization.md#modelmodel_dump) - -Generate a dictionary representation of the model, optionally specifying which fields to include or exclude. - -##### Arguments - -- `mode`: The mode in which `to_python` should run. If mode is 'json', the output will only contain JSON serializable types. If mode is 'python', the output may contain non-JSON-serializable Python objects. -- `kwargs`: - - - - -### method model_dump_json - -```python -self, *, -indent: 'int | None' = None, **kwargs: 'Any' -``` - -!!! abstract "Usage Documentation" - [`model_dump_json`](../concepts/serialization.md#modelmodel_dump_json) - -Generates a JSON representation of the model using Pydantic's `to_json` method. - -##### Arguments - -- `indent`: Indentation to use in the JSON output. If None is passed, the output will be compact. -- `kwargs`: - - - - diff --git a/models/ref/python/automations/newautomation.mdx b/models/ref/python/automations/newautomation.mdx index 7754533fe9..3b0c464ca4 100644 --- a/models/ref/python/automations/newautomation.mdx +++ b/models/ref/python/automations/newautomation.mdx @@ -46,47 +46,5 @@ The scope in which the triggering event must occur. -## Methods - -### method model_dump - -```python -self, *, -mode: 'str' = 'json', **kwargs: 'Any' -``` - -!!! abstract "Usage Documentation" - [`model_dump`](../concepts/serialization.md#modelmodel_dump) - -Generate a dictionary representation of the model, optionally specifying which fields to include or exclude. - -##### Arguments - -- `mode`: The mode in which `to_python` should run. If mode is 'json', the output will only contain JSON serializable types. If mode is 'python', the output may contain non-JSON-serializable Python objects. -- `kwargs`: - - - - -### method model_dump_json - -```python -self, *, -indent: 'int | None' = None, **kwargs: 'Any' -``` - -!!! abstract "Usage Documentation" - [`model_dump_json`](../concepts/serialization.md#modelmodel_dump_json) - -Generates a JSON representation of the model using Pydantic's `to_json` method. - -##### Arguments - -- `indent`: Indentation to use in the JSON output. If None is passed, the output will be compact. -- `kwargs`: - - - - diff --git a/models/ref/python/automations/onaddartifactalias.mdx b/models/ref/python/automations/onaddartifactalias.mdx index a7cbcbbd0a..f75f8aacfe 100644 --- a/models/ref/python/automations/onaddartifactalias.mdx +++ b/models/ref/python/automations/onaddartifactalias.mdx @@ -54,46 +54,6 @@ event = OnAddArtifactAlias( ## Methods -### method model_dump - -```python -self, *, -mode: 'str' = 'json', **kwargs: 'Any' -``` - -!!! abstract "Usage Documentation" - [`model_dump`](../concepts/serialization.md#modelmodel_dump) - -Generate a dictionary representation of the model, optionally specifying which fields to include or exclude. - -##### Arguments - -- `mode`: The mode in which `to_python` should run. If mode is 'json', the output will only contain JSON serializable types. If mode is 'python', the output may contain non-JSON-serializable Python objects. -- `kwargs`: - - - - -### method model_dump_json - -```python -self, *, -indent: 'int | None' = None, **kwargs: 'Any' -``` - -!!! abstract "Usage Documentation" - [`model_dump_json`](../concepts/serialization.md#modelmodel_dump_json) - -Generates a JSON representation of the model using Pydantic's `to_json` method. - -##### Arguments - -- `indent`: Indentation to use in the JSON output. If None is passed, the output will be compact. -- `kwargs`: - - - - ### method then ```python diff --git a/models/ref/python/automations/onaddartifacttag.mdx b/models/ref/python/automations/onaddartifacttag.mdx index d05fc63ec7..eacd36bb1a 100644 --- a/models/ref/python/automations/onaddartifacttag.mdx +++ b/models/ref/python/automations/onaddartifacttag.mdx @@ -54,46 +54,6 @@ event = OnAddArtifactTag( ## Methods -### method model_dump - -```python -self, *, -mode: 'str' = 'json', **kwargs: 'Any' -``` - -!!! abstract "Usage Documentation" - [`model_dump`](../concepts/serialization.md#modelmodel_dump) - -Generate a dictionary representation of the model, optionally specifying which fields to include or exclude. - -##### Arguments - -- `mode`: The mode in which `to_python` should run. If mode is 'json', the output will only contain JSON serializable types. If mode is 'python', the output may contain non-JSON-serializable Python objects. -- `kwargs`: - - - - -### method model_dump_json - -```python -self, *, -indent: 'int | None' = None, **kwargs: 'Any' -``` - -!!! abstract "Usage Documentation" - [`model_dump_json`](../concepts/serialization.md#modelmodel_dump_json) - -Generates a JSON representation of the model using Pydantic's `to_json` method. - -##### Arguments - -- `indent`: Indentation to use in the JSON output. If None is passed, the output will be compact. -- `kwargs`: - - - - ### method then ```python diff --git a/models/ref/python/automations/onaddcollectiontag.mdx b/models/ref/python/automations/onaddcollectiontag.mdx index dcdd716375..45b5af304a 100644 --- a/models/ref/python/automations/onaddcollectiontag.mdx +++ b/models/ref/python/automations/onaddcollectiontag.mdx @@ -38,46 +38,6 @@ A new tag is assigned to an artifact collection. ## Methods -### method model_dump - -```python -self, *, -mode: 'str' = 'json', **kwargs: 'Any' -``` - -!!! abstract "Usage Documentation" - [`model_dump`](../concepts/serialization.md#modelmodel_dump) - -Generate a dictionary representation of the model, optionally specifying which fields to include or exclude. - -##### Arguments - -- `mode`: The mode in which `to_python` should run. If mode is 'json', the output will only contain JSON serializable types. If mode is 'python', the output may contain non-JSON-serializable Python objects. -- `kwargs`: - - - - -### method model_dump_json - -```python -self, *, -indent: 'int | None' = None, **kwargs: 'Any' -``` - -!!! abstract "Usage Documentation" - [`model_dump_json`](../concepts/serialization.md#modelmodel_dump_json) - -Generates a JSON representation of the model using Pydantic's `to_json` method. - -##### Arguments - -- `indent`: Indentation to use in the JSON output. If None is passed, the output will be compact. -- `kwargs`: - - - - ### method then ```python diff --git a/models/ref/python/automations/oncreateartifact.mdx b/models/ref/python/automations/oncreateartifact.mdx index 653023a8cc..3447d5cdb0 100644 --- a/models/ref/python/automations/oncreateartifact.mdx +++ b/models/ref/python/automations/oncreateartifact.mdx @@ -51,46 +51,6 @@ event = OnCreateArtifact(scope=collection) ## Methods -### method model_dump - -```python -self, *, -mode: 'str' = 'json', **kwargs: 'Any' -``` - -!!! abstract "Usage Documentation" - [`model_dump`](../concepts/serialization.md#modelmodel_dump) - -Generate a dictionary representation of the model, optionally specifying which fields to include or exclude. - -##### Arguments - -- `mode`: The mode in which `to_python` should run. If mode is 'json', the output will only contain JSON serializable types. If mode is 'python', the output may contain non-JSON-serializable Python objects. -- `kwargs`: - - - - -### method model_dump_json - -```python -self, *, -indent: 'int | None' = None, **kwargs: 'Any' -``` - -!!! abstract "Usage Documentation" - [`model_dump_json`](../concepts/serialization.md#modelmodel_dump_json) - -Generates a JSON representation of the model using Pydantic's `to_json` method. - -##### Arguments - -- `indent`: Indentation to use in the JSON output. If None is passed, the output will be compact. -- `kwargs`: - - - - ### method then ```python diff --git a/models/ref/python/automations/onlinkartifact.mdx b/models/ref/python/automations/onlinkartifact.mdx index b45e0b8ddc..97f7ed33d6 100644 --- a/models/ref/python/automations/onlinkartifact.mdx +++ b/models/ref/python/automations/onlinkartifact.mdx @@ -54,46 +54,6 @@ event = OnLinkArtifact( ## Methods -### method model_dump - -```python -self, *, -mode: 'str' = 'json', **kwargs: 'Any' -``` - -!!! abstract "Usage Documentation" - [`model_dump`](../concepts/serialization.md#modelmodel_dump) - -Generate a dictionary representation of the model, optionally specifying which fields to include or exclude. - -##### Arguments - -- `mode`: The mode in which `to_python` should run. If mode is 'json', the output will only contain JSON serializable types. If mode is 'python', the output may contain non-JSON-serializable Python objects. -- `kwargs`: - - - - -### method model_dump_json - -```python -self, *, -indent: 'int | None' = None, **kwargs: 'Any' -``` - -!!! abstract "Usage Documentation" - [`model_dump_json`](../concepts/serialization.md#modelmodel_dump_json) - -Generates a JSON representation of the model using Pydantic's `to_json` method. - -##### Arguments - -- `indent`: Indentation to use in the JSON output. If None is passed, the output will be compact. -- `kwargs`: - - - - ### method then ```python diff --git a/models/ref/python/automations/onremoveartifacttag.mdx b/models/ref/python/automations/onremoveartifacttag.mdx index 164d29e4fa..d0ccd09505 100644 --- a/models/ref/python/automations/onremoveartifacttag.mdx +++ b/models/ref/python/automations/onremoveartifacttag.mdx @@ -38,46 +38,6 @@ A tag is removed from an artifact version. ## Methods -### method model_dump - -```python -self, *, -mode: 'str' = 'json', **kwargs: 'Any' -``` - -!!! abstract "Usage Documentation" - [`model_dump`](../concepts/serialization.md#modelmodel_dump) - -Generate a dictionary representation of the model, optionally specifying which fields to include or exclude. - -##### Arguments - -- `mode`: The mode in which `to_python` should run. If mode is 'json', the output will only contain JSON serializable types. If mode is 'python', the output may contain non-JSON-serializable Python objects. -- `kwargs`: - - - - -### method model_dump_json - -```python -self, *, -indent: 'int | None' = None, **kwargs: 'Any' -``` - -!!! abstract "Usage Documentation" - [`model_dump_json`](../concepts/serialization.md#modelmodel_dump_json) - -Generates a JSON representation of the model using Pydantic's `to_json` method. - -##### Arguments - -- `indent`: Indentation to use in the JSON output. If None is passed, the output will be compact. -- `kwargs`: - - - - ### method then ```python diff --git a/models/ref/python/automations/onremovecollectiontag.mdx b/models/ref/python/automations/onremovecollectiontag.mdx index 4d2644cd1f..5286f0f0db 100644 --- a/models/ref/python/automations/onremovecollectiontag.mdx +++ b/models/ref/python/automations/onremovecollectiontag.mdx @@ -38,46 +38,6 @@ A tag is removed from an artifact collection. ## Methods -### method model_dump - -```python -self, *, -mode: 'str' = 'json', **kwargs: 'Any' -``` - -!!! abstract "Usage Documentation" - [`model_dump`](../concepts/serialization.md#modelmodel_dump) - -Generate a dictionary representation of the model, optionally specifying which fields to include or exclude. - -##### Arguments - -- `mode`: The mode in which `to_python` should run. If mode is 'json', the output will only contain JSON serializable types. If mode is 'python', the output may contain non-JSON-serializable Python objects. -- `kwargs`: - - - - -### method model_dump_json - -```python -self, *, -indent: 'int | None' = None, **kwargs: 'Any' -``` - -!!! abstract "Usage Documentation" - [`model_dump_json`](../concepts/serialization.md#modelmodel_dump_json) - -Generates a JSON representation of the model using Pydantic's `to_json` method. - -##### Arguments - -- `indent`: Indentation to use in the JSON output. If None is passed, the output will be compact. -- `kwargs`: - - - - ### method then ```python diff --git a/models/ref/python/automations/onrunmetric.mdx b/models/ref/python/automations/onrunmetric.mdx index 682fb78d53..9016691b8e 100644 --- a/models/ref/python/automations/onrunmetric.mdx +++ b/models/ref/python/automations/onrunmetric.mdx @@ -54,46 +54,6 @@ event = OnRunMetric( ## Methods -### method model_dump - -```python -self, *, -mode: 'str' = 'json', **kwargs: 'Any' -``` - -!!! abstract "Usage Documentation" - [`model_dump`](../concepts/serialization.md#modelmodel_dump) - -Generate a dictionary representation of the model, optionally specifying which fields to include or exclude. - -##### Arguments - -- `mode`: The mode in which `to_python` should run. If mode is 'json', the output will only contain JSON serializable types. If mode is 'python', the output may contain non-JSON-serializable Python objects. -- `kwargs`: - - - - -### method model_dump_json - -```python -self, *, -indent: 'int | None' = None, **kwargs: 'Any' -``` - -!!! abstract "Usage Documentation" - [`model_dump_json`](../concepts/serialization.md#modelmodel_dump_json) - -Generates a JSON representation of the model using Pydantic's `to_json` method. - -##### Arguments - -- `indent`: Indentation to use in the JSON output. If None is passed, the output will be compact. -- `kwargs`: - - - - ### method then ```python diff --git a/models/ref/python/automations/onrunstate.mdx b/models/ref/python/automations/onrunstate.mdx index 811e86c597..510c136d34 100644 --- a/models/ref/python/automations/onrunstate.mdx +++ b/models/ref/python/automations/onrunstate.mdx @@ -54,46 +54,6 @@ event = OnRunState( ## Methods -### method model_dump - -```python -self, *, -mode: 'str' = 'json', **kwargs: 'Any' -``` - -!!! abstract "Usage Documentation" - [`model_dump`](../concepts/serialization.md#modelmodel_dump) - -Generate a dictionary representation of the model, optionally specifying which fields to include or exclude. - -##### Arguments - -- `mode`: The mode in which `to_python` should run. If mode is 'json', the output will only contain JSON serializable types. If mode is 'python', the output may contain non-JSON-serializable Python objects. -- `kwargs`: - - - - -### method model_dump_json - -```python -self, *, -indent: 'int | None' = None, **kwargs: 'Any' -``` - -!!! abstract "Usage Documentation" - [`model_dump_json`](../concepts/serialization.md#modelmodel_dump_json) - -Generates a JSON representation of the model using Pydantic's `to_json` method. - -##### Arguments - -- `indent`: Indentation to use in the JSON output. If None is passed, the output will be compact. -- `kwargs`: - - - - ### method then ```python diff --git a/models/ref/python/automations/onunlinkartifact.mdx b/models/ref/python/automations/onunlinkartifact.mdx index a34a53c7fe..7f6058b128 100644 --- a/models/ref/python/automations/onunlinkartifact.mdx +++ b/models/ref/python/automations/onunlinkartifact.mdx @@ -38,46 +38,6 @@ An artifact version is unlinked from a collection. ## Methods -### method model_dump - -```python -self, *, -mode: 'str' = 'json', **kwargs: 'Any' -``` - -!!! abstract "Usage Documentation" - [`model_dump`](../concepts/serialization.md#modelmodel_dump) - -Generate a dictionary representation of the model, optionally specifying which fields to include or exclude. - -##### Arguments - -- `mode`: The mode in which `to_python` should run. If mode is 'json', the output will only contain JSON serializable types. If mode is 'python', the output may contain non-JSON-serializable Python objects. -- `kwargs`: - - - - -### method model_dump_json - -```python -self, *, -indent: 'int | None' = None, **kwargs: 'Any' -``` - -!!! abstract "Usage Documentation" - [`model_dump_json`](../concepts/serialization.md#modelmodel_dump_json) - -Generates a JSON representation of the model using Pydantic's `to_json` method. - -##### Arguments - -- `indent`: Indentation to use in the JSON output. If None is passed, the output will be compact. -- `kwargs`: - - - - ### method then ```python diff --git a/models/ref/python/automations/runstatefilter.mdx b/models/ref/python/automations/runstatefilter.mdx index f569f9939d..657ae82207 100644 --- a/models/ref/python/automations/runstatefilter.mdx +++ b/models/ref/python/automations/runstatefilter.mdx @@ -34,47 +34,5 @@ Represents a filter for triggering events based on changes in run states. -## Methods - -### method model_dump - -```python -self, *, -mode: 'str' = 'json', **kwargs: 'Any' -``` - -!!! abstract "Usage Documentation" - [`model_dump`](../concepts/serialization.md#modelmodel_dump) - -Generate a dictionary representation of the model, optionally specifying which fields to include or exclude. - -##### Arguments - -- `mode`: The mode in which `to_python` should run. If mode is 'json', the output will only contain JSON serializable types. If mode is 'python', the output may contain non-JSON-serializable Python objects. -- `kwargs`: - - - - -### method model_dump_json - -```python -self, *, -indent: 'int | None' = None, **kwargs: 'Any' -``` - -!!! abstract "Usage Documentation" - [`model_dump_json`](../concepts/serialization.md#modelmodel_dump_json) - -Generates a JSON representation of the model using Pydantic's `to_json` method. - -##### Arguments - -- `indent`: Indentation to use in the JSON output. If None is passed, the output will be compact. -- `kwargs`: - - - - diff --git a/models/ref/python/automations/sendnotification.mdx b/models/ref/python/automations/sendnotification.mdx index fc6b1ae8b7..cd0c9c8553 100644 --- a/models/ref/python/automations/sendnotification.mdx +++ b/models/ref/python/automations/sendnotification.mdx @@ -63,45 +63,5 @@ Define a notification action that sends to the given (Slack) integration. -### method model_dump - -```python -self, *, -mode: 'str' = 'json', **kwargs: 'Any' -``` - -!!! abstract "Usage Documentation" - [`model_dump`](../concepts/serialization.md#modelmodel_dump) - -Generate a dictionary representation of the model, optionally specifying which fields to include or exclude. - -##### Arguments - -- `mode`: The mode in which `to_python` should run. If mode is 'json', the output will only contain JSON serializable types. If mode is 'python', the output may contain non-JSON-serializable Python objects. -- `kwargs`: - - - - -### method model_dump_json - -```python -self, *, -indent: 'int | None' = None, **kwargs: 'Any' -``` - -!!! abstract "Usage Documentation" - [`model_dump_json`](../concepts/serialization.md#modelmodel_dump_json) - -Generates a JSON representation of the model using Pydantic's `to_json` method. - -##### Arguments - -- `indent`: Indentation to use in the JSON output. If None is passed, the output will be compact. -- `kwargs`: - - - - diff --git a/models/ref/python/automations/sendwebhook.mdx b/models/ref/python/automations/sendwebhook.mdx index 83eb4ff622..4b9282668e 100644 --- a/models/ref/python/automations/sendwebhook.mdx +++ b/models/ref/python/automations/sendwebhook.mdx @@ -55,45 +55,5 @@ Define a webhook action that sends to the given (webhook) integration. -### method model_dump - -```python -self, *, -mode: 'str' = 'json', **kwargs: 'Any' -``` - -!!! abstract "Usage Documentation" - [`model_dump`](../concepts/serialization.md#modelmodel_dump) - -Generate a dictionary representation of the model, optionally specifying which fields to include or exclude. - -##### Arguments - -- `mode`: The mode in which `to_python` should run. If mode is 'json', the output will only contain JSON serializable types. If mode is 'python', the output may contain non-JSON-serializable Python objects. -- `kwargs`: - - - - -### method model_dump_json - -```python -self, *, -indent: 'int | None' = None, **kwargs: 'Any' -``` - -!!! abstract "Usage Documentation" - [`model_dump_json`](../concepts/serialization.md#modelmodel_dump_json) - -Generates a JSON representation of the model using Pydantic's `to_json` method. - -##### Arguments - -- `indent`: Indentation to use in the JSON output. If None is passed, the output will be compact. -- `kwargs`: - - - - diff --git a/models/ref/python/experiments/settings.mdx b/models/ref/python/experiments/settings.mdx index b41d6aa0bb..aa993dc9b7 100644 --- a/models/ref/python/experiments/settings.mdx +++ b/models/ref/python/experiments/settings.mdx @@ -147,7 +147,7 @@ x_service_transport: str | None = None, x_service_wait: float = 30.0, x_skip_transaction_log: bool = False, x_start_time: float | None = None, -x_stats_pid: int = 99231, +x_stats_pid: int = 11419, x_stats_sampling_interval: float = 15.0, x_stats_neuron_monitor_config_path: str | None = None, x_stats_dcgm_exporter: str | None = None, From ffab3f4fc25eae1ce1449e72b371580347b4a3b5 Mon Sep 17 00:00:00 2001 From: Noah Luna <15202580+ngrayluna@users.noreply.github.com> Date: Wed, 24 Jun 2026 16:57:48 -0700 Subject: [PATCH 7/9] Find args for Pydantic, dunder, and docstring --- models/ref/python/automations/automation.mdx | 16 +- models/ref/python/automations/donothing.mdx | 4 +- .../python/automations/metricchangefilter.mdx | 6 +- .../automations/metricthresholdfilter.mdx | 2 +- .../python/automations/metriczscorefilter.mdx | 8 +- .../ref/python/automations/newautomation.mdx | 10 +- .../python/automations/onaddartifactalias.mdx | 4 +- .../python/automations/onaddartifacttag.mdx | 4 +- .../python/automations/onaddcollectiontag.mdx | 4 +- .../python/automations/oncreateartifact.mdx | 4 +- .../ref/python/automations/onlinkartifact.mdx | 4 +- .../automations/onremoveartifacttag.mdx | 4 +- .../automations/onremovecollectiontag.mdx | 4 +- models/ref/python/automations/onrunmetric.mdx | 4 +- models/ref/python/automations/onrunstate.mdx | 4 +- .../python/automations/onunlinkartifact.mdx | 4 +- .../ref/python/automations/runstatefilter.mdx | 4 +- .../python/automations/sendnotification.mdx | 8 +- models/ref/python/automations/sendwebhook.mdx | 4 +- models/ref/python/experiments/settings.mdx | 473 ++++++++++++------ 20 files changed, 371 insertions(+), 204 deletions(-) diff --git a/models/ref/python/automations/automation.mdx b/models/ref/python/automations/automation.mdx index 7265ccd474..333df2d81e 100644 --- a/models/ref/python/automations/automation.mdx +++ b/models/ref/python/automations/automation.mdx @@ -36,14 +36,14 @@ A local instance of a saved W&B automation that supports editing. - `__typename`: - `id`: -- `createdAt`: -- `updatedAt`: -- `name`: -- `description`: -- `enabled`: -- `scope`: -- `event`: -- `action`: +- `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. diff --git a/models/ref/python/automations/donothing.mdx b/models/ref/python/automations/donothing.mdx index 4a1fdd562d..9bcc0d9f76 100644 --- a/models/ref/python/automations/donothing.mdx +++ b/models/ref/python/automations/donothing.mdx @@ -26,7 +26,9 @@ Defines an automation action that intentionally does nothing. ## Args -- `no_op`: +- `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`: diff --git a/models/ref/python/automations/metricchangefilter.mdx b/models/ref/python/automations/metricchangefilter.mdx index 15d123a287..b610568567 100644 --- a/models/ref/python/automations/metricchangefilter.mdx +++ b/models/ref/python/automations/metricchangefilter.mdx @@ -38,9 +38,11 @@ between the current window and the non-overlapping prior window. - `name`: - `agg_op`: - `current_window_size`: -- `cmp`: +- `cmp`: Ignored. - `change_amount`: -- `prior_window_size`: +- `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`: diff --git a/models/ref/python/automations/metricthresholdfilter.mdx b/models/ref/python/automations/metricthresholdfilter.mdx index 6564a64c84..cbfdda350a 100644 --- a/models/ref/python/automations/metricthresholdfilter.mdx +++ b/models/ref/python/automations/metricthresholdfilter.mdx @@ -35,7 +35,7 @@ multiple values. - `name`: - `agg_op`: - `window_size`: -- `cmp_op`: +- `cmp_op`: Comparison operator between the metric value (left) vs. the threshold (right). - `threshold`: diff --git a/models/ref/python/automations/metriczscorefilter.mdx b/models/ref/python/automations/metriczscorefilter.mdx index 7d75b931e9..f9bfedc57a 100644 --- a/models/ref/python/automations/metriczscorefilter.mdx +++ b/models/ref/python/automations/metriczscorefilter.mdx @@ -28,10 +28,10 @@ Filter that compares a metric's z-score against a user-defined threshold. ## Args -- `name`: -- `window_size`: -- `threshold`: -- `change_dir`: +- `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. diff --git a/models/ref/python/automations/newautomation.mdx b/models/ref/python/automations/newautomation.mdx index 3b0c464ca4..c8a3321886 100644 --- a/models/ref/python/automations/newautomation.mdx +++ b/models/ref/python/automations/newautomation.mdx @@ -29,11 +29,11 @@ A new automation to be created. ## Args -- `name`: -- `description`: -- `enabled`: -- `event`: -- `action`: +- `name`: The name of this automation. +- `description`: An optional description of this automation. +- `enabled`: Whether this automation is enabled. Only enabled automations will trigger. +- `event`: The event that will trigger this automation. +- `action`: The action that will execute when this automation is triggered. diff --git a/models/ref/python/automations/onaddartifactalias.mdx b/models/ref/python/automations/onaddartifactalias.mdx index f75f8aacfe..e090fd3434 100644 --- a/models/ref/python/automations/onaddartifactalias.mdx +++ b/models/ref/python/automations/onaddartifactalias.mdx @@ -28,8 +28,8 @@ A new alias is assigned to an artifact. ## Args - `event_type`: -- `scope`: -- `filter`: +- `scope`: The scope of the event. +- `filter`: Additional conditions(s), if any, that are required for this event to trigger. ## Examples diff --git a/models/ref/python/automations/onaddartifacttag.mdx b/models/ref/python/automations/onaddartifacttag.mdx index eacd36bb1a..7431f1e2df 100644 --- a/models/ref/python/automations/onaddartifacttag.mdx +++ b/models/ref/python/automations/onaddartifacttag.mdx @@ -28,8 +28,8 @@ A new tag is assigned to an artifact version. ## Args - `event_type`: -- `scope`: -- `filter`: +- `scope`: The scope of the event. +- `filter`: Additional conditions(s), if any, that are required for this event to trigger. ## Examples diff --git a/models/ref/python/automations/onaddcollectiontag.mdx b/models/ref/python/automations/onaddcollectiontag.mdx index 45b5af304a..45fa453dc7 100644 --- a/models/ref/python/automations/onaddcollectiontag.mdx +++ b/models/ref/python/automations/onaddcollectiontag.mdx @@ -28,8 +28,8 @@ A new tag is assigned to an artifact collection. ## Args - `event_type`: -- `scope`: -- `filter`: +- `scope`: The scope of the event. +- `filter`: Additional conditions(s), if any, that are required for this event to trigger. diff --git a/models/ref/python/automations/oncreateartifact.mdx b/models/ref/python/automations/oncreateartifact.mdx index 3447d5cdb0..d1886b7f4b 100644 --- a/models/ref/python/automations/oncreateartifact.mdx +++ b/models/ref/python/automations/oncreateartifact.mdx @@ -28,8 +28,8 @@ A new artifact is created. ## Args - `event_type`: -- `scope`: -- `filter`: +- `scope`: The scope of the event: must be an artifact collection. +- `filter`: Additional conditions(s), if any, that are required for this event to trigger. ## Examples diff --git a/models/ref/python/automations/onlinkartifact.mdx b/models/ref/python/automations/onlinkartifact.mdx index 97f7ed33d6..bc141a42a4 100644 --- a/models/ref/python/automations/onlinkartifact.mdx +++ b/models/ref/python/automations/onlinkartifact.mdx @@ -28,8 +28,8 @@ A new artifact is linked to a collection. ## Args - `event_type`: -- `scope`: -- `filter`: +- `scope`: The scope of the event. +- `filter`: Additional conditions(s), if any, that are required for this event to trigger. ## Examples diff --git a/models/ref/python/automations/onremoveartifacttag.mdx b/models/ref/python/automations/onremoveartifacttag.mdx index d0ccd09505..2c23d58572 100644 --- a/models/ref/python/automations/onremoveartifacttag.mdx +++ b/models/ref/python/automations/onremoveartifacttag.mdx @@ -28,8 +28,8 @@ A tag is removed from an artifact version. ## Args - `event_type`: -- `scope`: -- `filter`: +- `scope`: The scope of the event. +- `filter`: Additional conditions(s), if any, that are required for this event to trigger. diff --git a/models/ref/python/automations/onremovecollectiontag.mdx b/models/ref/python/automations/onremovecollectiontag.mdx index 5286f0f0db..f4495cbde8 100644 --- a/models/ref/python/automations/onremovecollectiontag.mdx +++ b/models/ref/python/automations/onremovecollectiontag.mdx @@ -28,8 +28,8 @@ A tag is removed from an artifact collection. ## Args - `event_type`: -- `scope`: -- `filter`: +- `scope`: The scope of the event. +- `filter`: Additional conditions(s), if any, that are required for this event to trigger. diff --git a/models/ref/python/automations/onrunmetric.mdx b/models/ref/python/automations/onrunmetric.mdx index 9016691b8e..ad27d52640 100644 --- a/models/ref/python/automations/onrunmetric.mdx +++ b/models/ref/python/automations/onrunmetric.mdx @@ -28,8 +28,8 @@ A run metric satisfies a user-defined condition. ## Args - `event_type`: -- `scope`: -- `filter`: +- `scope`: The scope of the event: must be a project. +- `filter`: Run and/or metric condition(s) that must be satisfied for this event to trigger. ## Examples diff --git a/models/ref/python/automations/onrunstate.mdx b/models/ref/python/automations/onrunstate.mdx index 510c136d34..9d78e552c5 100644 --- a/models/ref/python/automations/onrunstate.mdx +++ b/models/ref/python/automations/onrunstate.mdx @@ -28,8 +28,8 @@ A run state changes. ## Args - `event_type`: -- `scope`: -- `filter`: +- `scope`: The scope of the event: must be a project. +- `filter`: Run state condition(s) that must be satisfied for this event to trigger. ## Examples diff --git a/models/ref/python/automations/onunlinkartifact.mdx b/models/ref/python/automations/onunlinkartifact.mdx index 7f6058b128..26394997d6 100644 --- a/models/ref/python/automations/onunlinkartifact.mdx +++ b/models/ref/python/automations/onunlinkartifact.mdx @@ -28,8 +28,8 @@ An artifact version is unlinked from a collection. ## Args - `event_type`: -- `scope`: -- `filter`: +- `scope`: The scope of the event. +- `filter`: Additional conditions(s), if any, that are required for this event to trigger. diff --git a/models/ref/python/automations/runstatefilter.mdx b/models/ref/python/automations/runstatefilter.mdx index 657ae82207..7e71e49e6f 100644 --- a/models/ref/python/automations/runstatefilter.mdx +++ b/models/ref/python/automations/runstatefilter.mdx @@ -26,8 +26,8 @@ Represents a filter for triggering events based on changes in run states. ## Args -- `run_filter`: -- `run_state_filter`: +- `run_filter`: Filters that must match any runs that will trigger this event. +- `run_state_filter`: Run state condition(s) that must be satisfied for this event to trigger. diff --git a/models/ref/python/automations/sendnotification.mdx b/models/ref/python/automations/sendnotification.mdx index cd0c9c8553..e9ca7a607e 100644 --- a/models/ref/python/automations/sendnotification.mdx +++ b/models/ref/python/automations/sendnotification.mdx @@ -29,10 +29,10 @@ Defines an automation action that sends a (Slack) notification. ## Args -- `integration_id`: -- `text`: -- `level`: -- `title`: +- `integration_id`: The ID of the Slack integration that will be used to send the notification. +- `text`: The message body of the sent notification. +- `level`: The severity (`INFO`, `WARN`, `ERROR`) of the sent notification. +- `title`: The title of the sent notification. - `action_type`: diff --git a/models/ref/python/automations/sendwebhook.mdx b/models/ref/python/automations/sendwebhook.mdx index 4b9282668e..de353d6432 100644 --- a/models/ref/python/automations/sendwebhook.mdx +++ b/models/ref/python/automations/sendwebhook.mdx @@ -27,8 +27,8 @@ Defines an automation action that sends a webhook request. ## Args -- `integration_id`: -- `requestPayload`: +- `integration_id`: The ID of the webhook integration that will be used to send the request. +- `requestPayload`: The payload, possibly with template variables, to send in the webhook request. - `action_type`: diff --git a/models/ref/python/experiments/settings.mdx b/models/ref/python/experiments/settings.mdx index aa993dc9b7..3fc7ace751 100644 --- a/models/ref/python/experiments/settings.mdx +++ b/models/ref/python/experiments/settings.mdx @@ -147,7 +147,7 @@ x_service_transport: str | None = None, x_service_wait: float = 30.0, x_skip_transaction_log: bool = False, x_start_time: float | None = None, -x_stats_pid: int = 11419, +x_stats_pid: int = 43535, x_stats_sampling_interval: float = 15.0, x_stats_neuron_monitor_config_path: str | None = None, x_stats_dcgm_exporter: str | None = None, @@ -193,160 +193,323 @@ The settings are organized into three categories: ## Args -- `allow_media_symlink`: -- `allow_offline_artifacts`: -- `allow_val_change`: -- `anonymous`: -- `api_key`: -- `azure_account_url_to_access_key`: -- `app_url_override`: -- `base_url`: -- `code_dir`: -- `config_paths`: -- `console`: -- `console_multipart`: -- `console_chunk_max_bytes`: -- `console_chunk_max_seconds`: -- `capture_loggers`: -- `credentials_file`: -- `disable_code`: -- `disable_git`: -- `disable_git_fork_point`: -- `disable_job_creation`: -- `docker`: -- `email`: -- `entity`: -- `organization`: -- `force`: -- `fork_from`: -- `git_commit`: -- `git_remote`: -- `git_remote_url`: -- `git_root`: -- `heartbeat_seconds`: -- `host`: -- `http_proxy`: -- `https_proxy`: -- `identity_token_file`: -- `ignore_globs`: -- `init_timeout`: -- `finish_timeout`: -- `finish_timeout_raises`: -- `insecure_disable_ssl`: -- `job_name`: -- `job_source`: -- `label_disable`: -- `launch`: -- `launch_config_path`: -- `login_timeout`: -- `mode`: -- `notebook_name`: -- `program`: -- `program_abspath`: -- `program_relpath`: -- `project`: -- `quiet`: -- `reinit`: -- `relogin`: -- `resume`: -- `resume_from`: -- `resumed`: -- `root_dir`: -- `run_group`: -- `run_id`: -- `run_job_type`: -- `run_name`: -- `run_notes`: -- `run_tags`: -- `sagemaker_disable`: -- `save_code`: -- `settings_system`: -- `stop_fn`: -- `max_end_of_run_history_metrics`: -- `max_end_of_run_summary_metrics`: -- `show_colors`: -- `show_emoji`: -- `show_errors`: -- `show_info`: -- `show_warnings`: -- `silent`: -- `start_method`: -- `stop_on_fatal_error`: -- `strict`: -- `summary_timeout`: -- `summary_warnings`: -- `sweep_id`: -- `sweep_param_path`: -- `symlink`: -- `sync_tensorboard`: -- `table_raise_on_max_row_limit_exceeded`: -- `use_dot_wandb`: -- `username`: -- `x_cli_only_mode`: -- `x_disable_meta`: -- `x_disable_stats`: -- `x_disable_viewer`: -- `x_disable_machine_info`: -- `x_executable`: -- `x_extra_http_headers`: -- `x_file_stream_max_bytes`: -- `x_file_stream_max_line_bytes`: -- `x_file_stream_transmit_interval`: -- `x_file_stream_retry_max`: -- `x_file_stream_retry_wait_min_seconds`: -- `x_file_stream_retry_wait_max_seconds`: -- `x_file_stream_timeout_seconds`: -- `x_file_transfer_retry_max`: -- `x_file_transfer_retry_wait_min_seconds`: -- `x_file_transfer_retry_wait_max_seconds`: -- `x_file_transfer_timeout_seconds`: -- `x_files_dir`: -- `x_flow_control_custom`: -- `x_flow_control_disabled`: -- `x_graphql_retry_max`: -- `x_graphql_retry_wait_min_seconds`: -- `x_graphql_retry_wait_max_seconds`: -- `x_graphql_timeout_seconds`: -- `x_internal_check_process`: -- `x_jupyter_name`: -- `x_jupyter_path`: -- `x_jupyter_root`: -- `x_label`: -- `x_live_policy_rate_limit`: -- `x_live_policy_wait_time`: -- `x_log_level`: -- `x_network_buffer`: -- `x_primary`: -- `x_proxies`: -- `x_runqueue_item_id`: -- `x_save_requirements`: -- `x_server_side_derived_summary`: -- `x_server_side_expand_glob_metrics`: -- `x_service_transport`: -- `x_service_wait`: -- `x_skip_transaction_log`: -- `x_start_time`: -- `x_stats_pid`: -- `x_stats_sampling_interval`: -- `x_stats_neuron_monitor_config_path`: -- `x_stats_dcgm_exporter`: -- `x_stats_open_metrics_endpoints`: -- `x_stats_open_metrics_filters`: -- `x_stats_open_metrics_http_headers`: -- `x_stats_disk_paths`: -- `x_stats_cpu_count`: -- `x_stats_cpu_logical_count`: -- `x_stats_gpu_count`: -- `x_stats_gpu_type`: -- `x_stats_gpu_device_ids`: -- `x_stats_buffer_size`: -- `x_stats_coreweave_metadata_base_url`: -- `x_stats_coreweave_metadata_endpoint`: -- `x_stats_track_process_tree`: -- `x_stats_no_cgroup`: -- `x_sync`: -- `x_sync_dir_suffix`: -- `x_update_finish_state`: +- `allow_media_symlink`: Whether to symlink media files to the run directory. + +If true, media files will be symlinked or hardlinked to the +run directory instead of copied. This may result in faster +logging and reduced disk usage. However, deleting or modifying +the original files before upload to the W&B server will be +reflected in the uploaded data. +- `allow_offline_artifacts`: Flag to allow table artifacts to be synced in offline mode. + +To revert to the old behavior, set this to False. +- `allow_val_change`: Flag to allow modification of `Config` values after they've been set. +- `anonymous`: Deprecated and will be removed. +- `api_key`: The W&B API key. +- `azure_account_url_to_access_key`: Mapping of Azure account URLs to their corresponding access keys for Azure integration. +- `app_url_override`: Override for the 'app' URL for the W&B UI. + +The `app_url` is normally computed based on `base_url`, but this can be +used to set it explicitly. + +WANDB_APP_URL is the corresponding environment variable. +- `base_url`: The URL of the W&B backend for data synchronization. +- `code_dir`: Directory containing the code to be tracked by W&B. +- `config_paths`: Paths to files to load configuration from into the `Config` object. +- `console`: The type of console capture to be applied. + +Possible values are: +- "auto" - Automatically selects the console capture method based on the + system environment and settings. +- "off" - Disables console capture. +- "redirect" - Redirects low-level file descriptors for capturing output. +- "wrap" - Overrides the write methods of sys.stdout/sys.stderr. Will be + mapped to either "wrap_raw" or "wrap_emu" based on the state of the system. +- "wrap_raw" - Same as "wrap" but captures raw output directly instead of + through an emulator. Derived from the `wrap` setting and should not be set manually. +- "wrap_emu" - Same as "wrap" but captures output through an emulator. + Derived from the `wrap` setting and should not be set manually. +- `console_multipart`: Enable multipart console logging. + +When True, the SDK writes console output to timestamped files +under the `logs/` directory instead of a single `output.log`. + +Each part is uploaded as soon as it is closed, giving users live +access to logs while the run is active. Rollover cadence is +controlled by `console_chunk_max_bytes` and/or `console_chunk_max_seconds`. +If both limits are `0`, all logs are uploaded once at run finish. + +Note: Uploaded chunks are immutable; terminal control sequences +that modify previous lines (e.g., progress bars using carriage returns) +only affect the current chunk. +- `console_chunk_max_bytes`: Size-based rollover threshold for multipart console logs, in bytes. + +Starts a new console log file when the current part reaches this +size. Has an effect only when `console_multipart` is `True`. +Can be combined with `console_chunk_max_seconds`; whichever limit is +hit first triggers the rollover. A value of `0` disables the +size-based limit. +- `console_chunk_max_seconds`: Time-based rollover threshold for multipart console logs, in seconds. + +Starts a new console log file after this many seconds have elapsed +since the current part began. Requires `console_multipart` to be +`True`. May be used with `console_chunk_max_bytes`; the first limit +reached closes the part. A value of `0` disables the time-based +limit. +- `capture_loggers`: Names of Python loggers to capture into the run's Logs tab. + +A mapping of logger name to minimum log level. When set, wandb installs a +logging.Handler on each named logger and removes it when the run finishes. +Log records emitted by those loggers are published as console output to the +run, similar to stdout/stderr capture. + +Log records are formatted the same as `logging.basicConfig()`, like +`INFO:my_module:Some message.` This is not currently customizable. + +To capture all logs, pass the name of the root logger, which is 'root'. + +This is independent of the `console` setting: both can be active +simultaneously. + +Example: +```python +wandb.init( + settings=wandb.Settings( + console="off", + capture_loggers={ + "my_app": "INFO", + "my_app.training": "ERROR", + }, + ), +) +``` +- `credentials_file`: Path to file for writing temporary access tokens. +- `disable_code`: Whether to disable capturing the code. +- `disable_git`: Whether to disable capturing the git state. +- `disable_git_fork_point`: Whether to disable inferring fork point from remote branches + +When set to True, the SDK will use the latest commit from the upstream +branch, if one is set. Otherwise skip generating the diff patch. + +When set to False, the SDK will try to use the latest commit from the upstream branch, +if one is set. +Otherwise, it will find the closest commit from all remote branches. +This may impact performance for repos with many upstream branches. +- `disable_job_creation`: Whether to disable the creation of a job artifact for W&B Launch. +- `docker`: The Docker image used to execute the script. +- `email`: The email address of the user. +- `entity`: The W&B entity, such as a user or a team. +- `organization`: The W&B organization. +- `force`: Whether to pass the `force` flag to `wandb.login()`. +- `fork_from`: Specifies a point in a previous execution of a run to fork from. + +The point is defined by the run ID, a metric, and its value. +Currently, only the metric '_step' is supported. +- `git_commit`: The git commit hash to associate with the run. +- `git_remote`: The git remote to associate with the run. +- `git_remote_url`: The URL of the git remote repository. +- `git_root`: Root directory of the git repository. +- `host`: Hostname of the machine running the script. +- `http_proxy`: Custom proxy servers for http requests to W&B. +- `https_proxy`: Custom proxy servers for https requests to W&B. +- `identity_token_file`: Path to file containing an identity token (JWT) for authentication. +- `ignore_globs`: Unix glob patterns relative to `files_dir` specifying files to exclude from upload. +- `init_timeout`: Time in seconds to wait for the `wandb.init` call to complete before timing out. +- `finish_timeout`: Time in seconds to wait for data to upload at the end of a run. + +Setting this can limit costs caused by slow uploads to W&B at the end of a +run, with the trade-off that the run will be marked crashed and may be +missing some data. The default is for `run.finish()` to block until all +data finishes uploading. + +If this is set to a number greater than zero, W&B gives up on uploading a +run's data after this many seconds at the end of a run, unblocking your +script. After some time, the run becomes Crashed or Failed in the UI. Any +unuploaded data is still stored on disk and can be uploaded with `wandb +sync`. + +Use the `finish_timeout_raises` setting to raise an error in addition to +printing a warning message. + +Runs shut down by `wandb.teardown()` (which automatically runs at the end +of a script in an atexit hook) will also respect this setting. +- `finish_timeout_raises`: Whether to raise a TimeoutError if finish_timeout expires. + +Using this together with the `finish_timeout` setting causes `run.finish()` +to raise a TimeoutError after a timeout in addition to printing a message. + +Note that `run.finish()` is called implicitly when using a Run as a context +manager: + + with wandb.init() as run: + ... # run.finish() executes at the end of the `with` block + +This does not cause `wandb.teardown()` to raise an error (since it runs +at the end of a script anyway). +- `insecure_disable_ssl`: Whether to insecurely disable SSL verification. +- `job_name`: Name of the Launch job running the script. +- `job_source`: Source type for Launch. +- `label_disable`: Whether to disable automatic labeling features. +- `launch_config_path`: Path to the launch configuration file. +- `login_timeout`: Time in seconds to wait for login operations before timing out. +- `mode`: The operating mode for W&B logging and synchronization. +- `notebook_name`: Name of the notebook if running in a Jupyter-like environment. +- `program`: Path to the script that created the run, if available. +- `program_abspath`: The absolute path from the root repository directory to the script that +created the run. + +Root repository directory is defined as the directory containing the +.git directory, if it exists. Otherwise, it's the current working directory. +- `program_relpath`: The relative path to the script that created the run. +- `project`: The W&B project ID. +- `quiet`: Flag to suppress non-essential output. +- `reinit`: What to do when `wandb.init()` is called while a run is active. + +Options: +- "default": Use "finish_previous" in notebooks and "return_previous" + otherwise. +- "return_previous": Return the most recently created run + that is not yet finished. This does not update `wandb.run`; see + the "create_new" option. +- "finish_previous": Finish all active runs, then return a new run. +- "create_new": Create a new run without modifying other active runs. + Does not update `wandb.run` and top-level functions like `wandb.log`. + Because of this, some older integrations that rely on the global run + will not work. + +Can also be a boolean, but this is deprecated. False is the same as +"return_previous", and True is the same as "finish_previous". +- `relogin`: Flag to force a new login attempt. +- `resume`: Specifies the resume behavior for the run. + +Options: +- "must": Resumes from an existing run with the same ID. If no such run exists, + it will result in failure. +- "allow": Attempts to resume from an existing run with the same ID. If none is + found, a new run will be created. +- "never": Always starts a new run. If a run with the same ID already exists, + it will result in failure. +- "auto": Automatically resumes from the most recent failed run on the same + machine. +- `resume_from`: Specifies a point in a previous execution of a run to resume from. + +The point is defined by the run ID, a metric, and its value. +Currently, only the metric '_step' is supported. +- `root_dir`: The root directory to use as the base for all run-related paths. + +In particular, this is used to derive the wandb directory and the run directory. +- `run_group`: Group identifier for related runs. + +Used for grouping runs in the UI. +- `run_id`: The ID of the run. +- `run_job_type`: Type of job being run (e.g., training, evaluation). +- `run_name`: Human-readable name for the run. +- `run_notes`: Additional notes or description for the run. +- `run_tags`: Tags to associate with the run for organization and filtering. +- `sagemaker_disable`: Flag to disable SageMaker-specific functionality. +- `save_code`: Whether to save the code associated with the run. +- `settings_system`: Path to the system-wide settings file. +- `stop_fn`: A callback to execute to stop the run. + +A run can be stopped through the web UI, or after a fatal error +(if configured via a setting). + +By default, to stop a run, W&B sends a SIGINT to the main thread. +Set this callback to override this behavior, like to use a different +signal or to take some other action before interrupting. + +The callback runs in a separate thread. It runs soon after a stop is +requested, but not immediately. +- `max_end_of_run_history_metrics`: Maximum number of history sparklines to display at the end of a run. +- `max_end_of_run_summary_metrics`: Maximum number of summary metrics to display at the end of a run. +- `show_errors`: Whether to display error messages. +- `show_info`: Whether to display informational messages. +- `show_warnings`: Whether to display warning messages. +- `silent`: Flag to suppress all output. +- `stop_on_fatal_error`: Whether to stop the run after a fatal error. + +After W&B hits an unrecoverable error while uploading data, it prints +a message and stops uploading, but still allows logging more data. +This is usually desirable: your training metrics get stored on disk +and can be recovered using `wandb sync`, even if they aren't uploaded. + +This is not useful if your files get deleted after training. +In that case, setting this to True will stop the run after a fatal error, +as if the stop button was pressed in the web UI. +- `strict`: Whether to enable strict mode for validation and error checking. +- `summary_timeout`: Time in seconds to wait for summary operations before timing out. +- `sweep_id`: Identifier of the sweep this run belongs to. +- `sweep_param_path`: Path to the sweep parameters configuration. +- `symlink`: Whether to use symlinks (True by default except on Windows). +- `sync_tensorboard`: Whether to synchronize TensorBoard logs with W&B. +- `table_raise_on_max_row_limit_exceeded`: Whether to raise an exception when table row limits are exceeded. +- `use_dot_wandb`: 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`: Username. +- `x_disable_meta`: Flag to disable the collection of system metadata. +- `x_disable_stats`: Flag to disable the collection of system metrics. +- `x_extra_http_headers`: Additional headers to add to all outgoing HTTP requests. +- `x_label`: Label to assign to system metrics and console logs collected for the run. + +This is used to group data by on the frontend and can be used to distinguish data +from different processes in a distributed training job. +- `x_primary`: Determines whether to save internal wandb files and metadata. + +In a distributed setting, this is useful for avoiding file overwrites +from secondary processes when only system metrics and logs are needed, +as the primary process handles the main logging. +- `x_save_requirements`: Flag to save the requirements file. +- `x_server_side_derived_summary`: Flag to delegate automatic computation of summary from history to the server. + +This does not disable user-provided summary updates. +- `x_service_wait`: Time in seconds to wait for the wandb-core internal service to start. +- `x_skip_transaction_log`: Whether to skip saving the run events to the transaction log. + +This is only relevant for online runs. Can be used to reduce the amount of +data written to disk. + +Should be used with caution, as it removes the gurantees about +recoverability. +- `x_stats_sampling_interval`: Sampling interval for the system monitor in seconds. +- `x_stats_open_metrics_endpoints`: OpenMetrics `/metrics` endpoints to monitor for system metrics. +- `x_stats_open_metrics_filters`: Filter to apply to metrics collected from OpenMetrics `/metrics` endpoints. + +Supports two formats: + - `{"metric regex pattern, including endpoint name as prefix": {"label": "label value regex pattern"}}` + - `("metric regex pattern 1", "metric regex pattern 2", ...)` +- `x_stats_open_metrics_http_headers`: HTTP headers to add to OpenMetrics requests. +- `x_stats_disk_paths`: System paths to monitor for disk usage. +- `x_stats_cpu_count`: System CPU count. + +If set, overrides the auto-detected value in the run metadata. +- `x_stats_cpu_logical_count`: Logical CPU count. + +If set, overrides the auto-detected value in the run metadata. +- `x_stats_gpu_count`: GPU device count. + +If set, overrides the auto-detected value in the run metadata. +- `x_stats_gpu_type`: GPU device type. + +If set, overrides the auto-detected value in the run metadata. +- `x_stats_gpu_device_ids`: GPU device indices to monitor. + +If not set, the system monitor captures metrics for all GPUs. +Assumes 0-based indexing matching CUDA/ROCm device enumeration. +- `x_stats_track_process_tree`: Monitor the entire process tree for resource usage, starting from `x_stats_pid`. + +When `True`, the system monitor aggregates the RSS, CPU%, and thread count +from the process with PID `x_stats_pid` and all of its descendants. +This can have a performance overhead and is disabled by default. +- `x_stats_no_cgroup`: Disable cgroup v2 CPU and memory limits for system metric percentages. +- `x_sync_dir_suffix`: Suffix to add to the run's directory name (sync_dir). + +This is set in wandb.init() to avoid naming conflicts. +If set, it is joined to the default name with a dash. +- `x_update_finish_state`: Flag to indicate whether this process can update the run's final state on the server. + +Set to False in distributed training when only the main process should determine the final state. From 2437ec51f48a35ce81780274fa98923f285729d1 Mon Sep 17 00:00:00 2001 From: Noah Luna <15202580+ngrayluna@users.noreply.github.com> Date: Mon, 29 Jun 2026 13:58:33 -0700 Subject: [PATCH 8/9] fix indentation --- models/ref/python/automations/donothing.mdx | 2 +- .../python/automations/metricchangefilter.mdx | 2 +- models/ref/python/data-types/evaltable.mdx | 18 +- models/ref/python/data-types/image.mdx | 16 +- models/ref/python/data-types/molecule.mdx | 2 - models/ref/python/data-types/object3d.mdx | 3 - models/ref/python/data-types/table.mdx | 22 +- models/ref/python/experiments/artifact.mdx | 4 + models/ref/python/experiments/run.mdx | 63 +++- models/ref/python/experiments/settings.mdx | 330 +++++++++--------- models/ref/python/functions/init.mdx | 27 ++ models/ref/python/public-api/api.mdx | 10 +- .../python/public-api/artifactcollection.mdx | 1 - .../python/public-api/artifactcollections.mdx | 1 - models/ref/python/public-api/artifacts.mdx | 1 - models/ref/python/public-api/artifacttype.mdx | 1 - models/ref/python/public-api/file.mdx | 1 - .../public-api/projectartifactcollections.mdx | 1 - models/ref/python/public-api/registry.mdx | 6 +- models/ref/python/public-api/run.mdx | 7 +- models/ref/python/public-api/user.mdx | 1 - 21 files changed, 317 insertions(+), 202 deletions(-) diff --git a/models/ref/python/automations/donothing.mdx b/models/ref/python/automations/donothing.mdx index 9bcc0d9f76..bfc14f992f 100644 --- a/models/ref/python/automations/donothing.mdx +++ b/models/ref/python/automations/donothing.mdx @@ -28,7 +28,7 @@ Defines an automation action that intentionally does nothing. - `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. + There should never be a need to set this field explicitly, as its value is ignored. - `action_type`: diff --git a/models/ref/python/automations/metricchangefilter.mdx b/models/ref/python/automations/metricchangefilter.mdx index b610568567..cf5518ce6a 100644 --- a/models/ref/python/automations/metricchangefilter.mdx +++ b/models/ref/python/automations/metricchangefilter.mdx @@ -42,7 +42,7 @@ between the current window and the non-overlapping prior window. - `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. + If omitted, defaults to the size of the current window. - `change_type`: - `change_dir`: diff --git a/models/ref/python/data-types/evaltable.mdx b/models/ref/python/data-types/evaltable.mdx index 1694a7dedb..6b5042ffa3 100644 --- a/models/ref/python/data-types/evaltable.mdx +++ b/models/ref/python/data-types/evaltable.mdx @@ -50,11 +50,19 @@ supported. - `dtype`: - `optional`: - `allow_mixed_types`: -- `log_mode`: Controls how the table is logged when the same EvalTable is passed to `run.log()` more than once. +- `log_mode`: Controls how the table is logged when the same EvalTable + is passed to `run.log()` more than once. + - "IMMUTABLE" (default): full table logged on first `run.log()`; + subsequent `run.log()` calls are no-ops. + - "MUTABLE" and "INCREMENTAL": not currently supported for EvalTable. - `input_columns`: Names of the input columns. If set, designates these columns as inputs. Eval comparisons will match rows based on matching values from input columns. If unset, we will inject a "row" index input column so comparisons can match against that. - `output_columns`: Names of the output columns. These represents the values to be compared. Any columns not designated as input, output, or score will default to being output columns. - `score_columns`: Names of the score columns. These represent derived scores for the outputs. By default, we will auto-summarize any numeric and boolean scores. - `unsupported_media_mode`: How to handle unsupported wandb media/value types. + - "stub" (default): log unsupported values as short placeholder strings + like "[wandb.Html not yet supported]". (This is a temporary flag + for use during development.) + - "raise": fail fast when unsupported wandb value types are added. @@ -93,7 +101,12 @@ Adds one or more computed columns based on existing data. ##### Arguments -- `fn`: A function which accepts one or two parameters, ndx (int) and row (dict), which is expected to return a dict representing new columns for that row, keyed by the new column names. - `ndx` is an integer representing the index of the row. Only included if `include_ndx` is set to `True`. - `row` is a dictionary keyed by existing columns +- `fn`: A function which accepts one or two parameters, ndx (int) and + row (dict), which is expected to return a dict representing + new columns for that row, keyed by the new column names. + - `ndx` is an integer representing the index of the row. Only included if `include_ndx` + is set to `True`. + - `row` is a dictionary keyed by existing columns @@ -166,6 +179,7 @@ Retrieves a column from the table and optionally converts it to a NumPy object. - `name`: (str) - the name of the column - `convert_to`: (str, optional) + - "numpy": will convert the underlying data to numpy object diff --git a/models/ref/python/data-types/image.mdx b/models/ref/python/data-types/image.mdx index 3d3cbcd3f8..799a47d5ef 100644 --- a/models/ref/python/data-types/image.mdx +++ b/models/ref/python/data-types/image.mdx @@ -32,13 +32,21 @@ A class for logging images to W&B. ## Args -- `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`. - pytorch tensor should be in the format (channel, height, width) - NumPy array should be in the format (height, width, channel) -- `mode`: The PIL mode for an image. Most common are "L", "RGB", "RGBA". +- `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`. + - pytorch tensor should be in the format (channel, height, width) + - NumPy array should be in the format (height, width, channel) +- `mode`: The PIL mode for an image. Most common are "L", "RGB", "RGBA". Full Pillow docs for more information https://pillow.readthedocs.io/en/stable/handbook/concepts.html#modes - `caption`: Label for display of image. - `grouping`: The grouping number for the image. - `classes`: A list of class information for the image, used for labeling bounding boxes, and image masks. -- `boxes`: A dictionary containing bounding box information for the image. -- `masks`: A dictionary containing mask information for the image. +- `boxes`: A dictionary containing bounding box information for the image. see https://docs.wandb.ai/models/ref/python/data-types/boundingboxes2d +- `masks`: A dictionary containing mask information for the image. see https://docs.wandb.ai/models/ref/python/data-types/imagemask - `file_type`: The file type to save the image as. This parameter has no effect if `data_or_path` is a path to an image file. - `normalize`: If `True`, normalize the image pixel values to fall within the range of [0, 255]. Normalize is only applied if `data_or_path` is a numpy array or pytorch tensor. diff --git a/models/ref/python/data-types/molecule.mdx b/models/ref/python/data-types/molecule.mdx index c9646247e8..72add3bc7d 100644 --- a/models/ref/python/data-types/molecule.mdx +++ b/models/ref/python/data-types/molecule.mdx @@ -52,7 +52,6 @@ Convert RDKit-supported file/object types to wandb.Molecule. - `data_or_path`: (string, rdkit.Chem.rdchem.Mol) Molecule can be initialized from a file name or an rdkit.Chem.rdchem.Mol object. - `caption`: (string) Caption associated with the molecule for display. - `convert_to_3d_and_optimize`: (bool) Convert to rdkit.Chem.rdchem.Mol with 3D coordinates. This is an expensive operation that may take a long time for complicated molecules. -- `mmff_optimize_molecule_max_iterations`: (int) Number of iterations to use in rdkit.Chem.AllChem.MMFFOptimizeMolecule @@ -75,7 +74,6 @@ Convert SMILES string to wandb.Molecule. - `caption`: Caption associated with the molecule for display. - `sanitize`: Check if the molecule is chemically reasonable by the RDKit's definition. - `convert_to_3d_and_optimize`: Convert to rdkit.Chem.rdchem.Mol with 3D coordinates. This is a computationally intensive operation that may take a long time for complicated molecules. -- `mmff_optimize_molecule_max_iterations`: Number of iterations to use in rdkit.Chem.AllChem.MMFFOptimizeMolecule. diff --git a/models/ref/python/data-types/object3d.mdx b/models/ref/python/data-types/object3d.mdx index 4428213493..81fbad102b 100644 --- a/models/ref/python/data-types/object3d.mdx +++ b/models/ref/python/data-types/object3d.mdx @@ -48,7 +48,6 @@ Initializes Object3D from a file or stream. ##### Arguments - `data_or_path`: A path to a file or a `TextIO` stream. -- `file_type`: Specifies the data format passed to `data_or_path`. Required when `data_or_path` is a `TextIO` stream. This parameter is ignored if a file path is provided. The type is taken from the file extension. @@ -63,7 +62,6 @@ Initializes Object3D from a numpy array. ##### Arguments -- `data`: Each entry in the array will represent one point in the point cloud. @@ -84,7 +82,6 @@ Initializes Object3D from a python object. - `points`: The points in the point cloud. - `boxes`: 3D bounding boxes for labeling the point cloud. Boxes are displayed in point cloud visualizations. - `vectors`: Each vector is displayed in the point cloud visualization. Can be used to indicate directionality of bounding boxes. Defaults to None. -- `point_cloud_type`: At this time, only the "lidar/beta" type is supported. Defaults to "lidar/beta". diff --git a/models/ref/python/data-types/table.mdx b/models/ref/python/data-types/table.mdx index f5084855a4..9040a7273b 100644 --- a/models/ref/python/data-types/table.mdx +++ b/models/ref/python/data-types/table.mdx @@ -38,9 +38,21 @@ https://docs.wandb.ai/models/tables - `rows`: (List[List[any]]) 2D row-oriented array of values. - `dataframe`: (pandas.DataFrame) DataFrame object used to create the table. When set, `data` and `columns` arguments are ignored. - `dtype`: -- `optional`: (Union[bool,List[bool]]) Determines if `None` values are allowed. Default to True - If a singular bool value, then the optionality is enforced for all columns specified at construction time - If a list of bool values, then the optionality is applied to each column - should be the same length as `columns` applies to all columns. A list of bool values applies to each respective column. +- `optional`: (Union[bool,List[bool]]) Determines if `None` values are allowed. Default to True + - If a singular bool value, then the optionality is enforced for all + columns specified at construction time + - If a list of bool values, then the optionality is applied to each + column - should be the same length as `columns` + applies to all columns. A list of bool values applies to each respective column. - `allow_mixed_types`: (bool) Determines if columns are allowed to have mixed types (disables type validation). Defaults to False - `log_mode`: Optional[str] Controls how the Table is logged when mutations occur. + Options: + - "IMMUTABLE" (default): Table can only be logged once; subsequent + logging attempts after the table has been mutated will be no-ops. + - "MUTABLE": Table can be re-logged after mutations, creating + a new artifact version each time it's logged. + - "INCREMENTAL": Table data is logged incrementally, with each log creating + a new artifact entry containing the new data since the last log. @@ -76,7 +88,12 @@ Adds one or more computed columns based on existing data. ##### Arguments -- `fn`: A function which accepts one or two parameters, ndx (int) and row (dict), which is expected to return a dict representing new columns for that row, keyed by the new column names. - `ndx` is an integer representing the index of the row. Only included if `include_ndx` is set to `True`. - `row` is a dictionary keyed by existing columns +- `fn`: A function which accepts one or two parameters, ndx (int) and + row (dict), which is expected to return a dict representing + new columns for that row, keyed by the new column names. + - `ndx` is an integer representing the index of the row. Only included if `include_ndx` + is set to `True`. + - `row` is a dictionary keyed by existing columns @@ -149,6 +166,7 @@ Retrieves a column from the table and optionally converts it to a NumPy object. - `name`: (str) - the name of the column - `convert_to`: (str, optional) + - "numpy": will convert the underlying data to numpy object diff --git a/models/ref/python/experiments/artifact.mdx b/models/ref/python/experiments/artifact.mdx index d6366722b8..e72a62ce58 100644 --- a/models/ref/python/experiments/artifact.mdx +++ b/models/ref/python/experiments/artifact.mdx @@ -289,6 +289,10 @@ Add a local directory to the artifact. - `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. - `skip_cache`: If set to `True`, W&B will not copy/move files to the cache while uploading - `policy`: By default, "mutable". + - mutable: Create a temporary copy of the file to prevent + corruption during upload. + - immutable: Disable protection, rely on the user not to delete + or change the file. - `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. diff --git a/models/ref/python/experiments/run.mdx b/models/ref/python/experiments/run.mdx index c925f37877..49c81cfac7 100644 --- a/models/ref/python/experiments/run.mdx +++ b/models/ref/python/experiments/run.mdx @@ -318,7 +318,19 @@ Subsequent "upserts" with the same distributed ID will result in a new version. ##### Arguments - `artifact_or_path`: A path to the contents of this artifact, + can be in the following forms: + - `/local/directory` + - `/local/directory/file.txt` + - `s3://bucket/path` + You can also pass an Artifact object created by calling + `wandb.Artifact`. - `name`: An artifact name. May be prefixed with entity/project. + Valid names can be in the following forms: + - name:version + - name:alias + - digest + This will default to the basename of the path prepended with the current + run id if not specified. - `type`: The type of artifact to log, examples include `dataset`, `model` - `aliases`: Aliases to apply to this artifact, defaults to `["latest"]` - `distributed_id`: Unique string that all distributed jobs share. If None, defaults to the run's group name. @@ -378,6 +390,10 @@ If not, create a new registered model with name 'registered_model_name'. ##### Arguments - `path`: (str) A path to the contents of this model, can be in the + following forms: + - `/local/directory` + - `/local/directory/file.txt` + - `s3://bucket/path` - `registered_model_name`: The name of the registered model that the model is to be linked to. A registered model is a collection of model versions linked to the model registry, typically representing a team's specific ML Task. The entity that this registered model belongs to will be derived from the run. - `name`: The name of the model artifact that files in 'path' will be logged to. This will default to the basename of the path prepended with the current run id if not specified. - `aliases`: Aliases that will only be applied on this linked artifact inside the registered model. The alias "latest" will always be applied to the latest version of an artifact that is linked. @@ -493,7 +509,7 @@ with wandb.init() as run: ##### Arguments -- `data`: A `dict` with `str` keys and values that are serializable +- `data`: A `dict` with `str` keys and values that are serializable Python objects including: `int`, `float` and `string`; any of the `wandb.data_types`; lists, tuples and NumPy arrays of serializable Python objects; other `dict`s of this structure. - `step`: The step number to log. If `None`, then an implicit auto-incrementing step is used. See the notes in the description. - `commit`: If true, finalize and upload the step. If false, then accumulate data for the step. See the notes in the description. If `step` is `None`, then the default is `commit=True`; otherwise, the default is `commit=False`. @@ -652,7 +668,18 @@ Declare an artifact as an output of a run. ##### Arguments - `artifact_or_path`: (str or Artifact) A path to the contents of this artifact, + can be in the following forms: + - `/local/directory` + - `/local/directory/file.txt` + - `s3://bucket/path` + You can also pass an Artifact object created by calling + `wandb.Artifact`. - `name`: (str, optional) An artifact name. Valid names can be in the following forms: + - name:version + - name:alias + - digest + This will default to the basename of the path prepended with the current + run id if not specified. - `type`: (str) The type of artifact to log, examples include `dataset`, `model` - `aliases`: (list, optional) Aliases to apply to this artifact, defaults to `["latest"]` - `tags`: (list, optional) Tags to apply to this artifact, if any. @@ -678,7 +705,7 @@ By default, it walks the current directory and logs all files that end with `.py - `root`: The relative (to `os.getcwd()`) or absolute path to recursively find code from. - `name`: (str, optional) The name of our code artifact. By default, we'll name the artifact `source-$PROJECT_ID-$ENTRYPOINT_RELPATH`. There may be scenarios where you want many runs to share the same artifact. Specifying name allows you to achieve that. -- `include_fn`: A callable that accepts a file path and (optionally) root path and returns True when it should be included and False otherwise. This +- `include_fn`: A callable that accepts a file path and (optionally) root path and returns True when it should be included and False otherwise. This defaults to `lambda path, root: path.endswith(".py")`. - `exclude_fn`: A callable that accepts a file path and (optionally) root path and returns `True` when it should be excluded and `False` otherwise. This defaults to a function that excludes all files within `/.wandb/` and `/wandb/` directories. @@ -727,6 +754,10 @@ underscores, and hyphens. ##### Arguments - `path`: (str) A path to the contents of this model, + can be in the following forms: + - `/local/directory` + - `/local/directory/file.txt` + - `s3://bucket/path` - `name`: A name to assign to the model artifact that the file contents will be added to. This will default to the basename of the path prepended with the current run id if not specified. - `aliases`: Aliases to apply to the created model artifact, defaults to `["latest"]` @@ -831,6 +862,9 @@ on the same file without modifications will not re-upload it. - `glob_str`: A relative or absolute path or Unix glob. - `base_path`: A path to use to infer a directory structure; see examples. - `policy`: One of `live`, `now`, or `end`. + - live: upload the file as it changes, overwriting the previous version + - now: upload the file once now + - end: upload file when the run ends @@ -882,7 +916,16 @@ This is useful when distributed jobs need to all contribute to the same artifact ##### Arguments - `artifact_or_path`: A path to the contents of this artifact, -- `name`: An artifact name. May be prefixed with "entity/project". Defaults to the basename of the path prepended with the current run ID + can be in the following forms: + - `/local/directory` + - `/local/directory/file.txt` + - `s3://bucket/path` +- `name`: An artifact name. May be prefixed with "entity/project". Defaults + to the basename of the path prepended with the current run ID + if not specified. Valid names can be in the following forms: + - name:version + - name:alias + - digest - `type`: The type of artifact to log. Common examples include `dataset`, `model`. - `aliases`: Aliases to apply to this artifact, defaults to `["latest"]`. - `distributed_id`: Unique string that all distributed jobs share. If None, defaults to the run's group name. @@ -906,7 +949,13 @@ Call `download` or `file` on the returned object to get the contents locally. ##### Arguments -- `artifact_or_name`: The name of the artifact to use. May be prefixed with the name of the project the artifact was logged to ("entity" or "entity/project"). If no entity is specified in the name, the Run or API setting's entity is used. Valid names can be in the following forms +- `artifact_or_name`: The name of the artifact to use. May be prefixed + with the name of the project the artifact was logged to + ("entity" or "entity/project"). If no + entity is specified in the name, the Run or API setting's entity is used. + Valid names can be in the following forms + - name:version + - name:alias - `type`: The type of artifact to use. - `aliases`: Aliases to apply to this artifact - `use_as`: This argument is deprecated and does nothing. @@ -952,7 +1001,11 @@ Download the files logged in a model artifact 'name'. ##### Arguments -- `name`: A model artifact name. 'name' must match the name of an existing logged model artifact. May be prefixed with `entity/project/`. Valid names can be in the following forms +- `name`: A model artifact name. 'name' must match the name of an existing logged + model artifact. May be prefixed with `entity/project/`. Valid names + can be in the following forms + - model_artifact_name:version + - model_artifact_name:alias ##### Raises diff --git a/models/ref/python/experiments/settings.mdx b/models/ref/python/experiments/settings.mdx index 3fc7ace751..363582c816 100644 --- a/models/ref/python/experiments/settings.mdx +++ b/models/ref/python/experiments/settings.mdx @@ -147,7 +147,7 @@ x_service_transport: str | None = None, x_service_wait: float = 30.0, x_skip_transaction_log: bool = False, x_start_time: float | None = None, -x_stats_pid: int = 43535, +x_stats_pid: int = 71170, x_stats_sampling_interval: float = 15.0, x_stats_neuron_monitor_config_path: str | None = None, x_stats_dcgm_exporter: str | None = None, @@ -195,106 +195,106 @@ The settings are organized into three categories: - `allow_media_symlink`: Whether to symlink media files to the run directory. -If true, media files will be symlinked or hardlinked to the -run directory instead of copied. This may result in faster -logging and reduced disk usage. However, deleting or modifying -the original files before upload to the W&B server will be -reflected in the uploaded data. + If true, media files will be symlinked or hardlinked to the + run directory instead of copied. This may result in faster + logging and reduced disk usage. However, deleting or modifying + the original files before upload to the W&B server will be + reflected in the uploaded data. - `allow_offline_artifacts`: Flag to allow table artifacts to be synced in offline mode. -To revert to the old behavior, set this to False. + To revert to the old behavior, set this to False. - `allow_val_change`: Flag to allow modification of `Config` values after they've been set. - `anonymous`: Deprecated and will be removed. - `api_key`: The W&B API key. - `azure_account_url_to_access_key`: Mapping of Azure account URLs to their corresponding access keys for Azure integration. - `app_url_override`: Override for the 'app' URL for the W&B UI. -The `app_url` is normally computed based on `base_url`, but this can be -used to set it explicitly. + The `app_url` is normally computed based on `base_url`, but this can be + used to set it explicitly. -WANDB_APP_URL is the corresponding environment variable. + WANDB_APP_URL is the corresponding environment variable. - `base_url`: The URL of the W&B backend for data synchronization. - `code_dir`: Directory containing the code to be tracked by W&B. - `config_paths`: Paths to files to load configuration from into the `Config` object. - `console`: The type of console capture to be applied. -Possible values are: -- "auto" - Automatically selects the console capture method based on the - system environment and settings. -- "off" - Disables console capture. -- "redirect" - Redirects low-level file descriptors for capturing output. -- "wrap" - Overrides the write methods of sys.stdout/sys.stderr. Will be - mapped to either "wrap_raw" or "wrap_emu" based on the state of the system. -- "wrap_raw" - Same as "wrap" but captures raw output directly instead of - through an emulator. Derived from the `wrap` setting and should not be set manually. -- "wrap_emu" - Same as "wrap" but captures output through an emulator. - Derived from the `wrap` setting and should not be set manually. + Possible values are: + - "auto" - Automatically selects the console capture method based on the + system environment and settings. + - "off" - Disables console capture. + - "redirect" - Redirects low-level file descriptors for capturing output. + - "wrap" - Overrides the write methods of sys.stdout/sys.stderr. Will be + mapped to either "wrap_raw" or "wrap_emu" based on the state of the system. + - "wrap_raw" - Same as "wrap" but captures raw output directly instead of + through an emulator. Derived from the `wrap` setting and should not be set manually. + - "wrap_emu" - Same as "wrap" but captures output through an emulator. + Derived from the `wrap` setting and should not be set manually. - `console_multipart`: Enable multipart console logging. -When True, the SDK writes console output to timestamped files -under the `logs/` directory instead of a single `output.log`. + When True, the SDK writes console output to timestamped files + under the `logs/` directory instead of a single `output.log`. -Each part is uploaded as soon as it is closed, giving users live -access to logs while the run is active. Rollover cadence is -controlled by `console_chunk_max_bytes` and/or `console_chunk_max_seconds`. -If both limits are `0`, all logs are uploaded once at run finish. + Each part is uploaded as soon as it is closed, giving users live + access to logs while the run is active. Rollover cadence is + controlled by `console_chunk_max_bytes` and/or `console_chunk_max_seconds`. + If both limits are `0`, all logs are uploaded once at run finish. -Note: Uploaded chunks are immutable; terminal control sequences -that modify previous lines (e.g., progress bars using carriage returns) -only affect the current chunk. + Note: Uploaded chunks are immutable; terminal control sequences + that modify previous lines (e.g., progress bars using carriage returns) + only affect the current chunk. - `console_chunk_max_bytes`: Size-based rollover threshold for multipart console logs, in bytes. -Starts a new console log file when the current part reaches this -size. Has an effect only when `console_multipart` is `True`. -Can be combined with `console_chunk_max_seconds`; whichever limit is -hit first triggers the rollover. A value of `0` disables the -size-based limit. + Starts a new console log file when the current part reaches this + size. Has an effect only when `console_multipart` is `True`. + Can be combined with `console_chunk_max_seconds`; whichever limit is + hit first triggers the rollover. A value of `0` disables the + size-based limit. - `console_chunk_max_seconds`: Time-based rollover threshold for multipart console logs, in seconds. -Starts a new console log file after this many seconds have elapsed -since the current part began. Requires `console_multipart` to be -`True`. May be used with `console_chunk_max_bytes`; the first limit -reached closes the part. A value of `0` disables the time-based -limit. + Starts a new console log file after this many seconds have elapsed + since the current part began. Requires `console_multipart` to be + `True`. May be used with `console_chunk_max_bytes`; the first limit + reached closes the part. A value of `0` disables the time-based + limit. - `capture_loggers`: Names of Python loggers to capture into the run's Logs tab. -A mapping of logger name to minimum log level. When set, wandb installs a -logging.Handler on each named logger and removes it when the run finishes. -Log records emitted by those loggers are published as console output to the -run, similar to stdout/stderr capture. - -Log records are formatted the same as `logging.basicConfig()`, like -`INFO:my_module:Some message.` This is not currently customizable. - -To capture all logs, pass the name of the root logger, which is 'root'. - -This is independent of the `console` setting: both can be active -simultaneously. - -Example: -```python -wandb.init( - settings=wandb.Settings( - console="off", - capture_loggers={ - "my_app": "INFO", - "my_app.training": "ERROR", - }, - ), -) -``` + A mapping of logger name to minimum log level. When set, wandb installs a + logging.Handler on each named logger and removes it when the run finishes. + Log records emitted by those loggers are published as console output to the + run, similar to stdout/stderr capture. + + Log records are formatted the same as `logging.basicConfig()`, like + `INFO:my_module:Some message.` This is not currently customizable. + + To capture all logs, pass the name of the root logger, which is 'root'. + + This is independent of the `console` setting: both can be active + simultaneously. + + Example: + ```python + wandb.init( + settings=wandb.Settings( + console="off", + capture_loggers={ + "my_app": "INFO", + "my_app.training": "ERROR", + }, + ), + ) + ``` - `credentials_file`: Path to file for writing temporary access tokens. - `disable_code`: Whether to disable capturing the code. - `disable_git`: Whether to disable capturing the git state. - `disable_git_fork_point`: Whether to disable inferring fork point from remote branches -When set to True, the SDK will use the latest commit from the upstream -branch, if one is set. Otherwise skip generating the diff patch. + When set to True, the SDK will use the latest commit from the upstream + branch, if one is set. Otherwise skip generating the diff patch. -When set to False, the SDK will try to use the latest commit from the upstream branch, -if one is set. -Otherwise, it will find the closest commit from all remote branches. -This may impact performance for repos with many upstream branches. + When set to False, the SDK will try to use the latest commit from the upstream branch, + if one is set. + Otherwise, it will find the closest commit from all remote branches. + This may impact performance for repos with many upstream branches. - `disable_job_creation`: Whether to disable the creation of a job artifact for W&B Launch. - `docker`: The Docker image used to execute the script. - `email`: The email address of the user. @@ -303,8 +303,8 @@ This may impact performance for repos with many upstream branches. - `force`: Whether to pass the `force` flag to `wandb.login()`. - `fork_from`: Specifies a point in a previous execution of a run to fork from. -The point is defined by the run ID, a metric, and its value. -Currently, only the metric '_step' is supported. + The point is defined by the run ID, a metric, and its value. + Currently, only the metric '_step' is supported. - `git_commit`: The git commit hash to associate with the run. - `git_remote`: The git remote to associate with the run. - `git_remote_url`: The URL of the git remote repository. @@ -317,35 +317,35 @@ Currently, only the metric '_step' is supported. - `init_timeout`: Time in seconds to wait for the `wandb.init` call to complete before timing out. - `finish_timeout`: Time in seconds to wait for data to upload at the end of a run. -Setting this can limit costs caused by slow uploads to W&B at the end of a -run, with the trade-off that the run will be marked crashed and may be -missing some data. The default is for `run.finish()` to block until all -data finishes uploading. + Setting this can limit costs caused by slow uploads to W&B at the end of a + run, with the trade-off that the run will be marked crashed and may be + missing some data. The default is for `run.finish()` to block until all + data finishes uploading. -If this is set to a number greater than zero, W&B gives up on uploading a -run's data after this many seconds at the end of a run, unblocking your -script. After some time, the run becomes Crashed or Failed in the UI. Any -unuploaded data is still stored on disk and can be uploaded with `wandb -sync`. + If this is set to a number greater than zero, W&B gives up on uploading a + run's data after this many seconds at the end of a run, unblocking your + script. After some time, the run becomes Crashed or Failed in the UI. Any + unuploaded data is still stored on disk and can be uploaded with `wandb + sync`. -Use the `finish_timeout_raises` setting to raise an error in addition to -printing a warning message. + Use the `finish_timeout_raises` setting to raise an error in addition to + printing a warning message. -Runs shut down by `wandb.teardown()` (which automatically runs at the end -of a script in an atexit hook) will also respect this setting. + Runs shut down by `wandb.teardown()` (which automatically runs at the end + of a script in an atexit hook) will also respect this setting. - `finish_timeout_raises`: Whether to raise a TimeoutError if finish_timeout expires. -Using this together with the `finish_timeout` setting causes `run.finish()` -to raise a TimeoutError after a timeout in addition to printing a message. + Using this together with the `finish_timeout` setting causes `run.finish()` + to raise a TimeoutError after a timeout in addition to printing a message. -Note that `run.finish()` is called implicitly when using a Run as a context -manager: + Note that `run.finish()` is called implicitly when using a Run as a context + manager: - with wandb.init() as run: - ... # run.finish() executes at the end of the `with` block + with wandb.init() as run: + ... # run.finish() executes at the end of the `with` block -This does not cause `wandb.teardown()` to raise an error (since it runs -at the end of a script anyway). + This does not cause `wandb.teardown()` to raise an error (since it runs + at the end of a script anyway). - `insecure_disable_ssl`: Whether to insecurely disable SSL verification. - `job_name`: Name of the Launch job running the script. - `job_source`: Source type for Launch. @@ -356,51 +356,51 @@ at the end of a script anyway). - `notebook_name`: Name of the notebook if running in a Jupyter-like environment. - `program`: Path to the script that created the run, if available. - `program_abspath`: The absolute path from the root repository directory to the script that -created the run. + created the run. -Root repository directory is defined as the directory containing the -.git directory, if it exists. Otherwise, it's the current working directory. + Root repository directory is defined as the directory containing the + .git directory, if it exists. Otherwise, it's the current working directory. - `program_relpath`: The relative path to the script that created the run. - `project`: The W&B project ID. - `quiet`: Flag to suppress non-essential output. - `reinit`: What to do when `wandb.init()` is called while a run is active. -Options: -- "default": Use "finish_previous" in notebooks and "return_previous" - otherwise. -- "return_previous": Return the most recently created run - that is not yet finished. This does not update `wandb.run`; see - the "create_new" option. -- "finish_previous": Finish all active runs, then return a new run. -- "create_new": Create a new run without modifying other active runs. - Does not update `wandb.run` and top-level functions like `wandb.log`. - Because of this, some older integrations that rely on the global run - will not work. - -Can also be a boolean, but this is deprecated. False is the same as -"return_previous", and True is the same as "finish_previous". + Options: + - "default": Use "finish_previous" in notebooks and "return_previous" + otherwise. + - "return_previous": Return the most recently created run + that is not yet finished. This does not update `wandb.run`; see + the "create_new" option. + - "finish_previous": Finish all active runs, then return a new run. + - "create_new": Create a new run without modifying other active runs. + Does not update `wandb.run` and top-level functions like `wandb.log`. + Because of this, some older integrations that rely on the global run + will not work. + + Can also be a boolean, but this is deprecated. False is the same as + "return_previous", and True is the same as "finish_previous". - `relogin`: Flag to force a new login attempt. - `resume`: Specifies the resume behavior for the run. -Options: -- "must": Resumes from an existing run with the same ID. If no such run exists, - it will result in failure. -- "allow": Attempts to resume from an existing run with the same ID. If none is - found, a new run will be created. -- "never": Always starts a new run. If a run with the same ID already exists, - it will result in failure. -- "auto": Automatically resumes from the most recent failed run on the same - machine. + Options: + - "must": Resumes from an existing run with the same ID. If no such run exists, + it will result in failure. + - "allow": Attempts to resume from an existing run with the same ID. If none is + found, a new run will be created. + - "never": Always starts a new run. If a run with the same ID already exists, + it will result in failure. + - "auto": Automatically resumes from the most recent failed run on the same + machine. - `resume_from`: Specifies a point in a previous execution of a run to resume from. -The point is defined by the run ID, a metric, and its value. -Currently, only the metric '_step' is supported. + The point is defined by the run ID, a metric, and its value. + Currently, only the metric '_step' is supported. - `root_dir`: The root directory to use as the base for all run-related paths. -In particular, this is used to derive the wandb directory and the run directory. + In particular, this is used to derive the wandb directory and the run directory. - `run_group`: Group identifier for related runs. -Used for grouping runs in the UI. + Used for grouping runs in the UI. - `run_id`: The ID of the run. - `run_job_type`: Type of job being run (e.g., training, evaluation). - `run_name`: Human-readable name for the run. @@ -411,15 +411,15 @@ Used for grouping runs in the UI. - `settings_system`: Path to the system-wide settings file. - `stop_fn`: A callback to execute to stop the run. -A run can be stopped through the web UI, or after a fatal error -(if configured via a setting). + A run can be stopped through the web UI, or after a fatal error + (if configured via a setting). -By default, to stop a run, W&B sends a SIGINT to the main thread. -Set this callback to override this behavior, like to use a different -signal or to take some other action before interrupting. + By default, to stop a run, W&B sends a SIGINT to the main thread. + Set this callback to override this behavior, like to use a different + signal or to take some other action before interrupting. -The callback runs in a separate thread. It runs soon after a stop is -requested, but not immediately. + The callback runs in a separate thread. It runs soon after a stop is + requested, but not immediately. - `max_end_of_run_history_metrics`: Maximum number of history sparklines to display at the end of a run. - `max_end_of_run_summary_metrics`: Maximum number of summary metrics to display at the end of a run. - `show_errors`: Whether to display error messages. @@ -428,14 +428,14 @@ requested, but not immediately. - `silent`: Flag to suppress all output. - `stop_on_fatal_error`: Whether to stop the run after a fatal error. -After W&B hits an unrecoverable error while uploading data, it prints -a message and stops uploading, but still allows logging more data. -This is usually desirable: your training metrics get stored on disk -and can be recovered using `wandb sync`, even if they aren't uploaded. + After W&B hits an unrecoverable error while uploading data, it prints + a message and stops uploading, but still allows logging more data. + This is usually desirable: your training metrics get stored on disk + and can be recovered using `wandb sync`, even if they aren't uploaded. -This is not useful if your files get deleted after training. -In that case, setting this to True will stop the run after a fatal error, -as if the stop button was pressed in the web UI. + This is not useful if your files get deleted after training. + In that case, setting this to True will stop the run after a fatal error, + as if the stop button was pressed in the web UI. - `strict`: Whether to enable strict mode for validation and error checking. - `summary_timeout`: Time in seconds to wait for summary operations before timing out. - `sweep_id`: Identifier of the sweep this run belongs to. @@ -445,71 +445,71 @@ as if the stop button was pressed in the web UI. - `table_raise_on_max_row_limit_exceeded`: Whether to raise an exception when table row limits are exceeded. - `use_dot_wandb`: 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`. + If True, the SDK uses `.wandb`. If False, `wandb`. + If not set, defaults to `.wandb` if it already exists, otherwise `wandb`. - `username`: Username. - `x_disable_meta`: Flag to disable the collection of system metadata. - `x_disable_stats`: Flag to disable the collection of system metrics. - `x_extra_http_headers`: Additional headers to add to all outgoing HTTP requests. - `x_label`: Label to assign to system metrics and console logs collected for the run. -This is used to group data by on the frontend and can be used to distinguish data -from different processes in a distributed training job. + This is used to group data by on the frontend and can be used to distinguish data + from different processes in a distributed training job. - `x_primary`: Determines whether to save internal wandb files and metadata. -In a distributed setting, this is useful for avoiding file overwrites -from secondary processes when only system metrics and logs are needed, -as the primary process handles the main logging. + In a distributed setting, this is useful for avoiding file overwrites + from secondary processes when only system metrics and logs are needed, + as the primary process handles the main logging. - `x_save_requirements`: Flag to save the requirements file. - `x_server_side_derived_summary`: Flag to delegate automatic computation of summary from history to the server. -This does not disable user-provided summary updates. + This does not disable user-provided summary updates. - `x_service_wait`: Time in seconds to wait for the wandb-core internal service to start. - `x_skip_transaction_log`: Whether to skip saving the run events to the transaction log. -This is only relevant for online runs. Can be used to reduce the amount of -data written to disk. + This is only relevant for online runs. Can be used to reduce the amount of + data written to disk. -Should be used with caution, as it removes the gurantees about -recoverability. + Should be used with caution, as it removes the gurantees about + recoverability. - `x_stats_sampling_interval`: Sampling interval for the system monitor in seconds. - `x_stats_open_metrics_endpoints`: OpenMetrics `/metrics` endpoints to monitor for system metrics. - `x_stats_open_metrics_filters`: Filter to apply to metrics collected from OpenMetrics `/metrics` endpoints. -Supports two formats: - - `{"metric regex pattern, including endpoint name as prefix": {"label": "label value regex pattern"}}` - - `("metric regex pattern 1", "metric regex pattern 2", ...)` + Supports two formats: + - `{"metric regex pattern, including endpoint name as prefix": {"label": "label value regex pattern"}}` + - `("metric regex pattern 1", "metric regex pattern 2", ...)` - `x_stats_open_metrics_http_headers`: HTTP headers to add to OpenMetrics requests. - `x_stats_disk_paths`: System paths to monitor for disk usage. - `x_stats_cpu_count`: System CPU count. -If set, overrides the auto-detected value in the run metadata. + If set, overrides the auto-detected value in the run metadata. - `x_stats_cpu_logical_count`: Logical CPU count. -If set, overrides the auto-detected value in the run metadata. + If set, overrides the auto-detected value in the run metadata. - `x_stats_gpu_count`: GPU device count. -If set, overrides the auto-detected value in the run metadata. + If set, overrides the auto-detected value in the run metadata. - `x_stats_gpu_type`: GPU device type. -If set, overrides the auto-detected value in the run metadata. + If set, overrides the auto-detected value in the run metadata. - `x_stats_gpu_device_ids`: GPU device indices to monitor. -If not set, the system monitor captures metrics for all GPUs. -Assumes 0-based indexing matching CUDA/ROCm device enumeration. + If not set, the system monitor captures metrics for all GPUs. + Assumes 0-based indexing matching CUDA/ROCm device enumeration. - `x_stats_track_process_tree`: Monitor the entire process tree for resource usage, starting from `x_stats_pid`. -When `True`, the system monitor aggregates the RSS, CPU%, and thread count -from the process with PID `x_stats_pid` and all of its descendants. -This can have a performance overhead and is disabled by default. + When `True`, the system monitor aggregates the RSS, CPU%, and thread count + from the process with PID `x_stats_pid` and all of its descendants. + This can have a performance overhead and is disabled by default. - `x_stats_no_cgroup`: Disable cgroup v2 CPU and memory limits for system metric percentages. - `x_sync_dir_suffix`: Suffix to add to the run's directory name (sync_dir). -This is set in wandb.init() to avoid naming conflicts. -If set, it is joined to the default name with a dash. + This is set in wandb.init() to avoid naming conflicts. + If set, it is joined to the default name with a dash. - `x_update_finish_state`: Flag to indicate whether this process can update the run's final state on the server. -Set to False in distributed training when only the main process should determine the final state. + Set to False in distributed training when only the main process should determine the final state. diff --git a/models/ref/python/functions/init.mdx b/models/ref/python/functions/init.mdx index b7b5135458..6fb899ffaa 100644 --- a/models/ref/python/functions/init.mdx +++ b/models/ref/python/functions/init.mdx @@ -78,9 +78,36 @@ Run IDs must not contain any of the following special characters `/ \ # ? % :` - `group`: Specify a group name to organize individual runs as part of a larger experiment. This is useful for cases like cross-validation or running multiple jobs that train and evaluate a model on different test sets. Grouping allows you to manage related runs collectively in the UI, making it easy to toggle and review results as a unified experiment. - `job_type`: Specify the type of run, especially helpful when organizing runs within a group as part of a larger experiment. For example, in a group, you might label runs with job types such as "train" and "eval". Defining job types enables you to easily filter and group similar runs in the UI, facilitating direct comparisons. - `mode`: Specifies how run data is managed, with the following options: + - `"online"` (default): Enables live syncing with W&B when a network + connection is available, with real-time updates to visualizations. + - `"offline"`: Suitable for air-gapped or offline environments; data + is saved locally and can be synced later. Ensure the run folder + is preserved to enable future syncing. + - `"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. - `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. + - `"never"`: If a run with the specified `id` exists, an error will + be raised. If no such run is found, a new run will be created. + - `"must"`: If a run with the specified `id` exists, it will resume + from the last step. If no run is found, an error will be raised. + - `"auto"`: Automatically resumes the previous run if it crashed on + this machine; otherwise, starts a new run. + - `True`: Deprecated. Use `"auto"` instead. + - `False`: Deprecated. Use the default behavior (leaving `resume` + unset) to always start a new run. + If `resume` is set, `fork_from` and `resume_from` cannot be + used. When `resume` is unset, the system will always start a new run. - `resume_from`: Specifies a moment in a previous run to resume a run from, using the format `{run_id}?_step={step}`. This allows users to truncate the history logged to a run at an intermediate step and resume logging from that step. The target run must be in the same project. If an `id` argument is also provided, the `resume_from` argument will take precedence. `resume`, `resume_from` and `fork_from` cannot be used together, only one of them can be used at a time. Note that this feature is in beta and may change in the future. - `fork_from`: Specifies a point in a previous run from which to fork a new run, using the format `{id}?_step={step}`. This creates a new run that resumes logging from the specified step in the target run’s history. The target run must be part of the current project. If an `id` argument is also provided, it must be different from the `fork_from` argument, an error will be raised if they are the same. `resume`, `resume_from` and `fork_from` cannot be used together, only one of them can be used at a time. Note that this feature is in beta and may change in the future. - `save_code`: Enables saving the main script or notebook to W&B, aiding in experiment reproducibility and allowing code comparisons across runs in the UI. By default, this is disabled, but you can change the default to enable on your settings page. diff --git a/models/ref/python/public-api/api.mdx b/models/ref/python/public-api/api.mdx index 61362bd40d..d9a6495fc7 100644 --- a/models/ref/python/public-api/api.mdx +++ b/models/ref/python/public-api/api.mdx @@ -26,7 +26,7 @@ Used for querying the W&B server. ## Args -- `overrides`: You can set `base_url` if you are +- `overrides`: You can set `base_url` if you are using a W&B server other than `https://api.wandb.ai`. You can also set defaults for `entity`, `project`, and `run`. - `timeout`: HTTP timeout in seconds for API requests. If not specified, the default timeout will be used. - `api_key`: API key to use for authentication. If not provided, the API key from the current environment or configuration will be used. Prompts for an API key if none is provided or configured in the environment. @@ -497,6 +497,8 @@ Create a custom chart preset and return its id. - `display_name`: Human-readable name shown in the UI - `spec_type`: Type of specification. Must be "vega2" for Vega-Lite v2 specifications. - `access`: Access level for the chart: + - "private": Chart is only accessible to the entity that created it + - "public": Chart is publicly accessible - `spec`: The Vega/Vega-Lite specification as a dictionary or JSON string @@ -576,10 +578,10 @@ Create a new registry. ##### Arguments - `name`: The name of the registry. Name must be unique within the organization. -- `visibility`: The visibility of the registry. +- `visibility`: The visibility of the registry. organization: Anyone in the organization can view this registry. You can edit their roles later from the settings in the UI. restricted: Only invited members via the UI can access this registry. Public sharing is disabled. - `organization`: The organization of the registry. If no organization is set in the settings, the organization will be fetched from the entity if the entity only belongs to one organization. - `description`: The description of the registry. -- `artifact_types`: The accepted artifact types of the registry. A type is no +- `artifact_types`: The accepted artifact types of the registry. A type is no more than 128 characters and do not include characters `/` or `:`. If not specified, all types are accepted. Allowed types added to the registry cannot be removed later. @@ -1092,7 +1094,7 @@ The following operations are supported: ##### Arguments - `path`: (str) path to project, should be in the form: "entity/project" -- `filters`: (dict) queries for specific runs using the MongoDB query language. You can filter by run properties such as config.key, summary_metrics.key, state, entity, createdAt, etc. +- `filters`: (dict) queries for specific runs using the MongoDB query language. You can filter by run properties such as config.key, summary_metrics.key, state, entity, createdAt, etc. For example: `{"config.experiment_name": "foo"}` would find runs with a config entry of experiment name set to "foo" - `order`: (str) Order can be `created_at`, `heartbeat_at`, `config.*.value`, or `summary_metrics.*`. If you prepend order with a + order is ascending (default). If you prepend order with a - order is descending. The default order is run.created_at from oldest to newest. - `per_page`: (int) Sets the page size for query pagination. - `include_sweeps`: (bool) Whether to eagerly fetch the sweep object in each run result. diff --git a/models/ref/python/public-api/artifactcollection.mdx b/models/ref/python/public-api/artifactcollection.mdx index 084b044e2e..ecd09be75a 100644 --- a/models/ref/python/public-api/artifactcollection.mdx +++ b/models/ref/python/public-api/artifactcollection.mdx @@ -36,7 +36,6 @@ An artifact collection that represents a group of related artifacts. - `name`: The name of the artifact collection. - `type`: The type of the artifact collection (e.g., "dataset", "model"). - `organization`: Optional organization name if applicable. -- `attrs`: Optional mapping of attributes to initialize the artifact collection. If not provided, the object will load its attributes from W&B upon initialization. diff --git a/models/ref/python/public-api/artifactcollections.mdx b/models/ref/python/public-api/artifactcollections.mdx index 90f62af1c2..e3aa100a9d 100644 --- a/models/ref/python/public-api/artifactcollections.mdx +++ b/models/ref/python/public-api/artifactcollections.mdx @@ -37,7 +37,6 @@ Artifact collections of a specific type in a project. - `type_name`: The name of the artifact type for which to fetch collections. - `filters`: Optional mapping of filters to apply to the query. - `order`: Optional string to specify the order of the results. If prefixed with '+', sorts ascending (default). If prefixed with '-', sorts descending. -- `per_page`: The number of artifact collections to fetch per page. Default is 50. - `start`: diff --git a/models/ref/python/public-api/artifacts.mdx b/models/ref/python/public-api/artifacts.mdx index 718fdc7b74..a8a252ed90 100644 --- a/models/ref/python/public-api/artifacts.mdx +++ b/models/ref/python/public-api/artifacts.mdx @@ -43,7 +43,6 @@ Optionally pass in filters to narrow down the results based on specific criteria - `filters`: Optional mapping of filters to apply to the query. - `order`: Optional string to specify the order of the results. If prefixed with '+', sorts ascending (default). If prefixed with '-', sorts descending. - `per_page`: The number of artifact versions to fetch per page. Default is 50. -- `tags`: Optional string or list of strings to filter artifacts by tags. - `start`: diff --git a/models/ref/python/public-api/artifacttype.mdx b/models/ref/python/public-api/artifacttype.mdx index 83a753af41..90dc6509be 100644 --- a/models/ref/python/public-api/artifacttype.mdx +++ b/models/ref/python/public-api/artifacttype.mdx @@ -32,7 +32,6 @@ An artifact object that satisfies query based on the specified type. - `entity`: The entity (user or team) that owns the project. - `project`: The name of the project to query for artifact types. - `type_name`: The name of the artifact type. -- `attrs`: Optional attributes to initialize the ArtifactType. If omitted, the object will load its attributes from W&B upon initialization. diff --git a/models/ref/python/public-api/file.mdx b/models/ref/python/public-api/file.mdx index 41652320a8..c46b54bb7b 100644 --- a/models/ref/python/public-api/file.mdx +++ b/models/ref/python/public-api/file.mdx @@ -47,7 +47,6 @@ file logged to a specific run. You can search using the following keys: - `service_api`: The service API instance to use for querying W&B. - `attrs`: A dictionary of attributes that define the file -- `run`: The run object that contains the file diff --git a/models/ref/python/public-api/projectartifactcollections.mdx b/models/ref/python/public-api/projectartifactcollections.mdx index a4d91f0242..b8ee3093bb 100644 --- a/models/ref/python/public-api/projectartifactcollections.mdx +++ b/models/ref/python/public-api/projectartifactcollections.mdx @@ -35,7 +35,6 @@ Artifact collections in a project. - `project`: The name of the project to query for artifact collections. - `filters`: Optional mapping of filters to apply to the query. - `order`: Optional string to specify the order of the results. If prefixed with '+', sorts ascending (default). If prefixed with '-', sorts descending. -- `per_page`: The number of artifact collections to fetch per page. Default is 50. - `start`: diff --git a/models/ref/python/public-api/registry.mdx b/models/ref/python/public-api/registry.mdx index 11f6d406ab..7ff0fabf3f 100644 --- a/models/ref/python/public-api/registry.mdx +++ b/models/ref/python/public-api/registry.mdx @@ -302,7 +302,11 @@ Updates the role of a member (user or team) within this registry. ##### Arguments - `member`: The user or team to update the role of. Accepts a `User` object, `Team` object, or their string ID. -- `role`: The new role to assign to the member. May be one of: - "admin" - "member" - "viewer" - "restricted_viewer" (if supported by the W&B server) +- `role`: The new role to assign to the member. May be one of: + - "admin" + - "member" + - "viewer" + - "restricted_viewer" (if supported by the W&B server) ##### Raises diff --git a/models/ref/python/public-api/run.mdx b/models/ref/python/public-api/run.mdx index db977ea359..af6cce5805 100644 --- a/models/ref/python/public-api/run.mdx +++ b/models/ref/python/public-api/run.mdx @@ -32,8 +32,8 @@ A single run associated with an entity and project. ## Args - `service_api`: Interface to the wandb-core service that performs W&B API calls for this run. -- `entity`: the name of the entity associated with the run -- `project`: the project associated with the run +- `entity`: The entity associated with the run. +- `project`: The project associated with the run. - `run_id`: The unique identifier for the run. - `attrs`: The attributes of the run. - `include_sweeps`: Whether to include sweeps in the run. @@ -501,9 +501,6 @@ See `Run.state` for the list of possible run states. - `state`: The target run state. One of `"pending"` or `"failed"`. -##### Raises - -- ``wandb.Error``: If the requested state transition is not allowed, or the server does not support this operation. ### method upload_file diff --git a/models/ref/python/public-api/user.mdx b/models/ref/python/public-api/user.mdx index 47df6050e5..093c7af00f 100644 --- a/models/ref/python/public-api/user.mdx +++ b/models/ref/python/public-api/user.mdx @@ -31,7 +31,6 @@ user. ## Args - `service_api`: The service API instance to use for querying W&B. -- `attrs`: A subset of the User type in the GraphQL schema. - `api_key`: From f49509ade9d033aaf0040a85adf3f43124a7859f Mon Sep 17 00:00:00 2001 From: Noah Luna <15202580+ngrayluna@users.noreply.github.com> Date: Mon, 29 Jun 2026 16:26:34 -0700 Subject: [PATCH 9/9] alphabetize --- models/ref/python/automations/automation.mdx | 1 - .../python/automations/onaddartifactalias.mdx | 18 -- .../python/automations/onaddartifacttag.mdx | 18 -- .../python/automations/onaddcollectiontag.mdx | 18 -- .../python/automations/oncreateartifact.mdx | 18 -- .../ref/python/automations/onlinkartifact.mdx | 18 -- .../automations/onremoveartifacttag.mdx | 18 -- .../automations/onremovecollectiontag.mdx | 18 -- models/ref/python/automations/onrunmetric.mdx | 18 -- models/ref/python/automations/onrunstate.mdx | 18 -- .../python/automations/onunlinkartifact.mdx | 18 -- .../python/automations/sendnotification.mdx | 2 +- models/ref/python/automations/sendwebhook.mdx | 2 +- models/ref/python/data-types/audio.mdx | 4 +- models/ref/python/data-types/evaltable.mdx | 16 +- models/ref/python/data-types/molecule.mdx | 4 +- models/ref/python/data-types/object3d.mdx | 6 +- models/ref/python/data-types/table.mdx | 16 +- models/ref/python/experiments/artifact.mdx | 258 +++++++++--------- models/ref/python/experiments/run.mdx | 168 ++++++------ models/ref/python/experiments/settings.mdx | 8 +- models/ref/python/public-api/agentruns.mdx | 14 +- models/ref/python/public-api/api.mdx | 94 +++---- .../python/public-api/artifactcollection.mdx | 46 ++-- .../python/public-api/artifactcollections.mdx | 6 +- .../ref/python/public-api/artifactfiles.mdx | 6 +- models/ref/python/public-api/artifacts.mdx | 4 +- models/ref/python/public-api/artifacttype.mdx | 4 +- .../ref/python/public-api/artifacttypes.mdx | 6 +- models/ref/python/public-api/automations.mdx | 7 +- models/ref/python/public-api/betareport.mdx | 24 +- models/ref/python/public-api/file.mdx | 12 +- models/ref/python/public-api/files.mdx | 2 +- .../public-api/incompleterunhistoryerror.mdx | 4 +- models/ref/python/public-api/member.mdx | 2 +- models/ref/python/public-api/project.mdx | 14 +- .../public-api/projectartifactcollections.mdx | 6 +- models/ref/python/public-api/projects.mdx | 6 +- models/ref/python/public-api/registry.mdx | 76 +++--- models/ref/python/public-api/reports.mdx | 6 +- models/ref/python/public-api/run.mdx | 125 ++++----- models/ref/python/public-api/runartifacts.mdx | 6 +- models/ref/python/public-api/runs.mdx | 8 +- models/ref/python/public-api/sweep.mdx | 42 +-- models/ref/python/public-api/sweeps.mdx | 4 +- models/ref/python/public-api/team.mdx | 6 +- models/ref/python/public-api/user.mdx | 14 +- 47 files changed, 515 insertions(+), 694 deletions(-) diff --git a/models/ref/python/automations/automation.mdx b/models/ref/python/automations/automation.mdx index 333df2d81e..00db5686aa 100644 --- a/models/ref/python/automations/automation.mdx +++ b/models/ref/python/automations/automation.mdx @@ -34,7 +34,6 @@ A local instance of a saved W&B automation that supports editing. ## Args -- `__typename`: - `id`: - `createdAt`: The date and time when this automation was created. - `updatedAt`: The date and time when this automation was last updated, if applicable. diff --git a/models/ref/python/automations/onaddartifactalias.mdx b/models/ref/python/automations/onaddartifactalias.mdx index e090fd3434..364796c53a 100644 --- a/models/ref/python/automations/onaddartifactalias.mdx +++ b/models/ref/python/automations/onaddartifactalias.mdx @@ -52,23 +52,5 @@ event = OnAddArtifactAlias( -## Methods - -### method then - -```python -self, -action: 'InputAction' -``` - -Define a new Automation in which this event triggers the given action. - -##### Arguments - -- `action`: - - - - diff --git a/models/ref/python/automations/onaddartifacttag.mdx b/models/ref/python/automations/onaddartifacttag.mdx index 7431f1e2df..d89139eb6b 100644 --- a/models/ref/python/automations/onaddartifacttag.mdx +++ b/models/ref/python/automations/onaddartifacttag.mdx @@ -52,23 +52,5 @@ event = OnAddArtifactTag( -## Methods - -### method then - -```python -self, -action: 'InputAction' -``` - -Define a new Automation in which this event triggers the given action. - -##### Arguments - -- `action`: - - - - diff --git a/models/ref/python/automations/onaddcollectiontag.mdx b/models/ref/python/automations/onaddcollectiontag.mdx index 45fa453dc7..d2f05c086b 100644 --- a/models/ref/python/automations/onaddcollectiontag.mdx +++ b/models/ref/python/automations/onaddcollectiontag.mdx @@ -36,23 +36,5 @@ A new tag is assigned to an artifact collection. -## Methods - -### method then - -```python -self, -action: 'InputAction' -``` - -Define a new Automation in which this event triggers the given action. - -##### Arguments - -- `action`: - - - - diff --git a/models/ref/python/automations/oncreateartifact.mdx b/models/ref/python/automations/oncreateartifact.mdx index d1886b7f4b..a1995ed4b5 100644 --- a/models/ref/python/automations/oncreateartifact.mdx +++ b/models/ref/python/automations/oncreateartifact.mdx @@ -49,23 +49,5 @@ event = OnCreateArtifact(scope=collection) -## Methods - -### method then - -```python -self, -action: 'InputAction' -``` - -Define a new Automation in which this event triggers the given action. - -##### Arguments - -- `action`: - - - - diff --git a/models/ref/python/automations/onlinkartifact.mdx b/models/ref/python/automations/onlinkartifact.mdx index bc141a42a4..cba01551ba 100644 --- a/models/ref/python/automations/onlinkartifact.mdx +++ b/models/ref/python/automations/onlinkartifact.mdx @@ -52,23 +52,5 @@ event = OnLinkArtifact( -## Methods - -### method then - -```python -self, -action: 'InputAction' -``` - -Define a new Automation in which this event triggers the given action. - -##### Arguments - -- `action`: - - - - diff --git a/models/ref/python/automations/onremoveartifacttag.mdx b/models/ref/python/automations/onremoveartifacttag.mdx index 2c23d58572..39d54e8b6b 100644 --- a/models/ref/python/automations/onremoveartifacttag.mdx +++ b/models/ref/python/automations/onremoveartifacttag.mdx @@ -36,23 +36,5 @@ A tag is removed from an artifact version. -## Methods - -### method then - -```python -self, -action: 'InputAction' -``` - -Define a new Automation in which this event triggers the given action. - -##### Arguments - -- `action`: - - - - diff --git a/models/ref/python/automations/onremovecollectiontag.mdx b/models/ref/python/automations/onremovecollectiontag.mdx index f4495cbde8..40a833fe25 100644 --- a/models/ref/python/automations/onremovecollectiontag.mdx +++ b/models/ref/python/automations/onremovecollectiontag.mdx @@ -36,23 +36,5 @@ A tag is removed from an artifact collection. -## Methods - -### method then - -```python -self, -action: 'InputAction' -``` - -Define a new Automation in which this event triggers the given action. - -##### Arguments - -- `action`: - - - - diff --git a/models/ref/python/automations/onrunmetric.mdx b/models/ref/python/automations/onrunmetric.mdx index ad27d52640..fe887cc711 100644 --- a/models/ref/python/automations/onrunmetric.mdx +++ b/models/ref/python/automations/onrunmetric.mdx @@ -52,23 +52,5 @@ event = OnRunMetric( -## Methods - -### method then - -```python -self, -action: 'InputAction' -``` - -Define a new Automation in which this event triggers the given action. - -##### Arguments - -- `action`: - - - - diff --git a/models/ref/python/automations/onrunstate.mdx b/models/ref/python/automations/onrunstate.mdx index 9d78e552c5..5ec22e089a 100644 --- a/models/ref/python/automations/onrunstate.mdx +++ b/models/ref/python/automations/onrunstate.mdx @@ -52,23 +52,5 @@ event = OnRunState( -## Methods - -### method then - -```python -self, -action: 'InputAction' -``` - -Define a new Automation in which this event triggers the given action. - -##### Arguments - -- `action`: - - - - diff --git a/models/ref/python/automations/onunlinkartifact.mdx b/models/ref/python/automations/onunlinkartifact.mdx index 26394997d6..0a29edef16 100644 --- a/models/ref/python/automations/onunlinkartifact.mdx +++ b/models/ref/python/automations/onunlinkartifact.mdx @@ -36,23 +36,5 @@ An artifact version is unlinked from a collection. -## Methods - -### method then - -```python -self, -action: 'InputAction' -``` - -Define a new Automation in which this event triggers the given action. - -##### Arguments - -- `action`: - - - - diff --git a/models/ref/python/automations/sendnotification.mdx b/models/ref/python/automations/sendnotification.mdx index e9ca7a607e..bdea448127 100644 --- a/models/ref/python/automations/sendnotification.mdx +++ b/models/ref/python/automations/sendnotification.mdx @@ -42,7 +42,7 @@ Defines an automation action that sends a (Slack) notification. ## Methods -### method from_integration +### method SendNotification.from_integration() ```python integration: 'SlackIntegration', *, diff --git a/models/ref/python/automations/sendwebhook.mdx b/models/ref/python/automations/sendwebhook.mdx index de353d6432..1d738267dd 100644 --- a/models/ref/python/automations/sendwebhook.mdx +++ b/models/ref/python/automations/sendwebhook.mdx @@ -38,7 +38,7 @@ Defines an automation action that sends a webhook request. ## Methods -### method from_integration +### method SendWebhook.from_integration() ```python integration: 'WebhookIntegration', *, diff --git a/models/ref/python/data-types/audio.mdx b/models/ref/python/data-types/audio.mdx index f7bba2cd0d..ff6c2a18da 100644 --- a/models/ref/python/data-types/audio.mdx +++ b/models/ref/python/data-types/audio.mdx @@ -37,7 +37,7 @@ W&B class for audio clips. ## Methods -### method durations +### method Audio.durations() ```python (audio_list) @@ -52,7 +52,7 @@ Calculate the duration of the audio files. -### method sample_rates +### method Audio.sample_rates() ```python (audio_list) diff --git a/models/ref/python/data-types/evaltable.mdx b/models/ref/python/data-types/evaltable.mdx index 6b5042ffa3..221ad18e27 100644 --- a/models/ref/python/data-types/evaltable.mdx +++ b/models/ref/python/data-types/evaltable.mdx @@ -71,7 +71,7 @@ supported. ## Methods -### method add_column +### method EvalTable.add_column() ```python self, @@ -91,7 +91,7 @@ Adds a column of data to the table. -### method add_computed_columns +### method Table.add_computed_columns() ```python (self, fn) @@ -111,7 +111,7 @@ Adds one or more computed columns based on existing data. -### method add_data +### method EvalTable.add_data() ```python self, *data: 'Any' @@ -131,7 +131,7 @@ The length of the data should match the length of the table column. -### method add_row +### method Table.add_row() ```python (self, *row) @@ -146,7 +146,7 @@ Deprecated. Use `Table.add_data` method instead. -### method cast +### method Table.cast() ```python (self, col_name, dtype, optional=False) @@ -167,7 +167,7 @@ wandb.Classes. -### method get_column +### method Table.get_column() ```python (self, name, convert_to=None) @@ -184,7 +184,7 @@ Retrieves a column from the table and optionally converts it to a NumPy object. -### method get_dataframe +### method Table.get_dataframe() ```python (self) @@ -196,7 +196,7 @@ Returns a `pandas.DataFrame` of the table. -### method get_index +### method Table.get_index() ```python (self) diff --git a/models/ref/python/data-types/molecule.mdx b/models/ref/python/data-types/molecule.mdx index 72add3bc7d..631d9c33f9 100644 --- a/models/ref/python/data-types/molecule.mdx +++ b/models/ref/python/data-types/molecule.mdx @@ -36,7 +36,7 @@ W&B class for 3D Molecular data. ## Methods -### method from_rdkit +### method Molecule.from_rdkit() ```python data_or_path: 'RDKitDataType', @@ -56,7 +56,7 @@ Convert RDKit-supported file/object types to wandb.Molecule. -### method from_smiles +### method Molecule.from_smiles() ```python data: 'str', diff --git a/models/ref/python/data-types/object3d.mdx b/models/ref/python/data-types/object3d.mdx index 81fbad102b..4466a0dee8 100644 --- a/models/ref/python/data-types/object3d.mdx +++ b/models/ref/python/data-types/object3d.mdx @@ -36,7 +36,7 @@ W&B class for 3D point clouds. ## Methods -### method from_file +### method Object3D.from_file() ```python data_or_path: 'TextIO | str', @@ -52,7 +52,7 @@ Initializes Object3D from a file or stream. -### method from_numpy +### method Object3D.from_numpy() ```python data: 'np.ndarray' @@ -66,7 +66,7 @@ Initializes Object3D from a numpy array. -### method from_point_cloud +### method Object3D.from_point_cloud() ```python points: 'Sequence[Point]', diff --git a/models/ref/python/data-types/table.mdx b/models/ref/python/data-types/table.mdx index 9040a7273b..86fb886cd3 100644 --- a/models/ref/python/data-types/table.mdx +++ b/models/ref/python/data-types/table.mdx @@ -61,7 +61,7 @@ https://docs.wandb.ai/models/tables ## Methods -### method add_column +### method Table.add_column() ```python (self, name, data, optional=False) @@ -78,7 +78,7 @@ Adds a column of data to the table. -### method add_computed_columns +### method Table.add_computed_columns() ```python (self, fn) @@ -98,7 +98,7 @@ Adds one or more computed columns based on existing data. -### method add_data +### method Table.add_data() ```python (self, *data) @@ -118,7 +118,7 @@ The length of the data should match the length of the table column. -### method add_row +### method Table.add_row() ```python (self, *row) @@ -133,7 +133,7 @@ Deprecated. Use `Table.add_data` method instead. -### method cast +### method Table.cast() ```python (self, col_name, dtype, optional=False) @@ -154,7 +154,7 @@ wandb.Classes. -### method get_column +### method Table.get_column() ```python (self, name, convert_to=None) @@ -171,7 +171,7 @@ Retrieves a column from the table and optionally converts it to a NumPy object. -### method get_dataframe +### method Table.get_dataframe() ```python (self) @@ -183,7 +183,7 @@ Returns a `pandas.DataFrame` of the table. -### method get_index +### method Table.get_index() ```python (self) diff --git a/models/ref/python/experiments/artifact.mdx b/models/ref/python/experiments/artifact.mdx index e72a62ce58..56d32810fb 100644 --- a/models/ref/python/experiments/artifact.mdx +++ b/models/ref/python/experiments/artifact.mdx @@ -47,43 +47,16 @@ begin with `add`. Once the artifact has all the desired files, you can call ## Properties -### property id - -The artifact's ID. - -### property entity - -The name of the entity that the artifact collection belongs to. - -If the artifact is a link, the entity will be the entity of the linked artifact. - -### property project - -The name of the project that the artifact collection belongs to. - -If the artifact is a link, the project will be the project of the linked artifact. - -### property name - -The artifact name and version of the artifact. - -A string with the format `{collection}:{alias}`. If fetched before an artifact is -logged/saved, the name won't contain the alias. -If the artifact is a link, the name will be the name of the linked artifact. - -### property qualified_name - -The entity/project/name of the artifact. - -If the artifact is a link, the qualified name will be the qualified name of the -linked artifact path. +### property aliases -### property version +List of one or more semantically-friendly references or -The artifact's version. +identifying "nicknames" assigned to an artifact version. -A string with the format `v{number}`. -If this is a link artifact, the version will be from the linked collection. +Aliases are mutable references that you can programmatically reference. +Change an artifact's alias with the W&B App UI or programmatically. +See [Create new artifact versions](https://docs.wandb.ai/models/artifacts/create-a-new-artifact-version) +for more information. ### property collection @@ -97,36 +70,42 @@ that the artifact version originates from. The collection that an artifact originates from is known as the source sequence. -### property source_entity +### property commit_hash -The name of the entity of the source artifact. +The hash returned when this artifact was committed. -### property source_project +### property created_at -The name of the project of the source artifact. +Timestamp when the artifact was created. -### property source_name +### property description -The artifact name and version of the source artifact. +A description of the artifact. -A string with the format `{source_collection}:{alias}`. Before the artifact -is saved, contains only the name since the version is not yet known. +### property digest -### property source_qualified_name +The logical digest of the artifact. -The source_entity/source_project/source_name of the source artifact. +The digest is the checksum of the artifact's contents. If an artifact has the +same digest as the current `latest` version, then `log_artifact` is a no-op. -### property source_version +### property entity -The source artifact's version. +The name of the entity that the artifact collection belongs to. -A string with the format `v{number}`. +If the artifact is a link, the entity will be the entity of the linked artifact. -### property source_collection +### property file_count -The artifact's source collection. +The number of files (including references). -The source collection is the collection that the artifact was logged from. +### property history_step + +The nearest step which logged history metrics for this artifact's source run. + +### property id + +The artifact's ID. ### property is_link @@ -144,110 +123,131 @@ it will return an empty list. Limited to 500 results. -### property source_artifact +### property manifest -Returns the source artifact, which is the original logged artifact. +The artifact's manifest. -If this artifact is a source artifact (`artifact.is_link == False`), -it will return itself. +The manifest lists all of its contents, and can't be changed once the artifact +has been logged. -### property type +### property metadata -The artifact's type. Common types include `dataset` or `model`. +User-defined artifact metadata. -### property url +Structured data associated with the artifact. -Constructs the URL of the artifact. +### property name -### property description +The artifact name and version of the artifact. -A description of the artifact. +A string with the format `{collection}:{alias}`. If fetched before an artifact is +logged/saved, the name won't contain the alias. +If the artifact is a link, the name will be the name of the linked artifact. -### property metadata +### property project -User-defined artifact metadata. +The name of the project that the artifact collection belongs to. -Structured data associated with the artifact. +If the artifact is a link, the project will be the project of the linked artifact. -### property ttl +### property qualified_name -The time-to-live (TTL) policy of an artifact. +The entity/project/name of the artifact. -Artifacts are deleted shortly after a TTL policy's duration passes. -If set to `None`, the artifact deactivates TTL policies and will be not -scheduled for deletion, even if there is a team default TTL. -An artifact inherits a TTL policy from -the team default if the team administrator defines a default -TTL and there is no custom policy set on an artifact. +If the artifact is a link, the qualified name will be the qualified name of the +linked artifact path. -### property aliases +### property size -List of one or more semantically-friendly references or +The total size of the artifact in bytes. -identifying "nicknames" assigned to an artifact version. +Includes any references tracked by this artifact. -Aliases are mutable references that you can programmatically reference. -Change an artifact's alias with the W&B App UI or programmatically. -See [Create new artifact versions](https://docs.wandb.ai/models/artifacts/create-a-new-artifact-version) -for more information. +### property source_artifact -### property tags +Returns the source artifact, which is the original logged artifact. -List of one or more tags assigned to this artifact version. +If this artifact is a source artifact (`artifact.is_link == False`), +it will return itself. -### property use_as +### property source_collection -Deprecated. +The artifact's source collection. -### property state +The source collection is the collection that the artifact was logged from. -The status of the artifact. One of: "PENDING", "COMMITTED", or "DELETED". +### property source_entity -### property manifest +The name of the entity of the source artifact. -The artifact's manifest. +### property source_name -The manifest lists all of its contents, and can't be changed once the artifact -has been logged. +The artifact name and version of the source artifact. -### property digest +A string with the format `{source_collection}:{alias}`. Before the artifact +is saved, contains only the name since the version is not yet known. -The logical digest of the artifact. +### property source_project -The digest is the checksum of the artifact's contents. If an artifact has the -same digest as the current `latest` version, then `log_artifact` is a no-op. +The name of the project of the source artifact. -### property size +### property source_qualified_name -The total size of the artifact in bytes. +The source_entity/source_project/source_name of the source artifact. -Includes any references tracked by this artifact. +### property source_version -### property commit_hash +The source artifact's version. -The hash returned when this artifact was committed. +A string with the format `v{number}`. -### property file_count +### property state -The number of files (including references). +The status of the artifact. One of: "PENDING", "COMMITTED", or "DELETED". -### property created_at +### property tags -Timestamp when the artifact was created. +List of one or more tags assigned to this artifact version. + +### property ttl + +The time-to-live (TTL) policy of an artifact. + +Artifacts are deleted shortly after a TTL policy's duration passes. +If set to `None`, the artifact deactivates TTL policies and will be not +scheduled for deletion, even if there is a team default TTL. +An artifact inherits a TTL policy from +the team default if the team administrator defines a default +TTL and there is no custom policy set on an artifact. + +### property type + +The artifact's type. Common types include `dataset` or `model`. ### property updated_at The time when the artifact was last updated. -### property history_step +### property url -The nearest step which logged history metrics for this artifact's source run. +Constructs the URL of the artifact. + +### property use_as + +Deprecated. + +### property version + +The artifact's version. + +A string with the format `v{number}`. +If this is a link artifact, the version will be from the linked collection. ## Methods -### method add +### method Artifact.add() ```python self, @@ -270,7 +270,7 @@ Add wandb.WBValue `obj` to the artifact. - `ArtifactFinalizedError`: You cannot make changes to the current artifact version because it is finalized. Log a new artifact version instead. -### method add_dir +### method Artifact.add_dir() ```python self, @@ -302,7 +302,7 @@ Add a local directory to the artifact. - `ValueError`: Policy must be "mutable" or "immutable" -### method add_file +### method Artifact.add_file() ```python self, @@ -332,7 +332,7 @@ Add a local file to the artifact. - `ValueError`: Policy must be "mutable" or "immutable" -### method add_reference +### method Artifact.add_reference() ```python self, @@ -380,7 +380,7 @@ blank. - `ArtifactFinalizedError`: You cannot make changes to the current artifact version because it is finalized. Log a new artifact version instead. -### method checkout +### method Artifact.checkout() ```python self, @@ -402,7 +402,7 @@ artifact. - `ArtifactNotLoggedError`: If the artifact is not logged. -### method delete +### method Artifact.delete() ```python self, @@ -427,7 +427,7 @@ link between a source artifact and a collection. - `ArtifactNotLoggedError`: If the artifact is not logged. -### method download +### method Artifact.download() ```python self, @@ -458,7 +458,7 @@ the artifact. - `ArtifactNotLoggedError`: If the artifact is not logged. -### method file +### method Artifact.file() ```python self, @@ -478,7 +478,7 @@ Download a single file artifact to the directory you specify with `root`. - `ValueError`: If the artifact contains more than one file. -### method files +### method Artifact.files() ```python self, @@ -501,7 +501,7 @@ Iterate over all files stored in this artifact. - `ArtifactNotLoggedError`: If the artifact is not logged. -### method finalize +### method Artifact.finalize() ```python self @@ -518,7 +518,7 @@ when you log the artifact with `log_artifact`. -### method get +### method Artifact.get() ```python self, @@ -537,7 +537,7 @@ Get the WBValue object located at the artifact relative `name`. - `ArtifactNotLoggedError`: if the artifact isn't logged or the run is offline. -### method get_added_local_path_name +### method Artifact.get_added_local_path_name() ```python self, @@ -553,7 +553,7 @@ Get the artifact relative name of a file added by a local filesystem path. -### method get_entry +### method Artifact.get_entry() ```python self, @@ -573,7 +573,7 @@ Get the entry with the given name. - `KeyError`: if the artifact doesn't contain an entry with the given name. -### method get_path +### method Artifact.get_path() ```python self, @@ -589,7 +589,7 @@ Deprecated. Use `get_entry(name)`. -### method is_draft +### method Artifact.is_draft() ```python self @@ -601,7 +601,7 @@ Check if artifact is not saved. -### method json_encode +### method Artifact.json_encode() ```python self @@ -613,7 +613,7 @@ Returns the artifact encoded to the JSON format. -### method link +### method Artifact.link() ```python self, @@ -634,7 +634,7 @@ Link this artifact to a collection. - `ArtifactNotLoggedError`: If the artifact is not logged. -### method logged_by +### method Artifact.logged_by() ```python self @@ -649,7 +649,7 @@ Get the W&B run that originally logged the artifact. - `ArtifactNotLoggedError`: If the artifact is not logged. -### method new_draft +### method Artifact.new_draft() ```python self @@ -668,7 +668,7 @@ modified and logged as a new version. - `ArtifactNotLoggedError`: If the artifact is not logged. -### method new_file +### method Artifact.new_file() ```python self, @@ -691,7 +691,7 @@ Open a new temporary file and add it to the artifact. - `ArtifactFinalizedError`: You cannot make changes to the current artifact version because it is finalized. Log a new artifact version instead. -### method remove +### method Artifact.remove() ```python self, @@ -711,7 +711,7 @@ Remove an item from the artifact. - `FileNotFoundError`: If the item isn't found in the artifact. -### method save +### method Artifact.save() ```python self, @@ -732,7 +732,7 @@ run, a run of type "auto" is created to track this artifact. -### method unlink +### method Artifact.unlink() ```python self @@ -748,7 +748,7 @@ Unlink this artifact if it is a linked member of an artifact collection. - `ValueError`: If the artifact is not linked to any collection. -### method used_by +### method Artifact.used_by() ```python self @@ -763,7 +763,7 @@ Get a list of the runs that have used this artifact and its linked artifacts. - `ArtifactNotLoggedError`: If the artifact is not logged. -### method verify +### method Artifact.verify() ```python self, @@ -786,7 +786,7 @@ cross-referenced against the artifact's manifest. References are not verified. - `ValueError`: If the verification fails. -### method wait +### method Artifact.wait() ```python self, diff --git a/models/ref/python/experiments/run.mdx b/models/ref/python/experiments/run.mdx index 49c81cfac7..bffcfa2d76 100644 --- a/models/ref/python/experiments/run.mdx +++ b/models/ref/python/experiments/run.mdx @@ -76,14 +76,6 @@ with wandb.init(entity="entity", project="project") as run: ## Properties -### property settings - -A frozen copy of run's Settings object. - -### property dir - -The directory where files associated with the run are saved. - ### property config Config object associated with this run. @@ -92,60 +84,19 @@ Config object associated with this run. Static config object associated with this run. -### property name - -Display name of the run. - -Display names are not guaranteed to be unique and may be descriptive. -By default, they are randomly generated. - -### property notes - -Notes associated with the run, if there are any. - -Notes can be a multiline string and can also use markdown and latex -equations inside `$$`, like `$x + 3$`. - -### property tags - -Tags associated with the run, if there are any. - -### property id - -Identifier for this run. - -### property sweep_id - -Identifier for the sweep associated with the run, if there is one. - -### property path - -Path to the run. - -Run paths include entity, project, and run ID, in the format -`entity/project/run_id`. - -### property start_time - -Unix timestamp (in seconds) of when the run started. - -### property resumed - -True if the run was resumed, False otherwise. - -### property step +### property dir -The W&B step of the next `log()` call. +The directory where files associated with the run are saved. -Raises an error in mode="shared" runs. +### property disabled -### property offline +True if the run is disabled, False otherwise. -True if the run is offline, False otherwise. +### property entity -### property disabled +The name of the W&B entity associated with the run. -True if the run is disabled, False otherwise. +Entity can be a username or the name of a team or organization. ### property group @@ -160,6 +111,10 @@ In shared mode, where all processes share the same run object, setting a group is usually unnecessary, since there is only one run and no grouping is required. +### property id + +Identifier for this run. + ### property job_type Name of the job type associated with the run. @@ -172,6 +127,31 @@ and filtering runs in the W&B UI, especially when you have multiple runs with different job types in the same project. For more information, see [Organize runs](https://docs.wandb.ai/models/runs#organize-runs). +### property name + +Display name of the run. + +Display names are not guaranteed to be unique and may be descriptive. +By default, they are randomly generated. + +### property notes + +Notes associated with the run, if there are any. + +Notes can be a multiline string and can also use markdown and latex +equations inside `$$`, like `$x + 3$`. + +### property offline + +True if the run is offline, False otherwise. + +### property path + +Path to the run. + +Run paths include entity, project, and run ID, in the format +`entity/project/run_id`. + ### property project Name of the W&B project associated with the run. @@ -182,29 +162,49 @@ URL of the W&B project associated with the run, if there is one. Offline runs do not have a project URL. +### property resumed + +True if the run was resumed, False otherwise. + +### property settings + +A frozen copy of run's Settings object. + +### property start_time + +Unix timestamp (in seconds) of when the run started. + +### property step + +The W&B step of the next `log()` call. + +Raises an error in mode="shared" runs. + +### property sweep_id + +Identifier for the sweep associated with the run, if there is one. + ### property sweep_url URL of the sweep associated with the run, if there is one. Offline runs do not have a sweep URL. +### property tags + +Tags associated with the run, if there are any. + ### property url The url for the W&B run, if there is one. Offline runs will not have a url. -### property entity - -The name of the W&B entity associated with the run. - -Entity can be a username or the name of a team or organization. - ## Methods -### method alert +### method Run.alert() ```python self, @@ -226,7 +226,7 @@ Create an alert with the given title and text. -### method define_metric +### method Run.define_metric() ```python self, @@ -254,7 +254,7 @@ Customize metrics logged with `wandb.Run.log()`. -### method display +### method Run.display() ```python self, @@ -272,7 +272,7 @@ Display this run in Jupyter. -### method finish +### method Run.finish() ```python self, @@ -300,7 +300,7 @@ Run States: -### method finish_artifact +### method Run.finish_artifact() ```python self, @@ -338,7 +338,7 @@ Subsequent "upserts" with the same distributed ID will result in a new version. -### method link_artifact +### method Run.link_artifact() ```python self, @@ -364,7 +364,7 @@ View linked artifacts in the Registry UI for the specified collection. -### method link_model +### method Run.link_model() ```python self, @@ -405,7 +405,7 @@ If not, create a new registered model with name 'registered_model_name'. - `ValueError`: If name has invalid special characters. -### method log +### method Run.log() ```python self, @@ -652,7 +652,7 @@ with wandb.init() as run: ) ``` -### method log_artifact +### method Run.log_artifact() ```python self, @@ -687,7 +687,7 @@ Declare an artifact as an output of a run. -### method log_code +### method Run.log_code() ```python self, @@ -737,7 +737,7 @@ with wandb.init() as run: ) ``` -### method log_model +### method Run.log_model() ```python self, @@ -767,7 +767,7 @@ underscores, and hyphens. - `ValueError`: If name has invalid special characters. -### method mark_preempting +### method Run.mark_preempting() ```python self @@ -781,7 +781,7 @@ Also tells the internal process to immediately report this to server. -### method pin_config_keys +### method Run.pin_config_keys() ```python self, @@ -801,7 +801,7 @@ plain text. Calling this again replaces the previously pinned list. -### method restore +### method Run.restore() ```python self, @@ -830,7 +830,7 @@ By default, will only download the file if it doesn't already exist. - `ValueError`: If the file is not found or can't find run_path. -### method save +### method Run.save() ```python self, @@ -869,7 +869,7 @@ on the same file without modifications will not re-upload it. -### method status +### method Run.status() ```python self @@ -881,7 +881,7 @@ Get sync info from the internal backend, about the current run's sync status. -### method unwatch +### method Run.unwatch() ```python self, @@ -897,7 +897,7 @@ Remove pytorch model topology, gradient and parameter hooks. -### method upsert_artifact +### method Run.upsert_artifact() ```python self, @@ -933,7 +933,7 @@ This is useful when distributed jobs need to all contribute to the same artifact -### method use_artifact +### method Run.use_artifact() ```python self, @@ -990,7 +990,7 @@ artifact_d = run.use_artifact( run.finish() ``` -### method use_model +### method Run.use_model() ```python self, @@ -1013,7 +1013,7 @@ Download the files logged in a model artifact 'name'. - `AssertionError`: If model artifact 'name' is of a type that does not contain the substring 'model'. -### method watch +### method Run.watch() ```python self, @@ -1044,7 +1044,7 @@ This function can track parameters, gradients, or both during training. - `ValueError`: If `wandb.init()` has not been called or if any of the models are not instances of `torch.nn.Module`. -### method write_logs +### method Run.write_logs() ```python self, diff --git a/models/ref/python/experiments/settings.mdx b/models/ref/python/experiments/settings.mdx index 363582c816..8a492b389b 100644 --- a/models/ref/python/experiments/settings.mdx +++ b/models/ref/python/experiments/settings.mdx @@ -147,7 +147,7 @@ x_service_transport: str | None = None, x_service_wait: float = 30.0, x_skip_transaction_log: bool = False, x_start_time: float | None = None, -x_stats_pid: int = 71170, +x_stats_pid: int = 48832, x_stats_sampling_interval: float = 15.0, x_stats_neuron_monitor_config_path: str | None = None, x_stats_dcgm_exporter: str | None = None, @@ -607,7 +607,7 @@ Full path to the wandb directory. ## Methods -### method validate_anonymous +### method Settings.validate_anonymous() ```python value: 'object' @@ -622,7 +622,7 @@ value: 'object' -### method validate_x_extra_http_headers +### method Settings.validate_x_extra_http_headers() ```python (value) @@ -637,7 +637,7 @@ value: 'object' -### method validate_x_stats_coreweave_metadata_base_url +### method Settings.validate_x_stats_coreweave_metadata_base_url() ```python (value) diff --git a/models/ref/python/public-api/agentruns.mdx b/models/ref/python/public-api/agentruns.mdx index 5369ecd207..d7736dc50e 100644 --- a/models/ref/python/public-api/agentruns.mdx +++ b/models/ref/python/public-api/agentruns.mdx @@ -47,19 +47,19 @@ A lazy iterator of `Run` objects for a single sweep agent. ## Properties -### property more - -Whether there are more pages to be fetched. - ### property cursor The start cursor to use for the next fetched page. +### property more + +Whether there are more pages to be fetched. + ## Methods -### method convert_objects +### method AgentRuns.convert_objects() ```python self @@ -71,7 +71,7 @@ Convert the current GraphQL page into :class:`Run` instances for this agent. -### method next +### method Paginator.__next__() ```python self @@ -83,7 +83,7 @@ Return the next item from the iterator. When exhausted, raise StopIteration -### method update_variables +### method AgentRuns.update_variables() ```python self diff --git a/models/ref/python/public-api/api.mdx b/models/ref/python/public-api/api.mdx index d9a6495fc7..6c68c0dcb3 100644 --- a/models/ref/python/public-api/api.mdx +++ b/models/ref/python/public-api/api.mdx @@ -41,14 +41,14 @@ wandb.Api() ## Properties -### property user_agent - -Returns W&B public user agent. - ### property default_entity Returns the default W&B entity. +### property user_agent + +Returns W&B public user agent. + ### property viewer Returns the viewer object. @@ -57,7 +57,7 @@ Returns the viewer object. ## Methods -### method artifact +### method Api.artifact() ```python (self, @@ -105,7 +105,7 @@ wandb.Api().artifact(name="entity/project/artifact:version") Note: This method is intended for external use only. Do not call `api.artifact()` within the wandb repository code. -### method artifact_collection +### method Api.artifact_collection() ```python self, @@ -147,7 +147,7 @@ artifact_example = collections.artifacts()[0] artifact_example.download() ``` -### method artifact_collection_exists +### method Api.artifact_collection_exists() ```python self, @@ -176,7 +176,7 @@ import wandb wandb.Api.artifact_collection_exists(type="type", name="collection_name") ``` -### method artifact_collections +### method Api.artifact_collections() ```python self, @@ -200,7 +200,7 @@ Returns a collection of matching artifact collections. -### method artifact_exists +### method Api.artifact_exists() ```python self, @@ -232,7 +232,7 @@ wandb.Api().artifact_exists("entity/project/artifact:version") wandb.Api().artifact_exists("entity/project/artifact:alias") ``` -### method artifact_type +### method Api.artifact_type() ```python self, @@ -250,7 +250,7 @@ Returns the matching `ArtifactType`. -### method artifact_types +### method Api.artifact_types() ```python self, @@ -268,7 +268,7 @@ Returns a collection of matching artifact types. -### method artifact_versions +### method Api.artifact_versions() ```python (self, type_name, name, per_page=50) @@ -285,7 +285,7 @@ Deprecated. Use `Api.artifacts(type_name, name)` method instead. -### method artifacts +### method Api.artifacts() ```python self, @@ -354,7 +354,7 @@ remaining_artifacts = api.artifacts( ) ``` -### method automation +### method Api.automation() ```python self, @@ -392,7 +392,7 @@ Get an existing automation named "other-automation", from the entity "my-team": automation = api.automation(name="other-automation", entity="my-team") ``` -### method automations +### method Api.automations() ```python self, @@ -428,7 +428,7 @@ api = wandb.Api() automations = api.automations(entity="my-team") ``` -### method create_automation +### method Api.create_automation() ```python self, @@ -476,7 +476,7 @@ automation = api.create_automation( ) ``` -### method create_custom_chart +### method Api.create_custom_chart() ```python self, @@ -544,7 +544,7 @@ Create a custom chart preset and return its id. ) ``` -### method create_project +### method Api.create_project() ```python self, @@ -562,7 +562,7 @@ Create a new project. -### method create_registry +### method Api.create_registry() ```python self, @@ -601,7 +601,7 @@ registry = api.create_registry( ) ``` -### method create_run +### method Api.create_run() ```python self, *, @@ -621,7 +621,7 @@ Create a new run. -### method create_run_queue +### method Api.create_run_queue() ```python self, @@ -647,7 +647,7 @@ Create a new run queue in W&B Launch. -### method create_team +### method Api.create_team() ```python self, @@ -665,7 +665,7 @@ Create a new team. -### method create_user +### method Api.create_user() ```python self, @@ -683,7 +683,7 @@ Create a new user. -### method delete_automation +### method Api.delete_automation() ```python self, @@ -699,7 +699,7 @@ Delete an automation. -### method flush +### method Api.flush() ```python (self) @@ -715,7 +715,7 @@ with `api.flush()` to get the latest values associated with the run. -### method from_path +### method Api.from_path() ```python (self, @@ -749,7 +749,7 @@ sweep = api.from_path("team/project/sweeps/sweep_id") report = api.from_path("team/project/reports/report_name") ``` -### method integrations +### method Api.integrations() ```python self, @@ -769,7 +769,7 @@ Return an iterator of all integrations for an entity. -### method job +### method Api.job() ```python self, @@ -787,7 +787,7 @@ Return a `Job` object. -### method list_jobs +### method Api.list_jobs() ```python self, @@ -805,7 +805,7 @@ Return a list of jobs, if any, for the given entity and project. -### method project +### method Api.project() ```python self, @@ -823,7 +823,7 @@ Return the `Project` with the given name (and entity, if given). -### method projects +### method Api.projects() ```python self, @@ -841,7 +841,7 @@ Get projects for a given entity. -### method queued_run +### method Api.queued_run() ```python (self, @@ -867,7 +867,7 @@ Parses paths of the form `entity/project/queue_id/run_queue_item_id`. -### method registries +### method Api.registries() ```python self, @@ -948,7 +948,7 @@ saved_cursor = registries.cursor remaining_registries = api.registries(per_page=page_size, start=saved_cursor) ``` -### method registry +### method Api.registry() ```python self, @@ -979,7 +979,7 @@ registry.description = "This is an updated description" registry.save() ``` -### method reports +### method Api.reports() ```python self, @@ -1010,7 +1010,7 @@ import wandb wandb.Api.reports("entity/project") ``` -### method run +### method Api.run() ```python (self, path='') @@ -1025,7 +1025,7 @@ Return a single run by parsing path in the form `entity/project/run_id`. -### method run_queue +### method Api.run_queue() ```python (self, @@ -1045,7 +1045,7 @@ See `Api.create_run_queue` for more information on how to create a run queue. -### method runs +### method Api.runs() ```python (self, @@ -1148,7 +1148,7 @@ Api.runs( Api.runs(path="my_entity/project", order="+summary_metrics.loss") ``` -### method slack_integrations +### method Api.slack_integrations() ```python self, *, @@ -1190,7 +1190,7 @@ team_alert_integrations = [ ] ``` -### method sweep +### method Api.sweep() ```python (self, path='') @@ -1205,7 +1205,7 @@ Return a sweep by parsing path in the form `entity/project/sweep_id`. -### method sync_tensorboard +### method Api.sync_tensorboard() ```python (self, root_dir, run_id=None, project=None, entity=None) @@ -1223,7 +1223,7 @@ Sync a local directory containing tfevent files to wandb. -### method team +### method Api.team() ```python self, @@ -1239,7 +1239,7 @@ Return the matching `Team` with the given name. -### method update_automation +### method Api.update_automation() ```python self, @@ -1290,7 +1290,7 @@ updated_automation = api.update_automation( ) ``` -### method upsert_run_queue +### method Api.upsert_run_queue() ```python (self, @@ -1318,7 +1318,7 @@ Upsert a run queue in W&B Launch. -### method user +### method Api.user() ```python self, @@ -1337,7 +1337,7 @@ This function only works for local administrators. Use `api.viewer` -### method users +### method Api.users() ```python self, @@ -1356,7 +1356,7 @@ This function only works for local administrators. Use `api.viewer` -### method webhook_integrations +### method Api.webhook_integrations() ```python self, diff --git a/models/ref/python/public-api/artifactcollection.mdx b/models/ref/python/public-api/artifactcollection.mdx index ecd09be75a..46b6b0542c 100644 --- a/models/ref/python/public-api/artifactcollection.mdx +++ b/models/ref/python/public-api/artifactcollection.mdx @@ -42,18 +42,6 @@ An artifact collection that represents a group of related artifacts. ## Properties -### property id - -The unique identifier of the artifact collection. - -### property entity - -The entity (user or team) that owns the project. - -### property project - -The project that contains the artifact collection. - ### property aliases The aliases for all artifact versions contained in this collection. @@ -62,31 +50,43 @@ The aliases for all artifact versions contained in this collection. The creation date of the artifact collection. -### property updated_at - -The date at which the artifact collection was last updated. - ### property description A description of the artifact collection. -### property tags +### property entity -The tags associated with the artifact collection. +The entity (user or team) that owns the project. + +### property id + +The unique identifier of the artifact collection. ### property name The name of the artifact collection. +### property project + +The project that contains the artifact collection. + +### property tags + +The tags associated with the artifact collection. + ### property type Returns the type of the artifact collection. +### property updated_at + +The date at which the artifact collection was last updated. + ## Methods -### method artifacts +### method ArtifactCollection.artifacts() ```python self, @@ -104,7 +104,7 @@ Get all artifacts in the collection. -### method change_type +### method ArtifactCollection.change_type() ```python self, @@ -120,7 +120,7 @@ Deprecated, change type directly with `save` instead. -### method delete +### method ArtifactCollection.delete() ```python self @@ -132,7 +132,7 @@ Delete the entire artifact collection. -### method is_sequence +### method ArtifactCollection.is_sequence() ```python self @@ -144,7 +144,7 @@ Return whether the artifact collection is a sequence. -### method save +### method ArtifactCollection.save() ```python self diff --git a/models/ref/python/public-api/artifactcollections.mdx b/models/ref/python/public-api/artifactcollections.mdx index e3aa100a9d..e83fd8f818 100644 --- a/models/ref/python/public-api/artifactcollections.mdx +++ b/models/ref/python/public-api/artifactcollections.mdx @@ -46,7 +46,7 @@ Artifact collections of a specific type in a project. ## Methods -### method convert_objects +### method RelayPaginator.convert_objects() ```python self @@ -58,7 +58,7 @@ Convert the last fetched response data into the iterated objects. -### method next +### method Paginator.__next__() ```python self @@ -70,7 +70,7 @@ Return the next item from the iterator. When exhausted, raise StopIteration -### method update_variables +### method Paginator.update_variables() ```python self diff --git a/models/ref/python/public-api/artifactfiles.mdx b/models/ref/python/public-api/artifactfiles.mdx index a6427e0303..ed57069c7d 100644 --- a/models/ref/python/public-api/artifactfiles.mdx +++ b/models/ref/python/public-api/artifactfiles.mdx @@ -49,7 +49,7 @@ Returns the path of the artifact. ## Methods -### method convert_objects +### method RelayPaginator.convert_objects() ```python self @@ -61,7 +61,7 @@ Convert the last fetched response data into the iterated objects. -### method next +### method Paginator.__next__() ```python self @@ -73,7 +73,7 @@ Return the next item from the iterator. When exhausted, raise StopIteration -### method update_variables +### method Paginator.update_variables() ```python self diff --git a/models/ref/python/public-api/artifacts.mdx b/models/ref/python/public-api/artifacts.mdx index a8a252ed90..f165d698a3 100644 --- a/models/ref/python/public-api/artifacts.mdx +++ b/models/ref/python/public-api/artifacts.mdx @@ -52,7 +52,7 @@ Optionally pass in filters to narrow down the results based on specific criteria ## Methods -### method next +### method Paginator.__next__() ```python self @@ -64,7 +64,7 @@ Return the next item from the iterator. When exhausted, raise StopIteration -### method update_variables +### method Paginator.update_variables() ```python self diff --git a/models/ref/python/public-api/artifacttype.mdx b/models/ref/python/public-api/artifacttype.mdx index 90dc6509be..7a7049ed47 100644 --- a/models/ref/python/public-api/artifacttype.mdx +++ b/models/ref/python/public-api/artifacttype.mdx @@ -50,7 +50,7 @@ The name of the artifact type. ## Methods -### method collection +### method ArtifactType.collection() ```python self, @@ -66,7 +66,7 @@ Get a specific artifact collection by name. -### method collections +### method ArtifactType.collections() ```python self, diff --git a/models/ref/python/public-api/artifacttypes.mdx b/models/ref/python/public-api/artifacttypes.mdx index 68825a0002..29867489ae 100644 --- a/models/ref/python/public-api/artifacttypes.mdx +++ b/models/ref/python/public-api/artifacttypes.mdx @@ -43,7 +43,7 @@ An lazy iterator of `ArtifactType` objects for a specific project. ## Methods -### method convert_objects +### method RelayPaginator.convert_objects() ```python self @@ -55,7 +55,7 @@ Convert the last fetched response data into the iterated objects. -### method next +### method Paginator.__next__() ```python self @@ -67,7 +67,7 @@ Return the next item from the iterator. When exhausted, raise StopIteration -### method update_variables +### method Paginator.update_variables() ```python self diff --git a/models/ref/python/public-api/automations.mdx b/models/ref/python/public-api/automations.mdx index b54f34adc0..34d4b8c680 100644 --- a/models/ref/python/public-api/automations.mdx +++ b/models/ref/python/public-api/automations.mdx @@ -38,7 +38,6 @@ A lazy iterator of `Automation` objects. - `variables`: - `per_page`: - `start`: -- `_query`: - `omit_variables`: - `omit_fragments`: - `omit_fields`: @@ -51,7 +50,7 @@ A lazy iterator of `Automation` objects. ## Methods -### method convert_objects +### method Automations.convert_objects() ```python self @@ -63,7 +62,7 @@ Convert the last fetched response data into the iterated objects. -### method next +### method Paginator.__next__() ```python self @@ -75,7 +74,7 @@ Return the next item from the iterator. When exhausted, raise StopIteration -### method update_variables +### method Paginator.update_variables() ```python self diff --git a/models/ref/python/public-api/betareport.mdx b/models/ref/python/public-api/betareport.mdx index f150e414e4..0adf61f9f1 100644 --- a/models/ref/python/public-api/betareport.mdx +++ b/models/ref/python/public-api/betareport.mdx @@ -53,31 +53,31 @@ Attributes: ## Properties -### property spec +### property created_at -### property sections +### property description -Get the panel sections (groups) from the report. -### property id +### property display_name -### property name +### property id -### property display_name +### property name -### property description +### property sections +Get the panel sections (groups) from the report. -### property user +### property spec @@ -85,11 +85,11 @@ Get the panel sections (groups) from the report. -### property created_at +### property url -### property url +### property user @@ -97,7 +97,7 @@ Get the panel sections (groups) from the report. ## Methods -### method runs +### method BetaReport.runs() ```python self, @@ -117,7 +117,7 @@ Get runs associated with a section of the report. -### method to_html +### method BetaReport.to_html() ```python self, diff --git a/models/ref/python/public-api/file.mdx b/models/ref/python/public-api/file.mdx index c46b54bb7b..239766460c 100644 --- a/models/ref/python/public-api/file.mdx +++ b/models/ref/python/public-api/file.mdx @@ -53,19 +53,19 @@ file logged to a specific run. You can search using the following keys: ## Properties -### property size - -Returns the size of the file in bytes. - ### property path_uri Returns the URI path to the file in the storage bucket. +### property size + +Returns the size of the file in bytes. + ## Methods -### method delete +### method File.delete() ```python self @@ -77,7 +77,7 @@ Delete the file from the W&B server. -### method download +### method File.download() ```python self, diff --git a/models/ref/python/public-api/files.mdx b/models/ref/python/public-api/files.mdx index 3a88c5ad51..2fc509d25d 100644 --- a/models/ref/python/public-api/files.mdx +++ b/models/ref/python/public-api/files.mdx @@ -66,7 +66,7 @@ for file in files: ## Methods -### method next +### method Paginator.__next__() ```python self diff --git a/models/ref/python/public-api/incompleterunhistoryerror.mdx b/models/ref/python/public-api/incompleterunhistoryerror.mdx index dee5d369cf..3384ce0d87 100644 --- a/models/ref/python/public-api/incompleterunhistoryerror.mdx +++ b/models/ref/python/public-api/incompleterunhistoryerror.mdx @@ -31,7 +31,7 @@ parquet files yet, typically because the run is still ongoing. ## Methods -### method add_note +### method BaseException.add_note() @@ -42,7 +42,7 @@ add a note to the exception -### method with_traceback +### method BaseException.with_traceback() diff --git a/models/ref/python/public-api/member.mdx b/models/ref/python/public-api/member.mdx index 389f3a8878..bbb946f141 100644 --- a/models/ref/python/public-api/member.mdx +++ b/models/ref/python/public-api/member.mdx @@ -37,7 +37,7 @@ A member of a team. ## Methods -### method delete +### method Member.delete() ```python (self) diff --git a/models/ref/python/public-api/project.mdx b/models/ref/python/public-api/project.mdx index 0274c8e303..29271ac688 100644 --- a/models/ref/python/public-api/project.mdx +++ b/models/ref/python/public-api/project.mdx @@ -37,6 +37,10 @@ A project is a namespace for runs. ## Properties +### property id + + + ### property owner Returns the project owner as a User object. @@ -50,15 +54,11 @@ entity and project name. Returns the URL of the project. -### property id - - - ## Methods -### method artifacts_types +### method Project.artifacts_types() ```python self, @@ -74,7 +74,7 @@ Returns all artifact types associated with this project. -### method collections +### method Project.collections() ```python self, @@ -94,7 +94,7 @@ Returns all artifact collections associated with this project. -### method sweeps +### method Project.sweeps() ```python self, diff --git a/models/ref/python/public-api/projectartifactcollections.mdx b/models/ref/python/public-api/projectartifactcollections.mdx index b8ee3093bb..546d0f8ffb 100644 --- a/models/ref/python/public-api/projectartifactcollections.mdx +++ b/models/ref/python/public-api/projectartifactcollections.mdx @@ -44,7 +44,7 @@ Artifact collections in a project. ## Methods -### method convert_objects +### method RelayPaginator.convert_objects() ```python self @@ -56,7 +56,7 @@ Convert the last fetched response data into the iterated objects. -### method next +### method Paginator.__next__() ```python self @@ -68,7 +68,7 @@ Return the next item from the iterator. When exhausted, raise StopIteration -### method update_variables +### method Paginator.update_variables() ```python self diff --git a/models/ref/python/public-api/projects.mdx b/models/ref/python/public-api/projects.mdx index 9b759c2243..1f26cbea41 100644 --- a/models/ref/python/public-api/projects.mdx +++ b/models/ref/python/public-api/projects.mdx @@ -53,7 +53,7 @@ for project in projects: ## Methods -### method convert_objects +### method RelayPaginator.convert_objects() ```python self @@ -65,7 +65,7 @@ Convert the last fetched response data into the iterated objects. -### method next +### method Paginator.__next__() ```python self @@ -77,7 +77,7 @@ Return the next item from the iterator. When exhausted, raise StopIteration -### method update_variables +### method Paginator.update_variables() ```python self diff --git a/models/ref/python/public-api/registry.mdx b/models/ref/python/public-api/registry.mdx index 7ff0fabf3f..6e99554c21 100644 --- a/models/ref/python/public-api/registry.mdx +++ b/models/ref/python/public-api/registry.mdx @@ -39,30 +39,6 @@ A single registry in the Registry. ## Properties -### property id - -The unique ID for this registry. - -### property full_name - -Full name of the registry including the `wandb-registry-` prefix. - -### property name - -Name of the registry without the `wandb-registry-` prefix. - -### property entity - -Organization entity of the registry. - -### property organization - -Organization name of the registry. - -### property description - -Description of the registry. - ### property allow_all_artifact_types Return whether all artifact types are allowed in the registry. @@ -86,14 +62,38 @@ Note: Timestamp of when the registry was created. -### property updated_at +### property description -Timestamp of when the registry was last updated. +Description of the registry. + +### property entity + +Organization entity of the registry. + +### property full_name + +Full name of the registry including the `wandb-registry-` prefix. + +### property id + +The unique ID for this registry. + +### property name + +Name of the registry without the `wandb-registry-` prefix. + +### property organization + +Organization name of the registry. ### property path +### property updated_at + +Timestamp of when the registry was last updated. + ### property visibility Visibility of the registry. @@ -102,7 +102,7 @@ Visibility of the registry. ## Methods -### method add_members +### method Registry.add_members() ```python self, *members: 'User | UserMember | Team | TeamMember | str' @@ -139,7 +139,7 @@ my_team = api.team(name="my-team") registry.add_members(my_team) ``` -### method collections +### method Registry.collections() ```python self, @@ -161,7 +161,7 @@ Returns the collections belonging to this registry. -### method create +### method Registry.create() ```python api: 'Api', @@ -192,7 +192,7 @@ This function should be called using `api.create_registry()` - `ValueError`: If a registry with the same name already exists in the organization or if the creation fails. -### method delete +### method Registry.delete() ```python self @@ -204,7 +204,7 @@ Delete the registry. This is irreversible. -### method load +### method Registry.load() ```python self @@ -216,7 +216,7 @@ Load registry attributes from the backend. -### method members +### method Registry.members() ```python self @@ -228,7 +228,7 @@ Returns the current members (users and teams) of this registry. -### method remove_members +### method Registry.remove_members() ```python self, *members: 'User | UserMember | Team | TeamMember | str' @@ -265,7 +265,7 @@ old_team = api.team(name="old-team") registry.remove_members(old_team) ``` -### method save +### method Registry.save() ```python self @@ -277,7 +277,7 @@ Save registry attributes to the backend. -### method team_members +### method Registry.team_members() ```python self @@ -289,7 +289,7 @@ Returns the current member teams of this registry. -### method update_member +### method Registry.update_member() ```python self, @@ -329,7 +329,7 @@ for member in registry.user_members(): registry.update_member(member.user, role="admin") ``` -### method user_members +### method Registry.user_members() ```python self @@ -341,7 +341,7 @@ Returns the current member users of this registry. -### method versions +### method Registry.versions() ```python self, diff --git a/models/ref/python/public-api/reports.mdx b/models/ref/python/public-api/reports.mdx index 2f5108a17e..f882b9c2b7 100644 --- a/models/ref/python/public-api/reports.mdx +++ b/models/ref/python/public-api/reports.mdx @@ -41,7 +41,7 @@ Reports is a lazy iterator of `BetaReport` objects. ## Methods -### method convert_objects +### method Reports.convert_objects() ```python self @@ -53,7 +53,7 @@ Converts GraphQL edges to File objects. -### method next +### method Paginator.__next__() ```python self @@ -65,7 +65,7 @@ Return the next item from the iterator. When exhausted, raise StopIteration -### method update_variables +### method Reports.update_variables() ```python self diff --git a/models/ref/python/public-api/run.mdx b/models/ref/python/public-api/run.mdx index af6cce5805..5475caa35f 100644 --- a/models/ref/python/public-api/run.mdx +++ b/models/ref/python/public-api/run.mdx @@ -45,6 +45,41 @@ A single run associated with an entity and project. ## Properties +### property config + +Get run config. Auto-loads full data if in lazy mode. + +### property entity + +The entity associated with the run. + +### property id + +The unique identifier for the run. + +### property lastHistoryStep + +Returns the last step logged in the run's history. + +### property metadata + +Metadata about the run from wandb-metadata.json. + +Metadata includes the run's description, tags, start time, memory +usage and more. + +### property name + +The name of the run. + +### property path + +The path of the run. The path is a list containing the entity, project, and run_id. + +### property rawconfig + +Get raw run config including internal keys. Auto-loads full data if in lazy mode. + ### property state The state of the run. @@ -60,57 +95,29 @@ The following table describes the possible states a run can be in: | Running | Run is still running and has recently sent a heartbeat. | | Pending | Run is scheduled but not yet started (common in sweeps and Launch jobs). | -### property entity - -The entity associated with the run. - -### property username - -This API is deprecated. Use `entity` instead. - ### property storage_id The unique storage identifier for the run. -### property id - -The unique identifier for the run. - -### property name - -The name of the run. - -### property config - -Get run config. Auto-loads full data if in lazy mode. - ### property summary Get run summary metrics. Auto-loads full data if in lazy mode. -### property system_metrics - -Get run system metrics. Auto-loads full data if in lazy mode. - ### property summary_metrics Get run summary metrics. Auto-loads full data if in lazy mode. -### property rawconfig +### property sweep -Get raw run config including internal keys. Auto-loads full data if in lazy mode. +The sweep associated with this run. Loads sweep data if include_sweeps is False. ### property sweep_name Get sweep name. Always available since sweepName is in lightweight fragment. -### property sweep - -The sweep associated with this run. Loads sweep data if include_sweeps is False. - -### property path +### property system_metrics -The path of the run. The path is a list containing the entity, project, and run_id. +Get run system metrics. Auto-loads full data if in lazy mode. ### property url @@ -119,22 +126,15 @@ The URL of the run. The run URL is generated from the entity, project, and run_id. For SaaS users, it takes the form of `https://wandb.ai/entity/project/run_id`. -### property metadata - -Metadata about the run from wandb-metadata.json. - -Metadata includes the run's description, tags, start time, memory -usage and more. - -### property lastHistoryStep +### property username -Returns the last step logged in the run's history. +This API is deprecated. Use `entity` instead. ## Methods -### method beta_scan_history +### method Run.beta_scan_history() ```python self, @@ -158,7 +158,7 @@ use_cache: 'bool' = True -### method create +### method Run.create() ```python api: 'public.Api', @@ -211,7 +211,7 @@ run = Run.create( ) ``` -### method delete +### method Run.delete() ```python self, @@ -227,7 +227,7 @@ Delete the given run from the wandb backend. -### method download_history_exports +### method Run.download_history_exports() ```python self, @@ -249,7 +249,7 @@ Download any parquet history files for the run to the provided directory. - `WandbApiFailedError`: If the API request fails for reasons other than incomplete history. -### method file +### method Run.file() ```python self, @@ -265,7 +265,7 @@ Return the path of a file with a given name in the artifact. -### method files +### method Run.files() ```python self, @@ -288,7 +288,7 @@ If both are provided, the pattern will be ignored. -### method history +### method Run.history() ```python self, @@ -314,7 +314,7 @@ This is simpler and faster if you are ok with the history records being sampled. -### method load +### method Run.load() ```python self, @@ -330,7 +330,7 @@ Load run data using appropriate fragment based on lazy mode. -### method load_full_data +### method Run.load_full_data() ```python self, @@ -349,7 +349,7 @@ but need access to the full data for specific runs. -### method log_artifact +### method Run.log_artifact() ```python self, @@ -369,7 +369,7 @@ Declare an artifact as output of a run. -### method logged_artifacts +### method Run.logged_artifacts() ```python self, @@ -411,7 +411,7 @@ for logged_artifact in finished_run.logged_artifacts(): print(logged_artifact.name) ``` -### method save +### method Run.save() ```python self @@ -423,7 +423,7 @@ Persist changes to the run object to the W&B backend. -### method scan_history +### method Run.scan_history() ```python self, @@ -447,7 +447,7 @@ Returns an iterable collection of all history records for a run. -### method to_html +### method Run.to_html() ```python self, @@ -465,7 +465,7 @@ Generate HTML containing an iframe displaying this run. -### method update +### method Run.update() ```python self @@ -477,7 +477,7 @@ Persist changes to the run object to the wandb backend. -### method update_state +### method Run.update_state() ```python self, @@ -501,9 +501,12 @@ See `Run.state` for the list of possible run states. - `state`: The target run state. One of `"pending"` or `"failed"`. +##### Raises + +- ``wandb.Error``: If the requested state transition is not allowed, or the server does not support this operation. -### method upload_file +### method Run.upload_file() ```python self, @@ -521,7 +524,7 @@ Upload a local file to W&B, associating it with this run. -### method use_artifact +### method Run.use_artifact() ```python self, @@ -539,7 +542,7 @@ Declare an artifact as an input to a run. -### method used_artifacts +### method Run.used_artifacts() ```python self, @@ -575,7 +578,7 @@ for used_artifact in finished_run.used_artifacts(): test_artifact ``` -### method wait_until_finished +### method Run.wait_until_finished() ```python self diff --git a/models/ref/python/public-api/runartifacts.mdx b/models/ref/python/public-api/runartifacts.mdx index b426485a2a..f5cfde63c2 100644 --- a/models/ref/python/public-api/runartifacts.mdx +++ b/models/ref/python/public-api/runartifacts.mdx @@ -43,7 +43,7 @@ An iterable collection of artifacts associated with a specific run. ## Methods -### method convert_objects +### method RelayPaginator.convert_objects() ```python self @@ -55,7 +55,7 @@ Convert the last fetched response data into the iterated objects. -### method next +### method Paginator.__next__() ```python self @@ -67,7 +67,7 @@ Return the next item from the iterator. When exhausted, raise StopIteration -### method update_variables +### method Paginator.update_variables() ```python self diff --git a/models/ref/python/public-api/runs.mdx b/models/ref/python/public-api/runs.mdx index d7f4e4d645..c3840faf38 100644 --- a/models/ref/python/public-api/runs.mdx +++ b/models/ref/python/public-api/runs.mdx @@ -53,7 +53,7 @@ This is generally used indirectly using the `Api.runs` namespace. ## Methods -### method histories +### method Runs.histories() ```python self, @@ -77,7 +77,7 @@ Return sampled history metrics for all runs that fit the filters conditions. -### method next +### method Paginator.__next__() ```python self @@ -89,7 +89,7 @@ Return the next item from the iterator. When exhausted, raise StopIteration -### method update_variables +### method Paginator.update_variables() ```python self @@ -101,7 +101,7 @@ Update the query variables for the next page fetch. -### method upgrade_to_full +### method Runs.upgrade_to_full() ```python self diff --git a/models/ref/python/public-api/sweep.mdx b/models/ref/python/public-api/sweep.mdx index 38aaeffc69..88eb594f87 100644 --- a/models/ref/python/public-api/sweep.mdx +++ b/models/ref/python/public-api/sweep.mdx @@ -48,25 +48,31 @@ Attributes: ## Properties +### property config + +The sweep configuration used for the sweep. + ### property entity The entity associated with the sweep. -### property username +### property expected_run_count -Deprecated. Use `Sweep.entity` instead. +Return the number of expected runs in the sweep or None for infinite runs. -### property config +### property name -The sweep configuration used for the sweep. +The name of the sweep. -### property order +Returns the first name that exists in the following priority order: -Return the order key for the sweep. +1. User-edited display name +2. Name configured at creation time +3. Sweep ID -### property expected_run_count +### property order -Return the number of expected runs in the sweep or None for infinite runs. +Return the order key for the sweep. ### property path @@ -83,21 +89,15 @@ The sweep URL is generated from the entity, project, the term SaaS users, it takes the form of `https://wandb.ai/entity/project/sweeps/sweeps_ID`. -### property name - -The name of the sweep. - -Returns the first name that exists in the following priority order: +### property username -1. User-edited display name -2. Name configured at creation time -3. Sweep ID +Deprecated. Use `Sweep.entity` instead. ## Methods -### method agent +### method Sweep.agent() ```python self, @@ -113,7 +113,7 @@ Query an agent by ID for this sweep. -### method agents +### method Sweep.agents() ```python self @@ -125,7 +125,7 @@ Query the list of all agents for this sweep. -### method best_run +### method Sweep.best_run() ```python (self, order=None) @@ -140,7 +140,7 @@ Return the best run sorted by the metric defined in config or the order passed i -### method get +### method Sweep.get() ```python (api: 'Api', @@ -166,7 +166,7 @@ Execute a query against the cloud backend. -### method to_html +### method Sweep.to_html() ```python self, diff --git a/models/ref/python/public-api/sweeps.mdx b/models/ref/python/public-api/sweeps.mdx index 3526a8a62c..1d233fea23 100644 --- a/models/ref/python/public-api/sweeps.mdx +++ b/models/ref/python/public-api/sweeps.mdx @@ -52,7 +52,7 @@ for sweep in sweeps: ## Methods -### method next +### method Paginator.__next__() ```python self @@ -64,7 +64,7 @@ Return the next item from the iterator. When exhausted, raise StopIteration -### method update_variables +### method Paginator.update_variables() ```python self diff --git a/models/ref/python/public-api/team.mdx b/models/ref/python/public-api/team.mdx index c2136d2565..f8238a5e5d 100644 --- a/models/ref/python/public-api/team.mdx +++ b/models/ref/python/public-api/team.mdx @@ -41,7 +41,7 @@ to handle team attributes. ## Methods -### method create +### method Team.create() ```python api: 'Api', @@ -60,7 +60,7 @@ Create a new team. -### method create_service_account +### method Team.create_service_account() ```python self, @@ -76,7 +76,7 @@ Create a service account for the team. -### method invite +### method Team.invite() ```python self, diff --git a/models/ref/python/public-api/user.mdx b/models/ref/python/public-api/user.mdx index 093c7af00f..4303b516ab 100644 --- a/models/ref/python/public-api/user.mdx +++ b/models/ref/python/public-api/user.mdx @@ -38,10 +38,6 @@ user. ## Properties -### property user_api - -A `wandb.Api` instance using the user's credentials. - ### property api_keys Names of the user's API keys. @@ -60,11 +56,15 @@ Names of the user's teams. This is an empty list if the user has no team memberships or if teams data was not loaded. +### property user_api + +A `wandb.Api` instance using the user's credentials. + ## Methods -### method create +### method User.create() ```python api: 'Api', @@ -86,7 +86,7 @@ This is an internal method. Use the `create_user()` method of -### method delete_api_key +### method User.delete_api_key() ```python self, @@ -104,7 +104,7 @@ Only the owner of the key or an admin can delete it. -### method generate_api_key +### method User.generate_api_key() ```python self,