@@ -124,20 +124,16 @@ def test_pack():
124
124
assert x == unpack (pack (x )), "Set did not pack/unpack correctly"
125
125
126
126
x = tuple (range (10 ))
127
- assert x == unpack (
128
- pack (range (10 ))), "Iterator did not pack/unpack correctly"
127
+ assert x == unpack (pack (range (10 ))), "Iterator did not pack/unpack correctly"
129
128
130
129
x = Decimal ("1.24" )
131
- assert x == approx (
132
- unpack (pack (x ))), "Decimal object did not pack/unpack correctly"
130
+ assert x == approx (unpack (pack (x ))), "Decimal object did not pack/unpack correctly"
133
131
134
132
x = datetime .now ()
135
- assert x == unpack (
136
- pack (x )), "Datetime object did not pack/unpack correctly"
133
+ assert x == unpack (pack (x )), "Datetime object did not pack/unpack correctly"
137
134
138
135
x = np .bool_ (True )
139
- assert x == unpack (
140
- pack (x )), "Numpy bool object did not pack/unpack correctly"
136
+ assert x == unpack (pack (x )), "Numpy bool object did not pack/unpack correctly"
141
137
142
138
x = "test"
143
139
assert x == unpack (pack (x )), "String object did not pack/unpack correctly"
@@ -158,15 +154,13 @@ def test_recarrays():
158
154
x = x .view (np .recarray )
159
155
assert_array_equal (x , unpack (pack (x )))
160
156
161
- x = np .array ([(3 , 4 )], dtype = [("tmp0" , float ),
162
- ("tmp1" , "O" )]).view (np .recarray )
157
+ x = np .array ([(3 , 4 )], dtype = [("tmp0" , float ), ("tmp1" , "O" )]).view (np .recarray )
163
158
assert_array_equal (x , unpack (pack (x )))
164
159
165
160
166
161
def test_object_arrays ():
167
162
x = np .array (((1 , 2 , 3 ), True ), dtype = "object" )
168
- assert_array_equal (x , unpack (pack (x )),
169
- "Object array did not serialize correctly" )
163
+ assert_array_equal (x , unpack (pack (x )), "Object array did not serialize correctly" )
170
164
171
165
172
166
def test_complex ():
@@ -176,12 +170,10 @@ def test_complex():
176
170
z = np .random .randn (10 ) + 1j * np .random .randn (10 )
177
171
assert_array_equal (z , unpack (pack (z )), "Arrays do not match!" )
178
172
179
- x = np .float32 (np .random .randn (3 , 4 , 5 )) + 1j * \
180
- np .float32 (np .random .randn (3 , 4 , 5 ))
173
+ x = np .float32 (np .random .randn (3 , 4 , 5 )) + 1j * np .float32 (np .random .randn (3 , 4 , 5 ))
181
174
assert_array_equal (x , unpack (pack (x )), "Arrays do not match!" )
182
175
183
- x = np .int16 (np .random .randn (1 , 2 , 3 )) + 1j * \
184
- np .int16 (np .random .randn (1 , 2 , 3 ))
176
+ x = np .int16 (np .random .randn (1 , 2 , 3 )) + 1j * np .int16 (np .random .randn (1 , 2 , 3 ))
185
177
assert_array_equal (x , unpack (pack (x )), "Arrays do not match!" )
186
178
187
179
@@ -193,8 +185,7 @@ def test_insert_longblob(schema_any):
193
185
194
186
query_mym_blob = {"id" : 1 , "data" : np .array ([1 , 2 , 3 ])}
195
187
Longblob .insert1 (query_mym_blob )
196
- assert_array_equal (
197
- (Longblob & "id=1" ).fetch1 ()["data" ], query_mym_blob ["data" ])
188
+ assert_array_equal ((Longblob & "id=1" ).fetch1 ()["data" ], query_mym_blob ["data" ])
198
189
(Longblob & "id=1" ).delete ()
199
190
200
191
@@ -223,14 +214,12 @@ def test_insert_longblob_32bit(schema_any, enable_feature_32bit_dims):
223
214
)
224
215
]
225
216
],
226
- dtype = [("hits" , "O" ), ("sides" , "O" ),
227
- ("tasks" , "O" ), ("stage" , "O" )],
217
+ dtype = [("hits" , "O" ), ("sides" , "O" ), ("tasks" , "O" ), ("stage" , "O" )],
228
218
),
229
219
}
230
220
assert fetched ["id" ] == expected ["id" ]
231
- for name in expected ['data' ][0 ][0 ].dtype .names :
232
- assert_array_equal (
233
- expected ['data' ][0 ][0 ][name ], fetched ['data' ][0 ][0 ][name ])
221
+ for name in expected ["data" ][0 ][0 ].dtype .names :
222
+ assert_array_equal (expected ["data" ][0 ][0 ][name ], fetched ["data" ][0 ][0 ][name ])
234
223
(Longblob & "id=1" ).delete ()
235
224
236
225
0 commit comments