From a57793a6f446936e3fae4935ce787902f849f4e5 Mon Sep 17 00:00:00 2001 From: Carl Pearson Date: Wed, 2 Nov 2022 08:50:33 -0700 Subject: [PATCH] create directory if it doesn't exist --- lib/dtypes.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/dtypes.py b/lib/dtypes.py index 88fbbed..76d3e4a 100644 --- a/lib/dtypes.py +++ b/lib/dtypes.py @@ -9,6 +9,10 @@ import scipy.io from lib import config def download_ss_index(path): + + path_dir = path.parent + path_dir.mkdir(parents=True, exist_ok=True) + with open(path, "wb") as f: req = requests.get(config.SS_ROOT_URL + "/files/ss_index.mat") f.write(req.content) @@ -51,4 +55,4 @@ def dtype_from_rbtype(rbtype): DTYPES = {} for i in range(len(names)): - DTYPES[(groups[i], names[i])] = dtype_from_rbtype(rbtype[i]) \ No newline at end of file + DTYPES[(groups[i], names[i])] = dtype_from_rbtype(rbtype[i])