nshutils 0.16.0__py3-none-any.whl → 0.18.0__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.
- nshutils/__init__.py +2 -0
- nshutils/_display.py +2 -0
- nshutils/actsave/__init__.py +2 -0
- nshutils/actsave/_loader.py +2 -0
- nshutils/actsave/_saver.py +2 -0
- nshutils/collections.py +2 -0
- nshutils/logging.py +12 -10
- nshutils/snoop.py +2 -0
- nshutils/typecheck.py +2 -0
- {nshutils-0.16.0.dist-info → nshutils-0.18.0.dist-info}/METADATA +1 -1
- nshutils-0.18.0.dist-info/RECORD +12 -0
- nshutils-0.16.0.dist-info/RECORD +0 -12
- {nshutils-0.16.0.dist-info → nshutils-0.18.0.dist-info}/WHEEL +0 -0
nshutils/__init__.py
CHANGED
nshutils/_display.py
CHANGED
nshutils/actsave/__init__.py
CHANGED
nshutils/actsave/_loader.py
CHANGED
nshutils/actsave/_saver.py
CHANGED
nshutils/collections.py
CHANGED
@@ -2,6 +2,8 @@
|
|
2
2
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
3
3
|
# http://www.apache.org/licenses/LICENSE-2.0
|
4
4
|
#
|
5
|
+
from __future__ import annotations
|
6
|
+
|
5
7
|
import dataclasses
|
6
8
|
from collections import OrderedDict, defaultdict
|
7
9
|
from collections.abc import Callable, Mapping, Sequence
|
nshutils/logging.py
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
from __future__ import annotations
|
2
|
+
|
1
3
|
import logging
|
2
4
|
from pathlib import Path
|
3
5
|
|
@@ -7,7 +9,7 @@ def init_python_logging(
|
|
7
9
|
lovely_tensors: bool = False,
|
8
10
|
lovely_numpy: bool = False,
|
9
11
|
treescope: bool = False,
|
10
|
-
treescope_autovisualize_arrays: bool =
|
12
|
+
treescope_autovisualize_arrays: bool = False,
|
11
13
|
rich: bool = False,
|
12
14
|
rich_tracebacks: bool = False,
|
13
15
|
log_level: int | str | None = logging.INFO,
|
@@ -19,7 +21,7 @@ def init_python_logging(
|
|
19
21
|
|
20
22
|
_lovely_tensors.monkey_patch()
|
21
23
|
except ImportError:
|
22
|
-
logging.
|
24
|
+
logging.info(
|
23
25
|
"Failed to import `lovely_tensors`. Ignoring pretty PyTorch tensor formatting"
|
24
26
|
)
|
25
27
|
|
@@ -29,7 +31,7 @@ def init_python_logging(
|
|
29
31
|
|
30
32
|
_lovely_numpy.set_config(repr=_lovely_numpy.lovely)
|
31
33
|
except ImportError:
|
32
|
-
logging.
|
34
|
+
logging.info(
|
33
35
|
"Failed to import `lovely_numpy`. Ignoring pretty numpy array formatting"
|
34
36
|
)
|
35
37
|
|
@@ -45,11 +47,11 @@ def init_python_logging(
|
|
45
47
|
autovisualize_arrays=treescope_autovisualize_arrays
|
46
48
|
)
|
47
49
|
else:
|
48
|
-
logging.
|
50
|
+
logging.info(
|
49
51
|
"Treescope setup is only supported in Jupyter notebooks. Skipping."
|
50
52
|
)
|
51
53
|
except ImportError:
|
52
|
-
logging.
|
54
|
+
logging.info(
|
53
55
|
"Failed to import `treescope` or `IPython`. Ignoring `treescope` registration"
|
54
56
|
)
|
55
57
|
|
@@ -65,7 +67,7 @@ def init_python_logging(
|
|
65
67
|
|
66
68
|
log_handlers.append(RichHandler(rich_tracebacks=rich_tracebacks))
|
67
69
|
except ImportError:
|
68
|
-
logging.
|
70
|
+
logging.info(
|
69
71
|
"Failed to import rich. Falling back to default Python logging."
|
70
72
|
)
|
71
73
|
|
@@ -81,8 +83,8 @@ def pretty(
|
|
81
83
|
*,
|
82
84
|
lovely_tensors: bool = True,
|
83
85
|
lovely_numpy: bool = True,
|
84
|
-
treescope: bool =
|
85
|
-
treescope_autovisualize_arrays: bool =
|
86
|
+
treescope: bool = False,
|
87
|
+
treescope_autovisualize_arrays: bool = False,
|
86
88
|
log_level: int | str | None = logging.INFO,
|
87
89
|
log_save_dir: Path | None = None,
|
88
90
|
rich_log_handler: bool = False,
|
@@ -104,8 +106,8 @@ def lovely(
|
|
104
106
|
*,
|
105
107
|
lovely_tensors: bool = True,
|
106
108
|
lovely_numpy: bool = True,
|
107
|
-
treescope: bool =
|
108
|
-
treescope_autovisualize_arrays: bool =
|
109
|
+
treescope: bool = False,
|
110
|
+
treescope_autovisualize_arrays: bool = False,
|
109
111
|
log_level: int | str | None = logging.INFO,
|
110
112
|
log_save_dir: Path | None = None,
|
111
113
|
rich_log_handler: bool = False,
|
nshutils/snoop.py
CHANGED
nshutils/typecheck.py
CHANGED
@@ -0,0 +1,12 @@
|
|
1
|
+
nshutils/__init__.py,sha256=1kiWfKqSELCpTwUv4B6m43cnp2W4RPoD2DX9svgd3IA,575
|
2
|
+
nshutils/_display.py,sha256=lfxjB5A2SMdtrtElYCP_xhdgIsPjA8XL21G5jKv6dys,1477
|
3
|
+
nshutils/actsave/__init__.py,sha256=hAVsog9d1g3_rQN1TRslrl6sK1PhCGbjy8PPUAmJI58,203
|
4
|
+
nshutils/actsave/_loader.py,sha256=mof3HezUNvLliz7macstX6ewXW05L0Mtv3zJyrbmImg,4640
|
5
|
+
nshutils/actsave/_saver.py,sha256=Kor7PEk__noRDEAfCZ_I4vxql5UfWSIQIQ1OmW2RRTI,10290
|
6
|
+
nshutils/collections.py,sha256=QWGyANmo4Efq4XRNHDSTE9tRLStwEZHGwE0ATHR-Vqo,5233
|
7
|
+
nshutils/logging.py,sha256=-6IB0GTDDS8ue1H2tzkv_OLf4bZVN1ywL08TlDZWbtQ,3737
|
8
|
+
nshutils/snoop.py,sha256=VuEMwFXxI1mXrv2IDaj947s3UhgvoGhgaRxyu2iiIgI,7405
|
9
|
+
nshutils/typecheck.py,sha256=IC0cbPLlYV2Fnwv4xUl458fhye9_4O3zOpc1dNEgmVM,4951
|
10
|
+
nshutils-0.18.0.dist-info/METADATA,sha256=TiMkBQTVYLIHbr81cg7GP-hSaTik_shtem0K8T06h1k,4117
|
11
|
+
nshutils-0.18.0.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
|
12
|
+
nshutils-0.18.0.dist-info/RECORD,,
|
nshutils-0.16.0.dist-info/RECORD
DELETED
@@ -1,12 +0,0 @@
|
|
1
|
-
nshutils/__init__.py,sha256=T1MnsjctEI1c5wM06d_hUOuGIYLIz_NEb1e_tT-TgQ0,539
|
2
|
-
nshutils/_display.py,sha256=6CSaKdsFBHBGQXMppumRfO5fOfiJDXQ7FhtAvN8id7M,1441
|
3
|
-
nshutils/actsave/__init__.py,sha256=6gJ49011Ad3kS8BejeZRPj7ZyVyIcmX-VKLEmYZyGM8,167
|
4
|
-
nshutils/actsave/_loader.py,sha256=fAhD32DrJa4onkYfcwc21YIeGEYzOSXCK_HVo9SZLgQ,4604
|
5
|
-
nshutils/actsave/_saver.py,sha256=-uKMmMKjEErCa8pfLhAW4077GFcUjxr0Qq0PFAnbEOw,10254
|
6
|
-
nshutils/collections.py,sha256=EE_qLd-LrsX5lsyk9GSKh03Q8bhn9CHB3jiEeNj4uF4,5197
|
7
|
-
nshutils/logging.py,sha256=3NwW2pSoXBktiRWPGtUzs8BrOW8H9ZpfI-8wiLbEnEE,3721
|
8
|
-
nshutils/snoop.py,sha256=JW2JZg6oZd9WWubOP6ok6GUbh5mIQUOdP_T29iH5RCE,7369
|
9
|
-
nshutils/typecheck.py,sha256=_KtfinRy9A0Dgq78kN5MGGrefvb6jn2tGY6svdLEBAs,4915
|
10
|
-
nshutils-0.16.0.dist-info/METADATA,sha256=M9Mt17Jj5kzN2JMPyjLA7fLBCFgGtGivhzQ9JBS0IcQ,4117
|
11
|
-
nshutils-0.16.0.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
|
12
|
-
nshutils-0.16.0.dist-info/RECORD,,
|
File without changes
|