wandb 0.18.5__py3-none-win32.whl → 0.18.7__py3-none-win32.whl
Sign up to get free protection for your applications and to get access to all the features.
- wandb/__init__.py +2 -2
- wandb/__init__.pyi +22 -20
- wandb/agents/pyagent.py +1 -1
- wandb/apis/importers/wandb.py +1 -1
- wandb/apis/normalize.py +2 -18
- wandb/apis/public/api.py +126 -62
- wandb/apis/public/artifacts.py +8 -3
- wandb/apis/public/files.py +17 -2
- wandb/apis/public/jobs.py +2 -2
- wandb/apis/public/query_generator.py +1 -1
- wandb/apis/public/runs.py +8 -8
- wandb/apis/public/teams.py +3 -3
- wandb/apis/public/users.py +1 -1
- wandb/apis/public/utils.py +68 -0
- wandb/bin/gpu_stats.exe +0 -0
- wandb/bin/wandb-core +0 -0
- wandb/cli/cli.py +12 -3
- wandb/data_types.py +1 -1
- wandb/docker/__init__.py +2 -1
- wandb/docker/auth.py +2 -3
- wandb/errors/links.py +73 -0
- wandb/errors/term.py +7 -6
- wandb/filesync/step_prepare.py +1 -1
- wandb/filesync/upload_job.py +1 -1
- wandb/integration/catboost/catboost.py +2 -2
- wandb/integration/diffusers/pipeline_resolver.py +1 -1
- wandb/integration/diffusers/resolvers/multimodal.py +6 -6
- wandb/integration/diffusers/resolvers/utils.py +1 -1
- wandb/integration/fastai/__init__.py +3 -2
- wandb/integration/keras/callbacks/metrics_logger.py +1 -1
- wandb/integration/keras/callbacks/model_checkpoint.py +1 -1
- wandb/integration/keras/keras.py +1 -1
- wandb/integration/kfp/kfp_patch.py +1 -1
- wandb/integration/lightgbm/__init__.py +2 -2
- wandb/integration/magic.py +2 -2
- wandb/integration/metaflow/metaflow.py +1 -1
- wandb/integration/sacred/__init__.py +1 -1
- wandb/integration/sagemaker/auth.py +1 -1
- wandb/integration/sklearn/plot/classifier.py +7 -7
- wandb/integration/sklearn/plot/clusterer.py +3 -3
- wandb/integration/sklearn/plot/regressor.py +3 -3
- wandb/integration/sklearn/plot/shared.py +2 -2
- wandb/integration/tensorboard/log.py +2 -2
- wandb/integration/ultralytics/callback.py +2 -2
- wandb/integration/xgboost/xgboost.py +1 -1
- wandb/jupyter.py +0 -1
- wandb/plot/__init__.py +17 -8
- wandb/plot/bar.py +53 -27
- wandb/plot/confusion_matrix.py +151 -70
- wandb/plot/custom_chart.py +124 -0
- wandb/plot/histogram.py +46 -20
- wandb/plot/line.py +57 -26
- wandb/plot/line_series.py +148 -60
- wandb/plot/pr_curve.py +89 -44
- wandb/plot/roc_curve.py +82 -37
- wandb/plot/scatter.py +53 -20
- wandb/plot/viz.py +20 -102
- wandb/proto/v3/wandb_settings_pb2.py +2 -2
- wandb/proto/v3/wandb_telemetry_pb2.py +4 -4
- wandb/proto/v4/wandb_settings_pb2.py +2 -2
- wandb/proto/v4/wandb_telemetry_pb2.py +4 -4
- wandb/proto/v5/wandb_settings_pb2.py +2 -2
- wandb/proto/v5/wandb_telemetry_pb2.py +4 -4
- wandb/proto/wandb_deprecated.py +2 -0
- wandb/sdk/artifacts/artifact.py +281 -329
- wandb/sdk/artifacts/artifact_manifest.py +10 -9
- wandb/sdk/artifacts/artifact_manifest_entry.py +1 -1
- wandb/sdk/artifacts/storage_handlers/azure_handler.py +9 -4
- wandb/sdk/artifacts/storage_handlers/gcs_handler.py +1 -3
- wandb/sdk/artifacts/storage_handlers/s3_handler.py +1 -1
- wandb/sdk/artifacts/storage_handlers/wb_artifact_handler.py +2 -2
- wandb/sdk/artifacts/storage_handlers/wb_local_artifact_handler.py +1 -1
- wandb/sdk/backend/backend.py +0 -1
- wandb/sdk/data_types/audio.py +1 -1
- wandb/sdk/data_types/base_types/media.py +66 -5
- wandb/sdk/data_types/base_types/wb_value.py +20 -10
- wandb/sdk/data_types/bokeh.py +1 -1
- wandb/sdk/data_types/helper_types/bounding_boxes_2d.py +1 -1
- wandb/sdk/data_types/helper_types/image_mask.py +2 -2
- wandb/sdk/data_types/histogram.py +1 -1
- wandb/sdk/data_types/html.py +1 -1
- wandb/sdk/data_types/image.py +1 -1
- wandb/sdk/data_types/molecule.py +3 -3
- wandb/sdk/data_types/object_3d.py +4 -4
- wandb/sdk/data_types/plotly.py +1 -1
- wandb/sdk/data_types/saved_model.py +0 -1
- wandb/sdk/data_types/table.py +7 -7
- wandb/sdk/data_types/trace_tree.py +1 -1
- wandb/sdk/data_types/video.py +4 -3
- wandb/sdk/interface/interface_queue.py +0 -6
- wandb/sdk/interface/router.py +1 -4
- wandb/sdk/interface/router_queue.py +0 -3
- wandb/sdk/interface/router_relay.py +0 -2
- wandb/sdk/internal/datastore.py +1 -1
- wandb/sdk/internal/file_pusher.py +1 -1
- wandb/sdk/internal/file_stream.py +4 -4
- wandb/sdk/internal/handler.py +3 -4
- wandb/sdk/internal/internal.py +1 -15
- wandb/sdk/internal/internal_api.py +178 -63
- wandb/sdk/internal/internal_util.py +0 -3
- wandb/sdk/internal/job_builder.py +4 -3
- wandb/sdk/internal/sender.py +0 -2
- wandb/sdk/internal/system/assets/__init__.py +0 -2
- wandb/sdk/internal/tb_watcher.py +11 -10
- wandb/sdk/internal/writer.py +1 -3
- wandb/sdk/launch/__init__.py +2 -1
- wandb/sdk/launch/_launch.py +4 -3
- wandb/sdk/launch/_launch_add.py +2 -2
- wandb/sdk/launch/builder/kaniko_builder.py +0 -1
- wandb/sdk/launch/create_job.py +1 -0
- wandb/sdk/launch/environment/local_environment.py +0 -1
- wandb/sdk/launch/errors.py +0 -6
- wandb/sdk/launch/registry/local_registry.py +0 -2
- wandb/sdk/launch/runner/abstract.py +0 -5
- wandb/sdk/launch/sweeps/__init__.py +0 -2
- wandb/sdk/launch/sweeps/scheduler.py +0 -2
- wandb/sdk/launch/sweeps/scheduler_sweep.py +0 -1
- wandb/sdk/lib/_settings_toposort_generated.py +1 -0
- wandb/sdk/lib/apikey.py +3 -3
- wandb/sdk/lib/file_stream_utils.py +1 -1
- wandb/sdk/lib/filesystem.py +1 -1
- wandb/sdk/lib/ipython.py +16 -9
- wandb/sdk/lib/mailbox.py +0 -4
- wandb/sdk/lib/printer.py +44 -8
- wandb/sdk/lib/retry.py +1 -1
- wandb/sdk/lib/sock_client.py +0 -5
- wandb/sdk/service/server.py +2 -11
- wandb/sdk/service/server_sock.py +0 -2
- wandb/sdk/service/service.py +3 -3
- wandb/sdk/service/streams.py +2 -4
- wandb/sdk/wandb_init.py +20 -20
- wandb/sdk/wandb_login.py +1 -1
- wandb/sdk/wandb_require.py +1 -4
- wandb/sdk/wandb_run.py +97 -115
- wandb/sdk/wandb_settings.py +23 -6
- wandb/sdk/wandb_setup.py +1 -5
- wandb/sdk/wandb_sync.py +2 -1
- wandb/util.py +49 -21
- wandb/wandb_agent.py +3 -3
- wandb/wandb_controller.py +2 -2
- {wandb-0.18.5.dist-info → wandb-0.18.7.dist-info}/METADATA +1 -1
- {wandb-0.18.5.dist-info → wandb-0.18.7.dist-info}/RECORD +145 -147
- wandb/sdk/internal/system/assets/gpu_apple.py +0 -177
- wandb/sdk/lib/_wburls_generate.py +0 -25
- wandb/sdk/lib/_wburls_generated.py +0 -22
- wandb/sdk/lib/tracelog.py +0 -255
- wandb/sdk/lib/wburls.py +0 -46
- {wandb-0.18.5.dist-info → wandb-0.18.7.dist-info}/WHEEL +0 -0
- {wandb-0.18.5.dist-info → wandb-0.18.7.dist-info}/entry_points.txt +0 -0
- {wandb-0.18.5.dist-info → wandb-0.18.7.dist-info}/licenses/LICENSE +0 -0
@@ -48,18 +48,19 @@ class ArtifactManifest:
|
|
48
48
|
def digest(self) -> HexMD5:
|
49
49
|
raise NotImplementedError
|
50
50
|
|
51
|
-
def add_entry(self, entry: ArtifactManifestEntry) -> None:
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
self.entries[
|
51
|
+
def add_entry(self, entry: ArtifactManifestEntry, overwrite: bool = False) -> None:
|
52
|
+
path = entry.path
|
53
|
+
if not overwrite:
|
54
|
+
prev_entry = self.entries.get(path)
|
55
|
+
if prev_entry and (entry.digest != prev_entry.digest):
|
56
|
+
raise ValueError(f"Cannot add the same path twice: {path!r}")
|
57
|
+
self.entries[path] = entry
|
58
58
|
|
59
59
|
def remove_entry(self, entry: ArtifactManifestEntry) -> None:
|
60
|
-
|
60
|
+
try:
|
61
|
+
del self.entries[entry.path]
|
62
|
+
except LookupError:
|
61
63
|
raise FileNotFoundError(f"Cannot remove missing entry: '{entry.path}'")
|
62
|
-
del self.entries[entry.path]
|
63
64
|
|
64
65
|
def get_entry_by_path(self, path: str) -> ArtifactManifestEntry | None:
|
65
66
|
return self.entries.get(path)
|
@@ -133,7 +133,7 @@ class ArtifactManifestEntry:
|
|
133
133
|
) -> FilePathStr:
|
134
134
|
"""Download this artifact entry to the specified root path.
|
135
135
|
|
136
|
-
|
136
|
+
Args:
|
137
137
|
root: (str, optional) The root path in which to download this
|
138
138
|
artifact entry. Defaults to the artifact's root.
|
139
139
|
|
@@ -28,6 +28,9 @@ class AzureHandler(StorageHandler):
|
|
28
28
|
".blob.core.windows.net"
|
29
29
|
)
|
30
30
|
|
31
|
+
def __init__(self, scheme: str | None = None) -> None:
|
32
|
+
self._cache = get_artifact_file_cache()
|
33
|
+
|
31
34
|
def load_path(
|
32
35
|
self,
|
33
36
|
manifest_entry: ArtifactManifestEntry,
|
@@ -37,7 +40,7 @@ class AzureHandler(StorageHandler):
|
|
37
40
|
if not local:
|
38
41
|
return manifest_entry.ref
|
39
42
|
|
40
|
-
path, hit, cache_open =
|
43
|
+
path, hit, cache_open = self._cache.check_etag_obj_path(
|
41
44
|
URIStr(manifest_entry.ref),
|
42
45
|
ETag(manifest_entry.digest),
|
43
46
|
manifest_entry.size or 0,
|
@@ -136,10 +139,11 @@ class AzureHandler(StorageHandler):
|
|
136
139
|
name_starts_with=f"{blob_name}/"
|
137
140
|
):
|
138
141
|
if len(entries) >= max_objects:
|
139
|
-
|
140
|
-
f"
|
141
|
-
f"
|
142
|
+
wandb.termwarn(
|
143
|
+
f"Found more than {max_objects} objects under path, limiting upload "
|
144
|
+
f"to {max_objects} objects. Increase max_objects to upload more"
|
142
145
|
)
|
146
|
+
break
|
143
147
|
if not self._is_directory_stub(blob_properties):
|
144
148
|
suffix = PurePosixPath(blob_properties.name).relative_to(blob_name)
|
145
149
|
entries.append(
|
@@ -151,6 +155,7 @@ class AzureHandler(StorageHandler):
|
|
151
155
|
),
|
152
156
|
)
|
153
157
|
)
|
158
|
+
|
154
159
|
return entries
|
155
160
|
|
156
161
|
def _get_module(self, name: str) -> ModuleType:
|
@@ -24,8 +24,6 @@ if TYPE_CHECKING:
|
|
24
24
|
class _GCSIsADirectoryError(Exception):
|
25
25
|
"""Raised when we try to download a GCS folder."""
|
26
26
|
|
27
|
-
pass
|
28
|
-
|
29
27
|
|
30
28
|
class GCSHandler(StorageHandler):
|
31
29
|
_client: gcs_module.client.Client | None
|
@@ -169,7 +167,7 @@ class GCSHandler(StorageHandler):
|
|
169
167
|
) -> ArtifactManifestEntry:
|
170
168
|
"""Create an ArtifactManifestEntry from a GCS object.
|
171
169
|
|
172
|
-
|
170
|
+
Args:
|
173
171
|
obj: The GCS object
|
174
172
|
path: The GCS-style path (e.g.: "gs://bucket/file.txt")
|
175
173
|
name: The user assigned name, or None if not specified
|
@@ -243,7 +243,7 @@ class S3Handler(StorageHandler):
|
|
243
243
|
) -> ArtifactManifestEntry:
|
244
244
|
"""Create an ArtifactManifestEntry from an S3 object.
|
245
245
|
|
246
|
-
|
246
|
+
Args:
|
247
247
|
obj: The S3 object
|
248
248
|
path: The S3-style path (e.g.: "s3://bucket/file.txt")
|
249
249
|
name: The user assigned name, or None if not specified
|
@@ -49,7 +49,7 @@ class WBArtifactHandler(StorageHandler):
|
|
49
49
|
|
50
50
|
Download the referenced artifact; create and return a new symlink to the caller.
|
51
51
|
|
52
|
-
|
52
|
+
Args:
|
53
53
|
manifest_entry (ArtifactManifestEntry): The index entry to load
|
54
54
|
|
55
55
|
Returns:
|
@@ -89,7 +89,7 @@ class WBArtifactHandler(StorageHandler):
|
|
89
89
|
|
90
90
|
Recursively resolves the reference until the result is a concrete asset.
|
91
91
|
|
92
|
-
|
92
|
+
Args:
|
93
93
|
artifact: The artifact doing the storing path (str): The path to store name
|
94
94
|
(str): If specified, the logical name that should map to `path`
|
95
95
|
|
@@ -46,7 +46,7 @@ class WBLocalArtifactHandler(StorageHandler):
|
|
46
46
|
) -> Sequence[ArtifactManifestEntry]:
|
47
47
|
"""Store the file or directory at the given path within the specified artifact.
|
48
48
|
|
49
|
-
|
49
|
+
Args:
|
50
50
|
artifact: The artifact doing the storing
|
51
51
|
path (str): The path to store
|
52
52
|
name (str): If specified, the logical name that should map to `path`
|
wandb/sdk/backend/backend.py
CHANGED
wandb/sdk/data_types/audio.py
CHANGED
@@ -13,7 +13,7 @@ from .base_types.media import BatchableMedia
|
|
13
13
|
class Audio(BatchableMedia):
|
14
14
|
"""Wandb class for audio clips.
|
15
15
|
|
16
|
-
|
16
|
+
Args:
|
17
17
|
data_or_path: (string or numpy array) A path to an audio file
|
18
18
|
or a numpy array of audio data.
|
19
19
|
sample_rate: (int) Sample rate, required when passing in raw
|
@@ -24,9 +24,75 @@ if TYPE_CHECKING: # pragma: no cover
|
|
24
24
|
SYS_PLATFORM = platform.system()
|
25
25
|
|
26
26
|
|
27
|
+
def check_windows_valid_filename(path: Union[int, str]) -> bool:
|
28
|
+
r"""Verify that the given path does not contain any invalid characters for a Windows filename.
|
29
|
+
|
30
|
+
Windows filenames cannot contain the following characters:
|
31
|
+
< > : " \ / | ? *
|
32
|
+
|
33
|
+
For more details, refer to the official documentation:
|
34
|
+
https://learn.microsoft.com/en-us/windows/win32/fileio/naming-a-file#naming-conventions
|
35
|
+
|
36
|
+
Args:
|
37
|
+
path: The file path to check, which can be either an integer or a string.
|
38
|
+
|
39
|
+
Returns:
|
40
|
+
bool: True if the path does not contain any invalid characters, False otherwise.
|
41
|
+
"""
|
42
|
+
return not bool(re.search(r'[<>:"\\?*]', path)) # type: ignore
|
43
|
+
|
44
|
+
|
27
45
|
def _wb_filename(
|
28
46
|
key: Union[str, int], step: Union[str, int], id: Union[str, int], extension: str
|
29
47
|
) -> str:
|
48
|
+
r"""Generates a safe filename/path for storing media files, using the provided key, step, and id.
|
49
|
+
|
50
|
+
The filename is made safe by:
|
51
|
+
1. Removing any leading slashes to prevent writing to absolute paths
|
52
|
+
2. Replacing '.' and '..' with underscores to prevent directory traversal attacks
|
53
|
+
|
54
|
+
If the key contains slashes (e.g. 'images/cats/fluffy.jpg'), subdirectories will be created:
|
55
|
+
media/
|
56
|
+
images/
|
57
|
+
cats/
|
58
|
+
fluffy.jpg_step_id.ext
|
59
|
+
|
60
|
+
Args:
|
61
|
+
key: Name/path for the media file
|
62
|
+
step: Training step number
|
63
|
+
id: Unique identifier
|
64
|
+
extension: File extension (e.g. '.jpg', '.mp3')
|
65
|
+
|
66
|
+
Returns:
|
67
|
+
A sanitized filename string in the format: key_step_id.extension
|
68
|
+
|
69
|
+
Raises:
|
70
|
+
ValueError: If running on Windows and the key contains invalid filename characters
|
71
|
+
(\\, :, *, ?, ", <, >, |)
|
72
|
+
"""
|
73
|
+
if SYS_PLATFORM == "Windows" and not check_windows_valid_filename(key):
|
74
|
+
raise ValueError(
|
75
|
+
f'Media {key} is invalid. Please remove invalid filename characters (\\, :, *, ?, ", <, >, |)'
|
76
|
+
)
|
77
|
+
|
78
|
+
# On Windows, convert forward slashes to backslashes.
|
79
|
+
# This ensures that the key is a valid filename on Windows.
|
80
|
+
if SYS_PLATFORM == "Windows":
|
81
|
+
key = str(key).replace("/", os.sep)
|
82
|
+
|
83
|
+
# Avoid writing to absolute paths by striping any leading slashes.
|
84
|
+
# The key has already been validated for windows operating systems in util.check_windows_valid_filename
|
85
|
+
# This ensures the key does not contain invalid characters for windows, such as '\' or ':'.
|
86
|
+
# So we can check only for '/' in the key.
|
87
|
+
key = str(key).lstrip(os.sep)
|
88
|
+
|
89
|
+
# Avoid directory traversal by replacing dots with underscores.
|
90
|
+
keys = key.split(os.sep)
|
91
|
+
keys = [k.replace(".", "_") if k in (os.curdir, os.pardir) else k for k in keys]
|
92
|
+
|
93
|
+
# Recombine the key into a relative path.
|
94
|
+
key = os.sep.join(keys)
|
95
|
+
|
30
96
|
return f"{str(key)}_{str(step)}_{str(id)}{extension}"
|
31
97
|
|
32
98
|
|
@@ -100,11 +166,6 @@ class Media(WBValue):
|
|
100
166
|
"""
|
101
167
|
assert self.file_is_set(), "bind_to_run called before _set_file"
|
102
168
|
|
103
|
-
if SYS_PLATFORM == "Windows" and not util.check_windows_valid_filename(key):
|
104
|
-
raise ValueError(
|
105
|
-
f"Media {key} is invalid. Please remove invalid filename characters"
|
106
|
-
)
|
107
|
-
|
108
169
|
# The following two assertions are guaranteed to pass
|
109
170
|
# by definition file_is_set, but are needed for
|
110
171
|
# mypy to understand that these are strings below.
|
@@ -1,5 +1,6 @@
|
|
1
1
|
from typing import TYPE_CHECKING, Any, ClassVar, Dict, List, Optional, Type, Union
|
2
2
|
|
3
|
+
import wandb
|
3
4
|
from wandb import util
|
4
5
|
|
5
6
|
if TYPE_CHECKING: # pragma: no cover
|
@@ -13,16 +14,25 @@ if TYPE_CHECKING: # pragma: no cover
|
|
13
14
|
def _server_accepts_client_ids() -> bool:
|
14
15
|
from wandb.util import parse_version
|
15
16
|
|
16
|
-
#
|
17
|
-
#
|
18
|
-
#
|
19
|
-
#
|
20
|
-
#
|
21
|
-
#
|
22
|
-
#
|
23
|
-
#
|
24
|
-
#
|
25
|
-
|
17
|
+
# There are versions of W&B Server that cannot accept client IDs. Those versions of
|
18
|
+
# the backend have a max_cli_version of less than "0.11.0." If the backend cannot
|
19
|
+
# accept client IDs, manifests and artifact data would never be resolvable and lead
|
20
|
+
# to failed uploads. Our position in 2021/06/29 was to never lose data - and instead take the
|
21
|
+
# tradeoff in the UI. The results in tables not displaying media correctly, but
|
22
|
+
# the table can still be accessed via the .artifact op.
|
23
|
+
#
|
24
|
+
# The latest SDK version that is < "0.11.0" was released on 2021/06/29.
|
25
|
+
# AS OF NOW, 2024/11/06, we assume that all customer's server deployments accept
|
26
|
+
# client IDs.
|
27
|
+
#
|
28
|
+
# If there are any users with issues on an older backend, customers can disable the
|
29
|
+
# setting `allow_offline_artifacts` to revert the SDK's behavior back to not
|
30
|
+
# using client IDs in offline mode.
|
31
|
+
if (
|
32
|
+
util._is_offline()
|
33
|
+
and wandb.run
|
34
|
+
and not wandb.run.settings.allow_offline_artifacts
|
35
|
+
):
|
26
36
|
return False
|
27
37
|
|
28
38
|
# If the script is online, request the max_cli_version and ensure the server
|
wandb/sdk/data_types/bokeh.py
CHANGED
@@ -16,7 +16,7 @@ if TYPE_CHECKING: # pragma: no cover
|
|
16
16
|
class BoundingBoxes2D(JSONMetadata):
|
17
17
|
"""Format images with 2D bounding box overlays for logging to W&B.
|
18
18
|
|
19
|
-
|
19
|
+
Args:
|
20
20
|
val: (dictionary) A dictionary of the following form:
|
21
21
|
box_data: (list of dictionaries) One dictionary for each bounding box, containing:
|
22
22
|
position: (dictionary) the position and size of the bounding box, in one of two formats
|
@@ -18,7 +18,7 @@ if TYPE_CHECKING: # pragma: no cover
|
|
18
18
|
class ImageMask(Media):
|
19
19
|
"""Format image masks or overlays for logging to W&B.
|
20
20
|
|
21
|
-
|
21
|
+
Args:
|
22
22
|
val: (dictionary)
|
23
23
|
One of these two keys to represent the image:
|
24
24
|
mask_data : (2D numpy array) The mask containing an integer class label
|
@@ -117,7 +117,7 @@ class ImageMask(Media):
|
|
117
117
|
def __init__(self, val: dict, key: str) -> None:
|
118
118
|
"""Initialize an ImageMask object.
|
119
119
|
|
120
|
-
|
120
|
+
Args:
|
121
121
|
val: (dictionary) One of these two keys to represent the image:
|
122
122
|
mask_data : (2D numpy array) The mask containing an integer class label
|
123
123
|
for each pixel in the image
|
@@ -33,7 +33,7 @@ class Histogram(WBValue):
|
|
33
33
|
wandb.Histogram(np_histogram=hist)
|
34
34
|
```
|
35
35
|
|
36
|
-
|
36
|
+
Args:
|
37
37
|
sequence: (array_like) input data for histogram
|
38
38
|
np_histogram: (numpy histogram) alternative input of a precomputed histogram
|
39
39
|
num_bins: (int) Number of bins for the histogram. The default number of bins
|
wandb/sdk/data_types/html.py
CHANGED
@@ -18,7 +18,7 @@ if TYPE_CHECKING: # pragma: no cover
|
|
18
18
|
class Html(BatchableMedia):
|
19
19
|
"""Wandb class for arbitrary html.
|
20
20
|
|
21
|
-
|
21
|
+
Args:
|
22
22
|
data: (string or io object) HTML to display in wandb
|
23
23
|
inject: (boolean) Add a stylesheet to the HTML object. If set
|
24
24
|
to False the HTML will pass through unchanged.
|
wandb/sdk/data_types/image.py
CHANGED
@@ -65,7 +65,7 @@ def _server_accepts_artifact_path() -> bool:
|
|
65
65
|
class Image(BatchableMedia):
|
66
66
|
"""Format images for logging to W&B.
|
67
67
|
|
68
|
-
|
68
|
+
Args:
|
69
69
|
data_or_path: (numpy array, string, io) Accepts numpy array of
|
70
70
|
image data, or a PIL image. The class attempts to infer
|
71
71
|
the data format and converts it.
|
wandb/sdk/data_types/molecule.py
CHANGED
@@ -25,7 +25,7 @@ if TYPE_CHECKING: # pragma: no cover
|
|
25
25
|
class Molecule(BatchableMedia):
|
26
26
|
"""Wandb class for 3D Molecular data.
|
27
27
|
|
28
|
-
|
28
|
+
Args:
|
29
29
|
data_or_path: (string, io)
|
30
30
|
Molecule can be initialized from a file name or an io object.
|
31
31
|
caption: (string)
|
@@ -106,7 +106,7 @@ class Molecule(BatchableMedia):
|
|
106
106
|
) -> "Molecule":
|
107
107
|
"""Convert RDKit-supported file/object types to wandb.Molecule.
|
108
108
|
|
109
|
-
|
109
|
+
Args:
|
110
110
|
data_or_path: (string, rdkit.Chem.rdchem.Mol)
|
111
111
|
Molecule can be initialized from a file name or an rdkit.Chem.rdchem.Mol object.
|
112
112
|
caption: (string)
|
@@ -173,7 +173,7 @@ class Molecule(BatchableMedia):
|
|
173
173
|
) -> "Molecule":
|
174
174
|
"""Convert SMILES string to wandb.Molecule.
|
175
175
|
|
176
|
-
|
176
|
+
Args:
|
177
177
|
data: (string)
|
178
178
|
SMILES string.
|
179
179
|
caption: (string)
|
@@ -190,7 +190,7 @@ def box3d(
|
|
190
190
|
class Object3D(BatchableMedia):
|
191
191
|
"""Wandb class for 3D point clouds.
|
192
192
|
|
193
|
-
|
193
|
+
Args:
|
194
194
|
data_or_path: (numpy array, string, io)
|
195
195
|
Object3D can be initialized from a file or a numpy array.
|
196
196
|
|
@@ -341,7 +341,7 @@ class Object3D(BatchableMedia):
|
|
341
341
|
) -> "Object3D":
|
342
342
|
"""Initializes Object3D from a file or stream.
|
343
343
|
|
344
|
-
|
344
|
+
Args:
|
345
345
|
data_or_path (Union["TextIO", str]): A path to a file or a `TextIO` stream.
|
346
346
|
file_type (str): Specifies the data format passed to `data_or_path`. Required when `data_or_path` is a
|
347
347
|
`TextIO` stream. This parameter is ignored if a file path is provided. The type is taken from the file extension.
|
@@ -356,7 +356,7 @@ class Object3D(BatchableMedia):
|
|
356
356
|
def from_numpy(cls, data: "np.ndarray") -> "Object3D":
|
357
357
|
"""Initializes Object3D from a numpy array.
|
358
358
|
|
359
|
-
|
359
|
+
Args:
|
360
360
|
data (numpy array): Each entry in the array will
|
361
361
|
represent one point in the point cloud.
|
362
362
|
|
@@ -394,7 +394,7 @@ class Object3D(BatchableMedia):
|
|
394
394
|
) -> "Object3D":
|
395
395
|
"""Initializes Object3D from a python object.
|
396
396
|
|
397
|
-
|
397
|
+
Args:
|
398
398
|
points (Sequence["Point"]): The points in the point cloud.
|
399
399
|
boxes (Sequence["Box3D"]): 3D bounding boxes for labeling the point cloud. Boxes
|
400
400
|
are displayed in point cloud visualizations.
|
wandb/sdk/data_types/plotly.py
CHANGED
@@ -232,7 +232,6 @@ class _SavedModel(WBValue, Generic[SavedModelObjType]):
|
|
232
232
|
except Exception as e:
|
233
233
|
if DEBUG_MODE:
|
234
234
|
print(f"{cls}._maybe_init({obj_or_path}) failed: {e}")
|
235
|
-
pass
|
236
235
|
|
237
236
|
for child_cls in cls.__subclasses__():
|
238
237
|
maybe_instance = child_cls._maybe_init(obj_or_path, **kwargs)
|
wandb/sdk/data_types/table.py
CHANGED
@@ -191,7 +191,7 @@ class Table(Media):
|
|
191
191
|
This class is the primary class used to generate the Table Visualizer
|
192
192
|
in the UI: https://docs.wandb.ai/guides/data-vis/tables.
|
193
193
|
|
194
|
-
|
194
|
+
Args:
|
195
195
|
columns: (List[str]) Names of the columns in the table.
|
196
196
|
Defaults to ["Input", "Output", "Expected"].
|
197
197
|
data: (List[List[any]]) 2D row-oriented array of values.
|
@@ -318,7 +318,7 @@ class Table(Media):
|
|
318
318
|
This can be one of the normal python classes, an internal W&B type, or an
|
319
319
|
example object, like an instance of wandb.Image or wandb.Classes.
|
320
320
|
|
321
|
-
|
321
|
+
Args:
|
322
322
|
col_name: (str) - The name of the column to cast.
|
323
323
|
dtype: (class, wandb.wandb_sdk.interface._dtypes.Type, any) - The target dtype.
|
324
324
|
optional: (bool) - If the column should allow Nones.
|
@@ -704,7 +704,7 @@ class Table(Media):
|
|
704
704
|
If the state has been updated since the last update, wraps the data
|
705
705
|
appropriately in the Key classes.
|
706
706
|
|
707
|
-
|
707
|
+
Args:
|
708
708
|
force_last: (bool) Wraps the last column of data even if there
|
709
709
|
are no key updates.
|
710
710
|
"""
|
@@ -748,7 +748,7 @@ class Table(Media):
|
|
748
748
|
def _apply_key_updates(self, only_last=False):
|
749
749
|
"""Appropriately wraps the underlying data in special Key classes.
|
750
750
|
|
751
|
-
|
751
|
+
Args:
|
752
752
|
only_last: only apply the updates to the last row (used for performance when
|
753
753
|
the caller knows that the only new data is the last row and no updates were
|
754
754
|
applied to the column types)
|
@@ -797,7 +797,7 @@ class Table(Media):
|
|
797
797
|
def add_column(self, name, data, optional=False):
|
798
798
|
"""Adds a column of data to the table.
|
799
799
|
|
800
|
-
|
800
|
+
Args:
|
801
801
|
name: (str) - the unique name of the column
|
802
802
|
data: (list | np.array) - a column of homogeneous data
|
803
803
|
optional: (bool) - if null-like values are permitted
|
@@ -838,7 +838,7 @@ class Table(Media):
|
|
838
838
|
def get_column(self, name, convert_to=None):
|
839
839
|
"""Retrieves a column from the table and optionally converts it to a NumPy object.
|
840
840
|
|
841
|
-
|
841
|
+
Args:
|
842
842
|
name: (str) - the name of the column
|
843
843
|
convert_to: (str, optional)
|
844
844
|
- "numpy": will convert the underlying data to numpy object
|
@@ -1015,7 +1015,7 @@ class PartitionedTable(Media):
|
|
1015
1015
|
class JoinedTable(Media):
|
1016
1016
|
"""Join two tables for visualization in the Artifact UI.
|
1017
1017
|
|
1018
|
-
|
1018
|
+
Args:
|
1019
1019
|
table1 (str, wandb.Table, ArtifactManifestEntry):
|
1020
1020
|
the path to a wandb.Table in an artifact, the table object, or ArtifactManifestEntry
|
1021
1021
|
table2 (str, wandb.Table):
|
@@ -80,7 +80,7 @@ class Span:
|
|
80
80
|
class WBTraceTree(Media):
|
81
81
|
"""Media object for trace tree data.
|
82
82
|
|
83
|
-
|
83
|
+
Args:
|
84
84
|
root_span (Span): The root span of the trace tree.
|
85
85
|
model_dict (dict, optional): A dictionary containing the model dump.
|
86
86
|
NOTE: model_dict is a completely-user-defined dict. The UI will render
|
wandb/sdk/data_types/video.py
CHANGED
@@ -49,7 +49,7 @@ def write_gif_with_image_io(
|
|
49
49
|
class Video(BatchableMedia):
|
50
50
|
"""Format a video for logging to W&B.
|
51
51
|
|
52
|
-
|
52
|
+
Args:
|
53
53
|
data_or_path: (numpy array, string, io)
|
54
54
|
Video can be initialized with a path to a file or an io object.
|
55
55
|
The format must be "gif", "mp4", "webm" or "ogg".
|
@@ -103,10 +103,11 @@ class Video(BatchableMedia):
|
|
103
103
|
)
|
104
104
|
|
105
105
|
if isinstance(data_or_path, (BytesIO, str)) and fps:
|
106
|
-
|
106
|
+
msg = (
|
107
107
|
"`fps` argument does not affect the frame rate of the video "
|
108
|
-
|
108
|
+
"when providing a file path or raw bytes."
|
109
109
|
)
|
110
|
+
wandb.termwarn(msg)
|
110
111
|
|
111
112
|
if isinstance(data_or_path, BytesIO):
|
112
113
|
filename = os.path.join(
|
@@ -8,7 +8,6 @@ import logging
|
|
8
8
|
from multiprocessing.process import BaseProcess
|
9
9
|
from typing import TYPE_CHECKING, Optional
|
10
10
|
|
11
|
-
from ..lib import tracelog
|
12
11
|
from ..lib.mailbox import Mailbox
|
13
12
|
from .interface_shared import InterfaceShared
|
14
13
|
from .router_queue import MessageQueueRouter
|
@@ -37,10 +36,6 @@ class InterfaceQueue(InterfaceShared):
|
|
37
36
|
) -> None:
|
38
37
|
self.record_q = record_q
|
39
38
|
self.result_q = result_q
|
40
|
-
if self.record_q:
|
41
|
-
tracelog.annotate_queue(self.record_q, "record_q")
|
42
|
-
if self.result_q:
|
43
|
-
tracelog.annotate_queue(self.result_q, "result_q")
|
44
39
|
super().__init__(process=process, process_check=process_check, mailbox=mailbox)
|
45
40
|
|
46
41
|
def _init_router(self) -> None:
|
@@ -55,5 +50,4 @@ class InterfaceQueue(InterfaceShared):
|
|
55
50
|
if local:
|
56
51
|
record.control.local = local
|
57
52
|
if self.record_q:
|
58
|
-
tracelog.log_message_queue(record, self.record_q)
|
59
53
|
self.record_q.put(record)
|
wandb/sdk/interface/router.py
CHANGED
@@ -10,7 +10,7 @@ import uuid
|
|
10
10
|
from abc import abstractmethod
|
11
11
|
from typing import TYPE_CHECKING, Dict, Optional
|
12
12
|
|
13
|
-
from ..lib import mailbox
|
13
|
+
from ..lib import mailbox
|
14
14
|
from .message_future import MessageFuture
|
15
15
|
|
16
16
|
if TYPE_CHECKING:
|
@@ -25,8 +25,6 @@ logger = logging.getLogger("wandb")
|
|
25
25
|
class MessageRouterClosedError(Exception):
|
26
26
|
"""Router has been closed."""
|
27
27
|
|
28
|
-
pass
|
29
|
-
|
30
28
|
|
31
29
|
class MessageFutureObject(MessageFuture):
|
32
30
|
def __init__(self) -> None:
|
@@ -110,7 +108,6 @@ class MessageRouter:
|
|
110
108
|
# TODO (cvp): saw this in tests, seemed benign enough to ignore, but
|
111
109
|
# could point to other issues.
|
112
110
|
if msg.uuid != "":
|
113
|
-
tracelog.log_message_assert(msg)
|
114
111
|
logger.warning(
|
115
112
|
"No listener found for msg with uuid %s (%s)", msg.uuid, msg
|
116
113
|
)
|
@@ -7,7 +7,6 @@ Router to manage responses from a queue.
|
|
7
7
|
import queue
|
8
8
|
from typing import TYPE_CHECKING, Optional
|
9
9
|
|
10
|
-
from ..lib import tracelog
|
11
10
|
from ..lib.mailbox import Mailbox
|
12
11
|
from .router import MessageRouter
|
13
12
|
|
@@ -36,9 +35,7 @@ class MessageQueueRouter(MessageRouter):
|
|
36
35
|
msg = self._response_queue.get(timeout=1)
|
37
36
|
except queue.Empty:
|
38
37
|
return None
|
39
|
-
tracelog.log_message_dequeue(msg, self._response_queue)
|
40
38
|
return msg
|
41
39
|
|
42
40
|
def _send_message(self, record: "pb.Record") -> None:
|
43
|
-
tracelog.log_message_queue(record, self._request_queue)
|
44
41
|
self._request_queue.put(record)
|
@@ -6,7 +6,6 @@ Router to manage responses from a queue with relay.
|
|
6
6
|
|
7
7
|
from typing import TYPE_CHECKING
|
8
8
|
|
9
|
-
from ..lib import tracelog
|
10
9
|
from ..lib.mailbox import Mailbox
|
11
10
|
from .router_queue import MessageQueueRouter
|
12
11
|
|
@@ -33,7 +32,6 @@ class MessageRelayRouter(MessageQueueRouter):
|
|
33
32
|
|
34
33
|
def _handle_msg_rcv(self, msg: "pb.Result") -> None:
|
35
34
|
if msg.control.relay_id:
|
36
|
-
tracelog.log_message_queue(msg, self._relay_queue)
|
37
35
|
self._relay_queue.put(msg)
|
38
36
|
return
|
39
37
|
super()._handle_msg_rcv(msg)
|
wandb/sdk/internal/datastore.py
CHANGED
@@ -129,7 +129,7 @@ class FilePusher:
|
|
129
129
|
def file_changed(self, save_name: LogicalPath, path: str, copy: bool = True):
|
130
130
|
"""Tell the file pusher that a file's changed and should be uploaded.
|
131
131
|
|
132
|
-
|
132
|
+
Args:
|
133
133
|
save_name: string logical location of the file relative to the run
|
134
134
|
directory.
|
135
135
|
path: actual string path of the file to upload on the filesystem.
|