Skip to content

Sync tutorial notebooks with Colab and link example code in docs - #1256

Merged
jhnwu3 merged 1 commit into
medcode/icd-mappingsfrom
fix/tutorials-medcode-crossmap
Oct 1, 2026
Merged

jhnwu3 merged 1 commit into
medcode/icd-mappingsfrom
fix/tutorials-medcode-crossmap

Conversation

@jhnwu3

@jhnwu3 jhnwu3 commented Oct 1, 2026 •

Copy link
Copy Markdown
Collaborator

Stacked on #1257. Merge #1257 first; GitHub then retargets this PR to master.

Summary

The repo copies of the tutorial notebooks had drifted from the Colab versions linked in docs/tutorials.rst. The docs also referred to example files by bare names, several of which were wrong.

Changes

  • tutorial_pyhealth_medcode.ipynb: now matches the Colab version (Drive 1Tw1AUS53fotH1EYr4Abp7qYN3zDBeUbC), with outputs stripped. Its CrossMap.load("ICD9CM", "ICD10CM") cell needs the icd-mappings backend from medcode: ICD-9 <-> ICD-10 translation and grouper vocabularies via icd-mappings #1257; on master it fails with HTTP Error 404.
  • tutorial_pyhealth_data.ipynb, tutorial_pyhealth_trainer.ipynb: synced with Colab. The repo copies still called dataset.patients; BaseDataset now exposes unique_patient_ids.
  • docs/tutorials.rst:
    • Each Colab tutorial gets a [Source] link to its notebook in examples/tutorials/.
    • All 74 example filenames now link to the real files. Previously, wrong or renamed paths included EEG_events_SparcNet.py → eeg/eeg_models/SparcNet_eeg_events_classification.py, drug_recommendation_eICU_transformer.py → …_eicu_…, and sleep_staging_* → eeg/sleep_staging/.
    • The readmission list-table is fixed; it wasn't rendering because of a one-space indent.
    • blob/main → blob/master.
    • The file now parses with no docutils warnings (it had 11 before).

Earlier revisions of this PR also changed CrossMap and rewrote the medcode ICD-9 → ICD-10 cell. Those changes are dropped: the clearer missing-table error now lives in #1257, and the Colab cell is correct once #1257 lands.

Testing

  • I executed every code cell of the medcode, data and trainer notebooks against this branch, skipping !pip; all pass.
  • A script confirmed that every blob/master/examples/… link in tutorials.rst resolves to a file that exists.

🤖 Generated with Claude Code

- Sync tutorial_pyhealth_{data,trainer,medcode}.ipynb with the Colab
  versions linked from docs/tutorials.rst. The repo copies of data and
  trainer still used dataset.patients, which BaseDataset no longer has
  (it is unique_patient_ids). The medcode notebook's ICD9CM->ICD10CM
  cell relies on the icd-mappings backend added in the parent commits.
- docs/tutorials.rst: link each Colab tutorial to its source notebook,
  turn every example filename into a link to the real file (fixing
  wrong or renamed paths such as the EEG SparcNet and eICU scripts),
  fix the broken readmission list-table, and blob/main -> blob/master.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@jhnwu3
jhnwu3 force-pushed the fix/tutorials-medcode-crossmap branch from 20d26c3 to 3b4e3fc Compare October 1, 2026 20:55
@jhnwu3 jhnwu3 changed the title Fix medcode tutorial crosswalk, sync tutorial notebooks, link examples in docs Sync tutorial notebooks with Colab and link example code in docs Oct 1, 2026
@jhnwu3
jhnwu3 changed the base branch from master to medcode/icd-mappings October 1, 2026 20:55
@jhnwu3
jhnwu3 merged commit ea26ac5 into medcode/icd-mappings Oct 1, 2026
4 checks passed
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.

1 participant