wandb 0.16.6__py3-none-any.whl → 0.17.0rc1__py3-none-any.whl

Sign up to get free protection for your applications and to get access to all the features.
Files changed (136) hide show
  1. package_readme.md +95 -0
  2. wandb/__init__.py +2 -2
  3. wandb/agents/pyagent.py +0 -1
  4. wandb/analytics/sentry.py +2 -1
  5. wandb/apis/importers/internals/protocols.py +30 -56
  6. wandb/apis/importers/mlflow.py +13 -26
  7. wandb/apis/importers/wandb.py +8 -14
  8. wandb/apis/public/api.py +1 -0
  9. wandb/apis/public/artifacts.py +1 -0
  10. wandb/apis/public/files.py +1 -0
  11. wandb/apis/public/history.py +1 -0
  12. wandb/apis/public/jobs.py +1 -0
  13. wandb/apis/public/projects.py +1 -0
  14. wandb/apis/public/reports.py +1 -0
  15. wandb/apis/public/runs.py +1 -0
  16. wandb/apis/public/sweeps.py +1 -0
  17. wandb/apis/public/teams.py +1 -0
  18. wandb/apis/public/users.py +1 -0
  19. wandb/apis/reports/v1/_blocks.py +2 -6
  20. wandb/apis/reports/v2/gql.py +1 -0
  21. wandb/apis/reports/v2/interface.py +3 -4
  22. wandb/apis/reports/v2/internal.py +5 -8
  23. wandb/cli/cli.py +2 -2
  24. wandb/data_types.py +3 -3
  25. wandb/env.py +35 -5
  26. wandb/errors/__init__.py +5 -0
  27. wandb/integration/catboost/catboost.py +1 -1
  28. wandb/integration/fastai/__init__.py +1 -0
  29. wandb/integration/keras/__init__.py +1 -0
  30. wandb/integration/keras/keras.py +6 -6
  31. wandb/integration/langchain/wandb_tracer.py +1 -0
  32. wandb/integration/lightning/fabric/logger.py +1 -3
  33. wandb/integration/metaflow/metaflow.py +41 -6
  34. wandb/integration/openai/fine_tuning.py +3 -3
  35. wandb/keras/__init__.py +1 -0
  36. wandb/proto/v3/wandb_internal_pb2.py +364 -332
  37. wandb/proto/v3/wandb_settings_pb2.py +1 -1
  38. wandb/proto/v4/wandb_internal_pb2.py +322 -316
  39. wandb/proto/v4/wandb_settings_pb2.py +1 -1
  40. wandb/proto/wandb_internal_codegen.py +0 -25
  41. wandb/sdk/artifacts/artifact.py +16 -4
  42. wandb/sdk/artifacts/artifact_download_logger.py +1 -0
  43. wandb/sdk/artifacts/artifact_file_cache.py +18 -4
  44. wandb/sdk/artifacts/artifact_instance_cache.py +1 -0
  45. wandb/sdk/artifacts/artifact_manifest.py +1 -0
  46. wandb/sdk/artifacts/artifact_manifest_entry.py +1 -0
  47. wandb/sdk/artifacts/artifact_manifests/artifact_manifest_v1.py +1 -0
  48. wandb/sdk/artifacts/artifact_saver.py +5 -2
  49. wandb/sdk/artifacts/artifact_state.py +1 -0
  50. wandb/sdk/artifacts/artifact_ttl.py +1 -0
  51. wandb/sdk/artifacts/exceptions.py +1 -0
  52. wandb/sdk/artifacts/storage_handlers/azure_handler.py +1 -0
  53. wandb/sdk/artifacts/storage_handlers/gcs_handler.py +13 -18
  54. wandb/sdk/artifacts/storage_handlers/http_handler.py +1 -0
  55. wandb/sdk/artifacts/storage_handlers/local_file_handler.py +1 -0
  56. wandb/sdk/artifacts/storage_handlers/multi_handler.py +1 -0
  57. wandb/sdk/artifacts/storage_handlers/s3_handler.py +5 -3
  58. wandb/sdk/artifacts/storage_handlers/tracking_handler.py +1 -0
  59. wandb/sdk/artifacts/storage_handlers/wb_artifact_handler.py +1 -0
  60. wandb/sdk/artifacts/storage_handlers/wb_local_artifact_handler.py +1 -0
  61. wandb/sdk/artifacts/storage_policies/wandb_storage_policy.py +1 -0
  62. wandb/sdk/artifacts/storage_policy.py +1 -0
  63. wandb/sdk/data_types/base_types/media.py +3 -6
  64. wandb/sdk/data_types/helper_types/bounding_boxes_2d.py +3 -1
  65. wandb/sdk/integration_utils/auto_logging.py +5 -6
  66. wandb/sdk/integration_utils/data_logging.py +5 -1
  67. wandb/sdk/interface/interface.py +54 -31
  68. wandb/sdk/interface/interface_shared.py +7 -13
  69. wandb/sdk/internal/datastore.py +1 -1
  70. wandb/sdk/internal/handler.py +18 -2
  71. wandb/sdk/internal/internal.py +0 -1
  72. wandb/sdk/internal/internal_util.py +0 -1
  73. wandb/sdk/internal/job_builder.py +4 -3
  74. wandb/sdk/internal/profiler.py +1 -0
  75. wandb/sdk/internal/run.py +1 -0
  76. wandb/sdk/internal/sender.py +1 -1
  77. wandb/sdk/internal/system/assets/gpu_amd.py +44 -44
  78. wandb/sdk/internal/system/assets/gpu_apple.py +56 -11
  79. wandb/sdk/internal/system/assets/interfaces.py +6 -8
  80. wandb/sdk/internal/system/assets/open_metrics.py +2 -2
  81. wandb/sdk/internal/system/assets/trainium.py +1 -3
  82. wandb/sdk/launch/_project_spec.py +5 -3
  83. wandb/sdk/launch/agent/agent.py +1 -0
  84. wandb/sdk/launch/agent/config.py +72 -11
  85. wandb/sdk/launch/builder/abstract.py +1 -0
  86. wandb/sdk/launch/builder/build.py +28 -1
  87. wandb/sdk/launch/builder/docker_builder.py +1 -0
  88. wandb/sdk/launch/builder/noop.py +1 -0
  89. wandb/sdk/launch/create_job.py +18 -0
  90. wandb/sdk/launch/environment/abstract.py +1 -0
  91. wandb/sdk/launch/environment/gcp_environment.py +1 -0
  92. wandb/sdk/launch/environment/local_environment.py +1 -0
  93. wandb/sdk/launch/loader.py +1 -0
  94. wandb/sdk/launch/registry/abstract.py +1 -0
  95. wandb/sdk/launch/registry/azure_container_registry.py +1 -0
  96. wandb/sdk/launch/registry/elastic_container_registry.py +1 -0
  97. wandb/sdk/launch/registry/google_artifact_registry.py +1 -0
  98. wandb/sdk/launch/registry/local_registry.py +1 -0
  99. wandb/sdk/launch/runner/abstract.py +1 -0
  100. wandb/sdk/launch/runner/kubernetes_monitor.py +1 -0
  101. wandb/sdk/launch/runner/kubernetes_runner.py +4 -3
  102. wandb/sdk/launch/runner/sagemaker_runner.py +11 -10
  103. wandb/sdk/launch/sweeps/scheduler.py +1 -0
  104. wandb/sdk/launch/sweeps/scheduler_sweep.py +1 -0
  105. wandb/sdk/launch/sweeps/utils.py +1 -1
  106. wandb/sdk/launch/utils.py +3 -3
  107. wandb/sdk/lib/fsm.py +8 -12
  108. wandb/sdk/lib/gitlib.py +4 -4
  109. wandb/sdk/lib/lazyloader.py +0 -1
  110. wandb/sdk/lib/proto_util.py +1 -1
  111. wandb/sdk/lib/retry.py +3 -2
  112. wandb/sdk/service/service.py +17 -15
  113. wandb/sdk/verify/verify.py +2 -1
  114. wandb/sdk/wandb_manager.py +2 -2
  115. wandb/sdk/wandb_require.py +5 -0
  116. wandb/sdk/wandb_run.py +14 -12
  117. wandb/sdk/wandb_settings.py +0 -1
  118. wandb/sklearn/__init__.py +1 -0
  119. wandb/sklearn/plot/__init__.py +1 -0
  120. wandb/sklearn/plot/classifier.py +1 -0
  121. wandb/sklearn/plot/clusterer.py +1 -0
  122. wandb/sklearn/plot/regressor.py +1 -0
  123. wandb/sklearn/plot/shared.py +1 -0
  124. wandb/sklearn/utils.py +1 -0
  125. wandb/testing/relay.py +4 -4
  126. wandb/trigger.py +1 -0
  127. wandb/util.py +40 -17
  128. wandb/wandb_controller.py +0 -1
  129. wandb/wandb_torch.py +1 -2
  130. {wandb-0.16.6.dist-info → wandb-0.17.0rc1.dist-info}/METADATA +68 -69
  131. {wandb-0.16.6.dist-info → wandb-0.17.0rc1.dist-info}/RECORD +134 -135
  132. {wandb-0.16.6.dist-info → wandb-0.17.0rc1.dist-info}/WHEEL +1 -2
  133. wandb/bin/apple_gpu_stats +0 -0
  134. wandb-0.16.6.dist-info/top_level.txt +0 -1
  135. {wandb-0.16.6.dist-info → wandb-0.17.0rc1.dist-info}/entry_points.txt +0 -0
  136. {wandb-0.16.6.dist-info → wandb-0.17.0rc1.dist-info/licenses}/LICENSE +0 -0
package_readme.md ADDED
@@ -0,0 +1,95 @@
1
+ <div align="center">
2
+ <img src="https://i.imgur.com/RUtiVzH.png" width="600" /><br><br>
3
+ </div>
4
+
5
+ # Weights and Biases [![PyPI](https://img.shields.io/pypi/v/wandb)](https://pypi.python.org/pypi/wandb) [![Conda (channel only)](https://img.shields.io/conda/vn/conda-forge/wandb)](https://anaconda.org/conda-forge/wandb) [![CircleCI](https://img.shields.io/circleci/build/github/wandb/wandb/main)](https://circleci.com/gh/wandb/wandb) [![Codecov](https://img.shields.io/codecov/c/gh/wandb/wandb)](https://codecov.io/gh/wandb/wandb)
6
+
7
+ Use W&B to build better models faster. Track and visualize all the pieces of your machine learning pipeline, from datasets to production models.
8
+
9
+ - Quickly identify model regressions. Use W&B to visualize results in real time, all in a central dashboard.
10
+ - Focus on the interesting ML. Spend less time manually tracking results in spreadsheets and text files.
11
+ - Capture dataset versions with W&B Artifacts to identify how changing data affects your resulting models.
12
+ - Reproduce any model, with saved code, hyperparameters, launch commands, input data, and resulting model weights.
13
+
14
+ [Sign up for a free account →](https://wandb.ai/login?signup=true)
15
+
16
+ ## Features
17
+
18
+ - Store hyper-parameters used in a training run
19
+ - Search, compare, and visualize training runs
20
+ - Analyze system usage metrics alongside runs
21
+ - Collaborate with team members
22
+ - Replicate historic results
23
+ - Run parameter sweeps
24
+ - Keep records of experiments available forever
25
+
26
+ [Documentation →](https://docs.wandb.com)
27
+
28
+ ## Quickstart
29
+
30
+ ```shell
31
+ pip install wandb
32
+ ```
33
+
34
+ In your training script:
35
+
36
+ ```python
37
+ import wandb
38
+
39
+ # Your custom arguments defined here
40
+ args = ...
41
+
42
+ wandb.init(config=args, project="my-project")
43
+ wandb.config["more"] = "custom"
44
+
45
+
46
+ def training_loop():
47
+ while True:
48
+ # Do some machine learning
49
+ epoch, loss, val_loss = ...
50
+ # Framework agnostic / custom metrics
51
+ wandb.log({"epoch": epoch, "loss": loss, "val_loss": val_loss})
52
+ ```
53
+
54
+ If you're already using Tensorboard or [TensorboardX](https://github.com/lanpa/tensorboardX), you can integrate with one line:
55
+
56
+ ```python
57
+ wandb.init(sync_tensorboard=True)
58
+ ```
59
+
60
+ ## Running your script
61
+
62
+ Run `wandb login` from your terminal to signup or authenticate your machine (we store your api key in ~/.netrc). You can also set the `WANDB_API_KEY` environment variable with a key from your [settings](https://app.wandb.ai/settings).
63
+
64
+ Run your script with `python my_script.py` and all metadata will be synced to the cloud. You will see a url in your terminal logs when your script starts and finishes. Data is staged locally in a directory named _wandb_ relative to your script. If you want to test your script without syncing to the cloud you can set the environment variable `WANDB_MODE=dryrun`.
65
+
66
+ If you are using [docker](https://docker.com) to run your code, we provide a wrapper command `wandb docker` that mounts your current directory, sets environment variables, and ensures the wandb library is installed. Training your models in docker gives you the ability to restore the exact code and environment with the `wandb restore` command.
67
+
68
+ ## Web Interface
69
+
70
+ [Sign up for a free account →](https://wandb.com)
71
+ [![Watch the video](https://i.imgur.com/PW0Ejlc.png)](https://youtu.be/EeqhOSvNX-A)
72
+ [Introduction video →](https://youtu.be/EeqhOSvNX-A)
73
+
74
+ ## Detailed Usage
75
+
76
+ Framework specific and detailed usage can be found in our [documentation](http://docs.wandb.com/).
77
+
78
+ ## Testing
79
+
80
+ To run basic test use `make test`. More detailed information can be found at CONTRIBUTING.md.
81
+
82
+ We use [circleci](https://circleci.com) for CI.
83
+
84
+ # Academic Researchers
85
+ If you'd like a free academic account for your research group, [reach out to us →](https://www.wandb.com/academic)
86
+
87
+ We make it easy to cite W&B in your published paper. [Learn more →](https://www.wandb.com/academic)
88
+ [![](https://i.imgur.com/loKLiez.png)](https://www.wandb.com/academic)
89
+
90
+ ## Community
91
+ Got questions, feedback or want to join a community of ML engineers working on exciting projects?
92
+
93
+ <a href="https://bit.ly/wb-slack"><img src="https://svgshare.com/i/M93.svg" alt="slack" width="55"/></a> Join our [slack](https://bit.ly/wb-slack) community.
94
+
95
+ [![Twitter](https://img.shields.io/twitter/follow/weights_biases?style=social)](https://twitter.com/weights_biases) Follow us on [Twitter](https://twitter.com/weights_biases).
wandb/__init__.py CHANGED
@@ -11,8 +11,8 @@ For scripts and interactive notebooks, see https://github.com/wandb/examples.
11
11
 
12
12
  For reference documentation, see https://docs.wandb.com/ref/python.
13
13
  """
14
- __version__ = "0.16.6"
15
- _minimum_core_version = "0.17.0b10"
14
+ __version__ = "0.17.0rc1"
15
+
16
16
 
17
17
  # Used with pypi checks and other messages related to pip
18
18
  _wandb_module = "wandb"
wandb/agents/pyagent.py CHANGED
@@ -4,7 +4,6 @@ Manage wandb agent.
4
4
 
5
5
  """
6
6
 
7
-
8
7
  import ctypes
9
8
  import logging
10
9
  import os
wandb/analytics/sentry.py CHANGED
@@ -137,7 +137,8 @@ class Sentry:
137
137
  self.mark_session(status=status)
138
138
 
139
139
  client, _ = self.hub._stack[-1] # type: ignore
140
- client.flush()
140
+ if client is not None:
141
+ client.flush()
141
142
 
142
143
  return None
143
144
 
@@ -17,20 +17,15 @@ Policy = Literal["now", "end", "live"]
17
17
 
18
18
  @runtime_checkable
19
19
  class ImporterRun(Protocol):
20
- def run_id(self) -> str:
21
- ... # pragma: no cover
20
+ def run_id(self) -> str: ... # pragma: no cover
22
21
 
23
- def entity(self) -> str:
24
- ... # pragma: no cover
22
+ def entity(self) -> str: ... # pragma: no cover
25
23
 
26
- def project(self) -> str:
27
- ... # pragma: no cover
24
+ def project(self) -> str: ... # pragma: no cover
28
25
 
29
- def config(self) -> Dict[str, Any]:
30
- ... # pragma: no cover
26
+ def config(self) -> Dict[str, Any]: ... # pragma: no cover
31
27
 
32
- def summary(self) -> Dict[str, float]:
33
- ... # pragma: no cover
28
+ def summary(self) -> Dict[str, float]: ... # pragma: no cover
34
29
 
35
30
  def metrics(self) -> Iterable[Dict[str, float]]:
36
31
  """Metrics for the run.
@@ -55,71 +50,50 @@ class ImporterRun(Protocol):
55
50
  """
56
51
  ... # pragma: no cover
57
52
 
58
- def run_group(self) -> Optional[str]:
59
- ... # pragma: no cover
53
+ def run_group(self) -> Optional[str]: ... # pragma: no cover
60
54
 
61
- def job_type(self) -> Optional[str]:
62
- ... # pragma: no cover
55
+ def job_type(self) -> Optional[str]: ... # pragma: no cover
63
56
 
64
- def display_name(self) -> str:
65
- ... # pragma: no cover
57
+ def display_name(self) -> str: ... # pragma: no cover
66
58
 
67
- def notes(self) -> Optional[str]:
68
- ... # pragma: no cover
59
+ def notes(self) -> Optional[str]: ... # pragma: no cover
69
60
 
70
- def tags(self) -> Optional[List[str]]:
71
- ... # pragma: no cover
61
+ def tags(self) -> Optional[List[str]]: ... # pragma: no cover
72
62
 
73
- def artifacts(self) -> Optional[Iterable[Artifact]]:
74
- ... # pragma: no cover
63
+ def artifacts(self) -> Optional[Iterable[Artifact]]: ... # pragma: no cover
75
64
 
76
- def used_artifacts(self) -> Optional[Iterable[Artifact]]:
77
- ... # pragma: no cover
65
+ def used_artifacts(self) -> Optional[Iterable[Artifact]]: ... # pragma: no cover
78
66
 
79
- def os_version(self) -> Optional[str]:
80
- ... # pragma: no cover
67
+ def os_version(self) -> Optional[str]: ... # pragma: no cover
81
68
 
82
- def python_version(self) -> Optional[str]:
83
- ... # pragma: no cover
69
+ def python_version(self) -> Optional[str]: ... # pragma: no cover
84
70
 
85
- def cuda_version(self) -> Optional[str]:
86
- ... # pragma: no cover
71
+ def cuda_version(self) -> Optional[str]: ... # pragma: no cover
87
72
 
88
- def program(self) -> Optional[str]:
89
- ... # pragma: no cover
73
+ def program(self) -> Optional[str]: ... # pragma: no cover
90
74
 
91
- def host(self) -> Optional[str]:
92
- ... # pragma: no cover
75
+ def host(self) -> Optional[str]: ... # pragma: no cover
93
76
 
94
- def username(self) -> Optional[str]:
95
- ... # pragma: no cover
77
+ def username(self) -> Optional[str]: ... # pragma: no cover
96
78
 
97
- def executable(self) -> Optional[str]:
98
- ... # pragma: no cover
79
+ def executable(self) -> Optional[str]: ... # pragma: no cover
99
80
 
100
- def gpus_used(self) -> Optional[str]:
101
- ... # pragma: no cover
81
+ def gpus_used(self) -> Optional[str]: ... # pragma: no cover
102
82
 
103
- def cpus_used(self) -> Optional[int]:
104
- ... # pragma: no cover
83
+ def cpus_used(self) -> Optional[int]: ... # pragma: no cover
105
84
 
106
- def memory_used(self) -> Optional[int]:
107
- ... # pragma: no cover
85
+ def memory_used(self) -> Optional[int]: ... # pragma: no cover
108
86
 
109
- def runtime(self) -> Optional[int]:
110
- ... # pragma: no cover
87
+ def runtime(self) -> Optional[int]: ... # pragma: no cover
111
88
 
112
- def start_time(self) -> Optional[int]:
113
- ... # pragma: no cover
89
+ def start_time(self) -> Optional[int]: ... # pragma: no cover
114
90
 
115
- def code_path(self) -> Optional[str]:
116
- ... # pragma: no cover
91
+ def code_path(self) -> Optional[str]: ... # pragma: no cover
117
92
 
118
- def cli_version(self) -> Optional[str]:
119
- ... # pragma: no cover
93
+ def cli_version(self) -> Optional[str]: ... # pragma: no cover
120
94
 
121
- def files(self) -> Optional[Iterable[Tuple[PathStr, Policy]]]:
122
- ... # pragma: no cover
95
+ def files(
96
+ self,
97
+ ) -> Optional[Iterable[Tuple[PathStr, Policy]]]: ... # pragma: no cover
123
98
 
124
- def logs(self) -> Optional[Iterable[str]]:
125
- ... # pragma: no cover
99
+ def logs(self) -> Optional[Iterable[str]]: ... # pragma: no cover
@@ -96,35 +96,26 @@ class MlflowRun:
96
96
  def used_artifacts(self) -> Optional[Iterable[Artifact]]: # type: ignore
97
97
  ... # pragma: no cover
98
98
 
99
- def os_version(self) -> Optional[str]:
100
- ... # pragma: no cover
99
+ def os_version(self) -> Optional[str]: ... # pragma: no cover
101
100
 
102
- def python_version(self) -> Optional[str]:
103
- ... # pragma: no cover
101
+ def python_version(self) -> Optional[str]: ... # pragma: no cover
104
102
 
105
- def cuda_version(self) -> Optional[str]:
106
- ... # pragma: no cover
103
+ def cuda_version(self) -> Optional[str]: ... # pragma: no cover
107
104
 
108
- def program(self) -> Optional[str]:
109
- ... # pragma: no cover
105
+ def program(self) -> Optional[str]: ... # pragma: no cover
110
106
 
111
- def host(self) -> Optional[str]:
112
- ... # pragma: no cover
107
+ def host(self) -> Optional[str]: ... # pragma: no cover
113
108
 
114
- def username(self) -> Optional[str]:
115
- ... # pragma: no cover
109
+ def username(self) -> Optional[str]: ... # pragma: no cover
116
110
 
117
- def executable(self) -> Optional[str]:
118
- ... # pragma: no cover
111
+ def executable(self) -> Optional[str]: ... # pragma: no cover
119
112
 
120
- def gpus_used(self) -> Optional[str]:
121
- ... # pragma: no cover
113
+ def gpus_used(self) -> Optional[str]: ... # pragma: no cover
122
114
 
123
115
  def cpus_used(self) -> Optional[int]: # can we get the model?
124
116
  ... # pragma: no cover
125
117
 
126
- def memory_used(self) -> Optional[int]:
127
- ... # pragma: no cover
118
+ def memory_used(self) -> Optional[int]: ... # pragma: no cover
128
119
 
129
120
  def runtime(self) -> Optional[int]:
130
121
  end_time = (
@@ -137,17 +128,13 @@ class MlflowRun:
137
128
  def start_time(self) -> Optional[int]:
138
129
  return self.run.info.start_time // 1000
139
130
 
140
- def code_path(self) -> Optional[str]:
141
- ... # pragma: no cover
131
+ def code_path(self) -> Optional[str]: ... # pragma: no cover
142
132
 
143
- def cli_version(self) -> Optional[str]:
144
- ... # pragma: no cover
133
+ def cli_version(self) -> Optional[str]: ... # pragma: no cover
145
134
 
146
- def files(self) -> Optional[Iterable[Tuple[str, str]]]:
147
- ... # pragma: no cover
135
+ def files(self) -> Optional[Iterable[Tuple[str, str]]]: ... # pragma: no cover
148
136
 
149
- def logs(self) -> Optional[Iterable[str]]:
150
- ... # pragma: no cover
137
+ def logs(self) -> Optional[Iterable[str]]: ... # pragma: no cover
151
138
 
152
139
  @staticmethod
153
140
  def _handle_incompatible_strings(s: str) -> str:
@@ -1,4 +1,5 @@
1
1
  """Tooling for the W&B Importer."""
2
+
2
3
  import itertools
3
4
  import json
4
5
  import logging
@@ -201,35 +202,28 @@ class WandbRun:
201
202
 
202
203
  yield from self._used_artifacts
203
204
 
204
- def os_version(self) -> Optional[str]:
205
- ... # pragma: no cover
205
+ def os_version(self) -> Optional[str]: ... # pragma: no cover
206
206
 
207
207
  def python_version(self) -> Optional[str]:
208
208
  return self._metadata_file().get("python")
209
209
 
210
- def cuda_version(self) -> Optional[str]:
211
- ... # pragma: no cover
210
+ def cuda_version(self) -> Optional[str]: ... # pragma: no cover
212
211
 
213
- def program(self) -> Optional[str]:
214
- ... # pragma: no cover
212
+ def program(self) -> Optional[str]: ... # pragma: no cover
215
213
 
216
214
  def host(self) -> Optional[str]:
217
215
  return self._metadata_file().get("host")
218
216
 
219
- def username(self) -> Optional[str]:
220
- ... # pragma: no cover
217
+ def username(self) -> Optional[str]: ... # pragma: no cover
221
218
 
222
- def executable(self) -> Optional[str]:
223
- ... # pragma: no cover
219
+ def executable(self) -> Optional[str]: ... # pragma: no cover
224
220
 
225
- def gpus_used(self) -> Optional[str]:
226
- ... # pragma: no cover
221
+ def gpus_used(self) -> Optional[str]: ... # pragma: no cover
227
222
 
228
223
  def cpus_used(self) -> Optional[int]: # can we get the model?
229
224
  ... # pragma: no cover
230
225
 
231
- def memory_used(self) -> Optional[int]:
232
- ... # pragma: no cover
226
+ def memory_used(self) -> Optional[int]: ... # pragma: no cover
233
227
 
234
228
  def runtime(self) -> Optional[int]:
235
229
  wandb_runtime = self.run.summary.get("_wandb", {}).get("runtime")
wandb/apis/public/api.py CHANGED
@@ -10,6 +10,7 @@ You might use the Public API to
10
10
 
11
11
  For more on using the Public API, check out [our guide](https://docs.wandb.com/guides/track/public-api-guide).
12
12
  """
13
+
13
14
  import json
14
15
  import logging
15
16
  import os
@@ -1,4 +1,5 @@
1
1
  """Public API: artifacts."""
2
+
2
3
  import json
3
4
  from typing import TYPE_CHECKING, Any, Mapping, Optional, Sequence
4
5
 
@@ -1,4 +1,5 @@
1
1
  """Public API: files."""
2
+
2
3
  import io
3
4
  import os
4
5
  from typing import Optional
@@ -1,4 +1,5 @@
1
1
  """Public API: history."""
2
+
2
3
  import json
3
4
 
4
5
  import requests
wandb/apis/public/jobs.py CHANGED
@@ -1,4 +1,5 @@
1
1
  """Public API: jobs."""
2
+
2
3
  import json
3
4
  import os
4
5
  import shutil
@@ -1,4 +1,5 @@
1
1
  """Public API: projects."""
2
+
2
3
  from wandb_gql import gql
3
4
 
4
5
  from wandb.apis import public
@@ -1,4 +1,5 @@
1
1
  """Public API: reports."""
2
+
2
3
  import ast
3
4
  import json
4
5
  import sys
wandb/apis/public/runs.py CHANGED
@@ -1,4 +1,5 @@
1
1
  """Public API: runs."""
2
+
2
3
  import json
3
4
  import os
4
5
  import tempfile
@@ -1,4 +1,5 @@
1
1
  """Public API: sweeps."""
2
+
2
3
  import urllib
3
4
  from typing import Optional
4
5
 
@@ -1,4 +1,5 @@
1
1
  """Public API: teams."""
2
+
2
3
  import requests
3
4
  from wandb_gql import gql
4
5
 
@@ -1,4 +1,5 @@
1
1
  """Public API: users."""
2
+
2
3
  import requests
3
4
  from wandb_gql import gql
4
5
 
@@ -716,16 +716,12 @@ class WeaveBlockSummaryTable(Block):
716
716
  "fromOp"
717
717
  ]["inputs"]["run"]["fromOp"]["inputs"]["project"]["fromOp"]["inputs"][
718
718
  "entityName"
719
- ][
720
- "val"
721
- ]
719
+ ]["val"]
722
720
  project = spec["config"]["panelConfig"]["exp"]["fromOp"]["inputs"]["obj"][
723
721
  "fromOp"
724
722
  ]["inputs"]["run"]["fromOp"]["inputs"]["project"]["fromOp"]["inputs"][
725
723
  "projectName"
726
- ][
727
- "val"
728
- ]
724
+ ]["val"]
729
725
  table_name = spec["config"]["panelConfig"]["exp"]["fromOp"]["inputs"]["key"][
730
726
  "val"
731
727
  ]
@@ -1,4 +1,5 @@
1
1
  """GraphQL queries and mutations."""
2
+
2
3
  from wandb_gql import gql
3
4
 
4
5
  view_report = gql(
@@ -1,4 +1,5 @@
1
1
  """Public interfaces for the Report API."""
2
+
2
3
  import os
3
4
  from datetime import datetime
4
5
  from typing import Dict, Iterable, Optional, Tuple, Union
@@ -100,8 +101,7 @@ class Layout(Base):
100
101
 
101
102
 
102
103
  @dataclass(config=dataclass_config)
103
- class Block(Base):
104
- ...
104
+ class Block(Base): ...
105
105
 
106
106
 
107
107
  @dataclass(config=ConfigDict(validate_assignment=True, extra="allow", slots=True))
@@ -706,8 +706,7 @@ class Twitter(Block):
706
706
 
707
707
 
708
708
  @dataclass(config=dataclass_config)
709
- class WeaveBlock(Block):
710
- ...
709
+ class WeaveBlock(Block): ...
711
710
 
712
711
 
713
712
  BlockTypes = Union[
@@ -1,4 +1,5 @@
1
1
  """JSONSchema for internal types. Hopefully this is auto-generated one day!"""
2
+
2
3
  import json
3
4
  import random
4
5
  from copy import deepcopy
@@ -102,16 +103,13 @@ class TextLikeMixin:
102
103
  return obj
103
104
 
104
105
 
105
- class Sentinel(BaseModel):
106
- ...
106
+ class Sentinel(BaseModel): ...
107
107
 
108
108
 
109
- class ReportEntity(Sentinel):
110
- ...
109
+ class ReportEntity(Sentinel): ...
111
110
 
112
111
 
113
- class ReportProject(Sentinel):
114
- ...
112
+ class ReportProject(Sentinel): ...
115
113
 
116
114
 
117
115
  class ReportAPIBaseModel(BaseModel):
@@ -271,8 +269,7 @@ class PanelGridMetadata(ReportAPIBaseModel):
271
269
  # )
272
270
 
273
271
 
274
- class Block(ReportAPIBaseModel):
275
- ...
272
+ class Block(ReportAPIBaseModel): ...
276
273
 
277
274
 
278
275
  class PanelGrid(Block):
wandb/cli/cli.py CHANGED
@@ -2188,7 +2188,7 @@ def docker(
2188
2188
  if cmd:
2189
2189
  command.extend(["-e", "WANDB_COMMAND=%s" % cmd])
2190
2190
  command.extend(["-it", image, shell])
2191
- wandb.termlog("Launching docker container \U0001F6A2")
2191
+ wandb.termlog("Launching docker container \U0001f6a2")
2192
2192
  subprocess.call(command)
2193
2193
 
2194
2194
 
@@ -2306,7 +2306,7 @@ def start(ctx, port, env, daemon, upgrade, edge):
2306
2306
  )
2307
2307
  exit(1)
2308
2308
  else:
2309
- wandb.termlog("W&B server started at http://localhost:%s \U0001F680" % port)
2309
+ wandb.termlog("W&B server started at http://localhost:%s \U0001f680" % port)
2310
2310
  wandb.termlog("You can stop the server by running `wandb server stop`")
2311
2311
  if not api.api_key:
2312
2312
  # Let the server start before potentially launching a browser
wandb/data_types.py CHANGED
@@ -513,9 +513,9 @@ class Table(Media):
513
513
  deserialized = np.load(
514
514
  source_artifact.get_entry(serialization_path["path"]).download()
515
515
  )
516
- np_deserialized_columns[
517
- json_obj["columns"].index(col_name)
518
- ] = deserialized[serialization_path["key"]]
516
+ np_deserialized_columns[json_obj["columns"].index(col_name)] = (
517
+ deserialized[serialization_path["key"]]
518
+ )
519
519
  ndarray_type._clear_serialization_path()
520
520
 
521
521
  for r_ndx, row in enumerate(json_obj["data"]):
wandb/env.py CHANGED
@@ -13,7 +13,6 @@ these values in many cases.
13
13
  import json
14
14
  import os
15
15
  import sys
16
- from distutils.util import strtobool
17
16
  from pathlib import Path
18
17
  from typing import List, MutableMapping, Optional, Union
19
18
 
@@ -61,6 +60,8 @@ SAVE_CODE = "WANDB_SAVE_CODE"
61
60
  TAGS = "WANDB_TAGS"
62
61
  IGNORE = "WANDB_IGNORE_GLOBS"
63
62
  ERROR_REPORTING = "WANDB_ERROR_REPORTING"
63
+ CORE_ERROR_REPORTING = "WANDB_CORE_ERROR_REPORTING"
64
+ CORE_DEBUG = "WANDB_CORE_DEBUG"
64
65
  DOCKER = "WANDB_DOCKER"
65
66
  AGENT_REPORT_INTERVAL = "WANDB_AGENT_REPORT_INTERVAL"
66
67
  AGENT_KILL_DELAY = "WANDB_AGENT_KILL_DELAY"
@@ -87,6 +88,7 @@ _EXECUTABLE = "WANDB_EXECUTABLE"
87
88
  LAUNCH_QUEUE_NAME = "WANDB_LAUNCH_QUEUE_NAME"
88
89
  LAUNCH_QUEUE_ENTITY = "WANDB_LAUNCH_QUEUE_ENTITY"
89
90
  LAUNCH_TRACE_ID = "WANDB_LAUNCH_TRACE_ID"
91
+ _REQUIRE_CORE = "WANDB__REQUIRE_CORE"
90
92
 
91
93
  # For testing, to be removed in future version
92
94
  USE_V1_ARTIFACTS = "_WANDB_USE_V1_ARTIFACTS"
@@ -139,11 +141,16 @@ def _env_as_bool(
139
141
  if env is None:
140
142
  env = os.environ
141
143
  val = env.get(var, default)
144
+ if not isinstance(val, str):
145
+ return False
142
146
  try:
143
- val = bool(strtobool(val)) # type: ignore
144
- except (AttributeError, ValueError):
145
- pass
146
- return val if isinstance(val, bool) else False
147
+ return strtobool(val)
148
+ except ValueError:
149
+ return False
150
+
151
+
152
+ def is_require_core(env: Optional[Env] = None) -> bool:
153
+ return _env_as_bool(_REQUIRE_CORE, default="False", env=env)
147
154
 
148
155
 
149
156
  def is_debug(default: Optional[str] = None, env: Optional[Env] = None) -> bool:
@@ -154,6 +161,14 @@ def error_reporting_enabled() -> bool:
154
161
  return _env_as_bool(ERROR_REPORTING, default="True")
155
162
 
156
163
 
164
+ def core_error_reporting_enabled(default: Optional[str] = None) -> bool:
165
+ return _env_as_bool(CORE_ERROR_REPORTING, default=default)
166
+
167
+
168
+ def core_debug(default: Optional[str] = None) -> bool:
169
+ return _env_as_bool(CORE_DEBUG, default=default)
170
+
171
+
157
172
  def ssl_disabled() -> bool:
158
173
  return _env_as_bool(DISABLE_SSL, default="False")
159
174
 
@@ -464,3 +479,18 @@ def get_launch_trace_id(env: Optional[Env] = None) -> Optional[str]:
464
479
  env = os.environ
465
480
  val = env.get(LAUNCH_TRACE_ID, None)
466
481
  return val
482
+
483
+
484
+ def strtobool(val: str) -> bool:
485
+ """Convert a string representation of truth to true or false.
486
+
487
+ Copied from distutils. distutils was removed in Python 3.12.
488
+ """
489
+ val = val.lower()
490
+
491
+ if val in ("y", "yes", "t", "true", "on", "1"):
492
+ return True
493
+ elif val in ("n", "no", "f", "false", "off", "0"):
494
+ return False
495
+ else:
496
+ raise ValueError(f"invalid truth value {val!r}")
wandb/errors/__init__.py CHANGED
@@ -4,6 +4,7 @@ __all__ = [
4
4
  "AuthenticationError",
5
5
  "UsageError",
6
6
  "UnsupportedError",
7
+ "WandbCoreNotAvailableError",
7
8
  ]
8
9
 
9
10
  from typing import Optional
@@ -39,3 +40,7 @@ class UsageError(Error):
39
40
 
40
41
  class UnsupportedError(UsageError):
41
42
  """Raised when trying to use a feature that is not supported."""
43
+
44
+
45
+ class WandbCoreNotAvailableError(Error):
46
+ """Raised when wandb core is not available."""