pydiverse-common 0.3.5__py3-none-any.whl → 0.3.6__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/dtypes.py +7 -4
- pydiverse/common/util/structlog.py +10 -1
- {pydiverse_common-0.3.5.dist-info → pydiverse_common-0.3.6.dist-info}/METADATA +1 -1
- {pydiverse_common-0.3.5.dist-info → pydiverse_common-0.3.6.dist-info}/RECORD +6 -6
- {pydiverse_common-0.3.5.dist-info → pydiverse_common-0.3.6.dist-info}/WHEEL +0 -0
- {pydiverse_common-0.3.5.dist-info → pydiverse_common-0.3.6.dist-info}/licenses/LICENSE +0 -0
pydiverse/common/dtypes.py
CHANGED
@@ -103,7 +103,10 @@ class Dtype:
|
|
103
103
|
type_, pd.core.dtypes.common.classes(np_dtype)
|
104
104
|
)
|
105
105
|
|
106
|
-
|
106
|
+
workaround = (
|
107
|
+
pandas_type is not np.floating
|
108
|
+
) # see https://github.com/pandas-dev/pandas/issues/62018
|
109
|
+
if workaround and pd.api.types.is_signed_integer_dtype(pandas_type):
|
107
110
|
if is_np_dtype(pandas_type, np.int64):
|
108
111
|
return Int64()
|
109
112
|
elif is_np_dtype(pandas_type, np.int32):
|
@@ -113,7 +116,7 @@ class Dtype:
|
|
113
116
|
elif is_np_dtype(pandas_type, np.int8):
|
114
117
|
return Int8()
|
115
118
|
raise TypeError
|
116
|
-
if pd.api.types.is_unsigned_integer_dtype(pandas_type):
|
119
|
+
if workaround and pd.api.types.is_unsigned_integer_dtype(pandas_type):
|
117
120
|
if is_np_dtype(pandas_type, np.uint64):
|
118
121
|
return UInt64()
|
119
122
|
elif is_np_dtype(pandas_type, np.uint32):
|
@@ -123,8 +126,8 @@ class Dtype:
|
|
123
126
|
elif is_np_dtype(pandas_type, np.uint8):
|
124
127
|
return UInt8()
|
125
128
|
raise TypeError
|
126
|
-
if pd.api.types.is_float_dtype(pandas_type):
|
127
|
-
if is_np_dtype(pandas_type, np.float64):
|
129
|
+
if not workaround or pd.api.types.is_float_dtype(pandas_type):
|
130
|
+
if not workaround or is_np_dtype(pandas_type, np.float64):
|
128
131
|
return Float64()
|
129
132
|
elif is_np_dtype(pandas_type, np.float32):
|
130
133
|
return Float32()
|
@@ -80,7 +80,7 @@ class PydiverseConsoleRenderer(structlog.dev.ConsoleRenderer):
|
|
80
80
|
|
81
81
|
def setup_logging(
|
82
82
|
log_level=logging.INFO,
|
83
|
-
log_stream=
|
83
|
+
log_stream=None,
|
84
84
|
timestamp_format="%Y-%m-%d %H:%M:%S.%f",
|
85
85
|
):
|
86
86
|
"""Configures structlog and logging with sane defaults."""
|
@@ -92,6 +92,15 @@ def setup_logging(
|
|
92
92
|
level=log_level,
|
93
93
|
handlers=[StructlogHandler()],
|
94
94
|
)
|
95
|
+
if log_stream is None:
|
96
|
+
try:
|
97
|
+
# hack to avoid dask pickling problems with pytest capture
|
98
|
+
import structlog._output
|
99
|
+
|
100
|
+
structlog._output.stderr = sys.stderr
|
101
|
+
finally:
|
102
|
+
pass
|
103
|
+
log_stream = sys.stderr
|
95
104
|
# Configure structlog
|
96
105
|
structlog.configure(
|
97
106
|
processors=[
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: pydiverse-common
|
3
|
-
Version: 0.3.
|
3
|
+
Version: 0.3.6
|
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
1
|
pydiverse/common/__init__.py,sha256=J7b4iStFyaEMYre_jdlZ4l_8dLyrMWCIpQdsMQcB8aI,806
|
2
|
-
pydiverse/common/dtypes.py,sha256=
|
2
|
+
pydiverse/common/dtypes.py,sha256=LYZKaKYq_4uI4kUhoaCTTo5j1SRurswIOfN11Bkz25A,15986
|
3
3
|
pydiverse/common/testing.py,sha256=FcivI5wn0X3gzJhwnysKvCOgjSTTXaN6FtSFJ72jfSg,341
|
4
4
|
pydiverse/common/version.py,sha256=1IU_m4r76_Qq0u-Tyo2_bERZFOkh0ZFueVzDqcCfLO0,336
|
5
5
|
pydiverse/common/errors/__init__.py,sha256=FNeEfVbUa23b9sHkFsmxHYhY6sRgjaZysPQmlovpJrI,262
|
@@ -10,8 +10,8 @@ pydiverse/common/util/deep_merge.py,sha256=bV5p5_lsC-9nFah28EiEyG2h6U3Z5AuTqSoox
|
|
10
10
|
pydiverse/common/util/disposable.py,sha256=4XoGz70YRWA9TAqnUBvRCTAdsOGBviFN0gzxU7veY9o,993
|
11
11
|
pydiverse/common/util/hashing.py,sha256=6x77BKg-w61u59fuTe9di0BtU-kEKH6UTRcKsRoYJ84,1196
|
12
12
|
pydiverse/common/util/import_.py,sha256=K7dSgz4YyrqEvqhoOzbwgD7D8HScMoO5XoSWtjbaoUs,4056
|
13
|
-
pydiverse/common/util/structlog.py,sha256=
|
14
|
-
pydiverse_common-0.3.
|
15
|
-
pydiverse_common-0.3.
|
16
|
-
pydiverse_common-0.3.
|
17
|
-
pydiverse_common-0.3.
|
13
|
+
pydiverse/common/util/structlog.py,sha256=xxhauxMuyxcKXTVg1MiPTkuvPBj8Zcr4o_v8Bq59Nig,3778
|
14
|
+
pydiverse_common-0.3.6.dist-info/METADATA,sha256=TVaCnX9IArQwB64MGJ4wfVv1EE7KUDI51u9d0QnFXeY,3399
|
15
|
+
pydiverse_common-0.3.6.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
16
|
+
pydiverse_common-0.3.6.dist-info/licenses/LICENSE,sha256=AcE6SDVuAq6v9ZLE_8eOCe_NvSE0rAPR3NR7lSowYh4,1517
|
17
|
+
pydiverse_common-0.3.6.dist-info/RECORD,,
|
File without changes
|
File without changes
|