wandb 0.13.10__py3-none-any.whl → 0.14.0__py3-none-any.whl

Sign up to get free protection for your applications and to get access to all the features.
Files changed (228) hide show
  1. wandb/__init__.py +2 -3
  2. wandb/apis/__init__.py +1 -3
  3. wandb/apis/importers/__init__.py +4 -0
  4. wandb/apis/importers/base.py +312 -0
  5. wandb/apis/importers/mlflow.py +113 -0
  6. wandb/apis/internal.py +29 -2
  7. wandb/apis/normalize.py +6 -5
  8. wandb/apis/public.py +163 -180
  9. wandb/apis/reports/_templates.py +6 -12
  10. wandb/apis/reports/report.py +1 -1
  11. wandb/apis/reports/runset.py +1 -3
  12. wandb/apis/reports/util.py +12 -10
  13. wandb/beta/workflows.py +57 -34
  14. wandb/catboost/__init__.py +1 -2
  15. wandb/cli/cli.py +215 -133
  16. wandb/data_types.py +63 -56
  17. wandb/docker/__init__.py +78 -16
  18. wandb/docker/auth.py +21 -22
  19. wandb/env.py +0 -1
  20. wandb/errors/__init__.py +8 -116
  21. wandb/errors/term.py +1 -1
  22. wandb/fastai/__init__.py +1 -2
  23. wandb/filesync/dir_watcher.py +8 -5
  24. wandb/filesync/step_prepare.py +76 -75
  25. wandb/filesync/step_upload.py +1 -2
  26. wandb/integration/catboost/__init__.py +1 -3
  27. wandb/integration/catboost/catboost.py +8 -14
  28. wandb/integration/fastai/__init__.py +7 -13
  29. wandb/integration/gym/__init__.py +35 -4
  30. wandb/integration/keras/__init__.py +3 -3
  31. wandb/integration/keras/callbacks/metrics_logger.py +9 -8
  32. wandb/integration/keras/callbacks/model_checkpoint.py +9 -9
  33. wandb/integration/keras/callbacks/tables_builder.py +31 -19
  34. wandb/integration/kfp/kfp_patch.py +20 -17
  35. wandb/integration/kfp/wandb_logging.py +1 -2
  36. wandb/integration/lightgbm/__init__.py +21 -19
  37. wandb/integration/prodigy/prodigy.py +6 -7
  38. wandb/integration/sacred/__init__.py +9 -12
  39. wandb/integration/sagemaker/__init__.py +1 -3
  40. wandb/integration/sagemaker/auth.py +0 -1
  41. wandb/integration/sagemaker/config.py +1 -1
  42. wandb/integration/sagemaker/resources.py +1 -1
  43. wandb/integration/sb3/sb3.py +8 -4
  44. wandb/integration/tensorboard/__init__.py +1 -3
  45. wandb/integration/tensorboard/log.py +8 -8
  46. wandb/integration/tensorboard/monkeypatch.py +11 -9
  47. wandb/integration/tensorflow/__init__.py +1 -3
  48. wandb/integration/xgboost/__init__.py +4 -6
  49. wandb/integration/yolov8/__init__.py +7 -0
  50. wandb/integration/yolov8/yolov8.py +250 -0
  51. wandb/jupyter.py +31 -35
  52. wandb/lightgbm/__init__.py +1 -2
  53. wandb/old/settings.py +2 -2
  54. wandb/plot/bar.py +1 -2
  55. wandb/plot/confusion_matrix.py +1 -3
  56. wandb/plot/histogram.py +1 -2
  57. wandb/plot/line.py +1 -2
  58. wandb/plot/line_series.py +4 -4
  59. wandb/plot/pr_curve.py +17 -20
  60. wandb/plot/roc_curve.py +1 -3
  61. wandb/plot/scatter.py +1 -2
  62. wandb/proto/v3/wandb_server_pb2.py +85 -39
  63. wandb/proto/v3/wandb_telemetry_pb2.py +10 -10
  64. wandb/proto/v4/wandb_server_pb2.py +51 -39
  65. wandb/proto/v4/wandb_telemetry_pb2.py +10 -10
  66. wandb/sdk/__init__.py +1 -3
  67. wandb/sdk/backend/backend.py +1 -1
  68. wandb/sdk/data_types/_dtypes.py +38 -30
  69. wandb/sdk/data_types/base_types/json_metadata.py +1 -3
  70. wandb/sdk/data_types/base_types/media.py +17 -17
  71. wandb/sdk/data_types/base_types/wb_value.py +33 -26
  72. wandb/sdk/data_types/helper_types/bounding_boxes_2d.py +91 -125
  73. wandb/sdk/data_types/helper_types/classes.py +1 -1
  74. wandb/sdk/data_types/helper_types/image_mask.py +12 -12
  75. wandb/sdk/data_types/histogram.py +5 -4
  76. wandb/sdk/data_types/html.py +1 -2
  77. wandb/sdk/data_types/image.py +11 -11
  78. wandb/sdk/data_types/molecule.py +3 -6
  79. wandb/sdk/data_types/object_3d.py +1 -2
  80. wandb/sdk/data_types/plotly.py +1 -2
  81. wandb/sdk/data_types/saved_model.py +10 -8
  82. wandb/sdk/data_types/video.py +1 -1
  83. wandb/sdk/integration_utils/data_logging.py +5 -5
  84. wandb/sdk/interface/artifacts.py +288 -266
  85. wandb/sdk/interface/interface.py +2 -3
  86. wandb/sdk/interface/interface_grpc.py +1 -1
  87. wandb/sdk/interface/interface_queue.py +1 -1
  88. wandb/sdk/interface/interface_relay.py +1 -1
  89. wandb/sdk/interface/interface_shared.py +1 -2
  90. wandb/sdk/interface/interface_sock.py +1 -1
  91. wandb/sdk/interface/message_future.py +1 -1
  92. wandb/sdk/interface/message_future_poll.py +1 -1
  93. wandb/sdk/interface/router.py +1 -1
  94. wandb/sdk/interface/router_queue.py +1 -1
  95. wandb/sdk/interface/router_relay.py +1 -1
  96. wandb/sdk/interface/router_sock.py +1 -1
  97. wandb/sdk/interface/summary_record.py +1 -1
  98. wandb/sdk/internal/artifacts.py +1 -1
  99. wandb/sdk/internal/datastore.py +2 -3
  100. wandb/sdk/internal/file_pusher.py +5 -3
  101. wandb/sdk/internal/file_stream.py +22 -19
  102. wandb/sdk/internal/handler.py +5 -4
  103. wandb/sdk/internal/internal.py +1 -1
  104. wandb/sdk/internal/internal_api.py +115 -55
  105. wandb/sdk/internal/job_builder.py +1 -3
  106. wandb/sdk/internal/profiler.py +1 -1
  107. wandb/sdk/internal/progress.py +4 -6
  108. wandb/sdk/internal/sample.py +1 -3
  109. wandb/sdk/internal/sender.py +28 -16
  110. wandb/sdk/internal/settings_static.py +5 -5
  111. wandb/sdk/internal/system/assets/__init__.py +1 -0
  112. wandb/sdk/internal/system/assets/cpu.py +3 -9
  113. wandb/sdk/internal/system/assets/disk.py +2 -4
  114. wandb/sdk/internal/system/assets/gpu.py +6 -18
  115. wandb/sdk/internal/system/assets/gpu_apple.py +2 -4
  116. wandb/sdk/internal/system/assets/interfaces.py +50 -22
  117. wandb/sdk/internal/system/assets/ipu.py +1 -3
  118. wandb/sdk/internal/system/assets/memory.py +7 -13
  119. wandb/sdk/internal/system/assets/network.py +4 -8
  120. wandb/sdk/internal/system/assets/open_metrics.py +283 -0
  121. wandb/sdk/internal/system/assets/tpu.py +1 -4
  122. wandb/sdk/internal/system/assets/trainium.py +26 -14
  123. wandb/sdk/internal/system/system_info.py +2 -3
  124. wandb/sdk/internal/system/system_monitor.py +52 -20
  125. wandb/sdk/internal/tb_watcher.py +12 -13
  126. wandb/sdk/launch/_project_spec.py +54 -65
  127. wandb/sdk/launch/agent/agent.py +374 -90
  128. wandb/sdk/launch/builder/abstract.py +61 -7
  129. wandb/sdk/launch/builder/build.py +81 -110
  130. wandb/sdk/launch/builder/docker_builder.py +181 -0
  131. wandb/sdk/launch/builder/kaniko_builder.py +419 -0
  132. wandb/sdk/launch/builder/noop.py +31 -12
  133. wandb/sdk/launch/builder/templates/_wandb_bootstrap.py +70 -20
  134. wandb/sdk/launch/environment/abstract.py +28 -0
  135. wandb/sdk/launch/environment/aws_environment.py +276 -0
  136. wandb/sdk/launch/environment/gcp_environment.py +271 -0
  137. wandb/sdk/launch/environment/local_environment.py +65 -0
  138. wandb/sdk/launch/github_reference.py +3 -8
  139. wandb/sdk/launch/launch.py +38 -29
  140. wandb/sdk/launch/launch_add.py +6 -8
  141. wandb/sdk/launch/loader.py +230 -0
  142. wandb/sdk/launch/registry/abstract.py +54 -0
  143. wandb/sdk/launch/registry/elastic_container_registry.py +163 -0
  144. wandb/sdk/launch/registry/google_artifact_registry.py +203 -0
  145. wandb/sdk/launch/registry/local_registry.py +62 -0
  146. wandb/sdk/launch/runner/abstract.py +1 -16
  147. wandb/sdk/launch/runner/{kubernetes.py → kubernetes_runner.py} +83 -95
  148. wandb/sdk/launch/runner/local_container.py +46 -22
  149. wandb/sdk/launch/runner/local_process.py +1 -4
  150. wandb/sdk/launch/runner/{aws.py → sagemaker_runner.py} +53 -212
  151. wandb/sdk/launch/runner/{gcp_vertex.py → vertex_runner.py} +38 -55
  152. wandb/sdk/launch/sweeps/__init__.py +3 -2
  153. wandb/sdk/launch/sweeps/scheduler.py +132 -39
  154. wandb/sdk/launch/sweeps/scheduler_sweep.py +80 -89
  155. wandb/sdk/launch/utils.py +101 -30
  156. wandb/sdk/launch/wandb_reference.py +2 -7
  157. wandb/sdk/lib/_settings_toposort_generate.py +166 -0
  158. wandb/sdk/lib/_settings_toposort_generated.py +201 -0
  159. wandb/sdk/lib/apikey.py +2 -4
  160. wandb/sdk/lib/config_util.py +4 -1
  161. wandb/sdk/lib/console.py +1 -3
  162. wandb/sdk/lib/deprecate.py +3 -3
  163. wandb/sdk/lib/file_stream_utils.py +7 -5
  164. wandb/sdk/lib/filenames.py +1 -1
  165. wandb/sdk/lib/filesystem.py +61 -5
  166. wandb/sdk/lib/git.py +1 -3
  167. wandb/sdk/lib/import_hooks.py +4 -7
  168. wandb/sdk/lib/ipython.py +8 -5
  169. wandb/sdk/lib/lazyloader.py +1 -3
  170. wandb/sdk/lib/mailbox.py +14 -4
  171. wandb/sdk/lib/proto_util.py +10 -5
  172. wandb/sdk/lib/redirect.py +15 -22
  173. wandb/sdk/lib/reporting.py +1 -3
  174. wandb/sdk/lib/retry.py +4 -5
  175. wandb/sdk/lib/runid.py +1 -3
  176. wandb/sdk/lib/server.py +15 -9
  177. wandb/sdk/lib/sock_client.py +1 -1
  178. wandb/sdk/lib/sparkline.py +1 -1
  179. wandb/sdk/lib/wburls.py +1 -1
  180. wandb/sdk/service/port_file.py +1 -2
  181. wandb/sdk/service/service.py +36 -13
  182. wandb/sdk/service/service_base.py +12 -1
  183. wandb/sdk/verify/verify.py +5 -7
  184. wandb/sdk/wandb_artifacts.py +142 -177
  185. wandb/sdk/wandb_config.py +5 -8
  186. wandb/sdk/wandb_helper.py +1 -1
  187. wandb/sdk/wandb_init.py +24 -13
  188. wandb/sdk/wandb_login.py +9 -9
  189. wandb/sdk/wandb_manager.py +39 -4
  190. wandb/sdk/wandb_metric.py +2 -6
  191. wandb/sdk/wandb_require.py +4 -15
  192. wandb/sdk/wandb_require_helpers.py +1 -9
  193. wandb/sdk/wandb_run.py +95 -141
  194. wandb/sdk/wandb_save.py +1 -3
  195. wandb/sdk/wandb_settings.py +149 -54
  196. wandb/sdk/wandb_setup.py +66 -46
  197. wandb/sdk/wandb_summary.py +13 -10
  198. wandb/sdk/wandb_sweep.py +6 -7
  199. wandb/sdk/wandb_watch.py +1 -1
  200. wandb/sklearn/calculate/confusion_matrix.py +1 -1
  201. wandb/sklearn/calculate/learning_curve.py +1 -1
  202. wandb/sklearn/calculate/summary_metrics.py +1 -3
  203. wandb/sklearn/plot/__init__.py +1 -1
  204. wandb/sklearn/plot/classifier.py +27 -18
  205. wandb/sklearn/plot/clusterer.py +4 -5
  206. wandb/sklearn/plot/regressor.py +4 -4
  207. wandb/sklearn/plot/shared.py +2 -2
  208. wandb/sync/__init__.py +1 -3
  209. wandb/sync/sync.py +4 -5
  210. wandb/testing/relay.py +11 -10
  211. wandb/trigger.py +1 -1
  212. wandb/util.py +106 -81
  213. wandb/viz.py +4 -4
  214. wandb/wandb_agent.py +50 -50
  215. wandb/wandb_controller.py +2 -3
  216. wandb/wandb_run.py +1 -2
  217. wandb/wandb_torch.py +1 -1
  218. wandb/xgboost/__init__.py +1 -2
  219. {wandb-0.13.10.dist-info → wandb-0.14.0.dist-info}/METADATA +6 -2
  220. {wandb-0.13.10.dist-info → wandb-0.14.0.dist-info}/RECORD +224 -209
  221. {wandb-0.13.10.dist-info → wandb-0.14.0.dist-info}/WHEEL +1 -1
  222. wandb/sdk/launch/builder/docker.py +0 -80
  223. wandb/sdk/launch/builder/kaniko.py +0 -393
  224. wandb/sdk/launch/builder/loader.py +0 -32
  225. wandb/sdk/launch/runner/loader.py +0 -50
  226. {wandb-0.13.10.dist-info → wandb-0.14.0.dist-info}/LICENSE +0 -0
  227. {wandb-0.13.10.dist-info → wandb-0.14.0.dist-info}/entry_points.txt +0 -0
  228. {wandb-0.13.10.dist-info → wandb-0.14.0.dist-info}/top_level.txt +0 -0
@@ -1,4 +1,4 @@
1
- """Interface base class - Used to send messages to the internal process
1
+ """Interface base class - Used to send messages to the internal process.
2
2
 
3
3
  InterfaceBase: The abstract class
4
4
  InterfaceGrpc: Use gRPC to send and receive messages
@@ -267,7 +267,6 @@ class InterfaceBase:
267
267
  A new tree of dict's with large objects replaced with dictionaries
268
268
  with "_type" entries that say which type the original data was.
269
269
  """
270
-
271
270
  # Constructs a new `dict` tree in `json_value` that discards and/or
272
271
  # encodes objects that aren't JSON serializable.
273
272
 
@@ -396,7 +395,7 @@ class InterfaceBase:
396
395
  obj: Optional[pb.ArtifactManifest] = None,
397
396
  ) -> pb.ArtifactManifest:
398
397
  proto_manifest = obj or pb.ArtifactManifest()
399
- proto_manifest.version = artifact_manifest.version() # type: ignore
398
+ proto_manifest.version = artifact_manifest.version()
400
399
  proto_manifest.storage_policy = artifact_manifest.storage_policy.name()
401
400
 
402
401
  for k, v in artifact_manifest.storage_policy.config().items() or {}.items():
@@ -1,4 +1,4 @@
1
- """Backend Sender - Send to internal process
1
+ """Backend Sender - Send to internal process.
2
2
 
3
3
  Manage backend sender.
4
4
 
@@ -1,4 +1,4 @@
1
- """InterfaceQueue - Derived from InterfaceShared using queues to send to internal thread
1
+ """InterfaceQueue - Derived from InterfaceShared using queues to send to internal thread.
2
2
 
3
3
  See interface.py for how interface classes relate to each other.
4
4
 
@@ -1,4 +1,4 @@
1
- """InterfaceRelay - Derived from InterfaceQueue using RelayRouter to preserve uuid req/resp
1
+ """InterfaceRelay - Derived from InterfaceQueue using RelayRouter to preserve uuid req/resp.
2
2
 
3
3
  See interface.py for how interface classes relate to each other.
4
4
 
@@ -1,4 +1,4 @@
1
- """InterfaceShared - Derived from InterfaceBase - shared with InterfaceQueue and InterfaceSock
1
+ """InterfaceShared - Derived from InterfaceBase - shared with InterfaceQueue and InterfaceSock.
2
2
 
3
3
  See interface.py for how interface classes relate to each other.
4
4
 
@@ -380,7 +380,6 @@ class InterfaceShared(InterfaceBase):
380
380
  Returns:
381
381
  RunRecord object
382
382
  """
383
-
384
383
  req = self._make_record(run=run)
385
384
  resp = self._communicate(req, timeout=timeout)
386
385
  if resp is None:
@@ -1,4 +1,4 @@
1
- """InterfaceSock - Derived from InterfaceShared using a socket to send to internal thread
1
+ """InterfaceSock - Derived from InterfaceShared using a socket to send to internal thread.
2
2
 
3
3
  See interface.py for how interface classes relate to each other.
4
4
 
@@ -1,4 +1,4 @@
1
- """MessageFuture - represents a message result of an asynchronous operation
1
+ """MessageFuture - represents a message result of an asynchronous operation.
2
2
 
3
3
  Base class MessageFuture for MessageFutureObject and MessageFuturePoll
4
4
 
@@ -1,4 +1,4 @@
1
- """MessageFuturePoll - Derived from MessageFuture but implementing polling loop
1
+ """MessageFuturePoll - Derived from MessageFuture but implementing polling loop.
2
2
 
3
3
  MessageFuture represents a message result of an asynchronous operation.
4
4
 
@@ -1,4 +1,4 @@
1
- """Router - handle message router (base class)
1
+ """Router - handle message router (base class).
2
2
 
3
3
  Router to manage responses.
4
4
 
@@ -1,4 +1,4 @@
1
- """Router - handle message router (queue)
1
+ """Router - handle message router (queue).
2
2
 
3
3
  Router to manage responses from a queue.
4
4
 
@@ -1,4 +1,4 @@
1
- """Router - handle message router (relay)
1
+ """Router - handle message router (relay).
2
2
 
3
3
  Router to manage responses from a queue with relay.
4
4
 
@@ -1,4 +1,4 @@
1
- """Router - handle message router (sock)
1
+ """Router - handle message router (sock).
2
2
 
3
3
  Router to manage responses from a socket client.
4
4
 
@@ -8,7 +8,7 @@ import typing as t
8
8
 
9
9
 
10
10
  class SummaryRecord:
11
- """Encodes a diff -- analogous to the SummaryRecord protobuf message"""
11
+ """Encodes a diff -- analogous to the SummaryRecord protobuf message."""
12
12
 
13
13
  update: t.List["SummaryItem"]
14
14
  remove: t.List["SummaryItem"]
@@ -80,7 +80,7 @@ class ArtifactSaver:
80
80
  self._api = api
81
81
  self._file_pusher = file_pusher
82
82
  self._digest = digest
83
- self._manifest = ArtifactManifest.from_manifest_json(None, manifest_json)
83
+ self._manifest = ArtifactManifest.from_manifest_json(manifest_json)
84
84
  self._is_user_created = is_user_created
85
85
  self._server_artifact = None
86
86
 
@@ -112,8 +112,7 @@ class DataStore:
112
112
  return offset
113
113
 
114
114
  def in_last_block(self):
115
- """When reading, we want to know if we're in the last block to
116
- handle in progress writes"""
115
+ """Determine if we're in the last block to handle in-progress writes."""
117
116
  return self._index > self._size_bytes - LEVELDBLOG_DATA_LEN
118
117
 
119
118
  def scan_record(self):
@@ -260,7 +259,7 @@ class DataStore:
260
259
  # write middles (if any)
261
260
  while data_left > LEVELDBLOG_DATA_LEN:
262
261
  self._write_record(
263
- s[data_used : data_used + LEVELDBLOG_DATA_LEN], # noqa: E203
262
+ s[data_used : data_used + LEVELDBLOG_DATA_LEN],
264
263
  LEVELDBLOG_MIDDLE,
265
264
  )
266
265
  data_used += LEVELDBLOG_DATA_LEN
@@ -27,10 +27,11 @@ logger = logging.getLogger(__name__)
27
27
 
28
28
  class FilePusher:
29
29
  """Parallel file upload class.
30
+
30
31
  This manages uploading multiple files in parallel. It will restart a given file's
31
- upload job if it receives a notification that that file has been modified.
32
- The finish() method will block until all events have been processed and all
33
- uploads are complete.
32
+ upload job if it receives a notification that that file has been modified. The
33
+ finish() method will block until all events have been processed and all uploads are
34
+ complete.
34
35
  """
35
36
 
36
37
  MAX_UPLOAD_JOBS = 64
@@ -117,6 +118,7 @@ class FilePusher:
117
118
  copy: bool = True,
118
119
  ):
119
120
  """Tell the file pusher that a file's changed and should be uploaded.
121
+
120
122
  Arguments:
121
123
  save_name: string logical location of the file relative to the run
122
124
  directory.
@@ -103,8 +103,9 @@ class SummaryFilePolicy(DefaultFilePolicy):
103
103
 
104
104
 
105
105
  class StreamCRState:
106
- """There are two streams: stdout and stderr.
107
- We create two instances for each stream.
106
+ r"""Stream state that tracks carriage returns.
107
+
108
+ There are two streams: stdout and stderr. We create two instances for each stream.
108
109
  An instance holds state about:
109
110
  found_cr: if a carriage return has been found in this stream.
110
111
  cr: most recent offset (line number) where we found \r.
@@ -124,17 +125,16 @@ class StreamCRState:
124
125
 
125
126
 
126
127
  class CRDedupeFilePolicy(DefaultFilePolicy):
127
- """File stream policy that removes characters that would be erased by
128
- carriage returns.
128
+ r"""File stream policy for removing carriage-return erased characters.
129
129
 
130
- This is what a terminal does. We use it for console output to reduce the
131
- amount of data we need to send over the network (eg. for progress bars),
132
- while preserving the output's appearance in the web app.
130
+ This is what a terminal does. We use it for console output to reduce the amount of
131
+ data we need to send over the network (eg. for progress bars), while preserving the
132
+ output's appearance in the web app.
133
133
 
134
- CR stands for "carriage return", for the character \r. It tells the terminal
135
- to move the cursor back to the start of the current line. Progress bars
136
- (like tqdm) use \r repeatedly to overwrite a line with newer updates.
137
- This gives the illusion of the progress bar filling up in real-time.
134
+ CR stands for "carriage return", for the character \r. It tells the terminal to move
135
+ the cursor back to the start of the current line. Progress bars (like tqdm) use \r
136
+ repeatedly to overwrite a line with newer updates. This gives the illusion of the
137
+ progress bar filling up in real-time.
138
138
  """
139
139
 
140
140
  def __init__(self, start_chunk_id: int = 0) -> None:
@@ -148,7 +148,8 @@ class CRDedupeFilePolicy(DefaultFilePolicy):
148
148
 
149
149
  @staticmethod
150
150
  def get_consecutive_offsets(console: Dict[int, str]) -> List[List[int]]:
151
- """
151
+ """Compress consecutive line numbers into an interval.
152
+
152
153
  Args:
153
154
  console: Dict[int, str] which maps offsets (line numbers) to lines of text.
154
155
  It represents a mini version of our console dashboard on the UI.
@@ -176,13 +177,14 @@ class CRDedupeFilePolicy(DefaultFilePolicy):
176
177
 
177
178
  @staticmethod
178
179
  def split_chunk(chunk: Chunk) -> Tuple[str, str]:
179
- """
180
+ r"""Split chunks.
181
+
180
182
  Args:
181
183
  chunk: object with two fields: filename (str) & data (str)
182
184
  `chunk.data` is a str containing the lines we want. It usually contains \n or \r or both.
183
185
  `chunk.data` has two possible formats (for the two streams - stdout and stderr):
184
186
  - "2020-08-25T20:38:36.895321 this is my line of text\nsecond line\n"
185
- - "ERROR 2020-08-25T20:38:36.895321 this is my line of text\nsecond line\nthird\n"
187
+ - "ERROR 2020-08-25T20:38:36.895321 this is my line of text\nsecond line\nthird\n".
186
188
 
187
189
  Here's another example with a carriage return \r.
188
190
  - "ERROR 2020-08-25T20:38:36.895321 \r progress bar\n"
@@ -206,7 +208,8 @@ class CRDedupeFilePolicy(DefaultFilePolicy):
206
208
  return prefix, rest
207
209
 
208
210
  def process_chunks(self, chunks: List) -> List["ProcessedChunk"]:
209
- """
211
+ r"""Process chunks.
212
+
210
213
  Args:
211
214
  chunks: List of Chunk objects. See description of chunk above in `split_chunk(...)`.
212
215
 
@@ -268,7 +271,7 @@ class CRDedupeFilePolicy(DefaultFilePolicy):
268
271
 
269
272
  intervals = self.get_consecutive_offsets(console)
270
273
  ret = []
271
- for (a, b) in intervals:
274
+ for a, b in intervals:
272
275
  processed_chunk: "ProcessedChunk" = {
273
276
  "offset": a,
274
277
  "content": [console[i] for i in range(a, b + 1)],
@@ -495,7 +498,7 @@ class FileStreamApi:
495
498
  raise e
496
499
 
497
500
  def _handle_response(self, response: Union[Exception, "requests.Response"]) -> None:
498
- """Logs dropped chunks and updates dynamic settings"""
501
+ """Log dropped chunks and updates dynamic settings."""
499
502
  if isinstance(response, Exception):
500
503
  wandb.termerror(
501
504
  "Dropped streaming file chunk (see wandb/debug-internal.log)"
@@ -575,7 +578,7 @@ class FileStreamApi:
575
578
  self._queue.put(Chunk(filename, data))
576
579
 
577
580
  def push_success(self, artifact_id: str, save_name: str) -> None:
578
- """Notification that a file upload has been successfully completed
581
+ """Notification that a file upload has been successfully completed.
579
582
 
580
583
  Arguments:
581
584
  artifact_id: ID of artifact
@@ -584,7 +587,7 @@ class FileStreamApi:
584
587
  self._queue.put(self.PushSuccess(artifact_id, save_name))
585
588
 
586
589
  def finish(self, exitcode: int) -> None:
587
- """Cleans up.
590
+ """Clean up.
588
591
 
589
592
  Anything pushed after finish will be dropped.
590
593
 
@@ -413,7 +413,7 @@ class HandleManager:
413
413
  self._step += 1
414
414
 
415
415
  def _history_define_metric(self, hkey: str) -> Optional[MetricRecord]:
416
- """check for hkey match in glob metrics, return defined metric."""
416
+ """Check for hkey match in glob metrics and return the defined metric."""
417
417
  # Dont define metric for internal metrics
418
418
  if hkey.startswith("_"):
419
419
  return None
@@ -478,7 +478,6 @@ class HandleManager:
478
478
  history: HistoryRecord,
479
479
  history_dict: Dict[str, Any],
480
480
  ) -> None:
481
-
482
481
  # if syncing an old run, we can skip this logic
483
482
  if history_dict.get("_step") is None:
484
483
  self._history_assign_step(history, history_dict)
@@ -825,8 +824,10 @@ class HandleManager:
825
824
  self._dispatch_record(record, always_send=True)
826
825
 
827
826
  def handle_request_keepalive(self, record: Record) -> None:
828
- """keepalive is a noop, we just want to verify transport is alive."""
829
- pass
827
+ """Handle a keepalive request.
828
+
829
+ Keepalive is a noop, we just want to verify transport is alive.
830
+ """
830
831
 
831
832
  def handle_request_run_status(self, record: Record) -> None:
832
833
  self._dispatch_record(record, always_send=True)
@@ -177,7 +177,7 @@ def wandb_internal(
177
177
  traceback.print_exception(*exc_info)
178
178
  sentry_exc(exc_info, delay=True)
179
179
  wandb.termerror("Internal wandb error: file data was not synced")
180
- if settings.get("_require_service"):
180
+ if not settings.get("_disable_service"):
181
181
  # TODO: We can make this more graceful by returning an error to streams.py
182
182
  # and potentially just fail the one stream.
183
183
  os._exit(-1)