@@ -159,8 +159,15 @@ def test_frame(self):
159
159
self ._check_roundtrip_table (df , tm .assert_frame_equal )
160
160
self ._check_roundtrip (df , tm .assert_frame_equal )
161
161
162
+ self ._check_roundtrip_table (df , tm .assert_frame_equal ,
163
+ compression = True )
164
+ self ._check_roundtrip (df , tm .assert_frame_equal ,
165
+ compression = True )
166
+
162
167
tdf = tm .makeTimeDataFrame ()
163
168
self ._check_roundtrip (tdf , tm .assert_frame_equal )
169
+ self ._check_roundtrip (tdf , tm .assert_frame_equal ,
170
+ compression = True )
164
171
165
172
def test_store_mixed (self ):
166
173
def _make_one ():
@@ -283,8 +290,13 @@ def test_select_filter_corner(self):
283
290
result = self .store .select ('frame' , [crit ])
284
291
tm .assert_frame_equal (result , df .ix [:, df .columns [:75 ]])
285
292
286
- def _check_roundtrip (self , obj , comparator ):
287
- store = HDFStore (self .scratchpath , 'w' )
293
+ def _check_roundtrip (self , obj , comparator , compression = False ):
294
+ options = {}
295
+ if compression :
296
+ options ['complevel' ] = 9
297
+ options ['complib' ] = 'blosc'
298
+
299
+ store = HDFStore (self .scratchpath , 'w' , ** options )
288
300
try :
289
301
store ['obj' ] = obj
290
302
retrieved = store ['obj' ]
@@ -293,8 +305,13 @@ def _check_roundtrip(self, obj, comparator):
293
305
store .close ()
294
306
os .remove (self .scratchpath )
295
307
296
- def _check_roundtrip_table (self , obj , comparator ):
297
- store = HDFStore (self .scratchpath , 'w' )
308
+ def _check_roundtrip_table (self , obj , comparator , compression = False ):
309
+ options = {}
310
+ if compression :
311
+ options ['complevel' ] = 9
312
+ options ['complib' ] = 'blosc'
313
+
314
+ store = HDFStore (self .scratchpath , 'w' , ** options )
298
315
try :
299
316
store .put ('obj' , obj , table = True )
300
317
retrieved = store ['obj' ]
0 commit comments