Skip to content

Commit a57ca77

Browse files
committed
Update parmap API to remove DeprecationWarnings
parmap 1.5.0 introduced support for passing keyword arguments to mapped functions. The drawback of this feature is that a consistent naming of parmap arguments is needed in order to prevent conflicts between parmap arguments and user-defined arguments. The new parmap convention is to prefix all its arguments with "pm_" (for parmap) as documented http://parmap.readthedocs.io/en/latest/ This commit updates the DeepLearningImplementations parmap calls to use the new API, removing the deprecation warnings that appear with parmap==1.5.1 (the parmap version used). https://github.com/zeehio/parmap/blob/e0bc5969ab13562ec9ea2d8131f1cd9ecb8448a7/ChangeLog#L11
1 parent b75f09f commit a57ca77

File tree

6 files changed

+6
-6
lines changed

6 files changed

+6
-6
lines changed

Colorful/src/data/make_dataset.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ def build_HDF5(size=64):
9393
for chunk_idx in tqdm(arr_chunks):
9494

9595
list_img_path = list_img[chunk_idx].tolist()
96-
output = parmap.map(format_image, list_img_path, size, parallel=True)
96+
output = parmap.map(format_image, list_img_path, size, pm_parallel=True)
9797

9898
arr_img_color = np.vstack([o[0] for o in output if o[0].shape[0] > 0])
9999
arr_img_lab = np.vstack([o[1] for o in output if o[0].shape[0] > 0])

DFI/src/data/make_dataset.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ def build_HDF5(size):
8383
for chunk_idx in tqdm(arr_chunks):
8484

8585
list_img_path = arr_img[chunk_idx].tolist()
86-
output = parmap.map(format_image, list_img_path, size, parallel=True)
86+
output = parmap.map(format_image, list_img_path, size, pm_parallel=True)
8787

8888
arr_img_color = np.concatenate(output, axis=0)
8989

GAN/src/data/make_dataset.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ def build_HDF5(jpeg_dir, size=64):
5252
for chunk_idx in tqdm(arr_chunks):
5353

5454
list_img_path = list_img[chunk_idx].tolist()
55-
output = parmap.map(format_image, list_img_path, size, parallel=True)
55+
output = parmap.map(format_image, list_img_path, size, pm_parallel=True)
5656

5757
arr_img_color = np.concatenate(output, axis=0)
5858

InfoGAN/src/data/make_dataset.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ def build_HDF5(jpeg_dir, size=64):
5252
for chunk_idx in tqdm(arr_chunks):
5353

5454
list_img_path = list_img[chunk_idx].tolist()
55-
output = parmap.map(format_image, list_img_path, size, parallel=True)
55+
output = parmap.map(format_image, list_img_path, size, pm_parallel=True)
5656

5757
arr_img_color = np.concatenate(output, axis=0)
5858

WassersteinGAN/src/data/make_dataset.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ def build_HDF5(jpeg_dir, size=64):
5252
for chunk_idx in tqdm(arr_chunks):
5353

5454
list_img_path = list_img[chunk_idx].tolist()
55-
output = parmap.map(format_image, list_img_path, size, parallel=True)
55+
output = parmap.map(format_image, list_img_path, size, pm_parallel=True)
5656

5757
arr_img_color = np.concatenate(output, axis=0)
5858

pix2pix/src/data/make_dataset.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ def build_HDF5(jpeg_dir, nb_channels, size=256):
7676
for chunk_idx in tqdm(arr_chunks):
7777

7878
list_img_path = list_img[chunk_idx].tolist()
79-
output = parmap.map(format_image, list_img_path, size, nb_channels, parallel=False)
79+
output = parmap.map(format_image, list_img_path, size, nb_channels, pm_parallel=False)
8080

8181
arr_img_full = np.concatenate([o[0] for o in output], axis=0)
8282
arr_img_sketch = np.concatenate([o[1] for o in output], axis=0)

0 commit comments

Comments
 (0)