numbox 0.1.0__py3-none-any.whl → 0.1.2__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.
- numbox/__init__.py +1 -1
- numbox/core/any_type.py +16 -52
- {numbox-0.1.0.dist-info → numbox-0.1.2.dist-info}/METADATA +1 -1
- numbox-0.1.2.dist-info/RECORD +12 -0
- numbox-0.1.0.dist-info/RECORD +0 -12
- {numbox-0.1.0.dist-info → numbox-0.1.2.dist-info}/LICENSE +0 -0
- {numbox-0.1.0.dist-info → numbox-0.1.2.dist-info}/WHEEL +0 -0
- {numbox-0.1.0.dist-info → numbox-0.1.2.dist-info}/top_level.txt +0 -0
numbox/__init__.py
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
__version__ = '0.1.
|
|
1
|
+
__version__ = '0.1.2'
|
numbox/core/any_type.py
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
from numba import njit
|
|
2
2
|
from numba.core.errors import NumbaError
|
|
3
3
|
from numba.core.types import StructRef
|
|
4
|
-
from numba.core.typing import Signature
|
|
5
4
|
from numba.experimental.structref import define_boxing, new, register, StructRefProxy
|
|
6
5
|
from numba.extending import overload, overload_method
|
|
7
6
|
|
|
@@ -28,8 +27,6 @@ class _Content:
|
|
|
28
27
|
|
|
29
28
|
@overload(_Content, strict=False)
|
|
30
29
|
def ol_content(x_ty):
|
|
31
|
-
""" Custom version of `numba.experimental.structref.define_constructor` that extracts
|
|
32
|
-
first-class function type from the `Dispatcher` to be used as struct's member type """
|
|
33
30
|
x_ty = prune_type(x_ty)
|
|
34
31
|
content_type = ContentTypeClass([("x", x_ty)])
|
|
35
32
|
|
|
@@ -52,31 +49,24 @@ class Any(StructRefProxy):
|
|
|
52
49
|
def __new__(cls, x):
|
|
53
50
|
raise NotImplementedError(deleted_any_ctor_error)
|
|
54
51
|
|
|
52
|
+
@njit
|
|
55
53
|
def get_as(self, ty):
|
|
56
|
-
return get_as(
|
|
54
|
+
return self.get_as(ty)
|
|
57
55
|
|
|
56
|
+
@njit
|
|
58
57
|
def reset(self, val):
|
|
59
|
-
return reset(
|
|
58
|
+
return self.reset(val)
|
|
60
59
|
|
|
61
|
-
@property
|
|
62
|
-
def p(self):
|
|
63
|
-
raise NotImplementedError('You need to access `p` via `get_as`')
|
|
64
60
|
|
|
61
|
+
def _any_deleted_ctor(p):
|
|
62
|
+
raise NumbaError(deleted_any_ctor_error)
|
|
65
63
|
|
|
64
|
+
|
|
65
|
+
overload(Any)(_any_deleted_ctor)
|
|
66
66
|
define_boxing(AnyTypeClass, Any)
|
|
67
67
|
AnyType = AnyTypeClass([("p", ErasedType)])
|
|
68
68
|
|
|
69
69
|
|
|
70
|
-
@njit
|
|
71
|
-
def get_as(self, ty):
|
|
72
|
-
return self.get_as(ty)
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
@njit
|
|
76
|
-
def reset(self, val):
|
|
77
|
-
return self.reset(val)
|
|
78
|
-
|
|
79
|
-
|
|
80
70
|
@overload_method(AnyTypeClass, "get_as", strict=False)
|
|
81
71
|
def ol_get_as(self_class, ty_class):
|
|
82
72
|
def _(self, ty):
|
|
@@ -85,40 +75,14 @@ def ol_get_as(self_class, ty_class):
|
|
|
85
75
|
|
|
86
76
|
|
|
87
77
|
@overload_method(AnyTypeClass, "reset", strict=False)
|
|
88
|
-
def ol_reset(self_class,
|
|
89
|
-
def _(self,
|
|
90
|
-
self.p = cast(_Content(
|
|
78
|
+
def ol_reset(self_class, x_class):
|
|
79
|
+
def _(self, x):
|
|
80
|
+
self.p = cast(_Content(x), ErasedType)
|
|
91
81
|
return _
|
|
92
82
|
|
|
93
83
|
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
def ol_any_constructor(x_ty):
|
|
100
|
-
def _(x):
|
|
101
|
-
any = new(AnyType)
|
|
102
|
-
any.p = cast(_Content(x), ErasedType)
|
|
103
|
-
return any
|
|
104
|
-
return _
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
def make_any_maker(sig=None):
|
|
108
|
-
if sig is not None:
|
|
109
|
-
assert isinstance(sig, Signature)
|
|
110
|
-
|
|
111
|
-
@njit(sig)
|
|
112
|
-
def make_any_(x):
|
|
113
|
-
return any_constructor(x)
|
|
114
|
-
return make_any_
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
make_any = make_any_maker()
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
def _any_deleted_ctor(p):
|
|
121
|
-
raise NumbaError(deleted_any_ctor_error)
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
overload(Any)(_any_deleted_ctor)
|
|
84
|
+
@njit
|
|
85
|
+
def make_any(x):
|
|
86
|
+
any = new(AnyType)
|
|
87
|
+
any.p = cast(_Content(x), ErasedType)
|
|
88
|
+
return any
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
numbox/__init__.py,sha256=mdp2CftfqYbdKtP-eWv1z7rAUycYv6X1ntXSMUf8Kss,22
|
|
2
|
+
numbox/core/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
3
|
+
numbox/core/any_type.py,sha256=CvEwFk7EcuFwg5VqDJrYQYmWp_t3Kil92wC7gUOEl-Y,1711
|
|
4
|
+
numbox/core/meminfo.py,sha256=-b7wlCRyqOZjvKjEuwNwzqE4XvnEWxu3I2k4DEP3Cqk,1755
|
|
5
|
+
numbox/utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
6
|
+
numbox/utils/highlevel.py,sha256=hAmF2y2ayPJT0qpwHrGDt09R4-6Ts9sTkCTh-8FTIUU,319
|
|
7
|
+
numbox/utils/lowlevel.py,sha256=6CRfFbMeBZGM7hqPAQzyClzU_e_IsNpqONJknFWGzJM,1405
|
|
8
|
+
numbox-0.1.2.dist-info/LICENSE,sha256=YYgNvjH_p6-1NsdrIqGJnr1GUbZzA_8DxsP6vVfM6nY,1446
|
|
9
|
+
numbox-0.1.2.dist-info/METADATA,sha256=-xVLPSJg3MLfTBO61O1pEzpgA8wa9fPIxGp0abcpVEs,1926
|
|
10
|
+
numbox-0.1.2.dist-info/WHEEL,sha256=P9jw-gEje8ByB7_hXoICnHtVCrEwMQh-630tKvQWehc,91
|
|
11
|
+
numbox-0.1.2.dist-info/top_level.txt,sha256=A67jOkfqidCSYYm6ifjN_WZyIiR1B27fjxv6nNbPvjc,7
|
|
12
|
+
numbox-0.1.2.dist-info/RECORD,,
|
numbox-0.1.0.dist-info/RECORD
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
numbox/__init__.py,sha256=IMjkMO3twhQzluVTo8Z6rE7Eg-9U79_LGKMcsWLKBkY,22
|
|
2
|
-
numbox/core/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
3
|
-
numbox/core/any_type.py,sha256=UT2cDsQjdVLLipu1mJOPzTLkr4pgeR113T-nuCUrjsE,2538
|
|
4
|
-
numbox/core/meminfo.py,sha256=-b7wlCRyqOZjvKjEuwNwzqE4XvnEWxu3I2k4DEP3Cqk,1755
|
|
5
|
-
numbox/utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
6
|
-
numbox/utils/highlevel.py,sha256=hAmF2y2ayPJT0qpwHrGDt09R4-6Ts9sTkCTh-8FTIUU,319
|
|
7
|
-
numbox/utils/lowlevel.py,sha256=6CRfFbMeBZGM7hqPAQzyClzU_e_IsNpqONJknFWGzJM,1405
|
|
8
|
-
numbox-0.1.0.dist-info/LICENSE,sha256=YYgNvjH_p6-1NsdrIqGJnr1GUbZzA_8DxsP6vVfM6nY,1446
|
|
9
|
-
numbox-0.1.0.dist-info/METADATA,sha256=htXzICNISIDMny-tPQJLPdQvCqvfxRwQO0IxRXobBUw,1926
|
|
10
|
-
numbox-0.1.0.dist-info/WHEEL,sha256=P9jw-gEje8ByB7_hXoICnHtVCrEwMQh-630tKvQWehc,91
|
|
11
|
-
numbox-0.1.0.dist-info/top_level.txt,sha256=A67jOkfqidCSYYm6ifjN_WZyIiR1B27fjxv6nNbPvjc,7
|
|
12
|
-
numbox-0.1.0.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|