nshutils 0.11.0__tar.gz → 0.11.2__tar.gz

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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: nshutils
3
- Version: 0.11.0
3
+ Version: 0.11.2
4
4
  Summary:
5
5
  Author: Nima Shoghi
6
6
  Author-email: nimashoghi@gmail.com
@@ -16,6 +16,7 @@ Requires-Dist: numpy
16
16
  Requires-Dist: pysnooper ; extra == "extra"
17
17
  Requires-Dist: typing-extensions
18
18
  Requires-Dist: uuid7
19
+ Project-URL: homepage, https://github.com/nimashoghi/nshutils
19
20
  Description-Content-Type: text/markdown
20
21
 
21
22
  # nshutils
@@ -45,10 +46,10 @@ typecheck_this_module()
45
46
  You can also use the `tassert` function to assert that a value is of a certain type:
46
47
 
47
48
  ```python
48
- from nshutils.typecheck import tassert, Float32
49
+ import nshutils.typecheck as tc
49
50
 
50
- def my_function(x: Float32):
51
- tassert(Float32, x)
51
+ def my_function(x: tc.Float[torch.Tensor, "bsz seq len"]) -> tc.Float[torch.Tensor, "bsz seq len"]:
52
+ tc.tassert(tc.Float[torch.Tensor, "bsz seq len"], x)
52
53
  ...
53
54
  ```
54
55
 
@@ -25,10 +25,10 @@ typecheck_this_module()
25
25
  You can also use the `tassert` function to assert that a value is of a certain type:
26
26
 
27
27
  ```python
28
- from nshutils.typecheck import tassert, Float32
28
+ import nshutils.typecheck as tc
29
29
 
30
- def my_function(x: Float32):
31
- tassert(Float32, x)
30
+ def my_function(x: tc.Float[torch.Tensor, "bsz seq len"]) -> tc.Float[torch.Tensor, "bsz seq len"]:
31
+ tc.tassert(tc.Float[torch.Tensor, "bsz seq len"], x)
32
32
  ...
33
33
  ```
34
34
 
@@ -1,10 +1,13 @@
1
1
  [tool.poetry]
2
2
  name = "nshutils"
3
- version = "0.11.0"
3
+ version = "0.11.2"
4
4
  description = ""
5
5
  authors = ["Nima Shoghi <nimashoghi@gmail.com>"]
6
6
  readme = "README.md"
7
7
 
8
+ [tool.poetry.urls]
9
+ homepage = "https://github.com/nimashoghi/nshutils"
10
+
8
11
  [tool.poetry.dependencies]
9
12
  python = "^3.10"
10
13
  numpy = "*"