wandb 0.22.0__py3-none-musllinux_1_2_aarch64.whl → 0.22.2__py3-none-musllinux_1_2_aarch64.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (114) hide show
  1. wandb/__init__.py +1 -1
  2. wandb/__init__.pyi +8 -5
  3. wandb/_pydantic/__init__.py +12 -11
  4. wandb/_pydantic/base.py +49 -19
  5. wandb/apis/__init__.py +2 -0
  6. wandb/apis/attrs.py +2 -0
  7. wandb/apis/importers/internals/internal.py +16 -23
  8. wandb/apis/internal.py +2 -0
  9. wandb/apis/normalize.py +2 -0
  10. wandb/apis/public/__init__.py +3 -2
  11. wandb/apis/public/api.py +215 -164
  12. wandb/apis/public/artifacts.py +23 -20
  13. wandb/apis/public/const.py +2 -0
  14. wandb/apis/public/files.py +33 -24
  15. wandb/apis/public/history.py +2 -0
  16. wandb/apis/public/jobs.py +20 -18
  17. wandb/apis/public/projects.py +4 -2
  18. wandb/apis/public/query_generator.py +3 -0
  19. wandb/apis/public/registries/__init__.py +7 -0
  20. wandb/apis/public/registries/_freezable_list.py +9 -12
  21. wandb/apis/public/registries/registries_search.py +8 -6
  22. wandb/apis/public/registries/registry.py +22 -17
  23. wandb/apis/public/reports.py +2 -0
  24. wandb/apis/public/runs.py +261 -57
  25. wandb/apis/public/sweeps.py +10 -9
  26. wandb/apis/public/teams.py +2 -0
  27. wandb/apis/public/users.py +2 -0
  28. wandb/apis/public/utils.py +16 -15
  29. wandb/automations/_generated/__init__.py +54 -127
  30. wandb/automations/_generated/create_generic_webhook_integration.py +1 -7
  31. wandb/automations/_generated/fragments.py +26 -91
  32. wandb/bin/gpu_stats +0 -0
  33. wandb/bin/wandb-core +0 -0
  34. wandb/cli/beta.py +16 -2
  35. wandb/cli/beta_leet.py +74 -0
  36. wandb/cli/beta_sync.py +9 -11
  37. wandb/cli/cli.py +34 -7
  38. wandb/errors/errors.py +3 -3
  39. wandb/proto/v3/wandb_api_pb2.py +86 -0
  40. wandb/proto/v3/wandb_internal_pb2.py +352 -351
  41. wandb/proto/v3/wandb_settings_pb2.py +2 -2
  42. wandb/proto/v3/wandb_sync_pb2.py +19 -6
  43. wandb/proto/v4/wandb_api_pb2.py +37 -0
  44. wandb/proto/v4/wandb_internal_pb2.py +352 -351
  45. wandb/proto/v4/wandb_settings_pb2.py +2 -2
  46. wandb/proto/v4/wandb_sync_pb2.py +10 -6
  47. wandb/proto/v5/wandb_api_pb2.py +38 -0
  48. wandb/proto/v5/wandb_internal_pb2.py +352 -351
  49. wandb/proto/v5/wandb_settings_pb2.py +2 -2
  50. wandb/proto/v5/wandb_sync_pb2.py +10 -6
  51. wandb/proto/v6/wandb_api_pb2.py +48 -0
  52. wandb/proto/v6/wandb_internal_pb2.py +352 -351
  53. wandb/proto/v6/wandb_settings_pb2.py +2 -2
  54. wandb/proto/v6/wandb_sync_pb2.py +10 -6
  55. wandb/proto/wandb_api_pb2.py +18 -0
  56. wandb/proto/wandb_generate_proto.py +1 -0
  57. wandb/sdk/artifacts/_factories.py +7 -2
  58. wandb/sdk/artifacts/_generated/__init__.py +112 -412
  59. wandb/sdk/artifacts/_generated/fragments.py +65 -0
  60. wandb/sdk/artifacts/_generated/operations.py +52 -22
  61. wandb/sdk/artifacts/_generated/run_input_artifacts.py +3 -23
  62. wandb/sdk/artifacts/_generated/run_output_artifacts.py +3 -23
  63. wandb/sdk/artifacts/_generated/type_info.py +19 -0
  64. wandb/sdk/artifacts/_gqlutils.py +47 -0
  65. wandb/sdk/artifacts/_models/__init__.py +4 -0
  66. wandb/sdk/artifacts/_models/base_model.py +20 -0
  67. wandb/sdk/artifacts/_validators.py +40 -12
  68. wandb/sdk/artifacts/artifact.py +99 -118
  69. wandb/sdk/artifacts/artifact_file_cache.py +6 -1
  70. wandb/sdk/artifacts/artifact_manifest_entry.py +67 -14
  71. wandb/sdk/artifacts/storage_handler.py +18 -12
  72. wandb/sdk/artifacts/storage_handlers/azure_handler.py +11 -6
  73. wandb/sdk/artifacts/storage_handlers/gcs_handler.py +9 -6
  74. wandb/sdk/artifacts/storage_handlers/http_handler.py +9 -4
  75. wandb/sdk/artifacts/storage_handlers/local_file_handler.py +10 -6
  76. wandb/sdk/artifacts/storage_handlers/multi_handler.py +5 -4
  77. wandb/sdk/artifacts/storage_handlers/s3_handler.py +10 -8
  78. wandb/sdk/artifacts/storage_handlers/tracking_handler.py +6 -4
  79. wandb/sdk/artifacts/storage_handlers/wb_artifact_handler.py +24 -21
  80. wandb/sdk/artifacts/storage_handlers/wb_local_artifact_handler.py +4 -2
  81. wandb/sdk/artifacts/storage_policies/_multipart.py +187 -0
  82. wandb/sdk/artifacts/storage_policies/wandb_storage_policy.py +71 -242
  83. wandb/sdk/artifacts/storage_policy.py +25 -12
  84. wandb/sdk/data_types/bokeh.py +5 -1
  85. wandb/sdk/data_types/image.py +17 -6
  86. wandb/sdk/data_types/object_3d.py +67 -2
  87. wandb/sdk/interface/interface.py +31 -4
  88. wandb/sdk/interface/interface_queue.py +10 -0
  89. wandb/sdk/interface/interface_shared.py +0 -7
  90. wandb/sdk/interface/interface_sock.py +9 -3
  91. wandb/sdk/internal/_generated/__init__.py +2 -12
  92. wandb/sdk/internal/job_builder.py +27 -10
  93. wandb/sdk/internal/sender.py +5 -2
  94. wandb/sdk/internal/settings_static.py +2 -82
  95. wandb/sdk/launch/create_job.py +2 -1
  96. wandb/sdk/launch/runner/kubernetes_runner.py +25 -20
  97. wandb/sdk/launch/utils.py +82 -1
  98. wandb/sdk/lib/progress.py +8 -74
  99. wandb/sdk/lib/service/service_client.py +5 -9
  100. wandb/sdk/lib/service/service_connection.py +39 -23
  101. wandb/sdk/mailbox/mailbox_handle.py +2 -0
  102. wandb/sdk/projects/_generated/__init__.py +12 -33
  103. wandb/sdk/wandb_init.py +23 -3
  104. wandb/sdk/wandb_login.py +53 -27
  105. wandb/sdk/wandb_run.py +10 -5
  106. wandb/sdk/wandb_settings.py +63 -25
  107. wandb/sync/sync.py +7 -2
  108. wandb/util.py +1 -1
  109. {wandb-0.22.0.dist-info → wandb-0.22.2.dist-info}/METADATA +1 -1
  110. {wandb-0.22.0.dist-info → wandb-0.22.2.dist-info}/RECORD +784 -774
  111. wandb/sdk/artifacts/_graphql_fragments.py +0 -19
  112. {wandb-0.22.0.dist-info → wandb-0.22.2.dist-info}/WHEEL +0 -0
  113. {wandb-0.22.0.dist-info → wandb-0.22.2.dist-info}/entry_points.txt +0 -0
  114. {wandb-0.22.0.dist-info → wandb-0.22.2.dist-info}/licenses/LICENSE +0 -0
wandb/__init__.py CHANGED
@@ -10,7 +10,7 @@ For reference documentation, see https://docs.wandb.com/ref/python.
10
10
  """
11
11
  from __future__ import annotations
12
12
 
13
- __version__ = "0.22.0"
13
+ __version__ = "0.22.2"
14
14
 
15
15
 
16
16
  from wandb.errors import Error
wandb/__init__.pyi CHANGED
@@ -107,7 +107,7 @@ if TYPE_CHECKING:
107
107
  import wandb
108
108
  from wandb.plot import CustomChart
109
109
 
110
- __version__: str = "0.22.0"
110
+ __version__: str = "0.22.2"
111
111
 
112
112
  run: Run | None
113
113
  config: wandb_config.Config
@@ -388,8 +388,8 @@ def init(
388
388
  enable on your settings page.
389
389
  tensorboard: Deprecated. Use `sync_tensorboard` instead.
390
390
  sync_tensorboard: Enables automatic syncing of W&B logs from TensorBoard
391
- or TensorBoardX, saving relevant event files for viewing in the W&B UI.
392
- saving relevant event files for viewing in the W&B UI. (Default: `False`)
391
+ or TensorBoardX, saving relevant event files for viewing in
392
+ the W&B UI.
393
393
  monitor_gym: Enables automatic logging of videos of the environment when
394
394
  using OpenAI Gym.
395
395
  settings: Specifies a dictionary or `wandb.Settings` object with advanced
@@ -754,6 +754,9 @@ def save(
754
754
  When given an absolute path or glob and no `base_path`, one
755
755
  directory level is preserved as in the example above.
756
756
 
757
+ Files are automatically deduplicated: calling `save()` multiple times
758
+ on the same file without modifications will not re-upload it.
759
+
757
760
  Args:
758
761
  glob_str: A relative or absolute path or Unix glob.
759
762
  base_path: A path to use to infer a directory structure; see examples.
@@ -778,10 +781,10 @@ def save(
778
781
  run.save("these/are/myfiles/*", base_path="these")
779
782
  # => Saves files in an "are/myfiles/" folder in the run.
780
783
 
781
- run.save("/User/username/Documents/run123/*.txt")
784
+ run.save("/Users/username/Documents/run123/*.txt")
782
785
  # => Saves files in a "run123/" folder in the run. See note below.
783
786
 
784
- run.save("/User/username/Documents/run123/*.txt", base_path="/User")
787
+ run.save("/Users/username/Documents/run123/*.txt", base_path="/Users")
785
788
  # => Saves files in a "username/Documents/run123/" folder in the run.
786
789
 
787
790
  run.save("files/*/saveme.txt")
@@ -1,19 +1,9 @@
1
1
  """Internal utilities for working with pydantic."""
2
2
 
3
- from .base import CompatBaseModel, GQLBase
4
- from .field_types import GQLId, Typename
5
- from .utils import IS_PYDANTIC_V2, from_json, gql_typename, pydantic_isinstance, to_json
6
- from .v1_compat import (
7
- AliasChoices,
8
- computed_field,
9
- field_validator,
10
- model_validator,
11
- to_camel,
12
- )
13
-
14
3
  __all__ = [
15
4
  "IS_PYDANTIC_V2",
16
5
  "CompatBaseModel",
6
+ "JsonableModel",
17
7
  "GQLBase",
18
8
  "Typename",
19
9
  "GQLId",
@@ -27,3 +17,14 @@ __all__ = [
27
17
  "from_json",
28
18
  "gql_typename",
29
19
  ]
20
+
21
+ from .base import CompatBaseModel, GQLBase, JsonableModel
22
+ from .field_types import GQLId, Typename
23
+ from .utils import IS_PYDANTIC_V2, from_json, gql_typename, pydantic_isinstance, to_json
24
+ from .v1_compat import (
25
+ AliasChoices,
26
+ computed_field,
27
+ field_validator,
28
+ model_validator,
29
+ to_camel,
30
+ )
wandb/_pydantic/base.py CHANGED
@@ -2,7 +2,8 @@
2
2
 
3
3
  from __future__ import annotations
4
4
 
5
- from typing import TYPE_CHECKING, Any, Callable, Literal
5
+ from abc import ABC
6
+ from typing import TYPE_CHECKING, Any, Callable, ClassVar, Literal
6
7
 
7
8
  from pydantic import BaseModel, ConfigDict
8
9
  from typing_extensions import TypedDict, Unpack, override
@@ -29,34 +30,54 @@ class ModelDumpKwargs(TypedDict, total=False):
29
30
  serialize_as_any: bool
30
31
 
31
32
 
32
- #: Custom overrides of default kwargs for `BaseModel.model_{dump,dump_json}`.
33
- MODEL_DUMP_DEFAULTS = ModelDumpKwargs(
34
- by_alias=True, # Always serialize with aliases (e.g. camelCase names)
35
- round_trip=True, # Ensure serialized values remain valid inputs for deserialization
36
- )
33
+ # ---------------------------------------------------------------------------
34
+ # Base models and mixin classes.
35
+ #
36
+ # Extra info is provided for devs in inline comments, NOT docstrings. This
37
+ # prevents it from showing up in generated docs for subclasses.
37
38
 
38
39
 
39
- # v1-compatible base class for pydantic types.
40
+ # FOR INTERNAL USE ONLY: v1-compatible drop-in replacement for `pydantic.BaseModel`.
41
+ # If pydantic v2 is detected, this is just `pydantic.BaseModel`.
42
+ #
43
+ # Deliberately inherits ALL default configuration from `pydantic.BaseModel`.
40
44
  class CompatBaseModel(PydanticCompatMixin, BaseModel):
41
45
  __doc__ = None # Prevent subclasses from inheriting the BaseModel docstring
42
46
 
43
47
 
44
- # Base class for all GraphQL-generated types.
45
- # Omitted from docstring to avoid inclusion in generated docs.
46
- class GQLBase(CompatBaseModel):
48
+ class JsonableModel(CompatBaseModel, ABC):
49
+ # Base class with sensible default behavior for classes that need to convert to/from JSON.
50
+ #
51
+ # Automatically parse/serialize "raw" API data (e.g. automatically convert to/from camelCase keys):
52
+ # - `.model_{dump,dump_json}()` should return "JSON-ready" dicts or JSON strings
53
+ # - `.model_{validate,validate_json}()` should accept "JSON-ready" dicts or JSON strings
54
+ #
55
+ # Ensure round-trip serialization <-> deserialization between:
56
+ # - `model_dump()` <-> `model_validate()`
57
+ # - `model_dump_json()` <-> `model_validate_json()`
58
+ #
59
+ # These behaviors are useful for models that need to predictably handle e.g. GraphQL request/response data.
60
+
47
61
  model_config = ConfigDict(
48
- populate_by_name=True, # Discouraged in pydantic v2.11+, will be deprecated in v3
49
- validate_by_name=True, # Introduced in pydantic v2.11
50
- validate_by_alias=True, # Introduced in pydantic v2.11
51
- serialize_by_alias=True, # Introduced in pydantic v2.11
62
+ # ---------------------------------------------------------------------------
63
+ # Discouraged in v2.11+, deprecated in v3. Kept here for compatibility.
64
+ populate_by_name=True,
65
+ # ---------------------------------------------------------------------------
66
+ # Introduced in v2.11, ignored in earlier versions
67
+ validate_by_name=True,
68
+ validate_by_alias=True,
69
+ serialize_by_alias=True,
70
+ # ---------------------------------------------------------------------------
52
71
  validate_assignment=True,
53
- validate_default=True,
54
72
  use_attribute_docstrings=True,
55
73
  from_attributes=True,
56
- revalidate_instances="always",
57
- protected_namespaces=(), # Some GraphQL fields may begin with "model_"
58
74
  )
59
75
 
76
+ # Custom defaults keyword args for `JsonableModel.model_{dump,dump_json}`:
77
+ # - by_alias: Convert keys to JSON-ready names and objects to JSON-ready dicts.
78
+ # - round_trip: Ensure round-trippable result
79
+ __DUMP_DEFAULTS: ClassVar[ModelDumpKwargs] = dict(by_alias=True, round_trip=True)
80
+
60
81
  @override
61
82
  def model_dump(
62
83
  self,
@@ -64,7 +85,7 @@ class GQLBase(CompatBaseModel):
64
85
  mode: Literal["json", "python"] | str = "json", # NOTE: changed default
65
86
  **kwargs: Unpack[ModelDumpKwargs],
66
87
  ) -> dict[str, Any]:
67
- kwargs = {**MODEL_DUMP_DEFAULTS, **kwargs}
88
+ kwargs = {**self.__DUMP_DEFAULTS, **kwargs} # allows overrides, if needed
68
89
  return super().model_dump(mode=mode, **kwargs)
69
90
 
70
91
  @override
@@ -74,5 +95,14 @@ class GQLBase(CompatBaseModel):
74
95
  indent: int | None = None,
75
96
  **kwargs: Unpack[ModelDumpKwargs],
76
97
  ) -> str:
77
- kwargs = {**MODEL_DUMP_DEFAULTS, **kwargs}
98
+ kwargs = {**self.__DUMP_DEFAULTS, **kwargs} # allows overrides, if needed
78
99
  return super().model_dump_json(indent=indent, **kwargs)
100
+
101
+
102
+ # Base class for all GraphQL-generated types.
103
+ class GQLBase(JsonableModel, ABC):
104
+ model_config = ConfigDict(
105
+ validate_default=True,
106
+ revalidate_instances="always",
107
+ protected_namespaces=(), # Some GraphQL fields may begin with "model_"
108
+ )
wandb/apis/__init__.py CHANGED
@@ -1,5 +1,7 @@
1
1
  """api."""
2
2
 
3
+ from __future__ import annotations
4
+
3
5
  from typing import Callable
4
6
 
5
7
  import requests
wandb/apis/attrs.py CHANGED
@@ -1,3 +1,5 @@
1
+ from __future__ import annotations
2
+
1
3
  from typing import Any, MutableMapping
2
4
 
3
5
  import wandb
@@ -8,12 +8,10 @@ from pathlib import Path
8
8
  from typing import Any, Dict, Iterable, Optional
9
9
 
10
10
  import numpy as np
11
- from google.protobuf.json_format import ParseDict
12
11
  from tenacity import retry, stop_after_attempt, wait_random_exponential
13
12
 
14
13
  from wandb import Artifact
15
14
  from wandb.proto import wandb_internal_pb2 as pb
16
- from wandb.proto import wandb_settings_pb2
17
15
  from wandb.proto import wandb_telemetry_pb2 as telem_pb
18
16
  from wandb.sdk.interface.interface import file_policy_to_enum
19
17
  from wandb.sdk.interface.interface_queue import InterfaceQueue
@@ -310,27 +308,22 @@ def _make_settings(
310
308
  ) -> SettingsStatic:
311
309
  _settings_override = coalesce(settings_override, {})
312
310
 
313
- default_settings: Dict[str, Any] = {
314
- "x_files_dir": os.path.join(root_dir, "files"),
315
- "root_dir": root_dir,
316
- "sync_file": os.path.join(root_dir, "txlog.wandb"),
317
- "resume": "false",
318
- "program": None,
319
- "ignore_globs": [],
320
- "disable_job_creation": True,
321
- "x_start_time": 0,
322
- "_offline": None,
323
- "x_sync": True,
324
- "x_live_policy_rate_limit": 15, # matches dir_watcher
325
- "x_live_policy_wait_time": 600, # matches dir_watcher
326
- "x_file_stream_timeout_seconds": 60,
327
- }
328
-
329
- combined_settings = {**default_settings, **_settings_override}
330
- settings_message = wandb_settings_pb2.Settings()
331
- ParseDict(combined_settings, settings_message)
332
-
333
- return SettingsStatic(settings_message)
311
+ return SettingsStatic(
312
+ {
313
+ "x_files_dir": os.path.join(root_dir, "files"),
314
+ "root_dir": root_dir,
315
+ "resume": "never",
316
+ "program": None,
317
+ "ignore_globs": [],
318
+ "disable_job_creation": True,
319
+ "x_start_time": 0,
320
+ "x_sync": True,
321
+ "x_live_policy_rate_limit": 15, # matches dir_watcher
322
+ "x_live_policy_wait_time": 600, # matches dir_watcher
323
+ "x_file_stream_timeout_seconds": 60,
324
+ **_settings_override,
325
+ }
326
+ )
334
327
 
335
328
 
336
329
  def send_run(
wandb/apis/internal.py CHANGED
@@ -1,3 +1,5 @@
1
+ from __future__ import annotations
2
+
1
3
  from typing import Any
2
4
 
3
5
  from wandb.sdk.internal.internal_api import Api as InternalApi
wandb/apis/normalize.py CHANGED
@@ -1,5 +1,7 @@
1
1
  """normalize."""
2
2
 
3
+ from __future__ import annotations
4
+
3
5
  import ast
4
6
  import sys
5
7
  from functools import wraps
@@ -10,7 +10,7 @@ __all__ = (
10
10
  "ArtifactTypes",
11
11
  "RunArtifacts",
12
12
  "Automations",
13
- "File", # doc:exclude
13
+ "File",
14
14
  "Files",
15
15
  "HistoryScan", # doc:exclude
16
16
  "SampledHistoryScan", # doc:exclude
@@ -27,6 +27,7 @@ __all__ = (
27
27
  "Sweeps",
28
28
  "QueryGenerator", # doc:exclude
29
29
  "Registry",
30
+ "Registries", # doc:exclude
30
31
  "BetaReport",
31
32
  "PanelMetricsHelper", # doc:exclude
32
33
  "PythonMongoishQueryGenerator", # doc:exclude
@@ -64,7 +65,7 @@ from wandb.apis.public.jobs import (
64
65
  )
65
66
  from wandb.apis.public.projects import PROJECT_FRAGMENT, Project, Projects, Sweeps
66
67
  from wandb.apis.public.query_generator import QueryGenerator
67
- from wandb.apis.public.registries.registry import Registry
68
+ from wandb.apis.public.registries import Registries, Registry
68
69
  from wandb.apis.public.reports import (
69
70
  BetaReport,
70
71
  PanelMetricsHelper,