Skip to content

Default-skip stimuli/ and derivatives/ on download and get #402

Closed

Description

@neuromechanist

Summary

Some NEMAR datasets will soon ship stimuli/ files inside the dataset tree, and derivatives/ folders are already common on existing datasets. Both can be very large and most users don't need them on first download. We should default to skipping those folders on nemar dataset download and nemar dataset get, and require an opt-in flag to fetch their content.

The git-annex pointer files (symlinks) are still cloned, so users can always run nemar dataset get later (with the flag) or git annex get stimuli/ directly.

Behavior

  • Default for both download and get: skip annex content under stimuli/**, **/stimuli/**, derivatives/**, **/derivatives/**.
  • Pointers are always cloned (this is just git annex get filtering, not a sparse clone).
  • New flags:
    • --stimuli opts in to downloading stimuli content.
    • --derivatives opts in to downloading derivatives content.
  • BIDS filters (--subjects, --tasks, etc.) still default-skip stimuli and derivatives unless the user passes the opt-in flags.
  • --no-data is unaffected (already skips everything).

Implementation

  • src/lib/bids-filter.ts: extend BidsFilterOptions with includeStimuli?: boolean and includeDerivatives?: boolean; emit --exclude patterns when opt-in is false.
  • src/commands/dataset.ts: add --stimuli and --derivatives flags to both download and get. Thread them through the filter helper for download, and apply via a new helper for get (which doesn't currently use buildBidsFilterArgs).
  • countPendingDownload should accept extra match args so the precount reflects the same exclusions, otherwise the progress bar will overestimate.

Tests

Extend test/bids-filter.test.ts with cases for default-skip, opt-in, and combinations with existing filters.

Metadata

Metadata

Assignees

No one assigned

    Labels

    feature

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions