Skip to content

Conversation

@chanshing
Copy link
Member

@chanshing chanshing commented Aug 24, 2025

Support CSV File Collation in collate_sleep Utility

Summary

Extended the collate_sleep utility to support collating CSV output files (predictions.csv, sleep_block.csv, day_summary.csv) in addition to existing JSON file support.

Key Features

  • CSV collation: Added support for collating all asleep CSV output files with filepath tracking
  • Selective collation: --include flag for choosing specific file types (info, summary, predictions, sleep_block, day_summary)
  • Compressed files: Added support for .gz and .zip formats across all file types
  • Improved CLI: Better help documentation with examples and choices validation

Usage Examples

# Default: collate info and summary JSON files only
collate_sleep results/

# Collate specific file types
collate_sleep results/ --include summary sleep_block day_summary

# Works with compressed files automatically
collate_sleep compressed_results/ --include info summary predictions sleep_block day_summary

- Add support for collating the output CSV files (predictions.csv, sleep_block.csv, day_summary.csv)
- Add --include flag to specify which file types to collate (info, summary, predictions, sleep_block, day_summary)
- Default behavior to only collate JSON files (info.json, summary.json) for better performance
- Support collating .gz and .zip compressed files for all file types
@chanshing chanshing changed the title Collate sleep csvs Support CSV File Collation in collate_sleep Utility Aug 24, 2025
@chanshing chanshing force-pushed the collate-sleep-csvs branch 2 times, most recently from 8c447d1 to 4feebbc Compare August 24, 2025 12:18
…with_filepath

- Remove the unused collate_csvs function that lacked filepath tracking
- Rename collate_csvs_with_filepath to simply collate_csvs for cleaner API
@chanshing chanshing merged commit 89bbcab into main Aug 24, 2025
9 checks passed
@chanshing chanshing deleted the collate-sleep-csvs branch August 24, 2025 12:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants