Skip to content

Commit b38179b

Browse files
committed
func to convert lists to array in pars
1 parent d0bfb54 commit b38179b

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

scripts/build_dsp.py

+13
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,19 @@
4646
database_dic = json.load(f)
4747

4848

49+
def replace_list_with_array(dic):
50+
for key, value in dic.items():
51+
if isinstance(value, dict):
52+
dic[key] = replace_list_with_array(value)
53+
elif isinstance(value, list):
54+
dic[key] = np.array(value)
55+
else:
56+
pass
57+
return dic
58+
59+
60+
database_dic = replace_list_with_array(database_dic)
61+
4962
pathlib.Path(os.path.dirname(args.output)).mkdir(parents=True, exist_ok=True)
5063

5164
rng = np.random.default_rng()

0 commit comments

Comments
 (0)