wandb 0.18.4__py3-none-any.whl → 0.18.6__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- 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 +183 -64
- 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.4.dist-info → wandb-0.18.6.dist-info}/METADATA +1 -1
- {wandb-0.18.4.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.4.dist-info → wandb-0.18.6.dist-info}/WHEEL +0 -0
- {wandb-0.18.4.dist-info → wandb-0.18.6.dist-info}/entry_points.txt +0 -0
- {wandb-0.18.4.dist-info → wandb-0.18.6.dist-info}/licenses/LICENSE +0 -0
wandb/__init__.py
CHANGED
@@ -10,7 +10,7 @@ For reference documentation, see https://docs.wandb.com/ref/python.
|
|
10
10
|
"""
|
11
11
|
from __future__ import annotations
|
12
12
|
|
13
|
-
__version__ = "0.18.
|
13
|
+
__version__ = "0.18.6"
|
14
14
|
|
15
15
|
|
16
16
|
from wandb.errors import Error
|
@@ -75,7 +75,7 @@ from wandb.data_types import JoinedTable
|
|
75
75
|
|
76
76
|
from wandb.wandb_agent import agent
|
77
77
|
|
78
|
-
from wandb.plot
|
78
|
+
from wandb.plot import visualize
|
79
79
|
from wandb.integration.sagemaker import sagemaker_auth
|
80
80
|
from wandb.sdk.internal import profiler
|
81
81
|
|
wandb/__init__.pyi
CHANGED
@@ -53,6 +53,7 @@ __all__ = (
|
|
53
53
|
"teardown",
|
54
54
|
"watch",
|
55
55
|
"unwatch",
|
56
|
+
"plot",
|
56
57
|
)
|
57
58
|
|
58
59
|
import os
|
@@ -68,6 +69,7 @@ from typing import (
|
|
68
69
|
Union,
|
69
70
|
)
|
70
71
|
|
72
|
+
import wandb.plot as plot
|
71
73
|
from wandb.analytics import Sentry
|
72
74
|
from wandb.apis import InternalApi, PublicApi
|
73
75
|
from wandb.data_types import (
|
@@ -96,9 +98,9 @@ from wandb.wandb_controller import _WandbController
|
|
96
98
|
if TYPE_CHECKING:
|
97
99
|
import torch # type: ignore [import-not-found]
|
98
100
|
|
99
|
-
from wandb.plot
|
101
|
+
from wandb.plot import CustomChart
|
100
102
|
|
101
|
-
__version__: str = "0.18.
|
103
|
+
__version__: str = "0.18.6"
|
102
104
|
|
103
105
|
run: Run | None
|
104
106
|
config: wandb_config.Config
|
@@ -249,7 +251,7 @@ def init(
|
|
249
251
|
For more on using `wandb.init()`, including detailed examples, check out our
|
250
252
|
[guide and FAQs](https://docs.wandb.ai/guides/track/launch).
|
251
253
|
|
252
|
-
|
254
|
+
Args:
|
253
255
|
project: (str, optional) The name of the project where you're sending
|
254
256
|
the new run. If the project is not specified, we will try to infer
|
255
257
|
the project name from git root or the current program file. If we
|
@@ -372,11 +374,11 @@ def init(
|
|
372
374
|
for saving hyperparameters to compare across runs. The ID cannot
|
373
375
|
contain the following special characters: `/\#?%:`.
|
374
376
|
See [our guide to resuming runs](https://docs.wandb.com/guides/runs/resuming).
|
375
|
-
fork_from: (str, optional) A string with the format {run_id}?_step={step} describing
|
377
|
+
fork_from: (str, optional) A string with the format `{run_id}?_step={step}` describing
|
376
378
|
a moment in a previous run to fork a new run from. Creates a new run that picks up
|
377
379
|
logging history from the specified run at the specified moment. The target run must
|
378
380
|
be in the current project. Example: `fork_from="my-run-id?_step=1234"`.
|
379
|
-
resume_from: (str, optional) A string with the format {run_id}?_step={step} describing
|
381
|
+
resume_from: (str, optional) A string with the format `{run_id}?_step={step}` describing
|
380
382
|
a moment in a previous run to resume a run from. This allows users to truncate
|
381
383
|
the history logged to a run at an intermediate step and resume logging from that step.
|
382
384
|
It uses run forking under the hood. The target run must be in the
|
@@ -429,7 +431,7 @@ def finish(exit_code: int | None = None, quiet: bool | None = None) -> None:
|
|
429
431
|
This is used when creating multiple runs in the same process.
|
430
432
|
We automatically call this method when your script exits.
|
431
433
|
|
432
|
-
|
434
|
+
Args:
|
433
435
|
exit_code: Set to something other than 0 to mark a run as failed
|
434
436
|
quiet: Set to true to minimize log output
|
435
437
|
"""
|
@@ -450,7 +452,7 @@ def login(
|
|
450
452
|
verifying them with the W&B server. To verify credentials, pass
|
451
453
|
`verify=True`.
|
452
454
|
|
453
|
-
|
455
|
+
Args:
|
454
456
|
anonymous: (string, optional) Can be "must", "allow", or "never".
|
455
457
|
If set to "must", always log a user in anonymously. If set to
|
456
458
|
"allow", only create an anonymous user if the user
|
@@ -503,7 +505,7 @@ def log(
|
|
503
505
|
[guides to logging](https://docs.wandb.ai/guides/track/log) for examples,
|
504
506
|
from 3D molecular structures and segmentation masks to PR curves and histograms.
|
505
507
|
You can use `wandb.Table` to log structured data. See our
|
506
|
-
[guide to logging tables](https://docs.wandb.ai/guides/
|
508
|
+
[guide to logging tables](https://docs.wandb.ai/guides/tables/tables-walkthrough)
|
507
509
|
for details.
|
508
510
|
|
509
511
|
The W&B UI organizes metrics with a forward slash (`/`) in their name
|
@@ -566,7 +568,7 @@ def log(
|
|
566
568
|
run.log({"accuracy": 0.9}, step=current_step)
|
567
569
|
```
|
568
570
|
|
569
|
-
|
571
|
+
Args:
|
570
572
|
data: A `dict` with `str` keys and values that are serializable
|
571
573
|
Python objects including: `int`, `float` and `string`;
|
572
574
|
any of the `wandb.data_types`; lists, tuples and NumPy arrays
|
@@ -745,7 +747,7 @@ def save(
|
|
745
747
|
Note: when given an absolute path or glob and no `base_path`, one
|
746
748
|
directory level is preserved as in the example above.
|
747
749
|
|
748
|
-
|
750
|
+
Args:
|
749
751
|
glob_str: A relative or absolute path or Unix glob.
|
750
752
|
base_path: A path to use to infer a directory structure; see examples.
|
751
753
|
policy: One of `live`, `now`, or `end`.
|
@@ -830,7 +832,7 @@ def agent(
|
|
830
832
|
is a part of, what function to execute, and (optionally) how
|
831
833
|
many agents to run.
|
832
834
|
|
833
|
-
|
835
|
+
Args:
|
834
836
|
sweep_id: The unique identifier for a sweep. A sweep ID
|
835
837
|
is generated by W&B CLI or Python SDK.
|
836
838
|
function: A function to call instead of the "program"
|
@@ -858,7 +860,7 @@ def define_metric(
|
|
858
860
|
) -> wandb_metric.Metric:
|
859
861
|
"""Customize metrics logged with `wandb.log()`.
|
860
862
|
|
861
|
-
|
863
|
+
Args:
|
862
864
|
name: The name of the metric to customize.
|
863
865
|
step_metric: The name of another metric to serve as the X-axis
|
864
866
|
for this metric in automatically generated charts.
|
@@ -893,7 +895,7 @@ def log_artifact(
|
|
893
895
|
) -> Artifact:
|
894
896
|
"""Declare an artifact as an output of a run.
|
895
897
|
|
896
|
-
|
898
|
+
Args:
|
897
899
|
artifact_or_path: (str or Artifact) A path to the contents of this artifact,
|
898
900
|
can be in the following forms:
|
899
901
|
- `/local/directory`
|
@@ -927,7 +929,7 @@ def use_artifact(
|
|
927
929
|
|
928
930
|
Call `download` or `file` on the returned object to get the contents locally.
|
929
931
|
|
930
|
-
|
932
|
+
Args:
|
931
933
|
artifact_or_name: (str or Artifact) An artifact name.
|
932
934
|
May be prefixed with project/ or entity/project/.
|
933
935
|
If no entity is specified in the name, the Run or API setting's entity is used.
|
@@ -952,7 +954,7 @@ def log_model(
|
|
952
954
|
) -> None:
|
953
955
|
"""Logs a model artifact containing the contents inside the 'path' to a run and marks it as an output to this run.
|
954
956
|
|
955
|
-
|
957
|
+
Args:
|
956
958
|
path: (str) A path to the contents of this model,
|
957
959
|
can be in the following forms:
|
958
960
|
- `/local/directory`
|
@@ -994,7 +996,7 @@ def log_model(
|
|
994
996
|
def use_model(name: str) -> FilePathStr:
|
995
997
|
"""Download the files logged in a model artifact 'name'.
|
996
998
|
|
997
|
-
|
999
|
+
Args:
|
998
1000
|
name: (str) A model artifact name. 'name' must match the name of an existing logged
|
999
1001
|
model artifact.
|
1000
1002
|
May be prefixed with entity/project/. Valid names
|
@@ -1051,7 +1053,7 @@ def link_model(
|
|
1051
1053
|
- Link version of model artifact 'name' to registered model, 'registered_model_name'.
|
1052
1054
|
- Attach aliases from 'aliases' list to the newly linked model artifact version.
|
1053
1055
|
|
1054
|
-
|
1056
|
+
Args:
|
1055
1057
|
path: (str) A path to the contents of this model,
|
1056
1058
|
can be in the following forms:
|
1057
1059
|
- `/local/directory`
|
@@ -1108,11 +1110,11 @@ def plot_table(
|
|
1108
1110
|
data_table: Table,
|
1109
1111
|
fields: dict[str, Any],
|
1110
1112
|
string_fields: dict[str, Any] | None = None,
|
1111
|
-
split_table: bool
|
1113
|
+
split_table: bool = False,
|
1112
1114
|
) -> CustomChart:
|
1113
1115
|
"""Create a custom plot on a table.
|
1114
1116
|
|
1115
|
-
|
1117
|
+
Args:
|
1116
1118
|
vega_spec_name: the name of the spec for the plot
|
1117
1119
|
data_table: a wandb.Table object containing the data to
|
1118
1120
|
be used on the visualization
|
wandb/agents/pyagent.py
CHANGED
@@ -337,7 +337,7 @@ class Agent:
|
|
337
337
|
def pyagent(sweep_id, function, entity=None, project=None, count=None):
|
338
338
|
"""Generic agent entrypoint, used for CLI or jupyter.
|
339
339
|
|
340
|
-
|
340
|
+
Args:
|
341
341
|
sweep_id (dict): Sweep ID generated by CLI or sweep API
|
342
342
|
function (func, optional): A function to call instead of the "program"
|
343
343
|
entity (str, optional): W&B Entity
|
wandb/apis/importers/wandb.py
CHANGED
@@ -573,7 +573,7 @@ class WandbImporter:
|
|
573
573
|
project = coalesce(project, src_art.project)
|
574
574
|
name = src_art.name
|
575
575
|
|
576
|
-
return self.dst_api.
|
576
|
+
return self.dst_api._artifact(f"{entity}/{project}/{name}")
|
577
577
|
|
578
578
|
def _get_run_problems(
|
579
579
|
self, src_run: Run, dst_run: Run, force_retry: bool = False
|
wandb/apis/normalize.py
CHANGED
@@ -3,34 +3,18 @@
|
|
3
3
|
import ast
|
4
4
|
import sys
|
5
5
|
from functools import wraps
|
6
|
-
from typing import Callable,
|
6
|
+
from typing import Callable, TypeVar
|
7
7
|
|
8
8
|
import requests
|
9
9
|
from wandb_gql.client import RetryError
|
10
10
|
|
11
11
|
from wandb import env
|
12
12
|
from wandb.errors import CommError, Error
|
13
|
+
from wandb.util import parse_backend_error_messages
|
13
14
|
|
14
15
|
_F = TypeVar("_F", bound=Callable)
|
15
16
|
|
16
17
|
|
17
|
-
def parse_backend_error_messages(response: requests.Response) -> List[str]:
|
18
|
-
errors = []
|
19
|
-
try:
|
20
|
-
data = response.json()
|
21
|
-
except ValueError:
|
22
|
-
return errors
|
23
|
-
|
24
|
-
if "errors" in data and isinstance(data["errors"], list):
|
25
|
-
for error in data["errors"]:
|
26
|
-
# Our tests and potentially some api endpoints return a string error?
|
27
|
-
if isinstance(error, str):
|
28
|
-
error = {"message": error}
|
29
|
-
if "message" in error:
|
30
|
-
errors.append(error["message"])
|
31
|
-
return errors
|
32
|
-
|
33
|
-
|
34
18
|
def normalize_exceptions(func: _F) -> _F:
|
35
19
|
"""Function decorator for catching common errors and re-raising as wandb.Error."""
|
36
20
|
|