|
37 | 37 |
|
38 | 38 | from mne_bids import ( |
39 | 39 | BIDSPath, |
| 40 | + __version__, |
40 | 41 | get_anonymization_daysback, |
41 | 42 | get_bids_path_from_fname, |
42 | 43 | read_raw_bids, |
@@ -1297,7 +1298,9 @@ def make_dataset_description( |
1297 | 1298 | doi:10.5281/zenodo.3686061). |
1298 | 1299 | generated_by : list of dict | None |
1299 | 1300 | Used to specify provenance of the dataset. See BIDS specification |
1300 | | - for details. |
| 1301 | + for details. If ``None``, a basic description containing MNE-BIDS name, version, |
| 1302 | + and URL will be generated for you. To suppress this behavior, pass an empty |
| 1303 | + list. |
1301 | 1304 | source_datasets : list of dict | None |
1302 | 1305 | Used to specify the locations and relevant attributes of all source |
1303 | 1306 | datasets. Each dict in the list represents one source dataset and |
@@ -1349,9 +1352,16 @@ def make_dataset_description( |
1349 | 1352 | ) |
1350 | 1353 | if not set(i.keys()).issubset(generated_by_keys): |
1351 | 1354 | raise ValueError(msg_key.format(i.keys() - generated_by_keys)) |
| 1355 | + elif generated_by is not None: |
| 1356 | + raise ValueError(msg_type.format("generated_by")) |
1352 | 1357 | else: |
1353 | | - if generated_by is not None: |
1354 | | - raise ValueError(msg_type.format("generated_by")) |
| 1358 | + generated_by = [ |
| 1359 | + dict( |
| 1360 | + Name="MNE-BIDS", |
| 1361 | + Version=__version__, |
| 1362 | + CodeURL="https://mne.tools/mne-bids/", |
| 1363 | + ) |
| 1364 | + ] |
1355 | 1365 |
|
1356 | 1366 | source_ds_keys = set(["URL", "DOI", "Version"]) |
1357 | 1367 | if isinstance(source_datasets, list): |
|
0 commit comments