pymovements.Participants.save#

Participants.save(path: Path | str, *, verify_bids: Literal['REQUIRED', 'RECOMMENDED'] | bool = 'REQUIRED', metadata_path: Path | str = 'participants.json', separator: str = '\t', write_csv_kwargs: dict[str, Any] | None = None, metadata_encoding: str = 'utf-8') → None[source]#

Save participants data including metadata.

By default, null values are written as 'n/a' per BIDS. This can be overridden via write_csv_kwargs.

Parameters:
  • path (Path | str) – Save participants data to this path. If this is a directory, use participants.tsv as filename.

  • verify_bids (Literal['REQUIRED', 'RECOMMENDED'] | bool) – Verify BIDS conformity before saving. If True, raise exception on non-conformity at REQUIRED level. If ‘REQUIRED’ or ‘RECOMMENDED’, emit warnings for non-conformity at that level. If False, do not verify. (default: 'REQUIRED')

  • metadata_path (Path | str) – Save metadata json to this path. If this is a relative path it is assumed to be relative to the directory specified by path. (default: participants.json)

  • separator (str) – Separator in the tabular data file. (default: \t)

  • write_csv_kwargs (dict[str, Any] | None) – Pass these additional keyword arguments to polars.DataFrame.write_csv(). Takes precedence over the separator argument. (default: None)

  • metadata_encoding (str) – Use this encoding for writing the metadata json file. (default: utf-8)