dataiter 0.51__tar.gz → 0.99__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.
- {dataiter-0.51 → dataiter-0.99}/PKG-INFO +3 -3
- {dataiter-0.51 → dataiter-0.99}/dataiter/__init__.py +6 -1
- {dataiter-0.51 → dataiter-0.99}/dataiter/dt.py +1 -1
- {dataiter-0.51 → dataiter-0.99}/dataiter/test/test_vector.py +1 -1
- {dataiter-0.51 → dataiter-0.99}/dataiter/vector.py +5 -3
- {dataiter-0.51 → dataiter-0.99}/pyproject.toml +2 -2
- {dataiter-0.51 → dataiter-0.99}/.gitignore +0 -0
- {dataiter-0.51 → dataiter-0.99}/AUTHORS.md +0 -0
- {dataiter-0.51 → dataiter-0.99}/COPYING +0 -0
- {dataiter-0.51 → dataiter-0.99}/README.md +0 -0
- {dataiter-0.51 → dataiter-0.99}/dataiter/aggregate.py +0 -0
- {dataiter-0.51 → dataiter-0.99}/dataiter/data_frame.py +0 -0
- {dataiter-0.51 → dataiter-0.99}/dataiter/deco.py +0 -0
- {dataiter-0.51 → dataiter-0.99}/dataiter/geojson.py +0 -0
- {dataiter-0.51 → dataiter-0.99}/dataiter/io.py +0 -0
- {dataiter-0.51 → dataiter-0.99}/dataiter/list_of_dicts.py +0 -0
- {dataiter-0.51 → dataiter-0.99}/dataiter/test/__init__.py +0 -0
- {dataiter-0.51 → dataiter-0.99}/dataiter/test/test_aggregate.py +0 -0
- {dataiter-0.51 → dataiter-0.99}/dataiter/test/test_data_frame.py +0 -0
- {dataiter-0.51 → dataiter-0.99}/dataiter/test/test_dt.py +0 -0
- {dataiter-0.51 → dataiter-0.99}/dataiter/test/test_geojson.py +0 -0
- {dataiter-0.51 → dataiter-0.99}/dataiter/test/test_io.py +0 -0
- {dataiter-0.51 → dataiter-0.99}/dataiter/test/test_list_of_dicts.py +0 -0
- {dataiter-0.51 → dataiter-0.99}/dataiter/test/test_util.py +0 -0
- {dataiter-0.51 → dataiter-0.99}/dataiter/util.py +0 -0
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: dataiter
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.99
|
|
4
4
|
Summary: Classes for data manipulation
|
|
5
5
|
Project-URL: Homepage, https://github.com/otsaloma/dataiter
|
|
6
6
|
Author-email: Osmo Salomaa <otsaloma@iki.fi>
|
|
7
7
|
License-Expression: MIT
|
|
8
8
|
License-File: AUTHORS.md
|
|
9
9
|
License-File: COPYING
|
|
10
|
-
Requires-Python: >=3.
|
|
10
|
+
Requires-Python: >=3.9.0
|
|
11
11
|
Requires-Dist: attd>=0.3
|
|
12
|
-
Requires-Dist: numpy<
|
|
12
|
+
Requires-Dist: numpy<3.0,>=2.0
|
|
13
13
|
Requires-Dist: pandas>=1.0
|
|
14
14
|
Requires-Dist: wcwidth>=0.1
|
|
15
15
|
Description-Content-Type: text/markdown
|
|
@@ -21,10 +21,11 @@
|
|
|
21
21
|
# THE SOFTWARE.
|
|
22
22
|
|
|
23
23
|
import contextlib
|
|
24
|
+
import numpy as np
|
|
24
25
|
|
|
25
26
|
from dataiter import util
|
|
26
27
|
|
|
27
|
-
__version__ = "0.
|
|
28
|
+
__version__ = "0.99"
|
|
28
29
|
|
|
29
30
|
DEFAULT_PEEK_ELEMENTS = 10
|
|
30
31
|
DEFAULT_PEEK_ITEMS = 3
|
|
@@ -39,6 +40,9 @@ PRINT_TRUNCATE_WIDTH = 36
|
|
|
39
40
|
USE_NUMBA = False
|
|
40
41
|
USE_NUMBA_CACHE = True
|
|
41
42
|
|
|
43
|
+
if not np.__version__.startswith("2."):
|
|
44
|
+
raise Exception("NumPy 2.x required")
|
|
45
|
+
|
|
42
46
|
with contextlib.suppress(LookupError):
|
|
43
47
|
USE_NUMBA_CACHE = util.parse_env_boolean("DATAITER_USE_NUMBA_CACHE")
|
|
44
48
|
|
|
@@ -61,6 +65,7 @@ except LookupError:
|
|
|
61
65
|
|
|
62
66
|
globals().pop("check", None)
|
|
63
67
|
globals().pop("contextlib", None)
|
|
68
|
+
globals().pop("np", None)
|
|
64
69
|
globals().pop("numba", None)
|
|
65
70
|
globals().pop("util", None)
|
|
66
71
|
|
|
@@ -50,7 +50,7 @@ def from_string(x, format):
|
|
|
50
50
|
return from_string(x, format)[0]
|
|
51
51
|
x = util.sequencify(x)
|
|
52
52
|
assert isinstance(x, np.ndarray)
|
|
53
|
-
assert np.issubdtype(x.dtype, np.
|
|
53
|
+
assert np.issubdtype(x.dtype, np.str_)
|
|
54
54
|
out = np.full_like(x, None, object)
|
|
55
55
|
out = Vector.fast(out, object)
|
|
56
56
|
na = x == ""
|
|
@@ -46,7 +46,7 @@ class TestVector:
|
|
|
46
46
|
assert Vector([np.bool_(True)]).is_boolean()
|
|
47
47
|
assert Vector([np.datetime64(DATE)]).is_datetime()
|
|
48
48
|
assert Vector([np.datetime64(DATETIME)]).is_datetime()
|
|
49
|
-
assert Vector([np.
|
|
49
|
+
assert Vector([np.float64(0.5)]).is_float()
|
|
50
50
|
assert Vector([np.int_(1)]).is_integer()
|
|
51
51
|
assert Vector([np.object_(np)]).is_object()
|
|
52
52
|
assert Vector([np.str_("")]).is_string()
|
|
@@ -78,10 +78,12 @@ class Vector(np.ndarray):
|
|
|
78
78
|
"""
|
|
79
79
|
self._check_dimensions()
|
|
80
80
|
|
|
81
|
-
def __array_wrap__(self, array, context=None):
|
|
81
|
+
def __array_wrap__(self, array, context=None, return_scalar=False):
|
|
82
82
|
# Avoid returning 0-dimensional arrays.
|
|
83
83
|
# https://github.com/numpy/numpy/issues/7403
|
|
84
|
-
|
|
84
|
+
if not array.shape or return_scalar:
|
|
85
|
+
return array.dtype.type(array)
|
|
86
|
+
return array.view(self.__class__)
|
|
85
87
|
|
|
86
88
|
def __repr__(self):
|
|
87
89
|
return self.to_string()
|
|
@@ -322,7 +324,7 @@ class Vector(np.ndarray):
|
|
|
322
324
|
"""
|
|
323
325
|
Return whether vector data type is string.
|
|
324
326
|
"""
|
|
325
|
-
return np.issubdtype(self.dtype, np.
|
|
327
|
+
return np.issubdtype(self.dtype, np.str_)
|
|
326
328
|
|
|
327
329
|
def is_timedelta(self):
|
|
328
330
|
"""
|
|
@@ -8,9 +8,9 @@ dynamic = ["version"]
|
|
|
8
8
|
description = "Classes for data manipulation"
|
|
9
9
|
readme = "README.md"
|
|
10
10
|
license = "MIT"
|
|
11
|
-
requires-python = ">=3.
|
|
11
|
+
requires-python = ">=3.9.0"
|
|
12
12
|
authors = [{ name = "Osmo Salomaa", email = "otsaloma@iki.fi" }]
|
|
13
|
-
dependencies = ["attd>=0.3", "numpy>=
|
|
13
|
+
dependencies = ["attd>=0.3", "numpy>=2.0,<3.0", "pandas>=1.0", "wcwidth>=0.1"]
|
|
14
14
|
|
|
15
15
|
[project.urls]
|
|
16
16
|
Homepage = "https://github.com/otsaloma/dataiter"
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|