Skip to content

Commit 81e8496

Browse files
committed
Fix cbook style
- add missing functions to cbook.pyi - PEP8 format conform test
1 parent 787f308 commit 81e8496

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

lib/matplotlib/cbook.pyi

+3
Original file line numberDiff line numberDiff line change
@@ -181,4 +181,7 @@ def _setup_new_guiapp() -> None: ...
181181
def _format_approx(number: float, precision: int) -> str: ...
182182
def _g_sig_digits(value: float, delta: float) -> int: ...
183183
def _unikey_or_keysym_to_mplkey(unikey: str, keysym: str) -> str: ...
184+
def _is_torch_array(x: Any) -> bool: ...
185+
def _is_jax_array(x: Any) -> bool: ...
186+
def _unpack_to_numpy(x: Any) -> Any: ...
184187
def _auto_format_str(fmt: str, value: Any) -> str: ...

lib/matplotlib/tests/test_cbook.py

+3
Original file line numberDiff line numberDiff line change
@@ -948,8 +948,10 @@ def test_unpack_to_numpy_from_torch():
948948
class Tensor:
949949
def __init__(self, data):
950950
self.data = data
951+
951952
def __array__(self):
952953
return self.data
954+
953955
torch = ModuleType('torch')
954956
torch.Tensor = Tensor
955957
sys.modules['torch'] = torch
@@ -967,6 +969,7 @@ def test_unpack_to_numpy_from_jax():
967969
class Array:
968970
def __init__(self, data):
969971
self.data = data
972+
970973
def __array__(self):
971974
return self.data
972975

0 commit comments

Comments
 (0)