From c740ef2b996f651015e8125fb65b81ef20fd7d8a Mon Sep 17 00:00:00 2001 From: Teresa Gomez <46339554+teresamg@users.noreply.github.com> Date: Thu, 2 May 2024 12:53:31 -0700 Subject: [PATCH] Generates default dataset_description.json if not present --- AFQ/api/group.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/AFQ/api/group.py b/AFQ/api/group.py index 292b67bd8..7e676a438 100644 --- a/AFQ/api/group.py +++ b/AFQ/api/group.py @@ -128,8 +128,14 @@ def __init__(self, if not op.exists(bids_path): raise ValueError("bids_path not found") if not op.exists(op.join(bids_path, "dataset_description.json")): - raise ValueError("There must be a dataset_description.json" - + " in bids_path") + dataset_description = { + "Name": "unknown", + "BIDSVersion": "unknown", + "Authors": ["unknown"] + } + dd_file = op.join(bids_path, 'dataset_description.json') + with open(dd_file, 'w') as outfile: + json.dump(dataset_description, outfile) if not isinstance(bids_filters, dict): raise TypeError("bids_filters must be a dict") # preproc_pipeline typechecking handled by pyBIDS