feat(poplar): raw-data quality and coverage report - #324
ceyhunolcan wants to merge 2 commits into
Conversation
|
One thing that we have now is compressed data files ( |
|
this issue probably interacts, but should not be considered a blocker: (I am making new issues for cleanup related tasks I would like to get to) |
|
Good catch you're right that it interacts. Fixed to include both extensions ( Also noted #332 agreed it's not a blocker here; happy to align this with a unified reader when that lands. |
|
(the target branch has been merged into develop, retargeting this pull to develop) |
Adds
poplar/raw/quality.py: a cross-stream raw-data quality and coverage report for a study folder sitting besidepoplar.raw.doc(which describes streams) andpoplar.raw.readers(which reads them), as the validation piece.Per participant × stream it reports presence vs. expected-for-OS, file count and size, row count, first/last observation, days spanned and coverage, largest gap, duplicate and out-of-order rows, unreadable files, and a schema check against the documented header.
run()writes one long formatdata_quality.csv, one row per(backend_id, stream).Design
STREAMS(per-OS availability) andHEADERS(expected columns) frompoplar.raw.doc, so it tracks whatever Beiwe adds. Schema check is three-state to matchHEADERS: validate a column list,undocumentedfor"To do",nafornull.identifiersstream (headers differ by OS, e.g. power_state).run(study_folder, output_folder, tz_str, frequency, time_start, time_end, users)mirrors the other trees;frequencysets the coverage-bin resolution (HOURLY_AND_DAILYtreated as daily).clean_dataframe(dedups in place, which would erase the duplicates I need to count) orread_data(GPS/accel-specific, returns filenames for accel).Notes / open questions
frequency, or would you prefer fixed hour + day columns?poplar/raw/quality.pyreasonable, or elsewhere?Tests:
tests/poplar/test_quality.pydefect-injection (clean stream; a stream with schema mismatch + gap + duplicate + out-of-order + unreadable file; an expected-but-absent stream) + end-to-end. ruff/flake8/mypy clean; full suite green.Docs:
docs/source/quality.md(+ toctree).