Skip to content

copick config set-splits

core

Edit train/val/test split assignments on an existing Croissant.

Usage

copick config set-splits [OPTIONS]

Description

Assigns or edits train/val/test (or custom) splits on an existing Croissant. Splits live in the Croissant's runs.csv split column. This command opens the destination in Mode A, applies the mapping plus --unassign and --clear-all options under a single batch commit, and rewrites metadata.json so the spec-conforming splits RecordSet reflects the new set of distinct split names.

Provide assignments via repeated --split NAME=RUN1,RUN2 flags and/or a --splits-file CSV (columns split,run); the CLI flags override duplicate split names from the file.

Options

Option Type Default Description
--croissant file required Path / URL to the destination Croissant metadata.json. Must be writable (Mode A).
--split text · multiple Assign runs to an ML split, e.g. 'train=TS_001,TS_002'. Repeatable.
--splits-file file CSV with columns 'split' and 'run' providing assignments. Combined with --split flags (CLI flags override duplicate split names).
--clear-all boolean flag False Clear every run's split before applying the new mapping.
--unassign text Comma-separated run names to clear split for, applied AFTER the mapping.
--debug / --no-debug boolean flag False Enable debug logging.

Examples

# Assign train/val/test splits
copick config set-splits \
    --croissant Croissant/metadata.json \
    --split train=TS_001,TS_002 \
    --split val=TS_003 \
    --split test=TS_004

# Wipe every existing split first, then assign fresh
copick config set-splits --croissant Croissant/metadata.json --clear-all --split train=TS_001

# Assign some runs and clear the split on another
copick config set-splits \
    --croissant Croissant/metadata.json \
    --split train=TS_001,TS_002 \
    --split val=TS_003 \
    --unassign TS_004

See also