pydiverse-common 0.2.0__py3-none-any.whl → 0.3.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.
- pydiverse/common/__init__.py +8 -8
- pydiverse/common/dtypes.py +40 -32
- {pydiverse_common-0.2.0.dist-info → pydiverse_common-0.3.0.dist-info}/METADATA +1 -1
- {pydiverse_common-0.2.0.dist-info → pydiverse_common-0.3.0.dist-info}/RECORD +6 -6
- {pydiverse_common-0.2.0.dist-info → pydiverse_common-0.3.0.dist-info}/WHEEL +0 -0
- {pydiverse_common-0.2.0.dist-info → pydiverse_common-0.3.0.dist-info}/licenses/LICENSE +0 -0
pydiverse/common/__init__.py
CHANGED
@@ -20,10 +20,10 @@ from .dtypes import (
|
|
20
20
|
PandasBackend,
|
21
21
|
String,
|
22
22
|
Time,
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
23
|
+
UInt8,
|
24
|
+
UInt16,
|
25
|
+
UInt32,
|
26
|
+
UInt64,
|
27
27
|
)
|
28
28
|
|
29
29
|
__all__ = [
|
@@ -44,10 +44,10 @@ __all__ = [
|
|
44
44
|
"NullType",
|
45
45
|
"String",
|
46
46
|
"Time",
|
47
|
-
"
|
48
|
-
"
|
49
|
-
"
|
50
|
-
"
|
47
|
+
"UInt8",
|
48
|
+
"UInt16",
|
49
|
+
"UInt32",
|
50
|
+
"UInt64",
|
51
51
|
"List",
|
52
52
|
"PandasBackend",
|
53
53
|
]
|
pydiverse/common/dtypes.py
CHANGED
@@ -102,13 +102,13 @@ class Dtype:
|
|
102
102
|
raise TypeError
|
103
103
|
if pd.api.types.is_unsigned_integer_dtype(pandas_type):
|
104
104
|
if is_np_dtype(pandas_type, np.uint64):
|
105
|
-
return
|
105
|
+
return UInt64()
|
106
106
|
elif is_np_dtype(pandas_type, np.uint32):
|
107
|
-
return
|
107
|
+
return UInt32()
|
108
108
|
elif is_np_dtype(pandas_type, np.uint16):
|
109
|
-
return
|
109
|
+
return UInt16()
|
110
110
|
elif is_np_dtype(pandas_type, np.uint8):
|
111
|
-
return
|
111
|
+
return UInt8()
|
112
112
|
raise TypeError
|
113
113
|
if pd.api.types.is_float_dtype(pandas_type):
|
114
114
|
if is_np_dtype(pandas_type, np.float64):
|
@@ -143,13 +143,13 @@ class Dtype:
|
|
143
143
|
raise TypeError
|
144
144
|
if pa.types.is_unsigned_integer(arrow_type):
|
145
145
|
if pa.types.is_uint64(arrow_type):
|
146
|
-
return
|
146
|
+
return UInt64()
|
147
147
|
if pa.types.is_uint32(arrow_type):
|
148
|
-
return
|
148
|
+
return UInt32()
|
149
149
|
if pa.types.is_uint16(arrow_type):
|
150
|
-
return
|
150
|
+
return UInt16()
|
151
151
|
if pa.types.is_uint8(arrow_type):
|
152
|
-
return
|
152
|
+
return UInt8()
|
153
153
|
raise TypeError
|
154
154
|
if pa.types.is_floating(arrow_type):
|
155
155
|
if pa.types.is_float64(arrow_type):
|
@@ -186,10 +186,10 @@ class Dtype:
|
|
186
186
|
pl.Int32: Int32(),
|
187
187
|
pl.Int16: Int16(),
|
188
188
|
pl.Int8: Int8(),
|
189
|
-
pl.UInt64:
|
190
|
-
pl.UInt32:
|
191
|
-
pl.UInt16:
|
192
|
-
pl.UInt8:
|
189
|
+
pl.UInt64: UInt64(),
|
190
|
+
pl.UInt32: UInt32(),
|
191
|
+
pl.UInt16: UInt16(),
|
192
|
+
pl.UInt8: UInt8(),
|
193
193
|
pl.Float64: Float64(),
|
194
194
|
pl.Float32: Float32(),
|
195
195
|
pl.Decimal: Decimal(),
|
@@ -207,14 +207,16 @@ class Dtype:
|
|
207
207
|
import sqlalchemy as sqa
|
208
208
|
|
209
209
|
return {
|
210
|
+
Int(): sqa.BigInteger(), # we default to 64 bit
|
210
211
|
Int8(): sqa.SmallInteger(),
|
211
212
|
Int16(): sqa.SmallInteger(),
|
212
213
|
Int32(): sqa.Integer(),
|
213
214
|
Int64(): sqa.BigInteger(),
|
214
|
-
|
215
|
-
|
216
|
-
|
217
|
-
|
215
|
+
UInt8(): sqa.SmallInteger(),
|
216
|
+
UInt16(): sqa.Integer(),
|
217
|
+
UInt32(): sqa.BigInteger(),
|
218
|
+
UInt64(): sqa.BigInteger(),
|
219
|
+
Float(): sqa.Float(53), # we default to 64 bit
|
218
220
|
Float32(): sqa.Float(24),
|
219
221
|
Float64(): sqa.Float(53),
|
220
222
|
Decimal(): sqa.DECIMAL(),
|
@@ -245,14 +247,16 @@ class Dtype:
|
|
245
247
|
raise TypeError("pandas doesn't have a native time dtype")
|
246
248
|
|
247
249
|
return {
|
250
|
+
Int(): pd.Int64Dtype(), # we default to 64 bit
|
248
251
|
Int8(): pd.Int8Dtype(),
|
249
252
|
Int16(): pd.Int16Dtype(),
|
250
253
|
Int32(): pd.Int32Dtype(),
|
251
254
|
Int64(): pd.Int64Dtype(),
|
252
|
-
|
253
|
-
|
254
|
-
|
255
|
-
|
255
|
+
UInt8(): pd.UInt8Dtype(),
|
256
|
+
UInt16(): pd.UInt16Dtype(),
|
257
|
+
UInt32(): pd.UInt32Dtype(),
|
258
|
+
UInt64(): pd.UInt64Dtype(),
|
259
|
+
Float(): pd.Float64Dtype(), # we default to 64 bit
|
256
260
|
Float32(): pd.Float32Dtype(),
|
257
261
|
Float64(): pd.Float64Dtype(),
|
258
262
|
Decimal(): pd.Float64Dtype(), # NumericDtype is
|
@@ -267,14 +271,16 @@ class Dtype:
|
|
267
271
|
import pyarrow as pa
|
268
272
|
|
269
273
|
return {
|
274
|
+
Int(): pa.int64(), # we default to 64 bit
|
270
275
|
Int8(): pa.int8(),
|
271
276
|
Int16(): pa.int16(),
|
272
277
|
Int32(): pa.int32(),
|
273
278
|
Int64(): pa.int64(),
|
274
|
-
|
275
|
-
|
276
|
-
|
277
|
-
|
279
|
+
UInt8(): pa.uint8(),
|
280
|
+
UInt16(): pa.uint16(),
|
281
|
+
UInt32(): pa.uint32(),
|
282
|
+
UInt64(): pa.uint64(),
|
283
|
+
Float(): pa.float64(), # we default to 64 bit
|
278
284
|
Float32(): pa.float32(),
|
279
285
|
Float64(): pa.float64(),
|
280
286
|
Decimal(): pa.decimal128(35, 10), # Arbitrary precision
|
@@ -289,14 +295,16 @@ class Dtype:
|
|
289
295
|
import polars as pl
|
290
296
|
|
291
297
|
return {
|
298
|
+
Int(): pl.Int64, # we default to 64 bit
|
292
299
|
Int64(): pl.Int64,
|
293
300
|
Int32(): pl.Int32,
|
294
301
|
Int16(): pl.Int16,
|
295
302
|
Int8(): pl.Int8,
|
296
|
-
|
297
|
-
|
298
|
-
|
299
|
-
|
303
|
+
UInt64(): pl.UInt64,
|
304
|
+
UInt32(): pl.UInt32,
|
305
|
+
UInt16(): pl.UInt16,
|
306
|
+
UInt8(): pl.UInt8,
|
307
|
+
Float(): pl.Float64, # we default to 64 bit
|
300
308
|
Float64(): pl.Float64,
|
301
309
|
Float32(): pl.Float32,
|
302
310
|
Decimal(): pl.Decimal(scale=10), # Arbitrary precision
|
@@ -343,16 +351,16 @@ class Int16(Int): ...
|
|
343
351
|
class Int8(Int): ...
|
344
352
|
|
345
353
|
|
346
|
-
class
|
354
|
+
class UInt64(Int): ...
|
347
355
|
|
348
356
|
|
349
|
-
class
|
357
|
+
class UInt32(Int): ...
|
350
358
|
|
351
359
|
|
352
|
-
class
|
360
|
+
class UInt16(Int): ...
|
353
361
|
|
354
362
|
|
355
|
-
class
|
363
|
+
class UInt8(Int): ...
|
356
364
|
|
357
365
|
|
358
366
|
class String(Dtype): ...
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: pydiverse-common
|
3
|
-
Version: 0.
|
3
|
+
Version: 0.3.0
|
4
4
|
Summary: Common functionality shared between pydiverse libraries
|
5
5
|
Author: QuantCo, Inc.
|
6
6
|
Author-email: Martin Trautmann <windiana@users.sf.net>, Finn Rudolph <finn.rudolph@t-online.de>
|
@@ -1,5 +1,5 @@
|
|
1
|
-
pydiverse/common/__init__.py,sha256=
|
2
|
-
pydiverse/common/dtypes.py,sha256=
|
1
|
+
pydiverse/common/__init__.py,sha256=2t3wnZGY_KITo5lysb-GAgXizeyd_iZvPjEHKnMsYpA,732
|
2
|
+
pydiverse/common/dtypes.py,sha256=7qPxKH1yqVSacANi5Kl36DdBTHKSMZI2WkZCiEEejyU,12074
|
3
3
|
pydiverse/common/errors/__init__.py,sha256=FNeEfVbUa23b9sHkFsmxHYhY6sRgjaZysPQmlovpJrI,262
|
4
4
|
pydiverse/common/util/__init__.py,sha256=fGdKZtLaTVBW7NfCpX7rZhKHwUzmBnsuY2akDOnAnjc,315
|
5
5
|
pydiverse/common/util/computation_tracing.py,sha256=HeXRHRUI8vxpzQ27Xcpa0StndSTP63EMT9vj4trPJUY,9697
|
@@ -9,7 +9,7 @@ pydiverse/common/util/disposable.py,sha256=4XoGz70YRWA9TAqnUBvRCTAdsOGBviFN0gzxU
|
|
9
9
|
pydiverse/common/util/hashing.py,sha256=6x77BKg-w61u59fuTe9di0BtU-kEKH6UTRcKsRoYJ84,1196
|
10
10
|
pydiverse/common/util/import_.py,sha256=K7dSgz4YyrqEvqhoOzbwgD7D8HScMoO5XoSWtjbaoUs,4056
|
11
11
|
pydiverse/common/util/structlog.py,sha256=g0d8yaXBzAxmGNGZYMnMP9dsSQ__jN44GAY8Mb0ABeI,3487
|
12
|
-
pydiverse_common-0.
|
13
|
-
pydiverse_common-0.
|
14
|
-
pydiverse_common-0.
|
15
|
-
pydiverse_common-0.
|
12
|
+
pydiverse_common-0.3.0.dist-info/METADATA,sha256=5pwbOinMHcsH1Nbhe69cbh0eouevUvFNGt-QlLdl-HU,3357
|
13
|
+
pydiverse_common-0.3.0.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
14
|
+
pydiverse_common-0.3.0.dist-info/licenses/LICENSE,sha256=AcE6SDVuAq6v9ZLE_8eOCe_NvSE0rAPR3NR7lSowYh4,1517
|
15
|
+
pydiverse_common-0.3.0.dist-info/RECORD,,
|
File without changes
|
File without changes
|