Something went wrong. Try again.
A training to familiarize TIDE analysts with parquet datasets and python
Something went wrong. Try again.
tide-python-training CLAUDE.md
3.2 kB · 38 lines
Markdown
at main
Parquet + Polars Workshop #
Last verified: 2026-07-20
Teaching repo, not a software product. It teaches SAS-background analysts to
inspect Parquet in VS Code and manipulate it with Polars. Audience-facing docs
live in README.md; this file captures the invariants an editor must preserve.
Tech Stack #
- Python 3.11+, single runtime dependency:
polars==1.42.1(pinned inpyproject.toml) - No test runner — every exercise/solution self-grades via
assert - Synthetic data modelled on Sentinel Common Data Model (SCDM) v8.2.2
Commands #
pip install .— installs polars frompyproject.tomlpython data/generate_data.py— regenerates the three gitignored Parquet filespython scripts/verify_scdm.py— validates generated data against the SCDM specpython exercises/exNN_*.py/solutions/exNN_*.py— run a unit; success prints onlyAll checks passed.
Structure (the teaching loop) #
Each unit is: lesson → demo → exercise → self-check → solution, numbered 02–06.
lessons/— markdown, teaches each concept before it is used.00(Python survival kit) and01(Parquet in VS Code, Data Wrangler, no runnable script) have no demo/exercise/solution counterpart.demos/— runnable scripts (demo02–demo06) the lessons walk throughexercises/— learner fills blanks;solutions/— reference, must pass all assertionsdata/generate_data.pyproduces the Parquet;data/*.parquetand output dirs are gitignored
Invariants (do not break when editing) #
- Numbering is 1:1:
lessons/NN↔demos/demoNN↔exercises/exNN↔solutions/exNNfor NN in 02–06. There is no ex01 script — its content lives inlessons/01_parquet_in_vscode.md. - Assertion constants are data-derived (e.g.
15_698filtered rows, dataset row counts). Changing a filter, the data generator, or an assertion in isolation desyncs the trio. Re-derive against freshly generated data and update exercise + solution together. - Blank convention: exercises use
____(four underscores) for fill-in blanks in units 2–3. Units 4–6 useraise NotImplementedErrorexclusively (pattern hints in 4, tiered<details>hints in lesson 5's Your turn, task-only capstone in 6). Outcome signals (NotImplementedError/AssertionError/NameError/AttributeErroron____) are documented inlessons/00and README "How to run the scripts" — keep those three in sync. - De-scaffolding progression is intentional: blanks → tiered hints → minimal capstone. Preserve it; don't re-scaffold unit 6 or strip hints from 2–3.
- Scripts carry a
# pattern: Imperative Shellheader and a "Before you start / How to run" docstring block that points at the paired lesson and README rather than repeating platform commands. Keep new scripts consistent. - Polars only — never introduce pandas idioms. No SQL targeting Data Wrangler: it is low/no-code, SQL examples do not apply.
SCDM data (fabricated, no real records) #
Three tables keyed by PatID: demographic (1 row/patient), enrollment
(1 row/span; DrugCov flags drug coverage), dispensing (1 row/fill).
Unit 5(b) is a real Sentinel enrollment-coverage QC pattern (anti-join).