wandb 0.21.0__py3-none-win_amd64.whl → 0.21.1__py3-none-win_amd64.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 (97) 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 +526 -360
  8. wandb/apis/public/artifacts.py +204 -8
  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/registries_search.py +7 -15
  17. wandb/apis/public/reports.py +83 -5
  18. wandb/apis/public/runs.py +299 -105
  19. wandb/apis/public/sweeps.py +222 -22
  20. wandb/apis/public/teams.py +41 -4
  21. wandb/apis/public/users.py +45 -4
  22. wandb/beta/workflows.py +66 -30
  23. wandb/bin/gpu_stats.exe +0 -0
  24. wandb/bin/wandb-core +0 -0
  25. wandb/cli/cli.py +80 -1
  26. wandb/env.py +8 -0
  27. wandb/errors/errors.py +4 -1
  28. wandb/integration/lightning/fabric/logger.py +3 -4
  29. wandb/integration/metaflow/__init__.py +6 -0
  30. wandb/integration/metaflow/data_pandas.py +74 -0
  31. wandb/integration/metaflow/errors.py +13 -0
  32. wandb/integration/metaflow/metaflow.py +205 -190
  33. wandb/integration/openai/fine_tuning.py +1 -2
  34. wandb/jupyter.py +5 -5
  35. wandb/plot/custom_chart.py +30 -7
  36. wandb/proto/v3/wandb_internal_pb2.py +280 -280
  37. wandb/proto/v3/wandb_telemetry_pb2.py +4 -4
  38. wandb/proto/v4/wandb_internal_pb2.py +280 -280
  39. wandb/proto/v4/wandb_telemetry_pb2.py +4 -4
  40. wandb/proto/v5/wandb_internal_pb2.py +280 -280
  41. wandb/proto/v5/wandb_telemetry_pb2.py +4 -4
  42. wandb/proto/v6/wandb_internal_pb2.py +280 -280
  43. wandb/proto/v6/wandb_telemetry_pb2.py +4 -4
  44. wandb/proto/wandb_deprecated.py +6 -0
  45. wandb/sdk/artifacts/_internal_artifact.py +19 -8
  46. wandb/sdk/artifacts/_validators.py +8 -0
  47. wandb/sdk/artifacts/artifact.py +106 -75
  48. wandb/sdk/data_types/audio.py +38 -10
  49. wandb/sdk/data_types/base_types/media.py +6 -56
  50. wandb/sdk/data_types/graph.py +48 -14
  51. wandb/sdk/data_types/helper_types/bounding_boxes_2d.py +1 -3
  52. wandb/sdk/data_types/helper_types/image_mask.py +1 -3
  53. wandb/sdk/data_types/histogram.py +34 -21
  54. wandb/sdk/data_types/html.py +35 -12
  55. wandb/sdk/data_types/image.py +104 -68
  56. wandb/sdk/data_types/molecule.py +32 -19
  57. wandb/sdk/data_types/object_3d.py +36 -17
  58. wandb/sdk/data_types/plotly.py +18 -5
  59. wandb/sdk/data_types/saved_model.py +4 -6
  60. wandb/sdk/data_types/table.py +59 -30
  61. wandb/sdk/data_types/video.py +53 -26
  62. wandb/sdk/integration_utils/auto_logging.py +2 -2
  63. wandb/sdk/internal/internal_api.py +6 -0
  64. wandb/sdk/internal/job_builder.py +6 -0
  65. wandb/sdk/launch/agent/agent.py +8 -1
  66. wandb/sdk/launch/agent/run_queue_item_file_saver.py +2 -2
  67. wandb/sdk/launch/create_job.py +3 -1
  68. wandb/sdk/launch/inputs/internal.py +3 -4
  69. wandb/sdk/launch/inputs/schema.py +1 -0
  70. wandb/sdk/launch/runner/kubernetes_monitor.py +1 -0
  71. wandb/sdk/launch/runner/kubernetes_runner.py +328 -1
  72. wandb/sdk/launch/sweeps/scheduler.py +2 -3
  73. wandb/sdk/lib/asyncio_compat.py +3 -0
  74. wandb/sdk/lib/deprecate.py +1 -7
  75. wandb/sdk/lib/disabled.py +1 -1
  76. wandb/sdk/lib/hashutil.py +14 -1
  77. wandb/sdk/lib/module.py +7 -13
  78. wandb/sdk/lib/progress.py +0 -19
  79. wandb/sdk/lib/sock_client.py +0 -4
  80. wandb/sdk/wandb_init.py +66 -91
  81. wandb/sdk/wandb_login.py +18 -14
  82. wandb/sdk/wandb_metric.py +2 -0
  83. wandb/sdk/wandb_run.py +406 -414
  84. wandb/sdk/wandb_settings.py +130 -2
  85. wandb/sdk/wandb_setup.py +28 -28
  86. wandb/sdk/wandb_sweep.py +14 -13
  87. wandb/sdk/wandb_watch.py +4 -6
  88. wandb/sync/sync.py +10 -0
  89. wandb/util.py +57 -0
  90. wandb/wandb_run.py +1 -2
  91. {wandb-0.21.0.dist-info → wandb-0.21.1.dist-info}/METADATA +1 -1
  92. {wandb-0.21.0.dist-info → wandb-0.21.1.dist-info}/RECORD +95 -95
  93. wandb/vendor/pynvml/__init__.py +0 -0
  94. wandb/vendor/pynvml/pynvml.py +0 -4779
  95. {wandb-0.21.0.dist-info → wandb-0.21.1.dist-info}/WHEEL +0 -0
  96. {wandb-0.21.0.dist-info → wandb-0.21.1.dist-info}/entry_points.txt +0 -0
  97. {wandb-0.21.0.dist-info → wandb-0.21.1.dist-info}/licenses/LICENSE +0 -0
@@ -1,4 +1,8 @@
1
- """Public API: reports."""
1
+ """W&B Public API for Report objects.
2
+
3
+ This module provides classes for interacting with W&B reports and
4
+ managing report-related data.
5
+ """
2
6
 
3
7
  import ast
4
8
  import json
@@ -15,7 +19,17 @@ from wandb.sdk.lib import ipython
15
19
 
16
20
 
17
21
  class Reports(SizedPaginator["BetaReport"]):
18
- """Reports is an iterable collection of `BetaReport` objects."""
22
+ """Reports is a lazy iterator of `BetaReport` objects.
23
+
24
+ Args:
25
+ client (`wandb.apis.internal.Api`): The API client instance to use.
26
+ project (`wandb.sdk.internal.Project`): The project to fetch reports from.
27
+ name (str, optional): The name of the report to filter by. If `None`,
28
+ fetches all reports.
29
+ entity (str, optional): The entity name for the project. Defaults to
30
+ the project entity.
31
+ per_page (int): Number of reports to fetch per page (default is 50).
32
+ """
19
33
 
20
34
  QUERY = gql(
21
35
  """
@@ -64,6 +78,10 @@ class Reports(SizedPaginator["BetaReport"]):
64
78
 
65
79
  @property
66
80
  def _length(self):
81
+ """The number of reports in the project.
82
+
83
+ <!-- lazydoc-ignore: internal -->
84
+ """
67
85
  # TODO: Add the count the backend
68
86
  if self.last_response:
69
87
  return len(self.objects)
@@ -71,25 +89,37 @@ class Reports(SizedPaginator["BetaReport"]):
71
89
  return None
72
90
 
73
91
  @property
74
- def more(self):
92
+ def more(self) -> bool:
93
+ """Returns whether there are more files to fetch.
94
+
95
+ <!-- lazydoc-ignore: internal -->
96
+ """
75
97
  if self.last_response:
76
- return self.last_response["project"]["allViews"]["pageInfo"]["hasNextPage"]
98
+ return bool(
99
+ self.last_response["project"]["allViews"]["pageInfo"]["hasNextPage"]
100
+ )
77
101
  else:
78
102
  return True
79
103
 
80
104
  @property
81
105
  def cursor(self):
106
+ """Returns the cursor position for pagination of file results.
107
+
108
+ <!-- lazydoc-ignore: internal -->
109
+ """
82
110
  if self.last_response:
83
111
  return self.last_response["project"]["allViews"]["edges"][-1]["cursor"]
84
112
  else:
85
113
  return None
86
114
 
87
115
  def update_variables(self):
116
+ """Updates the GraphQL query variables for pagination."""
88
117
  self.variables.update(
89
118
  {"reportCursor": self.cursor, "reportLimit": self.per_page}
90
119
  )
91
120
 
92
121
  def convert_objects(self):
122
+ """Converts GraphQL edges to File objects."""
93
123
  if self.last_response["project"] is None:
94
124
  raise ValueError(
95
125
  f"Project {self.variables['project']} does not exist under entity {self.variables['entity']}"
@@ -109,7 +139,7 @@ class Reports(SizedPaginator["BetaReport"]):
109
139
 
110
140
 
111
141
  class BetaReport(Attrs):
112
- """BetaReport is a class associated with reports created in wandb.
142
+ """BetaReport is a class associated with reports created in W&B.
113
143
 
114
144
  WARNING: this API will likely change in a future release
115
145
 
@@ -144,9 +174,11 @@ class BetaReport(Attrs):
144
174
 
145
175
  @property
146
176
  def sections(self):
177
+ """Get the panel sections (groups) from the report."""
147
178
  return self.spec["panelGroups"]
148
179
 
149
180
  def runs(self, section, per_page=50, only_selected=True):
181
+ """Get runs associated with a section of the report."""
150
182
  run_set_idx = section.get("openRunSet", 0)
151
183
  run_set = section["runSets"][run_set_idx]
152
184
  order = self.query_generator.key_to_server_path(run_set["sort"]["key"])
@@ -244,6 +276,11 @@ class BetaReport(Attrs):
244
276
 
245
277
 
246
278
  class PythonMongoishQueryGenerator:
279
+ """Converts Python-style query expressions to MongoDB-style queries for W&B reports.
280
+
281
+ <!-- lazydoc-ignore-class: internal -->
282
+ """
283
+
247
284
  SPACER = "----------"
248
285
  DECIMAL_SPACER = ";;;"
249
286
  FRONTEND_NAME_MAPPING = {
@@ -354,6 +391,10 @@ class PythonMongoishQueryGenerator:
354
391
  return field_name.replace(self.SPACER, ".") # Allow dotted fields
355
392
 
356
393
  def python_to_mongo(self, filterstr):
394
+ """Convert Python expresion to MongoDB filter.
395
+
396
+ <!-- lazydoc-ignore: internal -->
397
+ """
357
398
  try:
358
399
  tree = ast.parse(self._convert(filterstr), mode="eval")
359
400
  except SyntaxError as e:
@@ -372,6 +413,10 @@ class PythonMongoishQueryGenerator:
372
413
  return {"$or": [{op: values}]}
373
414
 
374
415
  def front_to_back(self, name):
416
+ """Convert frontend metric names to backend field names.
417
+
418
+ <!-- lazydoc-ignore: internal -->
419
+ """
375
420
  name, *rest = name.split(".")
376
421
  rest = "." + ".".join(rest) if rest else ""
377
422
 
@@ -385,6 +430,10 @@ class PythonMongoishQueryGenerator:
385
430
  return f"summary_metrics.{name}{rest}"
386
431
 
387
432
  def back_to_front(self, name):
433
+ """Convert backend field names to frontend metric names.
434
+
435
+ <!-- lazydoc-ignore: internal -->
436
+ """
388
437
  if name in self.FRONTEND_NAME_MAPPING_REVERSED:
389
438
  return self.FRONTEND_NAME_MAPPING_REVERSED[name]
390
439
  elif name in self.FRONTEND_NAME_MAPPING:
@@ -401,6 +450,10 @@ class PythonMongoishQueryGenerator:
401
450
 
402
451
  # These are only used for ParallelCoordinatesPlot because it has weird backend names...
403
452
  def pc_front_to_back(self, name):
453
+ """Convert ParallelCoordinatesPlot to backend field names.
454
+
455
+ <!-- lazydoc-ignore: internal -->
456
+ """
404
457
  name, *rest = name.split(".")
405
458
  rest = "." + ".".join(rest) if rest else ""
406
459
  if name is None:
@@ -417,6 +470,10 @@ class PythonMongoishQueryGenerator:
417
470
  return f"summary:{name}{rest}"
418
471
 
419
472
  def pc_back_to_front(self, name):
473
+ """Convert backend backend field names to ParallelCoordinatesPlot names.
474
+
475
+ <!-- lazydoc-ignore: internal -->
476
+ """
420
477
  if name is None:
421
478
  return None
422
479
  elif "summary:" in name:
@@ -436,6 +493,11 @@ class PythonMongoishQueryGenerator:
436
493
 
437
494
 
438
495
  class PanelMetricsHelper:
496
+ """Converts Python-style query expressions to MongoDB-style queries for W&B reports.
497
+
498
+ <!-- lazydoc-ignore-class: internal -->
499
+ """
500
+
439
501
  FRONTEND_NAME_MAPPING = {
440
502
  "Step": "_step",
441
503
  "Relative Time (Wall)": "_absolute_runtime",
@@ -448,17 +510,29 @@ class PanelMetricsHelper:
448
510
  RUN_MAPPING_REVERSED = {v: k for k, v in RUN_MAPPING.items()}
449
511
 
450
512
  def front_to_back(self, name):
513
+ """Convert frontend metric names to backend field names.
514
+
515
+ <!-- lazydoc-ignore: internal -->
516
+ """
451
517
  if name in self.FRONTEND_NAME_MAPPING:
452
518
  return self.FRONTEND_NAME_MAPPING[name]
453
519
  return name
454
520
 
455
521
  def back_to_front(self, name):
522
+ """Convert backend field names to frontend metric names.
523
+
524
+ <!-- lazydoc-ignore: internal -->
525
+ """
456
526
  if name in self.FRONTEND_NAME_MAPPING_REVERSED:
457
527
  return self.FRONTEND_NAME_MAPPING_REVERSED[name]
458
528
  return name
459
529
 
460
530
  # ScatterPlot and ParallelCoords have weird conventions
461
531
  def special_front_to_back(self, name):
532
+ """Convert frontend metric names to backend field names.
533
+
534
+ <!-- lazydoc-ignore: internal -->
535
+ """
462
536
  if name is None:
463
537
  return name
464
538
 
@@ -485,6 +559,10 @@ class PanelMetricsHelper:
485
559
  return "summary:" + name
486
560
 
487
561
  def special_back_to_front(self, name):
562
+ """Convert backend field names to frontend metric names.
563
+
564
+ <!-- lazydoc-ignore: internal -->
565
+ """
488
566
  if name is not None:
489
567
  kind, rest = name.split(":", 1)
490
568