# Function bucketByWeek

- bucketByWeek(votes: ClassifiedVote[]): WeekBucket[]

  Bucket classified votes into ISO-week buckets keyed by Monday's date.

  Buckets are returned in chronological order (oldest first). Votes without a valid sittingDate are bucketed under the empty-string key and placed at the tail (sorting empty-string ahead of real dates would otherwise distort week-over-week shift detection and baseline computations).

  #### Parameters

  - votes: ClassifiedVote[]

    Sequence of classified MEP votes.

  #### Returns WeekBucket[]

  Per-week aggregates with computed defection / abstention rates.

  - Defined in utils/votingBaseline.ts:328