wandb 0.17.0rc2__py3-none-macosx_11_0_arm64.whl → 0.17.1__py3-none-macosx_11_0_arm64.whl

Sign up to get free protection for your applications and to get access to all the features.
Files changed (160) hide show
  1. wandb/__init__.py +1 -2
  2. wandb/apis/importers/internals/internal.py +0 -1
  3. wandb/apis/importers/wandb.py +12 -7
  4. wandb/apis/internal.py +0 -3
  5. wandb/apis/public/api.py +213 -79
  6. wandb/apis/public/artifacts.py +335 -100
  7. wandb/apis/public/files.py +9 -9
  8. wandb/apis/public/jobs.py +16 -4
  9. wandb/apis/public/projects.py +26 -28
  10. wandb/apis/public/query_generator.py +1 -1
  11. wandb/apis/public/runs.py +163 -65
  12. wandb/apis/public/sweeps.py +2 -2
  13. wandb/apis/reports/__init__.py +1 -7
  14. wandb/apis/reports/v1/__init__.py +5 -27
  15. wandb/apis/reports/v2/__init__.py +7 -19
  16. wandb/apis/workspaces/__init__.py +8 -0
  17. wandb/beta/workflows.py +8 -3
  18. wandb/bin/apple_gpu_stats +0 -0
  19. wandb/bin/wandb-core +0 -0
  20. wandb/cli/cli.py +131 -59
  21. wandb/docker/__init__.py +1 -1
  22. wandb/errors/term.py +10 -2
  23. wandb/filesync/step_checksum.py +1 -4
  24. wandb/filesync/step_prepare.py +4 -24
  25. wandb/filesync/step_upload.py +5 -107
  26. wandb/filesync/upload_job.py +0 -76
  27. wandb/integration/gym/__init__.py +35 -15
  28. wandb/integration/openai/fine_tuning.py +21 -3
  29. wandb/integration/prodigy/prodigy.py +1 -1
  30. wandb/jupyter.py +16 -17
  31. wandb/plot/pr_curve.py +2 -1
  32. wandb/plot/roc_curve.py +2 -1
  33. wandb/{plots → plot}/utils.py +13 -25
  34. wandb/proto/v3/wandb_internal_pb2.py +54 -54
  35. wandb/proto/v3/wandb_settings_pb2.py +2 -2
  36. wandb/proto/v3/wandb_telemetry_pb2.py +10 -10
  37. wandb/proto/v4/wandb_internal_pb2.py +54 -54
  38. wandb/proto/v4/wandb_settings_pb2.py +2 -2
  39. wandb/proto/v4/wandb_telemetry_pb2.py +10 -10
  40. wandb/proto/v5/wandb_base_pb2.py +30 -0
  41. wandb/proto/v5/wandb_internal_pb2.py +355 -0
  42. wandb/proto/v5/wandb_server_pb2.py +63 -0
  43. wandb/proto/v5/wandb_settings_pb2.py +45 -0
  44. wandb/proto/v5/wandb_telemetry_pb2.py +41 -0
  45. wandb/proto/wandb_base_pb2.py +2 -0
  46. wandb/proto/wandb_deprecated.py +9 -1
  47. wandb/proto/wandb_generate_deprecated.py +34 -0
  48. wandb/proto/{wandb_internal_codegen.py → wandb_generate_proto.py} +1 -35
  49. wandb/proto/wandb_internal_pb2.py +2 -0
  50. wandb/proto/wandb_server_pb2.py +2 -0
  51. wandb/proto/wandb_settings_pb2.py +2 -0
  52. wandb/proto/wandb_telemetry_pb2.py +2 -0
  53. wandb/sdk/artifacts/artifact.py +68 -22
  54. wandb/sdk/artifacts/artifact_manifest.py +1 -1
  55. wandb/sdk/artifacts/artifact_manifest_entry.py +6 -3
  56. wandb/sdk/artifacts/artifact_manifests/artifact_manifest_v1.py +1 -1
  57. wandb/sdk/artifacts/artifact_saver.py +1 -10
  58. wandb/sdk/artifacts/storage_handlers/local_file_handler.py +6 -2
  59. wandb/sdk/artifacts/storage_handlers/multi_handler.py +1 -1
  60. wandb/sdk/artifacts/storage_handlers/tracking_handler.py +6 -4
  61. wandb/sdk/artifacts/storage_policies/wandb_storage_policy.py +2 -42
  62. wandb/sdk/artifacts/storage_policy.py +1 -12
  63. wandb/sdk/data_types/image.py +1 -1
  64. wandb/sdk/data_types/video.py +4 -2
  65. wandb/sdk/interface/interface.py +13 -0
  66. wandb/sdk/interface/interface_shared.py +1 -1
  67. wandb/sdk/internal/file_pusher.py +2 -5
  68. wandb/sdk/internal/file_stream.py +6 -19
  69. wandb/sdk/internal/internal_api.py +148 -136
  70. wandb/sdk/internal/job_builder.py +207 -135
  71. wandb/sdk/internal/progress.py +0 -28
  72. wandb/sdk/internal/sender.py +102 -39
  73. wandb/sdk/internal/settings_static.py +8 -1
  74. wandb/sdk/internal/system/assets/trainium.py +3 -3
  75. wandb/sdk/internal/system/system_info.py +4 -2
  76. wandb/sdk/internal/update.py +1 -1
  77. wandb/sdk/launch/__init__.py +9 -1
  78. wandb/sdk/launch/_launch.py +4 -24
  79. wandb/sdk/launch/_launch_add.py +1 -3
  80. wandb/sdk/launch/_project_spec.py +184 -224
  81. wandb/sdk/launch/agent/agent.py +58 -18
  82. wandb/sdk/launch/agent/config.py +0 -3
  83. wandb/sdk/launch/builder/abstract.py +67 -0
  84. wandb/sdk/launch/builder/build.py +165 -576
  85. wandb/sdk/launch/builder/context_manager.py +235 -0
  86. wandb/sdk/launch/builder/docker_builder.py +7 -23
  87. wandb/sdk/launch/builder/kaniko_builder.py +10 -23
  88. wandb/sdk/launch/builder/templates/dockerfile.py +92 -0
  89. wandb/sdk/launch/create_job.py +51 -45
  90. wandb/sdk/launch/environment/aws_environment.py +26 -1
  91. wandb/sdk/launch/inputs/files.py +148 -0
  92. wandb/sdk/launch/inputs/internal.py +224 -0
  93. wandb/sdk/launch/inputs/manage.py +95 -0
  94. wandb/sdk/launch/runner/abstract.py +2 -2
  95. wandb/sdk/launch/runner/kubernetes_monitor.py +45 -12
  96. wandb/sdk/launch/runner/kubernetes_runner.py +6 -8
  97. wandb/sdk/launch/runner/local_container.py +2 -3
  98. wandb/sdk/launch/runner/local_process.py +8 -29
  99. wandb/sdk/launch/runner/sagemaker_runner.py +20 -14
  100. wandb/sdk/launch/runner/vertex_runner.py +8 -7
  101. wandb/sdk/launch/sweeps/scheduler.py +2 -0
  102. wandb/sdk/launch/sweeps/utils.py +2 -2
  103. wandb/sdk/launch/utils.py +16 -138
  104. wandb/sdk/lib/_settings_toposort_generated.py +2 -5
  105. wandb/sdk/lib/apikey.py +4 -2
  106. wandb/sdk/lib/config_util.py +3 -3
  107. wandb/sdk/lib/proto_util.py +22 -1
  108. wandb/sdk/lib/redirect.py +1 -1
  109. wandb/sdk/service/service.py +2 -1
  110. wandb/sdk/service/streams.py +5 -5
  111. wandb/sdk/wandb_init.py +25 -59
  112. wandb/sdk/wandb_login.py +28 -25
  113. wandb/sdk/wandb_run.py +112 -45
  114. wandb/sdk/wandb_settings.py +33 -64
  115. wandb/sdk/wandb_watch.py +1 -1
  116. wandb/sklearn/plot/classifier.py +4 -6
  117. wandb/sync/sync.py +2 -2
  118. wandb/testing/relay.py +32 -17
  119. wandb/util.py +36 -37
  120. wandb/wandb_agent.py +3 -3
  121. wandb/wandb_controller.py +3 -2
  122. {wandb-0.17.0rc2.dist-info → wandb-0.17.1.dist-info}/METADATA +7 -9
  123. {wandb-0.17.0rc2.dist-info → wandb-0.17.1.dist-info}/RECORD +126 -148
  124. {wandb-0.17.0rc2.dist-info → wandb-0.17.1.dist-info}/WHEEL +1 -1
  125. wandb/apis/reports/v1/_blocks.py +0 -1406
  126. wandb/apis/reports/v1/_helpers.py +0 -70
  127. wandb/apis/reports/v1/_panels.py +0 -1282
  128. wandb/apis/reports/v1/_templates.py +0 -478
  129. wandb/apis/reports/v1/blocks.py +0 -27
  130. wandb/apis/reports/v1/helpers.py +0 -2
  131. wandb/apis/reports/v1/mutations.py +0 -66
  132. wandb/apis/reports/v1/panels.py +0 -17
  133. wandb/apis/reports/v1/report.py +0 -268
  134. wandb/apis/reports/v1/runset.py +0 -144
  135. wandb/apis/reports/v1/templates.py +0 -7
  136. wandb/apis/reports/v1/util.py +0 -406
  137. wandb/apis/reports/v1/validators.py +0 -131
  138. wandb/apis/reports/v2/blocks.py +0 -25
  139. wandb/apis/reports/v2/expr_parsing.py +0 -257
  140. wandb/apis/reports/v2/gql.py +0 -68
  141. wandb/apis/reports/v2/interface.py +0 -1911
  142. wandb/apis/reports/v2/internal.py +0 -867
  143. wandb/apis/reports/v2/metrics.py +0 -6
  144. wandb/apis/reports/v2/panels.py +0 -15
  145. wandb/catboost/__init__.py +0 -9
  146. wandb/fastai/__init__.py +0 -9
  147. wandb/keras/__init__.py +0 -19
  148. wandb/lightgbm/__init__.py +0 -9
  149. wandb/plots/__init__.py +0 -6
  150. wandb/plots/explain_text.py +0 -36
  151. wandb/plots/heatmap.py +0 -81
  152. wandb/plots/named_entity.py +0 -43
  153. wandb/plots/part_of_speech.py +0 -50
  154. wandb/plots/plot_definitions.py +0 -768
  155. wandb/plots/precision_recall.py +0 -121
  156. wandb/plots/roc.py +0 -103
  157. wandb/sacred/__init__.py +0 -3
  158. wandb/xgboost/__init__.py +0 -9
  159. {wandb-0.17.0rc2.dist-info → wandb-0.17.1.dist-info}/entry_points.txt +0 -0
  160. {wandb-0.17.0rc2.dist-info → wandb-0.17.1.dist-info}/licenses/LICENSE +0 -0
@@ -1,1282 +0,0 @@
1
- from typing import Optional, Union
2
-
3
- from .helpers import LineKey, PCColumn
4
- from .util import Attr, Panel, coalesce, nested_get, nested_set
5
- from .validators import (
6
- AGGFUNCS,
7
- CODE_COMPARE_DIFF,
8
- FONT_SIZES,
9
- LEGEND_POSITIONS,
10
- LINEPLOT_STYLES,
11
- RANGEFUNCS,
12
- SMOOTHING_TYPES,
13
- Length,
14
- OneOf,
15
- TypeValidator,
16
- )
17
-
18
-
19
- class UnknownPanel(Panel):
20
- @property
21
- def view_type(self) -> str:
22
- return "UNKNOWN PANEL"
23
-
24
-
25
- class LinePlot(Panel):
26
- title: Optional[str] = Attr(
27
- json_path="spec.config.chartTitle",
28
- )
29
- x: Optional[str] = Attr(json_path="spec.config.xAxis")
30
- y: Optional[Union[list, str]] = Attr(json_path="spec.config.metrics")
31
- range_x: Union[list, tuple] = Attr(
32
- json_path=["spec.config.xAxisMin", "spec.config.xAxisMax"],
33
- validators=[
34
- Length(2),
35
- TypeValidator(Optional[Union[int, float]], how="keys"),
36
- ],
37
- )
38
- range_y: Union[list, tuple] = Attr(
39
- json_path=["spec.config.yAxisMin", "spec.config.yAxisMax"],
40
- validators=[
41
- Length(2),
42
- TypeValidator(Optional[Union[int, float]], how="keys"),
43
- ],
44
- )
45
- log_x: Optional[bool] = Attr(json_path="spec.config.xLogScale")
46
- log_y: Optional[bool] = Attr(json_path="spec.config.yLogScale")
47
- title_x: Optional[str] = Attr(json_path="spec.config.xAxisTitle")
48
- title_y: Optional[str] = Attr(json_path="spec.config.yAxisTitle")
49
- ignore_outliers: Optional[bool] = Attr(json_path="spec.config.ignoreOutliers")
50
- groupby: Optional[str] = Attr(json_path="spec.config.groupBy")
51
- groupby_aggfunc: Optional[str] = Attr(
52
- json_path="spec.config.groupAgg",
53
- validators=[OneOf(AGGFUNCS)],
54
- )
55
- groupby_rangefunc: Optional[str] = Attr(
56
- json_path="spec.config.groupArea",
57
- validators=[OneOf(RANGEFUNCS)],
58
- )
59
- smoothing_factor: Optional[float] = Attr(json_path="spec.config.smoothingWeight")
60
- smoothing_type: Optional[str] = Attr(
61
- json_path="spec.config.smoothingType",
62
- validators=[OneOf(SMOOTHING_TYPES)],
63
- )
64
- smoothing_show_original: Optional[bool] = Attr(
65
- json_path="spec.config.showOriginalAfterSmoothing"
66
- )
67
- max_runs_to_show: Optional[int] = Attr(json_path="spec.config.limit")
68
- custom_expressions: Optional[str] = Attr(json_path="spec.config.expressions")
69
- plot_type: Optional[str] = Attr(
70
- json_path="spec.config.plotType",
71
- validators=[OneOf(LINEPLOT_STYLES)],
72
- )
73
- font_size: Optional[str] = Attr(
74
- json_path="spec.config.fontSize",
75
- validators=[OneOf(FONT_SIZES)],
76
- )
77
- legend_position: Optional[str] = Attr(
78
- json_path="spec.config.legendPosition",
79
- validators=[OneOf(LEGEND_POSITIONS)],
80
- )
81
- legend_template: Optional[str] = Attr(json_path="spec.config.legendTemplate")
82
- # Attr( json_path="spec.config.startingXAxis")
83
- # Attr( json_path="spec.config.useLocalSmoothing")
84
- # Attr( json_path="spec.config.useGlobalSmoothingWeight")
85
- # Attr( json_path="spec.config.legendFields")
86
- aggregate: Optional[bool] = Attr(json_path="spec.config.aggregate")
87
- # Attr( json_path="spec.config.aggregateMetrics")
88
- # Attr( json_path="spec.config.metricRegex")
89
- # Attr( json_path="spec.config.useMetricRegex")
90
- # Attr( json_path="spec.config.yAxisAutoRange")
91
- group_runs_limit: Optional[int] = Attr(json_path="spec.config.groupRunsLimit")
92
- xaxis_expression: Optional[str] = Attr(json_path="spec.config.xExpression")
93
- # Attr( json_path="spec.config.colorEachMetricDifferently")
94
- # Attr( json_path="spec.config.showLegend")
95
-
96
- # line_titles: Optional[dict] = Attr(
97
- # json_path="spec.config.overrideSeriesTitles",
98
- # validators=[
99
- # TypeValidator(LineKey, how="keys"),
100
- # TypeValidator(str, how="values"),
101
- # ],
102
- # )
103
- # line_marks: Optional[dict] = Attr(
104
- # json_path="spec.config.overrideMarks",
105
- # validators=[
106
- # TypeValidator(LineKey, how="keys"),
107
- # OneOf(MARKS, how="values"),
108
- # ],
109
- # )
110
- # line_colors: Optional[dict] = Attr(
111
- # json_path="spec.config.overrideColors",
112
- # validators=[
113
- # TypeValidator(LineKey, how="keys"),
114
- # ],
115
- # )
116
- # line_widths: Optional[dict] = Attr(
117
- # json_path="spec.config.overrideLineWidths",
118
- # validators=[
119
- # TypeValidator(LineKey, how="keys"),
120
- # TypeValidator(Union[int, float], how="values"),
121
- # Between(0.5, 3.0, how="values"),
122
- # ],
123
- # )
124
-
125
- def __init__(
126
- self,
127
- title: Optional[str] = None,
128
- x: Optional[str] = None,
129
- y: Optional[Union[list, str]] = None,
130
- range_x: Union[list, tuple] = (None, None),
131
- range_y: Union[list, tuple] = (None, None),
132
- log_x: Optional[bool] = None,
133
- log_y: Optional[bool] = None,
134
- title_x: Optional[str] = None,
135
- title_y: Optional[str] = None,
136
- ignore_outliers: Optional[bool] = None,
137
- groupby: Optional[str] = None,
138
- groupby_aggfunc: Optional[str] = None,
139
- groupby_rangefunc: Optional[str] = None,
140
- smoothing_factor: Optional[float] = None,
141
- smoothing_type: Optional[str] = None,
142
- smoothing_show_original: Optional[bool] = None,
143
- max_runs_to_show: Optional[int] = None,
144
- custom_expressions: Optional[str] = None,
145
- plot_type: Optional[str] = None,
146
- font_size: Optional[str] = None,
147
- legend_position: Optional[str] = None,
148
- legend_template: Optional[str] = None,
149
- aggregate: Optional[bool] = None,
150
- group_runs_limit: Optional[int] = None,
151
- xaxis_expression: Optional[str] = None,
152
- # line_titles: Optional[dict] = None,
153
- # line_marks: Optional[dict] = None,
154
- # line_colors: Optional[dict] = None,
155
- # line_widths: Optional[dict] = None,
156
- *args,
157
- **kwargs,
158
- ):
159
- super().__init__(*args, **kwargs)
160
- self.title = title
161
- self.x = x
162
- self.y = y
163
- self.range_x = range_x
164
- self.range_y = range_y
165
- self.log_x = log_x
166
- self.log_y = log_y
167
- self.title_x = title_x
168
- self.title_y = title_y
169
- self.ignore_outliers = ignore_outliers
170
- self.groupby = groupby
171
- self.groupby_aggfunc = groupby_aggfunc
172
- self.groupby_rangefunc = groupby_rangefunc
173
- self.smoothing_factor = smoothing_factor
174
- self.smoothing_type = smoothing_type
175
- self.smoothing_show_original = smoothing_show_original
176
- self.max_runs_to_show = max_runs_to_show
177
- self.custom_expressions = custom_expressions
178
- self.plot_type = plot_type
179
- self.font_size = font_size
180
- self.legend_position = legend_position
181
- self.legend_template = legend_template
182
- self.aggregate = aggregate
183
- self.group_runs_limit = group_runs_limit
184
- self.xaxis_expression = xaxis_expression
185
- # self.line_titles = line_titles
186
- # self.line_marks = line_marks
187
- # self.line_colors = line_colors
188
- # self.line_widths = line_widths
189
-
190
- @x.getter
191
- def x(self):
192
- json_path = self._get_path("x")
193
- value = nested_get(self, json_path)
194
- return self.panel_metrics_helper.back_to_front(value)
195
-
196
- @x.setter
197
- def x(self, value):
198
- if value is None:
199
- value = "Step"
200
-
201
- json_path = self._get_path("x")
202
- value = self.panel_metrics_helper.front_to_back(value)
203
- nested_set(self, json_path, value)
204
-
205
- @y.getter
206
- def y(self):
207
- json_path = self._get_path("y")
208
- value = nested_get(self, json_path)
209
- if value is None:
210
- return value
211
- return [self.panel_metrics_helper.back_to_front(v) for v in value]
212
-
213
- @y.setter
214
- def y(self, value):
215
- json_path = self._get_path("y")
216
- if value is not None:
217
- if not isinstance(value, list):
218
- value = [value]
219
- value = [self.panel_metrics_helper.front_to_back(v) for v in value]
220
- nested_set(self, json_path, value)
221
-
222
- @property
223
- def view_type(self):
224
- return "Run History Line Plot"
225
-
226
-
227
- class ScatterPlot(Panel):
228
- title: Optional[str] = Attr(json_path="spec.config.chartTitle")
229
- x: Optional[str] = Attr(json_path="spec.config.xAxis")
230
- y: Optional[str] = Attr(json_path="spec.config.yAxis")
231
- z: Optional[str] = Attr(json_path="spec.config.zAxis")
232
- range_x: Union[list, tuple] = Attr(
233
- json_path=["spec.config.xAxisMin", "spec.config.xAxisMax"],
234
- validators=[
235
- Length(2),
236
- TypeValidator(Optional[Union[int, float]], how="keys"),
237
- ],
238
- )
239
- range_y: Union[list, tuple] = Attr(
240
- json_path=["spec.config.yAxisMin", "spec.config.yAxisMax"],
241
- validators=[
242
- Length(2),
243
- TypeValidator(Optional[Union[int, float]], how="keys"),
244
- ],
245
- )
246
- range_z: Union[list, tuple] = Attr(
247
- json_path=["spec.config.zAxisMin", "spec.config.zAxisMax"],
248
- validators=[
249
- Length(2),
250
- TypeValidator(Optional[Union[int, float]], how="keys"),
251
- ],
252
- )
253
- log_x: Optional[bool] = Attr(json_path="spec.config.xAxisLogScale")
254
- log_y: Optional[bool] = Attr(json_path="spec.config.yAxisLogScale")
255
- log_z: Optional[bool] = Attr(json_path="spec.config.zAxisLogScale")
256
- running_ymin: Optional[bool] = Attr(json_path="spec.config.showMinYAxisLine")
257
- running_ymax: Optional[bool] = Attr(json_path="spec.config.showMaxYAxisLine")
258
- running_ymean: Optional[bool] = Attr(json_path="spec.config.showAvgYAxisLine")
259
- legend_template: Optional[str] = Attr(json_path="spec.config.legendTemplate")
260
- gradient: Optional[dict] = Attr(
261
- json_path="spec.config.customGradient",
262
- )
263
- # color: ... = Attr(json_path="spec.config.color")
264
- # range_color: ... = Attr(
265
- # ["spec.config.minColor", "spec.config.maxColor"],
266
- # (list, tuple),
267
- # validators=[Length(2), TypeValidator((int, float), how='keys')],
268
- # )
269
-
270
- # Attr(json_path="spec.config.legendFields")
271
- font_size: Optional[str] = Attr(
272
- json_path="spec.config.fontSize",
273
- validators=[OneOf(FONT_SIZES)],
274
- )
275
- # Attr(json_path="spec.config.yAxisLineSmoothingWeight")
276
- regression: Optional[bool] = Attr(json_path="spec.config.showLinearRegression")
277
-
278
- def __init__(
279
- self,
280
- title=None,
281
- x=None,
282
- y=None,
283
- z=None,
284
- range_x=(None, None),
285
- range_y=(None, None),
286
- range_z=(None, None),
287
- log_x=None,
288
- log_y=None,
289
- log_z=None,
290
- running_ymin=None,
291
- running_ymax=None,
292
- running_ymean=None,
293
- legend_template=None,
294
- gradient=None,
295
- font_size=None,
296
- regression=None,
297
- *args,
298
- **kwargs,
299
- ):
300
- super().__init__(*args, **kwargs)
301
- self.title = title
302
- self.x = x
303
- self.y = y
304
- self.z = z
305
- self.range_x = range_x
306
- self.range_y = range_y
307
- self.range_z = range_z
308
- self.log_x = log_x
309
- self.log_y = log_y
310
- self.log_z = log_z
311
- self.running_ymin = running_ymin
312
- self.running_ymax = running_ymax
313
- self.running_ymean = running_ymean
314
- self.legend_template = legend_template
315
- self.gradient = gradient
316
- self.font_size = font_size
317
- self.regression = regression
318
-
319
- @x.getter
320
- def x(self):
321
- json_path = self._get_path("x")
322
- value = nested_get(self, json_path)
323
- return self.panel_metrics_helper.special_back_to_front(value)
324
-
325
- @x.setter
326
- def x(self, value):
327
- json_path = self._get_path("x")
328
- value = self.panel_metrics_helper.special_front_to_back(value)
329
- nested_set(self, json_path, value)
330
-
331
- @y.getter
332
- def y(self):
333
- json_path = self._get_path("y")
334
- value = nested_get(self, json_path)
335
- return self.panel_metrics_helper.special_back_to_front(value)
336
-
337
- @y.setter
338
- def y(self, value):
339
- json_path = self._get_path("y")
340
- value = self.panel_metrics_helper.special_front_to_back(value)
341
- nested_set(self, json_path, value)
342
-
343
- @z.getter
344
- def z(self):
345
- json_path = self._get_path("z")
346
- value = nested_get(self, json_path)
347
- return self.panel_metrics_helper.special_back_to_front(value)
348
-
349
- @z.setter
350
- def z(self, value):
351
- json_path = self._get_path("z")
352
- value = self.panel_metrics_helper.special_front_to_back(value)
353
- nested_set(self, json_path, value)
354
-
355
- @property
356
- def view_type(self) -> str:
357
- return "Scatter Plot"
358
-
359
-
360
- class BarPlot(Panel):
361
- title: Optional[str] = Attr(json_path="spec.config.chartTitle")
362
- metrics: Optional[Union[list, str]] = Attr(
363
- json_path="spec.config.metrics",
364
- validators=[TypeValidator(str, how="keys")],
365
- )
366
- orientation: str = Attr(
367
- json_path="spec.config.vertical", validators=[OneOf(["v", "h"])]
368
- )
369
- range_x: Union[list, tuple] = Attr(
370
- json_path=["spec.config.xAxisMin", "spec.config.xAxisMax"],
371
- validators=[
372
- Length(2),
373
- TypeValidator(Optional[Union[int, float]], how="keys"),
374
- ],
375
- )
376
- title_x: Optional[str] = Attr(json_path="spec.config.xAxisTitle")
377
- title_y: Optional[str] = Attr(json_path="spec.config.yAxisTitle")
378
- groupby: Optional[str] = Attr(json_path="spec.config.groupBy")
379
- groupby_aggfunc: Optional[str] = Attr(
380
- json_path="spec.config.groupAgg",
381
- validators=[OneOf(AGGFUNCS)],
382
- )
383
- groupby_rangefunc: Optional[str] = Attr(
384
- json_path="spec.config.groupArea",
385
- validators=[OneOf(RANGEFUNCS)],
386
- )
387
- max_runs_to_show: Optional[int] = Attr(json_path="spec.config.limit")
388
- max_bars_to_show: Optional[int] = Attr(json_path="spec.config.barLimit")
389
- custom_expressions: Optional[str] = Attr(json_path="spec.config.expressions")
390
- legend_template: Optional[str] = Attr(json_path="spec.config.legendTemplate")
391
- font_size: Optional[str] = Attr(
392
- json_path="spec.config.fontSize",
393
- validators=[OneOf(FONT_SIZES)],
394
- )
395
- # Attr(json_path="spec.config.limit")
396
- # Attr(json_path="spec.config.barLimit")
397
- # Attr(json_path="spec.config.aggregate")
398
- # Attr(json_path="spec.config.aggregateMetrics")
399
- # Attr(json_path="spec.config.groupRunsLimit")
400
- # Attr(json_path="spec.config.plotStyle")
401
- # Attr(json_path="spec.config.legendFields")
402
- # Attr(json_path="spec.config.colorEachMetricDifferently")
403
-
404
- line_titles: Optional[dict] = Attr(
405
- json_path="spec.config.overrideSeriesTitles",
406
- validators=[
407
- TypeValidator(LineKey, how="keys"),
408
- TypeValidator(str, how="values"),
409
- ],
410
- )
411
- line_colors: Optional[dict] = Attr(
412
- json_path="spec.config.overrideColors",
413
- validators=[
414
- TypeValidator(LineKey, how="keys"),
415
- ],
416
- )
417
-
418
- def __init__(
419
- self,
420
- title=None,
421
- metrics=None,
422
- orientation="h",
423
- range_x=(None, None),
424
- title_x=None,
425
- title_y=None,
426
- groupby=None,
427
- groupby_aggfunc=None,
428
- groupby_rangefunc=None,
429
- max_runs_to_show=None,
430
- max_bars_to_show=None,
431
- custom_expressions=None,
432
- legend_template=None,
433
- font_size=None,
434
- line_titles=None,
435
- line_colors=None,
436
- *args,
437
- **kwargs,
438
- ):
439
- super().__init__(*args, **kwargs)
440
- self.title = title
441
- self.metrics = metrics
442
- self.orientation = orientation
443
- self.range_x = range_x
444
- self.title_x = title_x
445
- self.title_y = title_y
446
- self.groupby = groupby
447
- self.groupby_aggfunc = groupby_aggfunc
448
- self.groupby_rangefunc = groupby_rangefunc
449
- self.max_runs_to_show = max_runs_to_show
450
- self.max_bars_to_show = max_bars_to_show
451
- self.custom_expressions = custom_expressions
452
- self.legend_template = legend_template
453
- self.font_size = font_size
454
- self.line_titles = line_titles
455
- self.line_colors = line_colors
456
-
457
- @metrics.getter
458
- def metrics(self):
459
- json_path = self._get_path("metrics")
460
- value = nested_get(self, json_path)
461
- if value is None:
462
- return value
463
- return [self.panel_metrics_helper.back_to_front(v) for v in value]
464
-
465
- @metrics.setter
466
- def metrics(self, value):
467
- json_path = self._get_path("metrics")
468
- if value is not None:
469
- if not isinstance(value, list):
470
- value = [value]
471
- value = [self.panel_metrics_helper.front_to_back(v) for v in value]
472
- nested_set(self, json_path, value)
473
-
474
- @orientation.getter
475
- def orientation(self):
476
- json_path = self._get_path("orientation")
477
- value = nested_get(self, json_path)
478
- return "v" if value is True else "h"
479
-
480
- @orientation.setter
481
- def orientation(self, value):
482
- json_path = self._get_path("orientation")
483
- value = True if value == "v" else False
484
- nested_set(self, json_path, value)
485
-
486
- @property
487
- def view_type(self) -> str:
488
- return "Bar Chart"
489
-
490
-
491
- class ScalarChart(Panel):
492
- title: Optional[str] = Attr(json_path="spec.config.chartTitle")
493
- metric: str = Attr(json_path="spec.config.metrics")
494
- groupby_aggfunc: Optional[str] = Attr(
495
- json_path="spec.config.groupAgg",
496
- validators=[OneOf(AGGFUNCS)],
497
- )
498
- groupby_rangefunc: Optional[str] = Attr(
499
- json_path="spec.config.groupArea",
500
- validators=[OneOf(RANGEFUNCS)],
501
- )
502
- custom_expressions: Optional[str] = Attr(json_path="spec.config.expressions")
503
- legend_template: Optional[str] = Attr(json_path="spec.config.legendTemplate")
504
-
505
- # Attr(json_path="spec.config.aggregate")
506
- # Attr(json_path="spec.config.aggregateMetrics")
507
- # Attr(json_path="spec.config.groupBy")
508
- # Attr(json_path="spec.config.groupRunsLimit")
509
- # Attr(json_path="spec.config.legendFields")
510
- # Attr(json_path="spec.config.showLegend")
511
- font_size: Optional[str] = Attr(
512
- json_path="spec.config.fontSize",
513
- validators=[OneOf(FONT_SIZES)],
514
- )
515
-
516
- def __init__(
517
- self,
518
- title=None,
519
- metric=None,
520
- groupby_aggfunc=None,
521
- groupby_rangefunc=None,
522
- custom_expressions=None,
523
- legend_template=None,
524
- font_size=None,
525
- *args,
526
- **kwargs,
527
- ):
528
- super().__init__(*args, **kwargs)
529
- self.title = title
530
- self.metric = coalesce(metric, "")
531
- self.groupby_aggfunc = groupby_aggfunc
532
- self.groupby_rangefunc = groupby_rangefunc
533
- self.custom_expressions = custom_expressions
534
- self.legend_template = legend_template
535
- self.font_size = font_size
536
-
537
- @metric.getter
538
- def metric(self):
539
- json_path = self._get_path("metric")
540
- value = nested_get(self, json_path)[0]
541
- return self.panel_metrics_helper.back_to_front(value)
542
-
543
- @metric.setter
544
- def metric(self, new_metrics):
545
- json_path = self._get_path("metric")
546
- new_metrics = self.panel_metrics_helper.front_to_back(new_metrics)
547
- nested_set(self, json_path, [new_metrics])
548
-
549
- @property
550
- def view_type(self) -> str:
551
- return "Scalar Chart"
552
-
553
-
554
- class CodeComparer(Panel):
555
- diff: Optional[str] = Attr(
556
- json_path="spec.config.diff",
557
- validators=[OneOf(CODE_COMPARE_DIFF)],
558
- )
559
-
560
- def __init__(self, diff=None, *args, **kwargs):
561
- super().__init__(*args, **kwargs)
562
- self.diff = diff
563
-
564
- @property
565
- def view_type(self) -> str:
566
- return "Code Comparer"
567
-
568
-
569
- class ParallelCoordinatesPlot(Panel):
570
- columns: list = Attr(
571
- json_path="spec.config.columns",
572
- validators=[TypeValidator(Union[PCColumn, str], how="keys")],
573
- )
574
- title: Optional[str] = Attr(json_path="spec.config.chartTitle")
575
- gradient: Optional[list] = Attr(json_path="spec.config.customGradient")
576
-
577
- # Attr(json_path="spec.config.dimensions")
578
- # Attr(json_path="spec.config.gradientColor")
579
- # Attr(json_path="spec.config.legendFields")
580
- font_size: Optional[str] = Attr(
581
- json_path="spec.config.fontSize",
582
- validators=[OneOf(FONT_SIZES)],
583
- )
584
-
585
- def __init__(self, columns=None, title=None, font_size=None, *args, **kwargs):
586
- super().__init__(*args, **kwargs)
587
- self.columns = coalesce(columns, [])
588
- self.title = title
589
- self.font_size = font_size
590
-
591
- @columns.getter
592
- def columns(self):
593
- json_path = self._get_path("columns")
594
- specs = nested_get(self, json_path)
595
- return [PCColumn.from_json(cspec) for cspec in specs]
596
-
597
- @columns.setter
598
- def columns(self, new_columns):
599
- json_path = self._get_path("columns")
600
- cols = []
601
- for c in new_columns:
602
- if isinstance(c, PCColumn):
603
- cols.append(c)
604
- else:
605
- cols.append(PCColumn(c))
606
- specs = [c.spec for c in cols]
607
- nested_set(self, json_path, specs)
608
-
609
- @property
610
- def view_type(self) -> str:
611
- return "Parallel Coordinates Plot"
612
-
613
-
614
- class ParameterImportancePlot(Panel):
615
- with_respect_to: str = Attr(json_path="spec.config.targetKey")
616
-
617
- def __init__(self, with_respect_to=None, *args, **kwargs):
618
- super().__init__(*args, **kwargs)
619
- self.with_respect_to = coalesce(with_respect_to, "Created Timestamp")
620
-
621
- @with_respect_to.getter
622
- def with_respect_to(self):
623
- json_path = self._get_path("with_respect_to")
624
- value = nested_get(self, json_path)
625
- return self.panel_metrics_helper.back_to_front(value)
626
-
627
- @with_respect_to.setter
628
- def with_respect_to(self, value):
629
- json_path = self._get_path("with_respect_to")
630
- value = self.panel_metrics_helper.front_to_back(value)
631
- nested_set(self, json_path, value)
632
-
633
- @property
634
- def view_type(self) -> str:
635
- return "Parameter Importance"
636
-
637
-
638
- class RunComparer(Panel):
639
- def __init__(self, diff_only=None, *args, **kwargs):
640
- super().__init__(*args, **kwargs)
641
- self.diff_only = diff_only
642
-
643
- diff_only: Optional[str] = Attr(
644
- json_path="spec.config.diffOnly",
645
- validators=[OneOf(["split", None])],
646
- )
647
-
648
- @property
649
- def view_type(self) -> str:
650
- return "Run Comparer"
651
-
652
-
653
- class MediaBrowser(Panel):
654
- num_columns: Optional[int] = Attr(json_path="spec.config.columnCount")
655
- media_keys: Optional[str] = Attr(json_path="spec.config.mediaKeys")
656
- # Attr(json_path="spec.config.chartTitle")
657
- # Attr(json_path="spec.config.stepIndex")
658
- # Attr(json_path="spec.config.mediaIndex")
659
- # Attr(json_path="spec.config.actualSize")
660
- # Attr(json_path="spec.config.fitToDimension")
661
- # Attr(json_path="spec.config.pixelated")
662
- # Attr(json_path="spec.config.mode")
663
- # Attr(json_path="spec.config.gallerySettings")
664
- # Attr(json_path="spec.config.gridSettings")
665
- # Attr(json_path="spec.config.selection")
666
- # Attr(json_path="spec.config.page")
667
- # Attr(json_path="spec.config.tileLayout")
668
- # Attr(json_path="spec.config.stepStrideLength")
669
- # Attr(json_path="spec.config.snapToExistingStep")
670
- # Attr(json_path="spec.config.maxGalleryItems")
671
- # Attr(json_path="spec.config.maxYAxisCount")
672
- # Attr(json_path="spec.config.moleculeConfig")
673
- # Attr(json_path="spec.config.segmentationMaskConfig")
674
- # Attr(json_path="spec.config.boundingBoxConfig")
675
-
676
- def __init__(self, num_columns=None, media_keys=None, *args, **kwargs):
677
- super().__init__(*args, **kwargs)
678
- self.num_columns = num_columns
679
- self.media_keys = media_keys
680
-
681
- @property
682
- def view_type(self) -> str:
683
- return "Media Browser"
684
-
685
-
686
- class MarkdownPanel(Panel):
687
- markdown: Optional[str] = Attr(json_path="spec.config.value")
688
-
689
- def __init__(self, markdown=None, *args, **kwargs):
690
- super().__init__(*args, **kwargs)
691
- self.markdown = markdown
692
-
693
- @property
694
- def view_type(self) -> str:
695
- return "Markdown Panel"
696
-
697
-
698
- class ConfusionMatrix(Panel):
699
- @property
700
- def view_type(self) -> str:
701
- return "Confusion Matrix"
702
-
703
-
704
- class DataFrames(Panel):
705
- @property
706
- def view_type(self) -> str:
707
- return "Data Frame Table"
708
-
709
-
710
- class MultiRunTable(Panel):
711
- @property
712
- def view_type(self) -> str:
713
- return "Multi Run Table"
714
-
715
-
716
- class Vega(Panel):
717
- @property
718
- def view_type(self) -> str:
719
- return "Vega"
720
-
721
-
722
- class CustomChart(Panel):
723
- query: dict = Attr(json_path="spec.config.userQuery.queryFields")
724
- chart_name: str = Attr(json_path="spec.config.panelDefId")
725
- chart_fields: dict = Attr(json_path="spec.config.fieldSettings")
726
- chart_strings: dict = Attr(json_path="spec.config.stringSettings")
727
-
728
- def __init__(
729
- self,
730
- query=None,
731
- chart_name="",
732
- chart_fields=None,
733
- chart_strings=None,
734
- *args,
735
- **kwargs,
736
- ):
737
- super().__init__(*args, **kwargs)
738
- self.spec["config"] = {"transform": {"name": "tableWithLeafColNames"}}
739
- self.query = coalesce(query, {})
740
- self.chart_name = chart_name
741
- self.chart_fields = coalesce(chart_fields, {})
742
- self.chart_strings = coalesce(chart_strings, {})
743
-
744
- @classmethod
745
- def from_table(cls, table_name, chart_fields=None, chart_strings=None):
746
- return CustomChart(
747
- query={"summaryTable": {"tableKey": table_name}},
748
- chart_fields=chart_fields,
749
- chart_strings=chart_strings,
750
- )
751
-
752
- @property
753
- def view_type(self) -> str:
754
- return "Vega2"
755
-
756
- @query.getter
757
- def query(self):
758
- def fields_to_dict(fields):
759
- d = {}
760
- for field in fields:
761
- keys = set(field.keys())
762
- name = field["name"]
763
-
764
- if keys == {"name", "fields"}:
765
- d[name] = {}
766
- elif keys == {"name", "value"}:
767
- d[name] = field["value"]
768
- elif keys == {"name", "args", "fields"}:
769
- d[name] = fields_to_dict(field["args"])
770
- return d
771
-
772
- fields = nested_get(self, self._get_path("query"))
773
- return fields_to_dict(fields)
774
-
775
- @query.setter
776
- def query(self, d):
777
- def dict_to_fields(d):
778
- fields = []
779
- for k, v in d.items():
780
- if isinstance(v, dict) and len(v) > 0:
781
- field = {"name": k, "args": dict_to_fields(v), "fields": []}
782
- elif isinstance(v, dict) and len(v) == 0 or v is None:
783
- field = {"name": k, "fields": []}
784
- else:
785
- field = {"name": k, "value": v}
786
- fields.append(field)
787
- return fields
788
-
789
- d.setdefault("id", [])
790
- d.setdefault("name", [])
791
-
792
- _query = [
793
- {
794
- "args": [
795
- {"name": "runSets", "value": r"${runSets}"},
796
- {"name": "limit", "value": 500},
797
- ],
798
- "fields": dict_to_fields(d),
799
- "name": "runSets",
800
- }
801
- ]
802
- nested_set(self, self._get_path("query"), _query)
803
-
804
-
805
- class Vega3(Panel):
806
- @property
807
- def view_type(self) -> str:
808
- return "Vega3"
809
-
810
-
811
- class WeavePanel(Panel):
812
- @property
813
- def view_type(self) -> str:
814
- return "Weave"
815
-
816
-
817
- class WeavePanelSummaryTable(Panel):
818
- table_name: Optional[str] = Attr(
819
- json_path="spec.config.panel2Config.exp.fromOp.inputs.key.val"
820
- )
821
-
822
- def __init__(self, table_name, *args, **kwargs):
823
- super().__init__(*args, **kwargs)
824
- self._spec["config"] = self._default_config()
825
- self.table_name = table_name
826
-
827
- @classmethod
828
- def from_json(cls, spec):
829
- table_name = spec["config"]["panel2Config"]["exp"]["fromOp"]["inputs"]["key"][
830
- "val"
831
- ]
832
- return cls(table_name)
833
-
834
- @property
835
- def view_type(self) -> str:
836
- return "Weave"
837
-
838
- @staticmethod
839
- def _default_config():
840
- return {
841
- "panel2Config": {
842
- "exp": {
843
- "nodeType": "output",
844
- "type": {
845
- "type": "tagged",
846
- "tag": {
847
- "type": "tagged",
848
- "tag": {
849
- "type": "typedDict",
850
- "propertyTypes": {
851
- "entityName": "string",
852
- "projectName": "string",
853
- },
854
- },
855
- "value": {
856
- "type": "typedDict",
857
- "propertyTypes": {
858
- "project": "project",
859
- "filter": "string",
860
- "order": "string",
861
- },
862
- },
863
- },
864
- "value": {
865
- "type": "list",
866
- "objectType": {
867
- "type": "tagged",
868
- "tag": {
869
- "type": "typedDict",
870
- "propertyTypes": {"run": "run"},
871
- },
872
- "value": {
873
- "type": "union",
874
- "members": [
875
- {
876
- "type": "file",
877
- "extension": "json",
878
- "wbObjectType": {
879
- "type": "table",
880
- "columnTypes": {},
881
- },
882
- },
883
- "none",
884
- ],
885
- },
886
- },
887
- "maxLength": 50,
888
- },
889
- },
890
- "fromOp": {
891
- "name": "pick",
892
- "inputs": {
893
- "obj": {
894
- "nodeType": "output",
895
- "type": {
896
- "type": "tagged",
897
- "tag": {
898
- "type": "tagged",
899
- "tag": {
900
- "type": "typedDict",
901
- "propertyTypes": {
902
- "entityName": "string",
903
- "projectName": "string",
904
- },
905
- },
906
- "value": {
907
- "type": "typedDict",
908
- "propertyTypes": {
909
- "project": "project",
910
- "filter": "string",
911
- "order": "string",
912
- },
913
- },
914
- },
915
- "value": {
916
- "type": "list",
917
- "objectType": {
918
- "type": "tagged",
919
- "tag": {
920
- "type": "typedDict",
921
- "propertyTypes": {"run": "run"},
922
- },
923
- "value": {
924
- "type": "union",
925
- "members": [
926
- {
927
- "type": "typedDict",
928
- "propertyTypes": {
929
- "_wandb": {
930
- "type": "typedDict",
931
- "propertyTypes": {
932
- "runtime": "number"
933
- },
934
- }
935
- },
936
- },
937
- {
938
- "type": "typedDict",
939
- "propertyTypes": {
940
- "_step": "number",
941
- "table": {
942
- "type": "file",
943
- "extension": "json",
944
- "wbObjectType": {
945
- "type": "table",
946
- "columnTypes": {},
947
- },
948
- },
949
- "_wandb": {
950
- "type": "typedDict",
951
- "propertyTypes": {
952
- "runtime": "number"
953
- },
954
- },
955
- "_runtime": "number",
956
- "_timestamp": "number",
957
- },
958
- },
959
- ],
960
- },
961
- },
962
- "maxLength": 50,
963
- },
964
- },
965
- "fromOp": {
966
- "name": "run-summary",
967
- "inputs": {
968
- "run": {
969
- "nodeType": "var",
970
- "type": {
971
- "type": "tagged",
972
- "tag": {
973
- "type": "tagged",
974
- "tag": {
975
- "type": "typedDict",
976
- "propertyTypes": {
977
- "entityName": "string",
978
- "projectName": "string",
979
- },
980
- },
981
- "value": {
982
- "type": "typedDict",
983
- "propertyTypes": {
984
- "project": "project",
985
- "filter": "string",
986
- "order": "string",
987
- },
988
- },
989
- },
990
- "value": {
991
- "type": "list",
992
- "objectType": "run",
993
- "maxLength": 50,
994
- },
995
- },
996
- "varName": "runs",
997
- }
998
- },
999
- },
1000
- },
1001
- "key": {
1002
- "nodeType": "const",
1003
- "type": "string",
1004
- "val": "",
1005
- },
1006
- },
1007
- },
1008
- "__userInput": True,
1009
- }
1010
- }
1011
- }
1012
-
1013
-
1014
- class WeavePanelArtifact(Panel):
1015
- artifact: Optional[str] = Attr(
1016
- json_path="spec.config.panel2Config.exp.fromOp.inputs.artifactName.val"
1017
- )
1018
- tab: str = Attr(
1019
- json_path="spec.config.panel2Config.panelConfig.tabConfigs.overview.selectedTab",
1020
- validators=[OneOf(["overview", "metadata", "usage", "files", "lineage"])],
1021
- )
1022
-
1023
- def __init__(self, artifact, tab="overview", *args, **kwargs):
1024
- super().__init__(*args, **kwargs)
1025
- self._spec["config"] = self._default_config()
1026
- self.artifact = artifact
1027
- self.tab = tab
1028
-
1029
- @classmethod
1030
- def from_json(cls, spec):
1031
- artifact = spec["config"]["panel2Config"]["exp"]["fromOp"]["inputs"][
1032
- "artifactName"
1033
- ]["val"]
1034
- tab = spec["config"]["panel2Config"]["panelConfig"]["tabConfigs"]["overview"][
1035
- "selectedTab"
1036
- ]
1037
- return cls(artifact, tab)
1038
-
1039
- @property
1040
- def view_type(self) -> str:
1041
- return "Weave"
1042
-
1043
- @staticmethod
1044
- def _default_config():
1045
- return {
1046
- "panel2Config": {
1047
- "exp": {
1048
- "nodeType": "output",
1049
- "type": {
1050
- "type": "tagged",
1051
- "tag": {
1052
- "type": "tagged",
1053
- "tag": {
1054
- "type": "typedDict",
1055
- "propertyTypes": {
1056
- "entityName": "string",
1057
- "projectName": "string",
1058
- },
1059
- },
1060
- "value": {
1061
- "type": "typedDict",
1062
- "propertyTypes": {
1063
- "project": "project",
1064
- "artifactName": "string",
1065
- },
1066
- },
1067
- },
1068
- "value": "artifact",
1069
- },
1070
- "fromOp": {
1071
- "name": "project-artifact",
1072
- "inputs": {
1073
- "project": {
1074
- "nodeType": "var",
1075
- "type": {
1076
- "type": "tagged",
1077
- "tag": {
1078
- "type": "typedDict",
1079
- "propertyTypes": {
1080
- "entityName": "string",
1081
- "projectName": "string",
1082
- },
1083
- },
1084
- "value": "project",
1085
- },
1086
- "varName": "project",
1087
- },
1088
- "artifactName": {
1089
- "nodeType": "const",
1090
- "type": "string",
1091
- "val": "",
1092
- },
1093
- },
1094
- },
1095
- "__userInput": True,
1096
- },
1097
- "panelInputType": {
1098
- "type": "tagged",
1099
- "tag": {
1100
- "type": "tagged",
1101
- "tag": {
1102
- "type": "typedDict",
1103
- "propertyTypes": {
1104
- "entityName": "string",
1105
- "projectName": "string",
1106
- },
1107
- },
1108
- "value": {
1109
- "type": "typedDict",
1110
- "propertyTypes": {
1111
- "project": "project",
1112
- "artifactName": "string",
1113
- },
1114
- },
1115
- },
1116
- "value": "artifact",
1117
- },
1118
- "panelConfig": {
1119
- "tabConfigs": {"overview": {"selectedTab": "overview"}}
1120
- },
1121
- }
1122
- }
1123
-
1124
-
1125
- class WeavePanelArtifactVersionedFile(Panel):
1126
- artifact: str = Attr(
1127
- json_path="spec.config.panel2Config.exp.fromOp.inputs.artifactVersion.fromOp.inputs.artifactName.val"
1128
- )
1129
- version: str = Attr(
1130
- json_path="spec.config.panel2Config.exp.fromOp.inputs.artifactVersion.fromOp.inputs.artifactVersionAlias.val",
1131
- )
1132
- file: str = Attr(json_path="spec.config.panel2Config.exp.fromOp.inputs.path.val")
1133
-
1134
- def __init__(self, artifact, version, file, *args, **kwargs):
1135
- super().__init__(*args, **kwargs)
1136
- self._spec["config"] = self._default_config()
1137
- self.artifact = artifact
1138
- self.version = version
1139
- self.file = file
1140
-
1141
- @classmethod
1142
- def from_json(cls, spec):
1143
- artifact = spec["config"]["panel2Config"]["exp"]["fromOp"]["inputs"][
1144
- "artifactVersion"
1145
- ]["fromOp"]["inputs"]["artifactName"]["val"]
1146
- version = spec["config"]["panel2Config"]["exp"]["fromOp"]["inputs"][
1147
- "artifactVersion"
1148
- ]["fromOp"]["inputs"]["artifactVersionAlias"]["val"]
1149
- file = spec["config"]["panel2Config"]["exp"]["fromOp"]["inputs"]["path"]["val"]
1150
- return cls(artifact, version, file)
1151
-
1152
- @property
1153
- def view_type(self) -> str:
1154
- return "Weave"
1155
-
1156
- @staticmethod
1157
- def _default_config():
1158
- return {
1159
- "panel2Config": {
1160
- "exp": {
1161
- "nodeType": "output",
1162
- "type": {
1163
- "type": "tagged",
1164
- "tag": {
1165
- "type": "tagged",
1166
- "tag": {
1167
- "type": "typedDict",
1168
- "propertyTypes": {
1169
- "entityName": "string",
1170
- "projectName": "string",
1171
- },
1172
- },
1173
- "value": {
1174
- "type": "typedDict",
1175
- "propertyTypes": {
1176
- "project": "project",
1177
- "artifactName": "string",
1178
- "artifactVersionAlias": "string",
1179
- },
1180
- },
1181
- },
1182
- "value": {
1183
- "type": "file",
1184
- "extension": "json",
1185
- "wbObjectType": {"type": "table", "columnTypes": {}},
1186
- },
1187
- },
1188
- "fromOp": {
1189
- "name": "artifactVersion-file",
1190
- "inputs": {
1191
- "artifactVersion": {
1192
- "nodeType": "output",
1193
- "type": {
1194
- "type": "tagged",
1195
- "tag": {
1196
- "type": "tagged",
1197
- "tag": {
1198
- "type": "typedDict",
1199
- "propertyTypes": {
1200
- "entityName": "string",
1201
- "projectName": "string",
1202
- },
1203
- },
1204
- "value": {
1205
- "type": "typedDict",
1206
- "propertyTypes": {
1207
- "project": "project",
1208
- "artifactName": "string",
1209
- "artifactVersionAlias": "string",
1210
- },
1211
- },
1212
- },
1213
- "value": "artifactVersion",
1214
- },
1215
- "fromOp": {
1216
- "name": "project-artifactVersion",
1217
- "inputs": {
1218
- "project": {
1219
- "nodeType": "var",
1220
- "type": {
1221
- "type": "tagged",
1222
- "tag": {
1223
- "type": "typedDict",
1224
- "propertyTypes": {
1225
- "entityName": "string",
1226
- "projectName": "string",
1227
- },
1228
- },
1229
- "value": "project",
1230
- },
1231
- "varName": "project",
1232
- },
1233
- "artifactName": {
1234
- "nodeType": "const",
1235
- "type": "string",
1236
- "val": "",
1237
- },
1238
- "artifactVersionAlias": {
1239
- "nodeType": "const",
1240
- "type": "string",
1241
- "val": "",
1242
- },
1243
- },
1244
- },
1245
- },
1246
- "path": {"nodeType": "const", "type": "string", "val": ""},
1247
- },
1248
- },
1249
- "__userInput": True,
1250
- }
1251
- }
1252
- }
1253
-
1254
-
1255
- panel_mapping = {
1256
- # Panels with config
1257
- "Run History Line Plot": LinePlot,
1258
- "Scatter Plot": ScatterPlot,
1259
- "Bar Chart": BarPlot,
1260
- "Scalar Chart": ScalarChart,
1261
- "Code Comparer": CodeComparer,
1262
- "Parallel Coordinates Plot": ParallelCoordinatesPlot,
1263
- "Parameter Importance": ParameterImportancePlot,
1264
- "Run Comparer": RunComparer,
1265
- "Media Browser": MediaBrowser,
1266
- "Markdown Panel": MarkdownPanel,
1267
- # Panels with no config
1268
- "Confusion Matrix": ConfusionMatrix,
1269
- "Data Frame Table": DataFrames,
1270
- "Multi Run Table": MultiRunTable,
1271
- "Vega": Vega,
1272
- "Vega2": CustomChart,
1273
- "Vega3": Vega3,
1274
- "Weave": WeavePanel,
1275
- }
1276
-
1277
- weave_panels = [
1278
- WeavePanelSummaryTable,
1279
- WeavePanelArtifactVersionedFile,
1280
- WeavePanelArtifact,
1281
- WeavePanel,
1282
- ]