Skip to content

Commit 65937df

Browse files
committed
allow_pickle=True for np.load in tests
1 parent e7d64da commit 65937df

File tree

3 files changed

+52
-52
lines changed

3 files changed

+52
-52
lines changed

tests/test_func_api_classification_binary.py

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ def test_oof_pred_mode(self):
145145
# Normally if cleaning is performed there is only one .npy file at given moment
146146
# But if we have no cleaning there may be more then one file so we take the latest
147147
file_name = sorted(glob.glob(os.path.join(temp_dir, '*.npy')))[-1] # take the latest file
148-
S = np.load(file_name)
148+
S = np.load(file_name, allow_pickle=True)
149149
S_train_3 = S[0]
150150
S_test_3 = S[1]
151151

@@ -171,7 +171,7 @@ def test_oof_mode(self):
171171
# Normally if cleaning is performed there is only one .npy file at given moment
172172
# But if we have no cleaning there may be more then one file so we take the latest
173173
file_name = sorted(glob.glob(os.path.join(temp_dir, '*.npy')))[-1] # take the latest file
174-
S = np.load(file_name)
174+
S = np.load(file_name, allow_pickle=True)
175175
S_train_3 = S[0]
176176
S_test_3 = S[1]
177177

@@ -197,7 +197,7 @@ def test_pred_mode(self):
197197
# Normally if cleaning is performed there is only one .npy file at given moment
198198
# But if we have no cleaning there may be more then one file so we take the latest
199199
file_name = sorted(glob.glob(os.path.join(temp_dir, '*.npy')))[-1] # take the latest file
200-
S = np.load(file_name)
200+
S = np.load(file_name, allow_pickle=True)
201201
S_train_3 = S[0]
202202
S_test_3 = S[1]
203203

@@ -236,7 +236,7 @@ def test_oof_pred_bag_mode(self):
236236
# Normally if cleaning is performed there is only one .npy file at given moment
237237
# But if we have no cleaning there may be more then one file so we take the latest
238238
file_name = sorted(glob.glob(os.path.join(temp_dir, '*.npy')))[-1] # take the latest file
239-
S = np.load(file_name)
239+
S = np.load(file_name, allow_pickle=True)
240240
S_train_3 = S[0]
241241
S_test_3 = S[1]
242242

@@ -273,7 +273,7 @@ def test_pred_bag_mode(self):
273273
# Normally if cleaning is performed there is only one .npy file at given moment
274274
# But if we have no cleaning there may be more then one file so we take the latest
275275
file_name = sorted(glob.glob(os.path.join(temp_dir, '*.npy')))[-1] # take the latest file
276-
S = np.load(file_name)
276+
S = np.load(file_name, allow_pickle=True)
277277
S_train_3 = S[0]
278278
S_test_3 = S[1]
279279

@@ -304,7 +304,7 @@ def test_oof_pred_mode_proba(self):
304304
# Normally if cleaning is performed there is only one .npy file at given moment
305305
# But if we have no cleaning there may be more then one file so we take the latest
306306
file_name = sorted(glob.glob(os.path.join(temp_dir, '*.npy')))[-1] # take the latest file
307-
S = np.load(file_name)
307+
S = np.load(file_name, allow_pickle=True)
308308
S_train_3 = S[0]
309309
S_test_3 = S[1]
310310

@@ -330,7 +330,7 @@ def test_oof_mode_proba(self):
330330
# Normally if cleaning is performed there is only one .npy file at given moment
331331
# But if we have no cleaning there may be more then one file so we take the latest
332332
file_name = sorted(glob.glob(os.path.join(temp_dir, '*.npy')))[-1] # take the latest file
333-
S = np.load(file_name)
333+
S = np.load(file_name, allow_pickle=True)
334334
S_train_3 = S[0]
335335
S_test_3 = S[1]
336336

@@ -356,7 +356,7 @@ def test_pred_mode_proba(self):
356356
# Normally if cleaning is performed there is only one .npy file at given moment
357357
# But if we have no cleaning there may be more then one file so we take the latest
358358
file_name = sorted(glob.glob(os.path.join(temp_dir, '*.npy')))[-1] # take the latest file
359-
S = np.load(file_name)
359+
S = np.load(file_name, allow_pickle=True)
360360
S_train_3 = S[0]
361361
S_test_3 = S[1]
362362

@@ -398,7 +398,7 @@ def test_oof_pred_bag_mode_proba(self):
398398
# Normally if cleaning is performed there is only one .npy file at given moment
399399
# But if we have no cleaning there may be more then one file so we take the latest
400400
file_name = sorted(glob.glob(os.path.join(temp_dir, '*.npy')))[-1] # take the latest file
401-
S = np.load(file_name)
401+
S = np.load(file_name, allow_pickle=True)
402402
S_train_3 = S[0]
403403
S_test_3 = S[1]
404404

@@ -447,7 +447,7 @@ def test_pred_bag_mode_proba(self):
447447
# Normally if cleaning is performed there is only one .npy file at given moment
448448
# But if we have no cleaning there may be more then one file so we take the latest
449449
file_name = sorted(glob.glob(os.path.join(temp_dir, '*.npy')))[-1] # take the latest file
450-
S = np.load(file_name)
450+
S = np.load(file_name, allow_pickle=True)
451451
S_train_3 = S[0]
452452
S_test_3 = S[1]
453453

@@ -491,7 +491,7 @@ def test_oof_pred_bag_mode_shuffle(self):
491491
# Normally if cleaning is performed there is only one .npy file at given moment
492492
# But if we have no cleaning there may be more then one file so we take the latest
493493
file_name = sorted(glob.glob(os.path.join(temp_dir, '*.npy')))[-1] # take the latest file
494-
S = np.load(file_name)
494+
S = np.load(file_name, allow_pickle=True)
495495
S_train_3 = S[0]
496496
S_test_3 = S[1]
497497

@@ -609,7 +609,7 @@ def test_oof_pred_mode_2_models(self):
609609
# Normally if cleaning is performed there is only one .npy file at given moment
610610
# But if we have no cleaning there may be more then one file so we take the latest
611611
file_name = sorted(glob.glob(os.path.join(temp_dir, '*.npy')))[-1] # take the latest file
612-
S = np.load(file_name)
612+
S = np.load(file_name, allow_pickle=True)
613613
S_train_3 = S[0]
614614
S_test_3 = S[1]
615615

@@ -672,7 +672,7 @@ def test_oof_pred_bag_mode_2_models(self):
672672
# Normally if cleaning is performed there is only one .npy file at given moment
673673
# But if we have no cleaning there may be more then one file so we take the latest
674674
file_name = sorted(glob.glob(os.path.join(temp_dir, '*.npy')))[-1] # take the latest file
675-
S = np.load(file_name)
675+
S = np.load(file_name, allow_pickle=True)
676676
S_train_3 = S[0]
677677
S_test_3 = S[1]
678678

@@ -712,7 +712,7 @@ def test_oof_pred_mode_proba_2_models(self):
712712
# Normally if cleaning is performed there is only one .npy file at given moment
713713
# But if we have no cleaning there may be more then one file so we take the latest
714714
file_name = sorted(glob.glob(os.path.join(temp_dir, '*.npy')))[-1] # take the latest file
715-
S = np.load(file_name)
715+
S = np.load(file_name, allow_pickle=True)
716716
S_train_3 = S[0]
717717
S_test_3 = S[1]
718718

@@ -784,7 +784,7 @@ def test_oof_pred_bag_mode_proba_2_models(self):
784784
# Normally if cleaning is performed there is only one .npy file at given moment
785785
# But if we have no cleaning there may be more then one file so we take the latest
786786
file_name = sorted(glob.glob(os.path.join(temp_dir, '*.npy')))[-1] # take the latest file
787-
S = np.load(file_name)
787+
S = np.load(file_name, allow_pickle=True)
788788
S_train_3 = S[0]
789789
S_test_3 = S[1]
790790

@@ -834,7 +834,7 @@ def test_N_dim_input(self):
834834
# Normally if cleaning is performed there is only one .npy file at given moment
835835
# But if we have no cleaning there may be more then one file so we take the latest
836836
file_name = sorted(glob.glob(os.path.join(temp_dir, '*.npy')))[-1] # take the latest file
837-
S = np.load(file_name)
837+
S = np.load(file_name, allow_pickle=True)
838838
S_train_3 = S[0]
839839
S_test_3 = S[1]
840840

tests/test_func_api_classification_multiclass.py

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ def test_oof_pred_mode(self):
142142
# Normally if cleaning is performed there is only one .npy file at given moment
143143
# But if we have no cleaning there may be more then one file so we take the latest
144144
file_name = sorted(glob.glob(os.path.join(temp_dir, '*.npy')))[-1] # take the latest file
145-
S = np.load(file_name)
145+
S = np.load(file_name, allow_pickle=True)
146146
S_train_3 = S[0]
147147
S_test_3 = S[1]
148148

@@ -168,7 +168,7 @@ def test_oof_mode(self):
168168
# Normally if cleaning is performed there is only one .npy file at given moment
169169
# But if we have no cleaning there may be more then one file so we take the latest
170170
file_name = sorted(glob.glob(os.path.join(temp_dir, '*.npy')))[-1] # take the latest file
171-
S = np.load(file_name)
171+
S = np.load(file_name, allow_pickle=True)
172172
S_train_3 = S[0]
173173
S_test_3 = S[1]
174174

@@ -194,7 +194,7 @@ def test_pred_mode(self):
194194
# Normally if cleaning is performed there is only one .npy file at given moment
195195
# But if we have no cleaning there may be more then one file so we take the latest
196196
file_name = sorted(glob.glob(os.path.join(temp_dir, '*.npy')))[-1] # take the latest file
197-
S = np.load(file_name)
197+
S = np.load(file_name, allow_pickle=True)
198198
S_train_3 = S[0]
199199
S_test_3 = S[1]
200200

@@ -233,7 +233,7 @@ def test_oof_pred_bag_mode(self):
233233
# Normally if cleaning is performed there is only one .npy file at given moment
234234
# But if we have no cleaning there may be more then one file so we take the latest
235235
file_name = sorted(glob.glob(os.path.join(temp_dir, '*.npy')))[-1] # take the latest file
236-
S = np.load(file_name)
236+
S = np.load(file_name, allow_pickle=True)
237237
S_train_3 = S[0]
238238
S_test_3 = S[1]
239239

@@ -270,7 +270,7 @@ def test_pred_bag_mode(self):
270270
# Normally if cleaning is performed there is only one .npy file at given moment
271271
# But if we have no cleaning there may be more then one file so we take the latest
272272
file_name = sorted(glob.glob(os.path.join(temp_dir, '*.npy')))[-1] # take the latest file
273-
S = np.load(file_name)
273+
S = np.load(file_name, allow_pickle=True)
274274
S_train_3 = S[0]
275275
S_test_3 = S[1]
276276

@@ -301,7 +301,7 @@ def test_oof_pred_mode_proba(self):
301301
# Normally if cleaning is performed there is only one .npy file at given moment
302302
# But if we have no cleaning there may be more then one file so we take the latest
303303
file_name = sorted(glob.glob(os.path.join(temp_dir, '*.npy')))[-1] # take the latest file
304-
S = np.load(file_name)
304+
S = np.load(file_name, allow_pickle=True)
305305
S_train_3 = S[0]
306306
S_test_3 = S[1]
307307

@@ -327,7 +327,7 @@ def test_oof_mode_proba(self):
327327
# Normally if cleaning is performed there is only one .npy file at given moment
328328
# But if we have no cleaning there may be more then one file so we take the latest
329329
file_name = sorted(glob.glob(os.path.join(temp_dir, '*.npy')))[-1] # take the latest file
330-
S = np.load(file_name)
330+
S = np.load(file_name, allow_pickle=True)
331331
S_train_3 = S[0]
332332
S_test_3 = S[1]
333333

@@ -353,7 +353,7 @@ def test_pred_mode_proba(self):
353353
# Normally if cleaning is performed there is only one .npy file at given moment
354354
# But if we have no cleaning there may be more then one file so we take the latest
355355
file_name = sorted(glob.glob(os.path.join(temp_dir, '*.npy')))[-1] # take the latest file
356-
S = np.load(file_name)
356+
S = np.load(file_name, allow_pickle=True)
357357
S_train_3 = S[0]
358358
S_test_3 = S[1]
359359

@@ -395,7 +395,7 @@ def test_oof_pred_bag_mode_proba(self):
395395
# Normally if cleaning is performed there is only one .npy file at given moment
396396
# But if we have no cleaning there may be more then one file so we take the latest
397397
file_name = sorted(glob.glob(os.path.join(temp_dir, '*.npy')))[-1] # take the latest file
398-
S = np.load(file_name)
398+
S = np.load(file_name, allow_pickle=True)
399399
S_train_3 = S[0]
400400
S_test_3 = S[1]
401401

@@ -444,7 +444,7 @@ def test_pred_bag_mode_proba(self):
444444
# Normally if cleaning is performed there is only one .npy file at given moment
445445
# But if we have no cleaning there may be more then one file so we take the latest
446446
file_name = sorted(glob.glob(os.path.join(temp_dir, '*.npy')))[-1] # take the latest file
447-
S = np.load(file_name)
447+
S = np.load(file_name, allow_pickle=True)
448448
S_train_3 = S[0]
449449
S_test_3 = S[1]
450450

@@ -488,7 +488,7 @@ def test_oof_pred_bag_mode_shuffle(self):
488488
# Normally if cleaning is performed there is only one .npy file at given moment
489489
# But if we have no cleaning there may be more then one file so we take the latest
490490
file_name = sorted(glob.glob(os.path.join(temp_dir, '*.npy')))[-1] # take the latest file
491-
S = np.load(file_name)
491+
S = np.load(file_name, allow_pickle=True)
492492
S_train_3 = S[0]
493493
S_test_3 = S[1]
494494

@@ -606,7 +606,7 @@ def test_oof_pred_mode_2_models(self):
606606
# Normally if cleaning is performed there is only one .npy file at given moment
607607
# But if we have no cleaning there may be more then one file so we take the latest
608608
file_name = sorted(glob.glob(os.path.join(temp_dir, '*.npy')))[-1] # take the latest file
609-
S = np.load(file_name)
609+
S = np.load(file_name, allow_pickle=True)
610610
S_train_3 = S[0]
611611
S_test_3 = S[1]
612612

@@ -669,7 +669,7 @@ def test_oof_pred_bag_mode_2_models(self):
669669
# Normally if cleaning is performed there is only one .npy file at given moment
670670
# But if we have no cleaning there may be more then one file so we take the latest
671671
file_name = sorted(glob.glob(os.path.join(temp_dir, '*.npy')))[-1] # take the latest file
672-
S = np.load(file_name)
672+
S = np.load(file_name, allow_pickle=True)
673673
S_train_3 = S[0]
674674
S_test_3 = S[1]
675675

@@ -709,7 +709,7 @@ def test_oof_pred_mode_proba_2_models(self):
709709
# Normally if cleaning is performed there is only one .npy file at given moment
710710
# But if we have no cleaning there may be more then one file so we take the latest
711711
file_name = sorted(glob.glob(os.path.join(temp_dir, '*.npy')))[-1] # take the latest file
712-
S = np.load(file_name)
712+
S = np.load(file_name, allow_pickle=True)
713713
S_train_3 = S[0]
714714
S_test_3 = S[1]
715715

@@ -781,7 +781,7 @@ def test_oof_pred_bag_mode_proba_2_models(self):
781781
# Normally if cleaning is performed there is only one .npy file at given moment
782782
# But if we have no cleaning there may be more then one file so we take the latest
783783
file_name = sorted(glob.glob(os.path.join(temp_dir, '*.npy')))[-1] # take the latest file
784-
S = np.load(file_name)
784+
S = np.load(file_name, allow_pickle=True)
785785
S_train_3 = S[0]
786786
S_test_3 = S[1]
787787

@@ -832,7 +832,7 @@ def test_N_dim_input(self):
832832
# Normally if cleaning is performed there is only one .npy file at given moment
833833
# But if we have no cleaning there may be more then one file so we take the latest
834834
file_name = sorted(glob.glob(os.path.join(temp_dir, '*.npy')))[-1] # take the latest file
835-
S = np.load(file_name)
835+
S = np.load(file_name, allow_pickle=True)
836836
S_train_3 = S[0]
837837
S_test_3 = S[1]
838838

0 commit comments

Comments
 (0)