wandb 0.19.0rc1__py3-none-macosx_11_0_arm64.whl → 0.19.1rc1__py3-none-macosx_11_0_arm64.whl

Sign up to get free protection for your applications and to get access to all the features.
Files changed (49) hide show
  1. wandb/__init__.py +1 -1
  2. wandb/__init__.pyi +211 -209
  3. wandb/apis/attrs.py +15 -4
  4. wandb/apis/public/api.py +8 -4
  5. wandb/apis/public/files.py +65 -12
  6. wandb/apis/public/runs.py +52 -7
  7. wandb/apis/public/sweeps.py +1 -1
  8. wandb/bin/gpu_stats +0 -0
  9. wandb/bin/wandb-core +0 -0
  10. wandb/cli/cli.py +2 -1
  11. wandb/env.py +1 -1
  12. wandb/errors/term.py +60 -1
  13. wandb/integration/keras/callbacks/tables_builder.py +3 -1
  14. wandb/integration/kfp/kfp_patch.py +25 -15
  15. wandb/integration/lightning/fabric/logger.py +3 -1
  16. wandb/integration/tensorboard/monkeypatch.py +3 -2
  17. wandb/jupyter.py +4 -5
  18. wandb/plot/bar.py +5 -6
  19. wandb/plot/histogram.py +1 -1
  20. wandb/plot/line_series.py +3 -3
  21. wandb/plot/pr_curve.py +7 -3
  22. wandb/plot/scatter.py +2 -1
  23. wandb/proto/v3/wandb_settings_pb2.py +25 -15
  24. wandb/proto/v4/wandb_settings_pb2.py +17 -15
  25. wandb/proto/v5/wandb_settings_pb2.py +17 -15
  26. wandb/sdk/artifacts/_validators.py +1 -3
  27. wandb/sdk/artifacts/artifact_manifest_entry.py +1 -1
  28. wandb/sdk/data_types/helper_types/bounding_boxes_2d.py +12 -2
  29. wandb/sdk/data_types/helper_types/image_mask.py +8 -2
  30. wandb/sdk/data_types/histogram.py +3 -3
  31. wandb/sdk/data_types/image.py +3 -1
  32. wandb/sdk/interface/interface.py +34 -5
  33. wandb/sdk/interface/interface_sock.py +2 -2
  34. wandb/sdk/internal/file_stream.py +4 -1
  35. wandb/sdk/internal/sender.py +4 -1
  36. wandb/sdk/internal/settings_static.py +17 -4
  37. wandb/sdk/launch/utils.py +1 -0
  38. wandb/sdk/lib/ipython.py +5 -27
  39. wandb/sdk/lib/printer.py +33 -20
  40. wandb/sdk/lib/sparkline.py +1 -2
  41. wandb/sdk/wandb_config.py +2 -2
  42. wandb/sdk/wandb_init.py +236 -243
  43. wandb/sdk/wandb_run.py +172 -231
  44. wandb/sdk/wandb_settings.py +103 -14
  45. {wandb-0.19.0rc1.dist-info → wandb-0.19.1rc1.dist-info}/METADATA +1 -1
  46. {wandb-0.19.0rc1.dist-info → wandb-0.19.1rc1.dist-info}/RECORD +49 -49
  47. {wandb-0.19.0rc1.dist-info → wandb-0.19.1rc1.dist-info}/WHEEL +0 -0
  48. {wandb-0.19.0rc1.dist-info → wandb-0.19.1rc1.dist-info}/entry_points.txt +0 -0
  49. {wandb-0.19.0rc1.dist-info → wandb-0.19.1rc1.dist-info}/licenses/LICENSE +0 -0
wandb/sdk/lib/ipython.py CHANGED
@@ -71,36 +71,14 @@ def in_notebook() -> bool:
71
71
  return _get_python_type() != "python"
72
72
 
73
73
 
74
- def display_html(html: str): # type: ignore
75
- """Display HTML in notebooks, is a noop outside a jupyter context."""
76
- if wandb.run and wandb.run._settings.silent:
77
- return
78
- try:
79
- from IPython.core.display import HTML, display # type: ignore
80
- except ImportError:
81
- wandb.termwarn("Unable to render HTML, can't import display from ipython.core")
82
- return False
83
- return display(HTML(html))
84
-
85
-
86
- def display_widget(widget):
87
- """Display ipywidgets in notebooks, is a noop outside of a jupyter context."""
88
- if wandb.run and wandb.run._settings.silent:
89
- return
90
- try:
91
- from IPython.core.display import display
92
- except ImportError:
93
- wandb.termwarn(
94
- "Unable to render Widget, can't import display from ipython.core"
95
- )
96
- return False
97
- return display(widget)
98
-
99
-
100
74
  class ProgressWidget:
101
75
  """A simple wrapper to render a nice progress bar with a label."""
102
76
 
103
77
  def __init__(self, widgets, min, max):
78
+ from IPython import display
79
+
80
+ self._ipython_display = display
81
+
104
82
  self.widgets = widgets
105
83
  self._progress = widgets.FloatProgress(min=min, max=max)
106
84
  self._label = widgets.Label()
@@ -116,7 +94,7 @@ class ProgressWidget:
116
94
  self._label.value = label
117
95
  if not self._displayed:
118
96
  self._displayed = True
119
- display_widget(self._widget)
97
+ self._ipython_display.display(self._widget)
120
98
  except Exception as e:
121
99
  self._disabled = True
122
100
  logger.exception(e)
wandb/sdk/lib/printer.py CHANGED
@@ -426,11 +426,24 @@ class _PrinterJupyter(Printer):
426
426
  super().__init__()
427
427
  self._progress = ipython.jupyter_progress_bar()
428
428
 
429
+ from IPython import display
430
+
431
+ self._ipython_display = display
432
+
429
433
  @override
430
434
  @contextlib.contextmanager
431
435
  def dynamic_text(self) -> Iterator[DynamicText | None]:
432
- # TODO: Support dynamic text in Jupyter notebooks.
433
- yield None
436
+ handle = self._ipython_display.display(
437
+ self._ipython_display.HTML(""),
438
+ display_id=True,
439
+ )
440
+
441
+ if handle:
442
+ yield _DynamicJupyterText(handle)
443
+ else:
444
+ yield None
445
+
446
+ handle.update(self._ipython_display.HTML(""))
434
447
 
435
448
  @override
436
449
  def display(
@@ -439,25 +452,12 @@ class _PrinterJupyter(Printer):
439
452
  *,
440
453
  level: str | int | None = None,
441
454
  ) -> None:
442
- text = "<br/>".join(text) if isinstance(text, (list, tuple)) else text
443
- self._display_fn_mapping(level)(text)
455
+ if wandb.run and wandb.run._settings.silent:
456
+ return
444
457
 
445
- @staticmethod
446
- def _display_fn_mapping(level: str | int | None) -> Callable[[str], None]:
447
- level = Printer._sanitize_level(level)
448
-
449
- if level >= CRITICAL:
450
- return ipython.display_html
451
- elif ERROR <= level < CRITICAL:
452
- return ipython.display_html
453
- elif WARNING <= level < ERROR:
454
- return ipython.display_html
455
- elif INFO <= level < WARNING:
456
- return ipython.display_html
457
- elif DEBUG <= level < INFO:
458
- return ipython.display_html
459
- else:
460
- return ipython.display_html
458
+ text = "<br>".join(text) if isinstance(text, (list, tuple)) else text
459
+ text = "<br>".join(text.splitlines())
460
+ self._ipython_display.display(self._ipython_display.HTML(text))
461
461
 
462
462
  @override
463
463
  @property
@@ -533,3 +533,16 @@ class _PrinterJupyter(Printer):
533
533
  def panel(self, columns: list[str]) -> str:
534
534
  row = "".join([f'<div class="wandb-col">{col}</div>' for col in columns])
535
535
  return f'{_JUPYTER_PANEL_STYLES}<div class="wandb-row">{row}</div>'
536
+
537
+
538
+ class _DynamicJupyterText(DynamicText):
539
+ def __init__(self, handle) -> None:
540
+ from IPython import display
541
+
542
+ self._ipython_to_html = display.HTML
543
+ self._handle: display.DisplayHandle = handle
544
+
545
+ @override
546
+ def set_text(self, text: str) -> None:
547
+ text = "<br>".join(text.splitlines())
548
+ self._handle.update(self._ipython_to_html(text))
@@ -16,8 +16,7 @@ def sparkify(series: List[Union[float, int]]) -> str:
16
16
  """Convert <series> to a sparkline string.
17
17
 
18
18
  Example:
19
- >>> sparkify([ 0.5, 1.2, 3.5, 7.3, 8.0, 12.5, 13.2, 15.0, 14.2, 11.8, 6.1,
20
- ... 1.9 ])
19
+ >>> sparkify([0.5, 1.2, 3.5, 7.3, 8.0, 12.5, 13.2, 15.0, 14.2, 11.8, 6.1, 1.9])
21
20
  u'▁▁▂▄▅▇▇██▆▄▂'
22
21
 
23
22
  >>> sparkify([1, 1, -2, 3, -5, 8, -13])
wandb/sdk/wandb_config.py CHANGED
@@ -61,8 +61,8 @@ class Config:
61
61
 
62
62
  Using absl flags
63
63
  ```
64
- flags.DEFINE_string("model", None, "model to run") # name, default, help
65
- wandb.config.update(flags.FLAGS) # adds all absl flags to config
64
+ flags.DEFINE_string("model", None, "model to run") # name, default, help
65
+ wandb.config.update(flags.FLAGS) # adds all absl flags to config
66
66
  ```
67
67
 
68
68
  Argparse flags