Skip to content

Commit ad6f7f6

Browse files
Add missing type stubs for newer visualization methods (#1418)
* Add missing type stubs for newer visualization methods * reformatted with black * Format __init__.pyi with Black --------- Co-authored-by: Mario Behling <mb@mariobehling.de>
1 parent c35aef3 commit ad6f7f6

2 files changed

Lines changed: 36 additions & 2 deletions

File tree

py/visdom/__init__.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,6 @@ def isndarray(n):
144144

145145
from visdom.utils.shared_utils import NanSafeEncoder
146146

147-
148147
# TODO: In appropriate places, we need to change many numpy calls to use
149148
# nan-aware ones, e.g., `X.max` => `np.nanmax(X)`.
150149

py/visdom/__init__.pyi

Lines changed: 36 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
# This source code is licensed under the license found in the
55
# LICENSE file in the root directory of this source tree.
66

7-
from typing import Optional, List, Any, Union, Mapping, overload, Text
7+
from typing import Optional, List, Any, Union, Mapping, overload, Text, Callable
88

99
### Type aliases for commonly-used types.
1010
# For optional 'options' parameters.
@@ -262,6 +262,13 @@ class Visdom:
262262
env: _OptStr = ...,
263263
opts: _OptOps = ...,
264264
) -> _SendReturn: ...
265+
def properties(
266+
self,
267+
data: List,
268+
win: _OptStr = ...,
269+
env: _OptStr = ...,
270+
opts: _OptOps = ...,
271+
) -> _SendReturn: ...
265272
def table(
266273
self,
267274
headers: List[Any],
@@ -270,3 +277,31 @@ class Visdom:
270277
env: _OptStr = ...,
271278
opts: _OptOps = ...,
272279
) -> _SendReturn: ...
280+
def embeddings(
281+
self,
282+
features: Tensor,
283+
labels: Tensor,
284+
data_getter: Optional[Callable[[int], Any]] = ...,
285+
data_type: _OptStr = ...,
286+
win: _OptStr = ...,
287+
env: _OptStr = ...,
288+
opts: _OptOps = ...,
289+
) -> _SendReturn: ...
290+
def sunburst(
291+
self,
292+
labels: Tensor,
293+
parents: Tensor,
294+
values: Optional[Tensor] = ...,
295+
win: _OptStr = ...,
296+
env: _OptStr = ...,
297+
opts: _OptOps = ...,
298+
) -> _SendReturn: ...
299+
def dual_axis_lines(
300+
self,
301+
X: Optional[Tensor] = ...,
302+
Y1: Optional[Tensor] = ...,
303+
Y2: Optional[Tensor] = ...,
304+
opts: _OptOps = ...,
305+
win: _OptStr = ...,
306+
env: _OptStr = ...,
307+
) -> _SendReturn: ...

0 commit comments

Comments
 (0)