Skip to content

ENH: write_raw_bids() should not overwrite existing README #1550

Description

@bruAristimunha

Describe the problem

write_raw_bids() creates a generic boilerplate README file ("This dataset was created with...") that contains no useful dataset-specific information. If a user has already created a comprehensive README with dataset-specific documentation, write_raw_bids() overwrites it.

Related: #1042

Describe your solution

Two possible approaches:

  1. Don't overwrite existing README: If a README file already exists with content beyond the boilerplate, skip writing it.
  2. Accept a readme parameter: Add an optional readme string parameter to write_raw_bids() that, when provided, is used instead of the boilerplate.

Option 1 is the least disruptive change and most backwards-compatible.

Describe possible alternatives

The current workaround is to write the README after all write_raw_bids() calls, overwriting the boilerplate. This works but requires careful ordering of operations.

Current downstream workaround (MOABB)

# After all write_raw_bids calls, overwrite the boilerplate README
readme_path = Path(root) / "README"
readme_path.write_text(_build_readme(dataset), encoding="utf-8")

Where _build_readme() generates a comprehensive document with paradigm info, channel setup, references, license, etc.

Additional context

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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