wandb 0.18.5__py3-none-any.whl → 0.18.6__py3-none-any.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 +21 -19
- wandb/agents/pyagent.py +1 -1
- wandb/apis/importers/wandb.py +1 -1
- wandb/apis/normalize.py +2 -18
- wandb/apis/public/api.py +122 -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 +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/sdk/artifacts/artifact.py +280 -328
- 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/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/router.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 -2
- wandb/sdk/internal/internal.py +1 -1
- wandb/sdk/internal/internal_api.py +178 -63
- wandb/sdk/internal/job_builder.py +4 -3
- wandb/sdk/internal/system/assets/__init__.py +0 -2
- wandb/sdk/internal/tb_watcher.py +11 -10
- 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/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/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 +57 -69
- wandb/sdk/wandb_settings.py +3 -4
- wandb/sdk/wandb_sync.py +2 -1
- wandb/util.py +46 -18
- wandb/wandb_agent.py +3 -3
- wandb/wandb_controller.py +2 -2
- {wandb-0.18.5.dist-info → wandb-0.18.6.dist-info}/METADATA +1 -1
- {wandb-0.18.5.dist-info → wandb-0.18.6.dist-info}/RECORD +124 -125
- 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/wburls.py +0 -46
- {wandb-0.18.5.dist-info → wandb-0.18.6.dist-info}/WHEEL +0 -0
- {wandb-0.18.5.dist-info → wandb-0.18.6.dist-info}/entry_points.txt +0 -0
- {wandb-0.18.5.dist-info → wandb-0.18.6.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.
|
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(
|
wandb/sdk/interface/router.py
CHANGED
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.
|
@@ -575,7 +575,7 @@ class FileStreamApi:
|
|
575
575
|
def push(self, filename: str, data: str) -> None:
|
576
576
|
"""Push a chunk of a file to the streaming endpoint.
|
577
577
|
|
578
|
-
|
578
|
+
Args:
|
579
579
|
filename: Name of file to append to.
|
580
580
|
data: Text to append to the file.
|
581
581
|
"""
|
@@ -584,7 +584,7 @@ class FileStreamApi:
|
|
584
584
|
def push_success(self, artifact_id: str, save_name: str) -> None:
|
585
585
|
"""Notification that a file upload has been successfully completed.
|
586
586
|
|
587
|
-
|
587
|
+
Args:
|
588
588
|
artifact_id: ID of artifact
|
589
589
|
save_name: saved name of the uploaded file
|
590
590
|
"""
|
@@ -595,7 +595,7 @@ class FileStreamApi:
|
|
595
595
|
|
596
596
|
Anything pushed after finish will be dropped.
|
597
597
|
|
598
|
-
|
598
|
+
Args:
|
599
599
|
exitcode: The exitcode of the watched process.
|
600
600
|
"""
|
601
601
|
logger.info("file stream finish called")
|
@@ -620,7 +620,7 @@ def request_with_retry(
|
|
620
620
|
) -> Union["requests.Response", "requests.RequestException"]:
|
621
621
|
"""Perform a requests http call, retrying with exponential backoff.
|
622
622
|
|
623
|
-
|
623
|
+
Args:
|
624
624
|
func: An http-requesting function to call, like requests.post
|
625
625
|
max_retries: Maximum retries before giving up.
|
626
626
|
By default, we retry 30 times in ~2 hours before dropping the chunk
|
wandb/sdk/internal/handler.py
CHANGED
@@ -21,6 +21,7 @@ from typing import (
|
|
21
21
|
cast,
|
22
22
|
)
|
23
23
|
|
24
|
+
from wandb.errors.links import url_registry
|
24
25
|
from wandb.proto.wandb_internal_pb2 import (
|
25
26
|
HistoryRecord,
|
26
27
|
InternalMessages,
|
@@ -37,7 +38,7 @@ from wandb.proto.wandb_internal_pb2 import (
|
|
37
38
|
)
|
38
39
|
|
39
40
|
from ..interface.interface_queue import InterfaceQueue
|
40
|
-
from ..lib import handler_util, proto_util, tracelog
|
41
|
+
from ..lib import handler_util, proto_util, tracelog
|
41
42
|
from . import context, sample, tb_watcher
|
42
43
|
from .settings_static import SettingsStatic
|
43
44
|
from .system.system_monitor import SystemMonitor
|
@@ -578,7 +579,7 @@ class HandleManager:
|
|
578
579
|
if not self._dropped_history:
|
579
580
|
message = (
|
580
581
|
"Step only supports monotonically increasing values, use define_metric to set a custom x "
|
581
|
-
f"axis. For details see: {
|
582
|
+
f"axis. For details see: {url_registry.url('define-metric')}"
|
582
583
|
)
|
583
584
|
self._internal_messages.warning.append(message)
|
584
585
|
self._dropped_history = True
|