Skip to content

ENH: Add Keywords parameter to make_dataset_description() #1549

@bruAristimunha

Description

@bruAristimunha

Describe the problem

make_dataset_description() accepts a fixed set of keyword arguments (name, authors, doi, funding, acknowledgements, etc.) but does not support Keywords, which is a valid BIDS field in dataset_description.json. Users who want to include keywords must manually patch the JSON after calling make_dataset_description().

Related: #302

Describe your solution

Add a keywords parameter to make_dataset_description():

def make_dataset_description(
    path,
    name=None,
    ...,
    keywords=None,  # NEW: list of str
    ...,
):

When provided, keywords should be written as the "Keywords" field in dataset_description.json.

Describe possible alternatives

  1. Manual JSON patching (current workaround) — read, modify, write the JSON after make_dataset_description().
  2. Only add extra_fields — a single generic parameter instead of explicitly adding keywords.

Current downstream workaround (MOABB)

mne_bids.make_dataset_description(path=str(root), overwrite=True, **desc_kwargs)

# Then patch in Keywords manually
desc_path = Path(root) / "dataset_description.json"
with open(desc_path) as f:
    desc = json.load(f)
if keywords and "Keywords" not in desc:
    desc["Keywords"] = keywords
    with open(desc_path, "w") as f:
        json.dump(desc, f, indent="\t")

Additional context

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions