wandb 0.21.0__py3-none-win32.whl → 0.21.2__py3-none-win32.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 (153) hide show
  1. wandb/__init__.py +16 -14
  2. wandb/__init__.pyi +427 -450
  3. wandb/agents/pyagent.py +41 -12
  4. wandb/analytics/sentry.py +7 -2
  5. wandb/apis/importers/mlflow.py +1 -1
  6. wandb/apis/public/__init__.py +1 -1
  7. wandb/apis/public/api.py +525 -360
  8. wandb/apis/public/artifacts.py +207 -13
  9. wandb/apis/public/automations.py +19 -3
  10. wandb/apis/public/files.py +172 -33
  11. wandb/apis/public/history.py +67 -15
  12. wandb/apis/public/integrations.py +25 -2
  13. wandb/apis/public/jobs.py +90 -2
  14. wandb/apis/public/projects.py +130 -79
  15. wandb/apis/public/query_generator.py +11 -1
  16. wandb/apis/public/registries/_utils.py +14 -16
  17. wandb/apis/public/registries/registries_search.py +183 -304
  18. wandb/apis/public/reports.py +96 -15
  19. wandb/apis/public/runs.py +299 -105
  20. wandb/apis/public/sweeps.py +222 -22
  21. wandb/apis/public/teams.py +41 -4
  22. wandb/apis/public/users.py +45 -4
  23. wandb/automations/_generated/delete_automation.py +1 -3
  24. wandb/automations/_generated/enums.py +13 -11
  25. wandb/beta/workflows.py +66 -30
  26. wandb/bin/gpu_stats.exe +0 -0
  27. wandb/bin/wandb-core +0 -0
  28. wandb/cli/cli.py +127 -3
  29. wandb/env.py +8 -0
  30. wandb/errors/errors.py +4 -1
  31. wandb/integration/lightning/fabric/logger.py +3 -4
  32. wandb/integration/metaflow/__init__.py +6 -0
  33. wandb/integration/metaflow/data_pandas.py +74 -0
  34. wandb/integration/metaflow/data_pytorch.py +75 -0
  35. wandb/integration/metaflow/data_sklearn.py +76 -0
  36. wandb/integration/metaflow/errors.py +13 -0
  37. wandb/integration/metaflow/metaflow.py +167 -223
  38. wandb/integration/openai/fine_tuning.py +1 -2
  39. wandb/integration/weave/__init__.py +6 -0
  40. wandb/integration/weave/interface.py +49 -0
  41. wandb/integration/weave/weave.py +63 -0
  42. wandb/jupyter.py +5 -5
  43. wandb/plot/custom_chart.py +30 -7
  44. wandb/proto/v3/wandb_internal_pb2.py +281 -280
  45. wandb/proto/v3/wandb_telemetry_pb2.py +4 -4
  46. wandb/proto/v4/wandb_internal_pb2.py +280 -280
  47. wandb/proto/v4/wandb_telemetry_pb2.py +4 -4
  48. wandb/proto/v5/wandb_internal_pb2.py +280 -280
  49. wandb/proto/v5/wandb_telemetry_pb2.py +4 -4
  50. wandb/proto/v6/wandb_internal_pb2.py +280 -280
  51. wandb/proto/v6/wandb_telemetry_pb2.py +4 -4
  52. wandb/proto/wandb_deprecated.py +6 -0
  53. wandb/sdk/artifacts/_factories.py +17 -0
  54. wandb/sdk/artifacts/_generated/__init__.py +221 -13
  55. wandb/sdk/artifacts/_generated/artifact_by_id.py +17 -0
  56. wandb/sdk/artifacts/_generated/artifact_by_name.py +22 -0
  57. wandb/sdk/artifacts/_generated/artifact_collection_membership_file_urls.py +43 -0
  58. wandb/sdk/artifacts/_generated/artifact_created_by.py +47 -0
  59. wandb/sdk/artifacts/_generated/artifact_file_urls.py +22 -0
  60. wandb/sdk/artifacts/_generated/artifact_type.py +31 -0
  61. wandb/sdk/artifacts/_generated/artifact_used_by.py +43 -0
  62. wandb/sdk/artifacts/_generated/artifact_via_membership_by_name.py +26 -0
  63. wandb/sdk/artifacts/_generated/delete_artifact.py +28 -0
  64. wandb/sdk/artifacts/_generated/enums.py +5 -0
  65. wandb/sdk/artifacts/_generated/fetch_artifact_manifest.py +38 -0
  66. wandb/sdk/artifacts/_generated/fetch_registries.py +32 -0
  67. wandb/sdk/artifacts/_generated/fragments.py +279 -41
  68. wandb/sdk/artifacts/_generated/link_artifact.py +6 -0
  69. wandb/sdk/artifacts/_generated/operations.py +654 -51
  70. wandb/sdk/artifacts/_generated/registry_collections.py +34 -0
  71. wandb/sdk/artifacts/_generated/registry_versions.py +34 -0
  72. wandb/sdk/artifacts/_generated/unlink_artifact.py +25 -0
  73. wandb/sdk/artifacts/_graphql_fragments.py +3 -86
  74. wandb/sdk/artifacts/_internal_artifact.py +19 -8
  75. wandb/sdk/artifacts/_validators.py +14 -4
  76. wandb/sdk/artifacts/artifact.py +512 -618
  77. wandb/sdk/artifacts/artifact_file_cache.py +10 -6
  78. wandb/sdk/artifacts/artifact_manifest.py +10 -9
  79. wandb/sdk/artifacts/artifact_manifest_entry.py +9 -10
  80. wandb/sdk/artifacts/artifact_manifests/artifact_manifest_v1.py +5 -3
  81. wandb/sdk/artifacts/storage_handlers/http_handler.py +1 -1
  82. wandb/sdk/artifacts/storage_handlers/s3_handler.py +1 -1
  83. wandb/sdk/artifacts/storage_policies/wandb_storage_policy.py +1 -1
  84. wandb/sdk/data_types/audio.py +38 -10
  85. wandb/sdk/data_types/base_types/media.py +6 -56
  86. wandb/sdk/data_types/graph.py +48 -14
  87. wandb/sdk/data_types/helper_types/bounding_boxes_2d.py +1 -3
  88. wandb/sdk/data_types/helper_types/image_mask.py +1 -3
  89. wandb/sdk/data_types/histogram.py +34 -21
  90. wandb/sdk/data_types/html.py +35 -12
  91. wandb/sdk/data_types/image.py +104 -68
  92. wandb/sdk/data_types/molecule.py +32 -19
  93. wandb/sdk/data_types/object_3d.py +36 -17
  94. wandb/sdk/data_types/plotly.py +18 -5
  95. wandb/sdk/data_types/saved_model.py +4 -6
  96. wandb/sdk/data_types/table.py +59 -30
  97. wandb/sdk/data_types/video.py +53 -26
  98. wandb/sdk/integration_utils/auto_logging.py +2 -2
  99. wandb/sdk/interface/interface_queue.py +1 -4
  100. wandb/sdk/interface/interface_shared.py +26 -37
  101. wandb/sdk/interface/interface_sock.py +24 -14
  102. wandb/sdk/internal/internal_api.py +6 -0
  103. wandb/sdk/internal/job_builder.py +6 -0
  104. wandb/sdk/internal/settings_static.py +2 -3
  105. wandb/sdk/launch/agent/agent.py +8 -1
  106. wandb/sdk/launch/agent/run_queue_item_file_saver.py +2 -2
  107. wandb/sdk/launch/create_job.py +15 -2
  108. wandb/sdk/launch/inputs/internal.py +3 -4
  109. wandb/sdk/launch/inputs/schema.py +1 -0
  110. wandb/sdk/launch/runner/kubernetes_monitor.py +1 -0
  111. wandb/sdk/launch/runner/kubernetes_runner.py +323 -1
  112. wandb/sdk/launch/sweeps/scheduler.py +2 -3
  113. wandb/sdk/lib/asyncio_compat.py +19 -16
  114. wandb/sdk/lib/asyncio_manager.py +252 -0
  115. wandb/sdk/lib/deprecate.py +1 -7
  116. wandb/sdk/lib/disabled.py +1 -1
  117. wandb/sdk/lib/hashutil.py +27 -5
  118. wandb/sdk/lib/module.py +7 -13
  119. wandb/sdk/lib/printer.py +2 -2
  120. wandb/sdk/lib/printer_asyncio.py +3 -1
  121. wandb/sdk/lib/progress.py +0 -19
  122. wandb/sdk/lib/retry.py +185 -78
  123. wandb/sdk/lib/service/service_client.py +106 -0
  124. wandb/sdk/lib/service/service_connection.py +20 -26
  125. wandb/sdk/lib/service/service_token.py +30 -13
  126. wandb/sdk/mailbox/mailbox.py +13 -5
  127. wandb/sdk/mailbox/mailbox_handle.py +22 -13
  128. wandb/sdk/mailbox/response_handle.py +42 -106
  129. wandb/sdk/mailbox/wait_with_progress.py +7 -42
  130. wandb/sdk/wandb_init.py +77 -116
  131. wandb/sdk/wandb_login.py +19 -15
  132. wandb/sdk/wandb_metric.py +2 -0
  133. wandb/sdk/wandb_run.py +497 -469
  134. wandb/sdk/wandb_settings.py +145 -4
  135. wandb/sdk/wandb_setup.py +204 -124
  136. wandb/sdk/wandb_sweep.py +14 -13
  137. wandb/sdk/wandb_watch.py +4 -6
  138. wandb/sync/sync.py +10 -0
  139. wandb/util.py +58 -1
  140. wandb/wandb_run.py +1 -2
  141. {wandb-0.21.0.dist-info → wandb-0.21.2.dist-info}/METADATA +1 -1
  142. {wandb-0.21.0.dist-info → wandb-0.21.2.dist-info}/RECORD +145 -129
  143. wandb/sdk/interface/interface_relay.py +0 -38
  144. wandb/sdk/interface/router.py +0 -89
  145. wandb/sdk/interface/router_queue.py +0 -43
  146. wandb/sdk/interface/router_relay.py +0 -50
  147. wandb/sdk/interface/router_sock.py +0 -32
  148. wandb/sdk/lib/sock_client.py +0 -236
  149. wandb/vendor/pynvml/__init__.py +0 -0
  150. wandb/vendor/pynvml/pynvml.py +0 -4779
  151. {wandb-0.21.0.dist-info → wandb-0.21.2.dist-info}/WHEEL +0 -0
  152. {wandb-0.21.0.dist-info → wandb-0.21.2.dist-info}/entry_points.txt +0 -0
  153. {wandb-0.21.0.dist-info → wandb-0.21.2.dist-info}/licenses/LICENSE +0 -0
@@ -1,4 +1,8 @@
1
- """Public API: artifacts."""
1
+ """W&B Public API for Artifact objects.
2
+
3
+ This module provides classes for interacting with W&B artifacts and their
4
+ collections.
5
+ """
2
6
 
3
7
  from __future__ import annotations
4
8
 
@@ -67,6 +71,11 @@ if TYPE_CHECKING:
67
71
 
68
72
 
69
73
  class ArtifactTypes(Paginator["ArtifactType"]):
74
+ """An lazy iterator of `ArtifactType` objects for a specific project.
75
+
76
+ <!-- lazydoc-ignore-init: internal -->
77
+ """
78
+
70
79
  QUERY = gql(PROJECT_ARTIFACT_TYPES_GQL)
71
80
 
72
81
  last_response: ArtifactTypesFragment | None
@@ -101,25 +110,45 @@ class ArtifactTypes(Paginator["ArtifactType"]):
101
110
 
102
111
  @property
103
112
  def _length(self) -> None:
113
+ """Returns `None`.
114
+
115
+ <!-- lazydoc-ignore: internal -->
116
+ """
104
117
  # TODO
105
118
  return None
106
119
 
107
120
  @property
108
121
  def more(self) -> bool:
122
+ """Returns whether there are more artifact types to fetch.
123
+
124
+ <!-- lazydoc-ignore: internal -->
125
+ """
109
126
  if self.last_response is None:
110
127
  return True
111
128
  return self.last_response.page_info.has_next_page
112
129
 
113
130
  @property
114
131
  def cursor(self) -> str | None:
132
+ """Returns the cursor for the next page of results.
133
+
134
+ <!-- lazydoc-ignore: internal -->
135
+ """
115
136
  if self.last_response is None:
116
137
  return None
117
138
  return self.last_response.edges[-1].cursor
118
139
 
119
140
  def update_variables(self) -> None:
141
+ """Update the cursor variable for pagination.
142
+
143
+ <!-- lazydoc-ignore: internal -->
144
+ """
120
145
  self.variables.update({"cursor": self.cursor})
121
146
 
122
147
  def convert_objects(self) -> list[ArtifactType]:
148
+ """Convert the raw response data into a list of ArtifactType objects.
149
+
150
+ <!-- lazydoc-ignore: internal -->
151
+ """
123
152
  if self.last_response is None:
124
153
  return []
125
154
 
@@ -137,6 +166,19 @@ class ArtifactTypes(Paginator["ArtifactType"]):
137
166
 
138
167
 
139
168
  class ArtifactType:
169
+ """An artifact object that satisfies query based on the specified type.
170
+
171
+ Args:
172
+ client: The client instance to use for querying W&B.
173
+ entity: The entity (user or team) that owns the project.
174
+ project: The name of the project to query for artifact types.
175
+ type_name: The name of the artifact type.
176
+ attrs: Optional mapping of attributes to initialize the artifact type. If not provided,
177
+ the object will load its attributes from W&B upon initialization.
178
+
179
+ <!-- lazydoc-ignore-init: internal -->
180
+ """
181
+
140
182
  def __init__(
141
183
  self,
142
184
  client: Client,
@@ -154,6 +196,10 @@ class ArtifactType:
154
196
  self.load()
155
197
 
156
198
  def load(self) -> Mapping[str, Any]:
199
+ """Load the artifact type attributes from W&B.
200
+
201
+ <!-- lazydoc-ignore: internal -->
202
+ """
157
203
  data: Mapping[str, Any] | None = self.client.execute(
158
204
  gql(PROJECT_ARTIFACT_TYPE_GQL),
159
205
  variable_values={
@@ -171,18 +217,30 @@ class ArtifactType:
171
217
 
172
218
  @property
173
219
  def id(self) -> str:
220
+ """The unique identifier of the artifact type."""
174
221
  return self._attrs["id"]
175
222
 
176
223
  @property
177
224
  def name(self) -> str:
225
+ """The name of the artifact type."""
178
226
  return self._attrs["name"]
179
227
 
180
228
  @normalize_exceptions
181
229
  def collections(self, per_page: int = 50) -> ArtifactCollections:
182
- """Artifact collections."""
230
+ """Get all artifact collections associated with this artifact type.
231
+
232
+ Args:
233
+ per_page (int): The number of artifact collections to fetch per page.
234
+ Default is 50.
235
+ """
183
236
  return ArtifactCollections(self.client, self.entity, self.project, self.type)
184
237
 
185
238
  def collection(self, name: str) -> ArtifactCollection:
239
+ """Get a specific artifact collection by name.
240
+
241
+ Args:
242
+ name (str): The name of the artifact collection to retrieve.
243
+ """
186
244
  return ArtifactCollection(
187
245
  self.client, self.entity, self.project, name, self.type
188
246
  )
@@ -192,6 +250,18 @@ class ArtifactType:
192
250
 
193
251
 
194
252
  class ArtifactCollections(SizedPaginator["ArtifactCollection"]):
253
+ """Artifact collections of a specific type in a project.
254
+
255
+ Args:
256
+ client: The client instance to use for querying W&B.
257
+ entity: The entity (user or team) that owns the project.
258
+ project: The name of the project to query for artifact collections.
259
+ type_name: The name of the artifact type for which to fetch collections.
260
+ per_page: The number of artifact collections to fetch per page. Default is 50.
261
+
262
+ <!-- lazydoc-ignore-init: internal -->
263
+ """
264
+
195
265
  last_response: ArtifactCollectionsFragment | None
196
266
 
197
267
  def __init__(
@@ -241,29 +311,48 @@ class ArtifactCollections(SizedPaginator["ArtifactCollection"]):
241
311
 
242
312
  @property
243
313
  def _length(self) -> int:
314
+ """Returns the total number of artifact collections.
315
+
316
+ <!-- lazydoc-ignore: internal -->
317
+ """
244
318
  if self.last_response is None:
245
319
  self._load_page()
246
320
  return self.last_response.total_count
247
321
 
248
322
  @property
249
323
  def more(self):
324
+ """Returns whether there are more artifacts to fetch.
325
+
326
+ <!-- lazydoc-ignore: internal -->
327
+ """
250
328
  if self.last_response is None:
251
329
  return True
252
330
  return self.last_response.page_info.has_next_page
253
331
 
254
332
  @property
255
333
  def cursor(self):
334
+ """Returns the cursor for the next page of results.
335
+
336
+ <!-- lazydoc-ignore: internal -->
337
+ """
256
338
  if self.last_response is None:
257
339
  return None
258
340
  return self.last_response.edges[-1].cursor
259
341
 
260
342
  def update_variables(self) -> None:
343
+ """Update the cursor variable for pagination.
344
+
345
+ <!-- lazydoc-ignore: internal -->
346
+ """
261
347
  self.variables.update({"cursor": self.cursor})
262
348
 
263
349
  def convert_objects(self) -> list[ArtifactCollection]:
350
+ """Convert the raw response data into a list of ArtifactCollection objects.
351
+
352
+ <!-- lazydoc-ignore: internal -->
353
+ """
264
354
  if self.last_response is None:
265
355
  return []
266
-
267
356
  return [
268
357
  ArtifactCollection(
269
358
  client=self.client,
@@ -278,6 +367,22 @@ class ArtifactCollections(SizedPaginator["ArtifactCollection"]):
278
367
 
279
368
 
280
369
  class ArtifactCollection:
370
+ """An artifact collection that represents a group of related artifacts.
371
+
372
+ Args:
373
+ client: The client instance to use for querying W&B.
374
+ entity: The entity (user or team) that owns the project.
375
+ project: The name of the project to query for artifact collections.
376
+ name: The name of the artifact collection.
377
+ type: The type of the artifact collection (e.g., "dataset", "model").
378
+ organization: Optional organization name if applicable.
379
+ attrs: Optional mapping of attributes to initialize the artifact collection.
380
+ If not provided, the object will load its attributes from W&B upon
381
+ initialization.
382
+
383
+ <!-- lazydoc-ignore-init: internal -->
384
+ """
385
+
281
386
  def __init__(
282
387
  self,
283
388
  client: Client,
@@ -310,11 +415,12 @@ class ArtifactCollection:
310
415
 
311
416
  @property
312
417
  def id(self) -> str:
418
+ """The unique identifier of the artifact collection."""
313
419
  return self._attrs["id"]
314
420
 
315
421
  @normalize_exceptions
316
422
  def artifacts(self, per_page: int = 50) -> Artifacts:
317
- """Artifacts."""
423
+ """Get all artifacts in the collection."""
318
424
  return Artifacts(
319
425
  client=self.client,
320
426
  entity=self.entity,
@@ -331,9 +437,14 @@ class ArtifactCollection:
331
437
 
332
438
  @property
333
439
  def created_at(self) -> str:
440
+ """The creation date of the artifact collection."""
334
441
  return self._created_at
335
442
 
336
443
  def load(self):
444
+ """Load the artifact collection attributes from W&B.
445
+
446
+ <!-- lazydoc-ignore: internal -->
447
+ """
337
448
  if server_supports_artifact_collections_gql_edges(self.client):
338
449
  rename_fields = None
339
450
  else:
@@ -425,6 +536,7 @@ class ArtifactCollection:
425
536
 
426
537
  @description.setter
427
538
  def description(self, description: str | None) -> None:
539
+ """Set the description of the artifact collection."""
428
540
  self._description = description
429
541
 
430
542
  @property
@@ -434,6 +546,7 @@ class ArtifactCollection:
434
546
 
435
547
  @tags.setter
436
548
  def tags(self, tags: list[str]) -> None:
549
+ """Set the tags associated with the artifact collection."""
437
550
  if any(not re.match(r"^[-\w]+([ ]+[-\w]+)*$", tag) for tag in tags):
438
551
  raise ValueError(
439
552
  "Tags must only contain alphanumeric characters or underscores separated by spaces or hyphens"
@@ -447,15 +560,17 @@ class ArtifactCollection:
447
560
 
448
561
  @name.setter
449
562
  def name(self, name: str) -> None:
563
+ """Set the name of the artifact collection."""
450
564
  self._name = validate_artifact_name(name)
451
565
 
452
566
  @property
453
567
  def type(self):
454
- """The type of the artifact collection."""
568
+ """Returns the type of the artifact collection."""
455
569
  return self._type
456
570
 
457
571
  @type.setter
458
572
  def type(self, type: list[str]) -> None:
573
+ """Set the type of the artifact collection."""
459
574
  if not self.is_sequence():
460
575
  raise ValueError(
461
576
  "Type can only be changed if the artifact collection is a sequence."
@@ -543,9 +658,23 @@ class ArtifactCollection:
543
658
 
544
659
 
545
660
  class Artifacts(SizedPaginator["Artifact"]):
546
- """An iterable collection of artifact versions associated with a project and optional filter.
547
-
548
- This is generally used indirectly via the `Api`.artifact_versions method.
661
+ """An iterable collection of artifact versions associated with a project.
662
+
663
+ Optionally pass in filters to narrow down the results based on specific criteria.
664
+
665
+ Args:
666
+ client: The client instance to use for querying W&B.
667
+ entity: The entity (user or team) that owns the project.
668
+ project: The name of the project to query for artifacts.
669
+ collection_name: The name of the artifact collection to query.
670
+ type: The type of the artifacts to query. Common examples include
671
+ "dataset" or "model".
672
+ filters: Optional mapping of filters to apply to the query.
673
+ order: Optional string to specify the order of the results.
674
+ per_page: The number of artifact versions to fetch per page. Default is 50.
675
+ tags: Optional string or list of strings to filter artifacts by tags.
676
+
677
+ <!-- lazydoc-ignore-init: internal -->
549
678
  """
550
679
 
551
680
  last_response: ArtifactsFragment | None
@@ -585,7 +714,7 @@ class Artifacts(SizedPaginator["Artifact"]):
585
714
 
586
715
  self.QUERY = gql_compat(
587
716
  PROJECT_ARTIFACTS_GQL,
588
- omit_fields=omit_artifact_fields(api=InternalApi()),
717
+ omit_fields=omit_artifact_fields(),
589
718
  rename_fields=rename_fields,
590
719
  )
591
720
 
@@ -609,23 +738,39 @@ class Artifacts(SizedPaginator["Artifact"]):
609
738
 
610
739
  @property
611
740
  def _length(self) -> int:
741
+ """Returns the total number of artifacts in the collection.
742
+
743
+ <!-- lazydoc-ignore: internal -->
744
+ """
612
745
  if self.last_response is None:
613
746
  self._load_page()
614
747
  return self.last_response.total_count
615
748
 
616
749
  @property
617
750
  def more(self) -> bool:
751
+ """Returns whether there are more files to fetch.
752
+
753
+ <!-- lazydoc-ignore: internal -->
754
+ """
618
755
  if self.last_response is None:
619
756
  return True
620
757
  return self.last_response.page_info.has_next_page
621
758
 
622
759
  @property
623
760
  def cursor(self) -> str | None:
761
+ """Returns the cursor for the next page of results.
762
+
763
+ <!-- lazydoc-ignore: internal -->
764
+ """
624
765
  if self.last_response is None:
625
766
  return None
626
767
  return self.last_response.edges[-1].cursor
627
768
 
628
769
  def convert_objects(self) -> list[Artifact]:
770
+ """Convert the raw response data into a list of wandb.Artifact objects.
771
+
772
+ <!-- lazydoc-ignore: internal -->
773
+ """
629
774
  if self.last_response is None:
630
775
  return []
631
776
 
@@ -645,6 +790,11 @@ class Artifacts(SizedPaginator["Artifact"]):
645
790
 
646
791
 
647
792
  class RunArtifacts(SizedPaginator["Artifact"]):
793
+ """An iterable collection of artifacts associated with a specific run.
794
+
795
+ <!-- lazydoc-ignore-init: internal -->
796
+ """
797
+
648
798
  last_response: (
649
799
  RunOutputArtifactsProjectRunOutputArtifacts
650
800
  | RunInputArtifactsProjectRunInputArtifacts
@@ -668,15 +818,13 @@ class RunArtifacts(SizedPaginator["Artifact"]):
668
818
  if mode == "logged":
669
819
  self.run_key = "outputArtifacts"
670
820
  self.QUERY = gql_compat(
671
- RUN_OUTPUT_ARTIFACTS_GQL,
672
- omit_fields=omit_artifact_fields(api=InternalApi()),
821
+ RUN_OUTPUT_ARTIFACTS_GQL, omit_fields=omit_artifact_fields()
673
822
  )
674
823
  self._response_cls = RunOutputArtifactsProjectRunOutputArtifacts
675
824
  elif mode == "used":
676
825
  self.run_key = "inputArtifacts"
677
826
  self.QUERY = gql_compat(
678
- RUN_INPUT_ARTIFACTS_GQL,
679
- omit_fields=omit_artifact_fields(api=InternalApi()),
827
+ RUN_INPUT_ARTIFACTS_GQL, omit_fields=omit_artifact_fields()
680
828
  )
681
829
  self._response_cls = RunInputArtifactsProjectRunInputArtifacts
682
830
  else:
@@ -699,23 +847,39 @@ class RunArtifacts(SizedPaginator["Artifact"]):
699
847
 
700
848
  @property
701
849
  def _length(self) -> int:
850
+ """Returns the total number of artifacts in the collection.
851
+
852
+ <!-- lazydoc-ignore: internal -->
853
+ """
702
854
  if self.last_response is None:
703
855
  self._load_page()
704
856
  return self.last_response.total_count
705
857
 
706
858
  @property
707
859
  def more(self) -> bool:
860
+ """Returns whether there are more artifacts to fetch.
861
+
862
+ <!-- lazydoc-ignore: internal -->
863
+ """
708
864
  if self.last_response is None:
709
865
  return True
710
866
  return self.last_response.page_info.has_next_page
711
867
 
712
868
  @property
713
869
  def cursor(self) -> str | None:
870
+ """Returns the cursor for the next page of results.
871
+
872
+ <!-- lazydoc-ignore: internal -->
873
+ """
714
874
  if self.last_response is None:
715
875
  return None
716
876
  return self.last_response.edges[-1].cursor
717
877
 
718
878
  def convert_objects(self) -> list[Artifact]:
879
+ """Convert the raw response data into a list of wandb.Artifact objects.
880
+
881
+ <!-- lazydoc-ignore: internal -->
882
+ """
719
883
  if self.last_response is None:
720
884
  return []
721
885
 
@@ -735,6 +899,11 @@ class RunArtifacts(SizedPaginator["Artifact"]):
735
899
 
736
900
 
737
901
  class ArtifactFiles(SizedPaginator["public.File"]):
902
+ """A paginator for files in an artifact.
903
+
904
+ <!-- lazydoc-ignore-init: internal -->
905
+ """
906
+
738
907
  last_response: FilesFragment | None
739
908
 
740
909
  def __init__(
@@ -796,30 +965,51 @@ class ArtifactFiles(SizedPaginator["public.File"]):
796
965
 
797
966
  @property
798
967
  def path(self) -> list[str]:
968
+ """Returns the path of the artifact."""
799
969
  return [self.artifact.entity, self.artifact.project, self.artifact.name]
800
970
 
801
971
  @property
802
972
  def _length(self) -> int:
803
973
  if self.last_response is None:
804
974
  self._load_page()
975
+ """Returns the total number of files in the artifact.
976
+
977
+ <!-- lazydoc-ignore: internal -->
978
+ """
805
979
  return self.artifact.file_count
806
980
 
807
981
  @property
808
982
  def more(self) -> bool:
983
+ """Returns whether there are more files to fetch.
984
+
985
+ <!-- lazydoc-ignore: internal -->
986
+ """
809
987
  if self.last_response is None:
810
988
  return True
811
989
  return self.last_response.page_info.has_next_page
812
990
 
813
991
  @property
814
992
  def cursor(self) -> str | None:
993
+ """Returns the cursor for the next page of results.
994
+
995
+ <!-- lazydoc-ignore: internal -->
996
+ """
815
997
  if self.last_response is None:
816
998
  return None
817
999
  return self.last_response.edges[-1].cursor
818
1000
 
819
1001
  def update_variables(self) -> None:
1002
+ """Update the variables dictionary with the cursor.
1003
+
1004
+ <!-- lazydoc-ignore: internal -->
1005
+ """
820
1006
  self.variables.update({"fileLimit": self.per_page, "fileCursor": self.cursor})
821
1007
 
822
1008
  def convert_objects(self) -> list[public.File]:
1009
+ """Convert the raw response data into a list of public.File objects.
1010
+
1011
+ <!-- lazydoc-ignore: internal -->
1012
+ """
823
1013
  if self.last_response is None:
824
1014
  return []
825
1015
 
@@ -840,6 +1030,10 @@ class ArtifactFiles(SizedPaginator["public.File"]):
840
1030
  def server_supports_artifact_collections_gql_edges(
841
1031
  client: RetryingClient, warn: bool = False
842
1032
  ) -> bool:
1033
+ """Check if W&B server supports GraphQL edges for artifact collections.
1034
+
1035
+ <!-- lazydoc-ignore-function: internal -->
1036
+ """
843
1037
  # TODO: Validate this version
844
1038
  # Edges were merged into core on Mar 2, 2022: https://github.com/wandb/core/commit/81c90b29eaacfe0a96dc1ebd83c53560ca763e8b
845
1039
  # CLI version was bumped to "0.12.11" on Mar 3, 2022: https://github.com/wandb/core/commit/328396fa7c89a2178d510a1be9c0d4451f350d7b
@@ -1,3 +1,5 @@
1
+ """W&B Public API for Automation objects."""
2
+
1
3
  from __future__ import annotations
2
4
 
3
5
  from itertools import chain
@@ -15,6 +17,11 @@ if TYPE_CHECKING:
15
17
 
16
18
 
17
19
  class Automations(Paginator["Automation"]):
20
+ """An lazy iterator of `Automation` objects.
21
+
22
+ <!-- lazydoc-ignore-init: internal -->
23
+ """
24
+
18
25
  last_response: ProjectConnectionFields | None
19
26
  _query: Document
20
27
 
@@ -32,14 +39,20 @@ class Automations(Paginator["Automation"]):
32
39
 
33
40
  @property
34
41
  def more(self) -> bool:
35
- """Whether there are more items to fetch."""
42
+ """Whether there are more items to fetch.
43
+
44
+ <!-- lazydoc-ignore: internal -->
45
+ """
36
46
  if self.last_response is None:
37
47
  return True
38
48
  return self.last_response.page_info.has_next_page
39
49
 
40
50
  @property
41
51
  def cursor(self) -> str | None:
42
- """The start cursor to use for the next page."""
52
+ """The start cursor to use for the next page.
53
+
54
+ <!-- lazydoc-ignore: internal -->
55
+ """
43
56
  if self.last_response is None:
44
57
  return None
45
58
  return self.last_response.page_info.end_cursor
@@ -59,7 +72,10 @@ class Automations(Paginator["Automation"]):
59
72
  raise ValueError("Unexpected response data") from e
60
73
 
61
74
  def convert_objects(self) -> Iterable[Automation]:
62
- """Parse the page data into a list of objects."""
75
+ """Parse the page data into a list of objects.
76
+
77
+ <!-- lazydoc-ignore: internal -->
78
+ """
63
79
  from wandb.automations import Automation
64
80
 
65
81
  page = self.last_response