wandb 0.18.5__py3-none-any.whl → 0.18.7__py3-none-any.whl

Sign up to get free protection for your applications and to get access to all the features.
Files changed (149) hide show
  1. wandb/__init__.py +2 -2
  2. wandb/__init__.pyi +22 -20
  3. wandb/agents/pyagent.py +1 -1
  4. wandb/apis/importers/wandb.py +1 -1
  5. wandb/apis/normalize.py +2 -18
  6. wandb/apis/public/api.py +126 -62
  7. wandb/apis/public/artifacts.py +8 -3
  8. wandb/apis/public/files.py +17 -2
  9. wandb/apis/public/jobs.py +2 -2
  10. wandb/apis/public/query_generator.py +1 -1
  11. wandb/apis/public/runs.py +8 -8
  12. wandb/apis/public/teams.py +3 -3
  13. wandb/apis/public/users.py +1 -1
  14. wandb/apis/public/utils.py +68 -0
  15. wandb/bin/gpu_stats +0 -0
  16. wandb/cli/cli.py +12 -3
  17. wandb/data_types.py +1 -1
  18. wandb/docker/__init__.py +2 -1
  19. wandb/docker/auth.py +2 -3
  20. wandb/errors/links.py +73 -0
  21. wandb/errors/term.py +7 -6
  22. wandb/filesync/step_prepare.py +1 -1
  23. wandb/filesync/upload_job.py +1 -1
  24. wandb/integration/catboost/catboost.py +2 -2
  25. wandb/integration/diffusers/pipeline_resolver.py +1 -1
  26. wandb/integration/diffusers/resolvers/multimodal.py +6 -6
  27. wandb/integration/diffusers/resolvers/utils.py +1 -1
  28. wandb/integration/fastai/__init__.py +3 -2
  29. wandb/integration/keras/callbacks/metrics_logger.py +1 -1
  30. wandb/integration/keras/callbacks/model_checkpoint.py +1 -1
  31. wandb/integration/keras/keras.py +1 -1
  32. wandb/integration/kfp/kfp_patch.py +1 -1
  33. wandb/integration/lightgbm/__init__.py +2 -2
  34. wandb/integration/magic.py +2 -2
  35. wandb/integration/metaflow/metaflow.py +1 -1
  36. wandb/integration/sacred/__init__.py +1 -1
  37. wandb/integration/sagemaker/auth.py +1 -1
  38. wandb/integration/sklearn/plot/classifier.py +7 -7
  39. wandb/integration/sklearn/plot/clusterer.py +3 -3
  40. wandb/integration/sklearn/plot/regressor.py +3 -3
  41. wandb/integration/sklearn/plot/shared.py +2 -2
  42. wandb/integration/tensorboard/log.py +2 -2
  43. wandb/integration/ultralytics/callback.py +2 -2
  44. wandb/integration/xgboost/xgboost.py +1 -1
  45. wandb/jupyter.py +0 -1
  46. wandb/plot/__init__.py +17 -8
  47. wandb/plot/bar.py +53 -27
  48. wandb/plot/confusion_matrix.py +151 -70
  49. wandb/plot/custom_chart.py +124 -0
  50. wandb/plot/histogram.py +46 -20
  51. wandb/plot/line.py +57 -26
  52. wandb/plot/line_series.py +148 -60
  53. wandb/plot/pr_curve.py +89 -44
  54. wandb/plot/roc_curve.py +82 -37
  55. wandb/plot/scatter.py +53 -20
  56. wandb/plot/viz.py +20 -102
  57. wandb/proto/v3/wandb_settings_pb2.py +2 -2
  58. wandb/proto/v3/wandb_telemetry_pb2.py +4 -4
  59. wandb/proto/v4/wandb_settings_pb2.py +2 -2
  60. wandb/proto/v4/wandb_telemetry_pb2.py +4 -4
  61. wandb/proto/v5/wandb_settings_pb2.py +2 -2
  62. wandb/proto/v5/wandb_telemetry_pb2.py +4 -4
  63. wandb/proto/wandb_deprecated.py +2 -0
  64. wandb/sdk/artifacts/artifact.py +281 -329
  65. wandb/sdk/artifacts/artifact_manifest.py +10 -9
  66. wandb/sdk/artifacts/artifact_manifest_entry.py +1 -1
  67. wandb/sdk/artifacts/storage_handlers/azure_handler.py +9 -4
  68. wandb/sdk/artifacts/storage_handlers/gcs_handler.py +1 -3
  69. wandb/sdk/artifacts/storage_handlers/s3_handler.py +1 -1
  70. wandb/sdk/artifacts/storage_handlers/wb_artifact_handler.py +2 -2
  71. wandb/sdk/artifacts/storage_handlers/wb_local_artifact_handler.py +1 -1
  72. wandb/sdk/backend/backend.py +0 -1
  73. wandb/sdk/data_types/audio.py +1 -1
  74. wandb/sdk/data_types/base_types/media.py +66 -5
  75. wandb/sdk/data_types/base_types/wb_value.py +20 -10
  76. wandb/sdk/data_types/bokeh.py +1 -1
  77. wandb/sdk/data_types/helper_types/bounding_boxes_2d.py +1 -1
  78. wandb/sdk/data_types/helper_types/image_mask.py +2 -2
  79. wandb/sdk/data_types/histogram.py +1 -1
  80. wandb/sdk/data_types/html.py +1 -1
  81. wandb/sdk/data_types/image.py +1 -1
  82. wandb/sdk/data_types/molecule.py +3 -3
  83. wandb/sdk/data_types/object_3d.py +4 -4
  84. wandb/sdk/data_types/plotly.py +1 -1
  85. wandb/sdk/data_types/saved_model.py +0 -1
  86. wandb/sdk/data_types/table.py +7 -7
  87. wandb/sdk/data_types/trace_tree.py +1 -1
  88. wandb/sdk/data_types/video.py +4 -3
  89. wandb/sdk/interface/interface_queue.py +0 -6
  90. wandb/sdk/interface/router.py +1 -4
  91. wandb/sdk/interface/router_queue.py +0 -3
  92. wandb/sdk/interface/router_relay.py +0 -2
  93. wandb/sdk/internal/datastore.py +1 -1
  94. wandb/sdk/internal/file_pusher.py +1 -1
  95. wandb/sdk/internal/file_stream.py +4 -4
  96. wandb/sdk/internal/handler.py +3 -4
  97. wandb/sdk/internal/internal.py +1 -15
  98. wandb/sdk/internal/internal_api.py +178 -63
  99. wandb/sdk/internal/internal_util.py +0 -3
  100. wandb/sdk/internal/job_builder.py +4 -3
  101. wandb/sdk/internal/sender.py +0 -2
  102. wandb/sdk/internal/system/assets/__init__.py +0 -2
  103. wandb/sdk/internal/tb_watcher.py +11 -10
  104. wandb/sdk/internal/writer.py +1 -3
  105. wandb/sdk/launch/__init__.py +2 -1
  106. wandb/sdk/launch/_launch.py +4 -3
  107. wandb/sdk/launch/_launch_add.py +2 -2
  108. wandb/sdk/launch/builder/kaniko_builder.py +0 -1
  109. wandb/sdk/launch/create_job.py +1 -0
  110. wandb/sdk/launch/environment/local_environment.py +0 -1
  111. wandb/sdk/launch/errors.py +0 -6
  112. wandb/sdk/launch/registry/local_registry.py +0 -2
  113. wandb/sdk/launch/runner/abstract.py +0 -5
  114. wandb/sdk/launch/sweeps/__init__.py +0 -2
  115. wandb/sdk/launch/sweeps/scheduler.py +0 -2
  116. wandb/sdk/launch/sweeps/scheduler_sweep.py +0 -1
  117. wandb/sdk/lib/_settings_toposort_generated.py +1 -0
  118. wandb/sdk/lib/apikey.py +3 -3
  119. wandb/sdk/lib/file_stream_utils.py +1 -1
  120. wandb/sdk/lib/filesystem.py +1 -1
  121. wandb/sdk/lib/ipython.py +16 -9
  122. wandb/sdk/lib/mailbox.py +0 -4
  123. wandb/sdk/lib/printer.py +44 -8
  124. wandb/sdk/lib/retry.py +1 -1
  125. wandb/sdk/lib/sock_client.py +0 -5
  126. wandb/sdk/service/server.py +2 -11
  127. wandb/sdk/service/server_sock.py +0 -2
  128. wandb/sdk/service/service.py +3 -3
  129. wandb/sdk/service/streams.py +2 -4
  130. wandb/sdk/wandb_init.py +20 -20
  131. wandb/sdk/wandb_login.py +1 -1
  132. wandb/sdk/wandb_require.py +1 -4
  133. wandb/sdk/wandb_run.py +97 -115
  134. wandb/sdk/wandb_settings.py +23 -6
  135. wandb/sdk/wandb_setup.py +1 -5
  136. wandb/sdk/wandb_sync.py +2 -1
  137. wandb/util.py +49 -21
  138. wandb/wandb_agent.py +3 -3
  139. wandb/wandb_controller.py +2 -2
  140. {wandb-0.18.5.dist-info → wandb-0.18.7.dist-info}/METADATA +1 -2
  141. {wandb-0.18.5.dist-info → wandb-0.18.7.dist-info}/RECORD +144 -146
  142. {wandb-0.18.5.dist-info → wandb-0.18.7.dist-info}/WHEEL +1 -1
  143. wandb/sdk/internal/system/assets/gpu_apple.py +0 -177
  144. wandb/sdk/lib/_wburls_generate.py +0 -25
  145. wandb/sdk/lib/_wburls_generated.py +0 -22
  146. wandb/sdk/lib/tracelog.py +0 -255
  147. wandb/sdk/lib/wburls.py +0 -46
  148. {wandb-0.18.5.dist-info → wandb-0.18.7.dist-info}/entry_points.txt +0 -0
  149. {wandb-0.18.5.dist-info → wandb-0.18.7.dist-info}/licenses/LICENSE +0 -0
wandb/sdk/wandb_init.py CHANGED
@@ -24,6 +24,7 @@ import wandb
24
24
  import wandb.env
25
25
  from wandb import trigger
26
26
  from wandb.errors import CommError, Error, UsageError
27
+ from wandb.errors.links import url_registry
27
28
  from wandb.errors.util import ProtobufErrorHandler
28
29
  from wandb.integration import sagemaker
29
30
  from wandb.integration.magic import magic_install
@@ -33,11 +34,17 @@ from wandb.util import _is_artifact_representation
33
34
 
34
35
  from . import wandb_login, wandb_setup
35
36
  from .backend.backend import Backend
36
- from .lib import SummaryDisabled, filesystem, ipython, module, reporting, telemetry
37
+ from .lib import (
38
+ SummaryDisabled,
39
+ filesystem,
40
+ ipython,
41
+ module,
42
+ printer,
43
+ reporting,
44
+ telemetry,
45
+ )
37
46
  from .lib.deprecate import Deprecated, deprecate
38
47
  from .lib.mailbox import Mailbox, MailboxProgress
39
- from .lib.printer import Printer, get_printer
40
- from .lib.wburls import wburls
41
48
  from .wandb_helper import parse_config
42
49
  from .wandb_run import Run, TeardownHook, TeardownStage
43
50
  from .wandb_settings import Settings, Source
@@ -125,17 +132,12 @@ class _WandbInit:
125
132
  self._wl: wandb_setup._WandbSetup | None = None
126
133
  self._reporter: wandb.sdk.lib.reporting.Reporter | None = None
127
134
  self.notebook: wandb.jupyter.Notebook | None = None # type: ignore
128
- self.printer: Printer | None = None
135
+ self.printer = printer.new_printer()
129
136
 
130
137
  self._init_telemetry_obj = telemetry.TelemetryRecord()
131
138
 
132
139
  self.deprecated_features_used: dict[str, str] = dict()
133
140
 
134
- def _setup_printer(self, settings: Settings) -> None:
135
- if self.printer:
136
- return
137
- self.printer = get_printer(settings._jupyter)
138
-
139
141
  def setup(self, kwargs: Any) -> None: # noqa: C901
140
142
  """Complete setup for `wandb.init()`.
141
143
 
@@ -148,8 +150,6 @@ class _WandbInit:
148
150
  # in between, they will be ignored, which we need to inform the user about.
149
151
  singleton = wandb_setup._WandbSetup._instance
150
152
  if singleton is not None:
151
- self._setup_printer(settings=singleton._settings)
152
- assert self.printer
153
153
  exclude_env_vars = {"WANDB_SERVICE", "WANDB_KUBEFLOW_URL"}
154
154
  # check if environment variables have changed
155
155
  singleton_env = {
@@ -170,7 +170,7 @@ class _WandbInit:
170
170
  "because your `wandb` session has already started. "
171
171
  "For more information on how to modify your settings with "
172
172
  "`wandb.init()` arguments, please refer to "
173
- f"{self.printer.link(wburls.get('wandb_init'), 'the W&B docs')}."
173
+ f"{self.printer.link(url_registry.url('wandb-init'), 'the W&B docs')}."
174
174
  )
175
175
  self.printer.display(line, level="warn")
176
176
 
@@ -202,7 +202,6 @@ class _WandbInit:
202
202
  if settings_param is not None and isinstance(settings_param, (Settings, dict)):
203
203
  settings.update(settings_param, source=Source.INIT)
204
204
 
205
- self._setup_printer(settings)
206
205
  self._reporter = reporting.setup_reporter(settings=settings)
207
206
 
208
207
  sagemaker_config: dict = (
@@ -610,7 +609,6 @@ class _WandbInit:
610
609
  return drun
611
610
 
612
611
  def _on_progress_init(self, handle: MailboxProgress) -> None:
613
- assert self.printer
614
612
  line = "Waiting for wandb.init()...\r"
615
613
  percent_done = handle.percent_done
616
614
  self.printer.progress_update(line, percent_done=percent_done)
@@ -827,7 +825,8 @@ class _WandbInit:
827
825
  if run_result is None:
828
826
  error_message = (
829
827
  f"Run initialization has timed out after {timeout} sec. "
830
- f"\nPlease refer to the documentation for additional information: {wburls.get('doc_start_err')}"
828
+ "Please try increasing the timeout with the `init_timeout` setting: "
829
+ "`wandb.init(settings=wandb.Settings(init_timeout=120))`."
831
830
  )
832
831
  # We're not certain whether the error we encountered is due to an issue
833
832
  # with the server (a "CommError") or if it's a problem within the SDK (an "Error").
@@ -851,7 +850,8 @@ class _WandbInit:
851
850
 
852
851
  if not run_result.HasField("run"):
853
852
  raise Error(
854
- "It appears that something have gone wrong during the program execution as an unexpected missing field was encountered. "
853
+ "It appears that something have gone wrong during the program "
854
+ "execution as an unexpected missing field was encountered. "
855
855
  "(run_result is missing the 'run' field)"
856
856
  )
857
857
 
@@ -920,7 +920,7 @@ def _attach(
920
920
  ) -> Run | None:
921
921
  """Attach to a run currently executing in another process/thread.
922
922
 
923
- Arguments:
923
+ Args:
924
924
  attach_id: (str, optional) The id of the run or an attach identifier
925
925
  that maps to a run.
926
926
  run_id: (str, optional) The id of the run to attach to.
@@ -1064,7 +1064,7 @@ def init(
1064
1064
  For more on using `wandb.init()`, including detailed examples, check out our
1065
1065
  [guide and FAQs](https://docs.wandb.ai/guides/track/launch).
1066
1066
 
1067
- Arguments:
1067
+ Args:
1068
1068
  project: (str, optional) The name of the project where you're sending
1069
1069
  the new run. If the project is not specified, we will try to infer
1070
1070
  the project name from git root or the current program file. If we
@@ -1187,11 +1187,11 @@ def init(
1187
1187
  for saving hyperparameters to compare across runs. The ID cannot
1188
1188
  contain the following special characters: `/\#?%:`.
1189
1189
  See [our guide to resuming runs](https://docs.wandb.com/guides/runs/resuming).
1190
- fork_from: (str, optional) A string with the format {run_id}?_step={step} describing
1190
+ fork_from: (str, optional) A string with the format `{run_id}?_step={step}` describing
1191
1191
  a moment in a previous run to fork a new run from. Creates a new run that picks up
1192
1192
  logging history from the specified run at the specified moment. The target run must
1193
1193
  be in the current project. Example: `fork_from="my-run-id?_step=1234"`.
1194
- resume_from: (str, optional) A string with the format {run_id}?_step={step} describing
1194
+ resume_from: (str, optional) A string with the format `{run_id}?_step={step}` describing
1195
1195
  a moment in a previous run to resume a run from. This allows users to truncate
1196
1196
  the history logged to a run at an intermediate step and resume logging from that step.
1197
1197
  It uses run forking under the hood. The target run must be in the
wandb/sdk/wandb_login.py CHANGED
@@ -58,7 +58,7 @@ def login(
58
58
  verifying them with the W&B server. To verify credentials, pass
59
59
  `verify=True`.
60
60
 
61
- Arguments:
61
+ Args:
62
62
  anonymous: (string, optional) Can be "must", "allow", or "never".
63
63
  If set to "must", always log a user in anonymously. If set to
64
64
  "allow", only create an anonymous user if the user
@@ -16,7 +16,6 @@ import wandb
16
16
  from wandb.env import _REQUIRE_LEGACY_SERVICE
17
17
  from wandb.errors import UnsupportedError
18
18
  from wandb.sdk import wandb_run
19
- from wandb.sdk.lib.wburls import wburls
20
19
 
21
20
 
22
21
  class _Requires:
@@ -63,9 +62,7 @@ class _Requires:
63
62
  func()
64
63
 
65
64
  if last_message:
66
- wandb.termerror(
67
- f"Supported wandb.require() features can be found at: {wburls.get('doc_require')}"
68
- )
65
+ wandb.termwarn("Supported requirements are: `legacy-service`, `service`.")
69
66
  raise UnsupportedError(last_message)
70
67
 
71
68