Skip to content

Commit

Permalink
func to convert lists to array in pars
Browse files Browse the repository at this point in the history
  • Loading branch information
ggmarshall committed Dec 6, 2023
1 parent d0bfb54 commit b38179b
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions scripts/build_dsp.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,19 @@
database_dic = json.load(f)


def replace_list_with_array(dic):
for key, value in dic.items():
if isinstance(value, dict):
dic[key] = replace_list_with_array(value)
elif isinstance(value, list):
dic[key] = np.array(value)
else:
pass
return dic


database_dic = replace_list_with_array(database_dic)

pathlib.Path(os.path.dirname(args.output)).mkdir(parents=True, exist_ok=True)

rng = np.random.default_rng()
Expand Down

0 comments on commit b38179b

Please sign in to comment.