arraykit 0.9.0__tar.gz → 1.0.0__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.
Files changed (45) hide show
  1. {arraykit-0.9.0/arraykit.egg-info → arraykit-1.0.0}/PKG-INFO +15 -5
  2. {arraykit-0.9.0 → arraykit-1.0.0}/README.rst +16 -4
  3. {arraykit-0.9.0 → arraykit-1.0.0/arraykit.egg-info}/PKG-INFO +15 -5
  4. {arraykit-0.9.0 → arraykit-1.0.0}/arraykit.egg-info/SOURCES.txt +4 -0
  5. arraykit-1.0.0/arraykit.egg-info/requires.txt +1 -0
  6. {arraykit-0.9.0 → arraykit-1.0.0}/setup.py +5 -5
  7. {arraykit-0.9.0 → arraykit-1.0.0}/src/__init__.py +4 -0
  8. {arraykit-0.9.0 → arraykit-1.0.0}/src/__init__.pyi +33 -0
  9. {arraykit-0.9.0 → arraykit-1.0.0}/src/_arraykit.c +19 -2
  10. arraykit-1.0.0/src/auto_map.c +2655 -0
  11. arraykit-1.0.0/src/auto_map.h +14 -0
  12. arraykit-1.0.0/test/test_auto_map.py +994 -0
  13. arraykit-1.0.0/test/test_auto_map_property.py +283 -0
  14. {arraykit-0.9.0 → arraykit-1.0.0}/test/test_pyi.py +13 -2
  15. arraykit-0.9.0/arraykit.egg-info/requires.txt +0 -1
  16. {arraykit-0.9.0 → arraykit-1.0.0}/LICENSE.txt +0 -0
  17. {arraykit-0.9.0 → arraykit-1.0.0}/MANIFEST.in +0 -0
  18. {arraykit-0.9.0 → arraykit-1.0.0}/arraykit.egg-info/dependency_links.txt +0 -0
  19. {arraykit-0.9.0 → arraykit-1.0.0}/arraykit.egg-info/top_level.txt +0 -0
  20. {arraykit-0.9.0 → arraykit-1.0.0}/setup.cfg +0 -0
  21. {arraykit-0.9.0 → arraykit-1.0.0}/src/array_go.c +0 -0
  22. {arraykit-0.9.0 → arraykit-1.0.0}/src/array_go.h +0 -0
  23. {arraykit-0.9.0 → arraykit-1.0.0}/src/array_to_tuple.c +0 -0
  24. {arraykit-0.9.0 → arraykit-1.0.0}/src/array_to_tuple.h +0 -0
  25. {arraykit-0.9.0 → arraykit-1.0.0}/src/block_index.c +0 -0
  26. {arraykit-0.9.0 → arraykit-1.0.0}/src/block_index.h +0 -0
  27. {arraykit-0.9.0 → arraykit-1.0.0}/src/delimited_to_arrays.c +0 -0
  28. {arraykit-0.9.0 → arraykit-1.0.0}/src/delimited_to_arrays.h +0 -0
  29. {arraykit-0.9.0 → arraykit-1.0.0}/src/methods.c +0 -0
  30. {arraykit-0.9.0 → arraykit-1.0.0}/src/methods.h +0 -0
  31. {arraykit-0.9.0 → arraykit-1.0.0}/src/py.typed +0 -0
  32. {arraykit-0.9.0 → arraykit-1.0.0}/src/tri_map.c +0 -0
  33. {arraykit-0.9.0 → arraykit-1.0.0}/src/tri_map.h +0 -0
  34. {arraykit-0.9.0 → arraykit-1.0.0}/src/utilities.h +0 -0
  35. {arraykit-0.9.0 → arraykit-1.0.0}/test/test_array_go.py +0 -0
  36. {arraykit-0.9.0 → arraykit-1.0.0}/test/test_block_index.py +0 -0
  37. {arraykit-0.9.0 → arraykit-1.0.0}/test/test_delimited_to_arrays.py +0 -0
  38. {arraykit-0.9.0 → arraykit-1.0.0}/test/test_delimited_to_arrays_integration.py +0 -0
  39. {arraykit-0.9.0 → arraykit-1.0.0}/test/test_delimited_to_arrays_property.py +0 -0
  40. {arraykit-0.9.0 → arraykit-1.0.0}/test/test_nonzero_1d.py +0 -0
  41. {arraykit-0.9.0 → arraykit-1.0.0}/test/test_nonzero_1d_property.py +0 -0
  42. {arraykit-0.9.0 → arraykit-1.0.0}/test/test_split_after_count.py +0 -0
  43. {arraykit-0.9.0 → arraykit-1.0.0}/test/test_tri_map.py +0 -0
  44. {arraykit-0.9.0 → arraykit-1.0.0}/test/test_type_discovery.py +0 -0
  45. {arraykit-0.9.0 → arraykit-1.0.0}/test/test_util.py +0 -0
@@ -1,6 +1,6 @@
1
- Metadata-Version: 2.1
1
+ Metadata-Version: 2.4
2
2
  Name: arraykit
3
- Version: 0.9.0
3
+ Version: 1.0.0
4
4
  Summary: Array utilities for StaticFrame
5
5
  Home-page: https://github.com/static-frame/arraykit
6
6
  Author: Christopher Ariza, Brandt Bucher, Charles Burkland
@@ -15,14 +15,24 @@ Classifier: License :: OSI Approved :: MIT License
15
15
  Classifier: Operating System :: MacOS :: MacOS X
16
16
  Classifier: Operating System :: Microsoft :: Windows
17
17
  Classifier: Operating System :: POSIX
18
- Classifier: Programming Language :: Python :: 3.9
19
18
  Classifier: Programming Language :: Python :: 3.10
20
19
  Classifier: Programming Language :: Python :: 3.11
21
20
  Classifier: Programming Language :: Python :: 3.12
21
+ Classifier: Programming Language :: Python :: 3.13
22
22
  Classifier: Typing :: Typed
23
- Requires-Python: >=3.9
23
+ Requires-Python: >=3.10
24
24
  License-File: LICENSE.txt
25
- Requires-Dist: numpy>=1.19.5
25
+ Requires-Dist: numpy>=1.24.3
26
+ Dynamic: author
27
+ Dynamic: classifier
28
+ Dynamic: description
29
+ Dynamic: home-page
30
+ Dynamic: keywords
31
+ Dynamic: license
32
+ Dynamic: license-file
33
+ Dynamic: requires-dist
34
+ Dynamic: requires-python
35
+ Dynamic: summary
26
36
 
27
37
  The ArrayKit library provides utilities for creating and transforming NumPy arrays, implementing performance-critical StaticFrame operations as Python C extensions.
28
38
 
@@ -23,20 +23,32 @@ Code: https://github.com/InvestmentSystems/arraykit
23
23
  Packages: https://pypi.org/project/arraykit
24
24
 
25
25
 
26
-
27
26
  Dependencies
28
27
  --------------
29
28
 
30
29
  ArrayKit requires the following:
31
30
 
32
- - Python>=3.9
33
- - numpy>=1.19.5
34
-
31
+ - Python>=3.10
32
+ - numpy>=1.24.3
35
33
 
36
34
 
37
35
  What is New in ArrayKit
38
36
  -------------------------
39
37
 
38
+ 1.0.0
39
+ ............
40
+
41
+ Integrated `AutoMap` and `FrozenAutoMap` from `arraymap`.
42
+
43
+ Removed global integer cache from `AutoMap` and `FrozenAutoMap` for thread safety.
44
+
45
+
46
+ 0.10.0
47
+ ............
48
+
49
+ Now building wheels for Python 3.13.
50
+
51
+
40
52
  0.9.0
41
53
  ............
42
54
 
@@ -1,6 +1,6 @@
1
- Metadata-Version: 2.1
1
+ Metadata-Version: 2.4
2
2
  Name: arraykit
3
- Version: 0.9.0
3
+ Version: 1.0.0
4
4
  Summary: Array utilities for StaticFrame
5
5
  Home-page: https://github.com/static-frame/arraykit
6
6
  Author: Christopher Ariza, Brandt Bucher, Charles Burkland
@@ -15,14 +15,24 @@ Classifier: License :: OSI Approved :: MIT License
15
15
  Classifier: Operating System :: MacOS :: MacOS X
16
16
  Classifier: Operating System :: Microsoft :: Windows
17
17
  Classifier: Operating System :: POSIX
18
- Classifier: Programming Language :: Python :: 3.9
19
18
  Classifier: Programming Language :: Python :: 3.10
20
19
  Classifier: Programming Language :: Python :: 3.11
21
20
  Classifier: Programming Language :: Python :: 3.12
21
+ Classifier: Programming Language :: Python :: 3.13
22
22
  Classifier: Typing :: Typed
23
- Requires-Python: >=3.9
23
+ Requires-Python: >=3.10
24
24
  License-File: LICENSE.txt
25
- Requires-Dist: numpy>=1.19.5
25
+ Requires-Dist: numpy>=1.24.3
26
+ Dynamic: author
27
+ Dynamic: classifier
28
+ Dynamic: description
29
+ Dynamic: home-page
30
+ Dynamic: keywords
31
+ Dynamic: license
32
+ Dynamic: license-file
33
+ Dynamic: requires-dist
34
+ Dynamic: requires-python
35
+ Dynamic: summary
26
36
 
27
37
  The ArrayKit library provides utilities for creating and transforming NumPy arrays, implementing performance-critical StaticFrame operations as Python C extensions.
28
38
 
@@ -14,6 +14,8 @@ src/array_go.c
14
14
  src/array_go.h
15
15
  src/array_to_tuple.c
16
16
  src/array_to_tuple.h
17
+ src/auto_map.c
18
+ src/auto_map.h
17
19
  src/block_index.c
18
20
  src/block_index.h
19
21
  src/delimited_to_arrays.c
@@ -25,6 +27,8 @@ src/tri_map.c
25
27
  src/tri_map.h
26
28
  src/utilities.h
27
29
  test/test_array_go.py
30
+ test/test_auto_map.py
31
+ test/test_auto_map_property.py
28
32
  test/test_block_index.py
29
33
  test/test_delimited_to_arrays.py
30
34
  test/test_delimited_to_arrays_integration.py
@@ -0,0 +1 @@
1
+ numpy>=1.24.3
@@ -3,9 +3,8 @@ import os
3
3
  import typing as tp
4
4
  from setuptools import Extension # type: ignore
5
5
  from setuptools import setup
6
- from pathlib import Path
7
6
 
8
- AK_VERSION = '0.9.0'
7
+ AK_VERSION = '1.0.0'
9
8
 
10
9
  def get_long_description() -> str:
11
10
  return '''The ArrayKit library provides utilities for creating and transforming NumPy arrays, implementing performance-critical StaticFrame operations as Python C extensions.
@@ -40,6 +39,7 @@ ak_extension = Extension(
40
39
  'src/delimited_to_arrays.c',
41
40
  'src/methods.c',
42
41
  'src/tri_map.c',
42
+ 'src/auto_map.c',
43
43
  ],
44
44
  include_dirs=get_ext_dir('numpy', '_core', 'include') + ['src'],
45
45
  library_dirs=get_ext_dir('numpy', '_core', 'lib'),
@@ -52,8 +52,8 @@ setup(
52
52
  version=AK_VERSION,
53
53
  description='Array utilities for StaticFrame',
54
54
  long_description=get_long_description(),
55
- python_requires='>=3.9',
56
- install_requires=['numpy>=1.19.5'],
55
+ python_requires='>=3.10',
56
+ install_requires=['numpy>=1.24.3'],
57
57
  url='https://github.com/static-frame/arraykit',
58
58
  author='Christopher Ariza, Brandt Bucher, Charles Burkland',
59
59
  license='MIT',
@@ -68,10 +68,10 @@ setup(
68
68
  'Operating System :: MacOS :: MacOS X',
69
69
  'Operating System :: Microsoft :: Windows',
70
70
  'Operating System :: POSIX',
71
- 'Programming Language :: Python :: 3.9',
72
71
  'Programming Language :: Python :: 3.10',
73
72
  'Programming Language :: Python :: 3.11',
74
73
  'Programming Language :: Python :: 3.12',
74
+ 'Programming Language :: Python :: 3.13',
75
75
  'Typing :: Typed',
76
76
  ],
77
77
  keywords='numpy array',
@@ -31,3 +31,7 @@ from ._arraykit import slice_to_ascending_slice as slice_to_ascending_slice
31
31
  from ._arraykit import array_to_tuple_array as array_to_tuple_array
32
32
  from ._arraykit import array_to_tuple_iter as array_to_tuple_iter
33
33
  from ._arraykit import nonzero_1d as nonzero_1d
34
+
35
+ from ._arraykit import AutoMap as AutoMap
36
+ from ._arraykit import FrozenAutoMap as FrozenAutoMap
37
+ from ._arraykit import NonUniqueError as NonUniqueError
@@ -108,6 +108,39 @@ class BlockIndex:
108
108
  ) -> tp.Iterator[tp.Tuple[int, tp.Union[slice, int]]]: ...
109
109
  def iter_block(self) -> tp.Iterator[tp.Tuple[int, slice]]: ...
110
110
 
111
+
112
+ class FrozenAutoMap:
113
+ def __init__(self, labels: tp.Iterable[_TLabel] | np.ndarray, /,) -> None: ...
114
+ def get(self, __key: _TLabel, /,) -> int: ...
115
+ def keys(self) -> tp.Iterator[_TLabel]: ...
116
+ def items(self) -> tp.Iterator[tuple[_TLabel, int]]: ...
117
+ def values(self) -> tp.Iterator[int]: ...
118
+ def get_all(self, __key: list[_TLabel] | np.ndarray) -> np.ndarray: ...
119
+ def get_any(self, __key: list[_TLabel] | np.ndarray) -> list[int]: ...
120
+
121
+ def __iter__(self) -> tp.Iterator[_TLabel]: ...
122
+ def __getitem__(self, __key: tp.Any) -> int: ...
123
+ def __contains__(self, __key: tp.Any) -> bool: ...
124
+ def __getnewargs__(self) -> tp.Any: ...
125
+ def __reversed__(self) -> tp.Any: ...
126
+ def __sizeof__(self) -> int: ...
127
+ def __getstate__(self) -> tp.Any: ...
128
+ def __setstate__(self, __state: tp.Any) -> None: ...
129
+ def __len__(self) -> int: ...
130
+
131
+ def __or__(self) -> tp.Any: ...
132
+ def __ror__(self) -> tp.Any: ...
133
+
134
+
135
+ class AutoMap(FrozenAutoMap):
136
+ def __init__(self, labels: tp.Iterable[_TLabel] | np.ndarray, /,) -> None: ...
137
+ def __ior__(self) -> tp.Any: ...
138
+ def add(self, __key: int) -> None: ...
139
+ def update(self, __keys: tp.Iterable[_TLabel] | np.ndarray) -> None: ...
140
+
141
+
142
+
143
+
111
144
  def iterable_str_to_array_1d(
112
145
  iterable: tp.Iterable[str],
113
146
  *,
@@ -11,6 +11,7 @@
11
11
  # include "delimited_to_arrays.h"
12
12
  # include "methods.h"
13
13
  # include "tri_map.h"
14
+ # include "auto_map.h"
14
15
 
15
16
  static PyMethodDef arraykit_methods[] = {
16
17
  {"immutable_filter", immutable_filter, METH_O, NULL},
@@ -85,6 +86,15 @@ PyInit__arraykit(void)
85
86
  return NULL;
86
87
  }
87
88
 
89
+ NonUniqueError = PyErr_NewExceptionWithDoc(
90
+ "arraykit.NonUniqueError",
91
+ "ValueError for non-unique values.",
92
+ PyExc_ValueError,
93
+ NULL);
94
+ if (NonUniqueError == NULL) {
95
+ return NULL;
96
+ }
97
+
88
98
  PyObject *copy = PyImport_ImportModule("copy");
89
99
  if (copy == NULL) {
90
100
  return NULL;
@@ -107,12 +117,19 @@ PyInit__arraykit(void)
107
117
  PyType_Ready(&BIIterBlockType) ||
108
118
  PyType_Ready(&TriMapType) ||
109
119
  PyType_Ready(&ArrayGOType) ||
120
+ PyType_Ready(&AMType) ||
121
+ PyType_Ready(&FAMIType) ||
122
+ PyType_Ready(&FAMVType) ||
123
+ PyType_Ready(&FAMType) ||
110
124
  PyModule_AddObject(m, "BlockIndex", (PyObject *) &BlockIndexType) ||
111
125
  PyModule_AddObject(m, "TriMap", (PyObject *) &TriMapType) ||
112
126
  PyModule_AddObject(m, "ArrayGO", (PyObject *) &ArrayGOType) ||
113
127
  PyModule_AddObject(m, "deepcopy", deepcopy) ||
114
- PyModule_AddObject(m, "ErrorInitTypeBlocks", ErrorInitTypeBlocks)
115
- ){
128
+ PyModule_AddObject(m, "ErrorInitTypeBlocks", ErrorInitTypeBlocks) ||
129
+ PyModule_AddObject(m, "AutoMap", (PyObject *)&AMType) ||
130
+ PyModule_AddObject(m, "FrozenAutoMap", (PyObject *)&FAMType) ||
131
+ PyModule_AddObject(m, "NonUniqueError", NonUniqueError)
132
+ ){
116
133
  Py_DECREF(deepcopy);
117
134
  Py_XDECREF(m);
118
135
  return NULL;