Skip to content

MedMod in-hospital mortality (1/4): dataset, task and EHR processor - #1637

Open
Rainie-Hu wants to merge 4 commits into
sunlabuiuc:masterfrom
Rainie-Hu:medmod-ihm-dataset-task
Open

Rainie-Hu wants to merge 4 commits into
sunlabuiuc:masterfrom
Rainie-Hu:medmod-ihm-dataset-task

Conversation

@Rainie-Hu

@Rainie-Hu Rainie-Hu commented Nov 27, 2026 •

Copy link
Copy Markdown
Contributor

Contributors: Yuqing Hu (GT username yhu672, yhu672@gatech.edu) and Hanh Trang Do (GT username hdo61, hdo61@gatech.edu), Georgia Tech CSE 6250

Contribution Type: Dataset + Task (part 1 of the Full Pipeline contribution #1609)

Part 1 of 4 of #1609. #1609 was too large for review, so it is split into: 1. dataset, task and processor (this PR); 2. models (#1638); 3. image tools, synthetic data, MedSigLIP embeddings, pretraining samples, examples and results (#1639, draft until 1 and 2 merge); 4. runner scripts and Colab notebook (#1640, draft until 3 merges). This PR needs nothing from the others.

Paper: Elsharief, S., et al. (2025). MedMod: Multimodal Benchmark for Medical Prediction Tasks with Electronic Health Records and Chest X-Ray Scans. CHIL 2025, PMLR 287. https://proceedings.mlr.press/v287/elsharief25a.html (code: https://github.com/nyuad-cai/MedMod)

What it adds:

  • Dataset: MedModMIMIC4Dataset reads MIMIC-IV v1.0 and MIMIC-CXR-JPG 2.0.0 and applies MedMod's fixed train / validation / test split (MedModSplit, split_by_medmod).
  • Task: MedModInHospitalMortality builds one sample per ICU stay: a 48 × 76 EHR time series (MedMod's 17 variables, discretized as in its released code), the image path and the mortality label. Our samples match MedMod's own extraction output for all 6,214 stays.
  • Processor: MedModEHRProcessor normalizes the EHR inside PyHealth's processor framework.

Why a separate dataset and task: PyHealth already has EHRCXRMortalityMIMIC4 (MedFuse's in-hospital mortality) and MedModDecompensationMIMIC4 (#1510), which share the 34-column EHR of ehr_cxr_mimic4 (17 values with ordinal Glasgow scores, plus masks, normalized on the training split). MedMod's models instead read MedMod's 76-column discretization: the 5 categorical variables one-hot encoded (47 columns), 12 continuous values and 17 masks, in MedMod's column order and with its stored normalizer. MedFuse's released EHR encoder was trained on exactly this input: its first LSTM layer is 1024 × 76, so it cannot load 34-column data. The fixed MedMod split also keeps the test patients out of the checkpoints' training data.

Links to other components: MedModMIMIC4Dataset and MedModEHRDataset subclass MIMIC4Dataset and MIMIC4EHRDataset to reuse PyHealth's MIMIC-IV loading. They add the v1.0 config and MedMod's row filters. A custom itemid_map adds a digest of its file to dataset_name, so each map gets its own cache. Nothing else imports or changes existing tasks or datasets.

Files to review:

  • pyhealth/datasets/medmod_mimic4.py - dataset, MedMod split
  • pyhealth/datasets/medmod/ - EHR extraction, discretizer, the download of MedMod's item map and split lists on first use, and MedMod's discretizer config and normalizer (files/, Apache-2.0)
  • pyhealth/datasets/configs/mimic4_ehr_v1.0.yaml - MIMIC-IV v1.0 table config
  • pyhealth/tasks/medmod_mortality_mimic4.py - task
  • pyhealth/processors/medmod_ehr_processor.py - EHR normalizer
  • tests/core/test_medmod_mimic4_dataset.py, test_medmod_mimic4_extraction.py, test_medmod_mimic4_processor.py, with helpers in tests/core/medmod_test_utils.py; test-resources/medmod/itemid_to_variable_map.csv (10 rows of MedMod's item map, so the tests need no download)
  • registrations in pyhealth/datasets/__init__.py and pyhealth/tasks/__init__.py; docs pages for the dataset and task and their index entries

Testing: our 50 tests run on synthetic data only, with no network access. Together with upstream's MedMod decompensation tests, all 71 pass. python tools/check_pr_rules.py passes.

Data: MIMIC-IV and MIMIC-CXR need PhysioNet credentialing. No MIMIC data or identifiers are in this PR.

🤖 Generated with Claude Code

Part 1 of 4 of sunlabuiuc#1609.

Co-authored-by: rainiehu <57816421+Rainie-Hu@users.noreply.github.com>
@Rainie-Hu Rainie-Hu changed the title Add the MedMod in-hospital mortality dataset, task and EHR processor Part 1 of 4 of sunlabuiuc/PyHealth#1609. Nov 27, 2026
@Rainie-Hu Rainie-Hu changed the title Part 1 of 4 of sunlabuiuc/PyHealth#1609. Add the MedMod in-hospital mortality dataset, task and EHR processor Nov 27, 2026
@solarsys solarsys added the status: manual Pending maintainer's review label Nov 27, 2026
@github-actions

github-actions Bot commented Nov 27, 2026 •

Copy link
Copy Markdown

Test Coverage

Total: 88.84% (62149 / 69959 lines)

Modified file Coverage Lines
pyhealth/benchmarks/__init__.py 100.00% 4 / 4
pyhealth/benchmarks/robustness.py 85.71% 30 / 35
pyhealth/calib/calibration/hb.py 88.60% 101 / 114
pyhealth/calib/calibration/temperature_scale.py 100.00% 45 / 45
pyhealth/datasets/__init__.py 100.00% 95 / 95
pyhealth/datasets/chestxray14.py 84.26% 91 / 108
pyhealth/datasets/hbn_eeg.py 94.59% 140 / 148
pyhealth/datasets/hirid.py 100.00% 32 / 32
pyhealth/datasets/medmod/__init__.py 100.00% 0 / 0
pyhealth/datasets/medmod/discretizer.py 96.41% 161 / 167
pyhealth/datasets/medmod/downloads.py 97.78% 44 / 45
pyhealth/datasets/medmod/extraction.py 92.61% 326 / 352
pyhealth/datasets/medmod_mimic4.py 100.00% 79 / 79
pyhealth/datasets/mitbih.py 97.35% 110 / 113
pyhealth/datasets/nhanes.py 96.99% 290 / 299
pyhealth/datasets/physionet2012.py 96.64% 115 / 119
pyhealth/datasets/pmdata.py 96.13% 273 / 284
pyhealth/datasets/polyp.py 100.00% 65 / 65
pyhealth/datasets/rotterdam.py 100.00% 71 / 71
pyhealth/datasets/seer.py 92.19% 59 / 64
pyhealth/datasets/vsac.py 96.45% 163 / 169
pyhealth/datasets/wesad.py 100.00% 39 / 39
pyhealth/medcode/pretrained_embeddings/lm_emb/openai_retriever.py 100.00% 13 / 13
pyhealth/metrics/__init__.py 100.00% 19 / 19
pyhealth/metrics/anomaly_detection.py 97.56% 40 / 41
pyhealth/metrics/detection.py 98.80% 82 / 83
pyhealth/metrics/fairness_utils/__init__.py 100.00% 3 / 3
pyhealth/metrics/fairness_utils/capacity.py 100.00% 59 / 59
pyhealth/metrics/labtop.py 98.61% 71 / 72
pyhealth/metrics/motionage.py 98.96% 95 / 96
pyhealth/metrics/value_set.py 100.00% 67 / 67
pyhealth/models/__init__.py 100.00% 131 / 131
pyhealth/models/brain_network_transformer.py 98.20% 164 / 167
pyhealth/models/califorest.py 91.97% 126 / 137
pyhealth/models/camchex.py 87.86% 123 / 140
pyhealth/models/clip_stress.py 91.63% 186 / 203
pyhealth/models/clip_stress_utils.py 88.10% 148 / 168
pyhealth/models/cnn2d_lstm.py 96.30% 52 / 54
pyhealth/models/concept_bottleneck.py 96.71% 294 / 304
pyhealth/models/convirt.py 96.18% 151 / 157
pyhealth/models/daft.py 93.64% 221 / 236
pyhealth/models/deepcoxph.py 96.43% 108 / 112
pyhealth/models/deephit.py 95.27% 141 / 148
pyhealth/models/duett.py 93.52% 101 / 108
pyhealth/models/ebcl.py 100.00% 93 / 93
pyhealth/models/ecg_branch_resnet.py 99.46% 184 / 185
pyhealth/models/ehr_cxr_early_fusion.py 93.33% 98 / 105
pyhealth/models/ga2m.py 94.12% 144 / 153
pyhealth/models/generators/corgan.py 98.77% 241 / 244
pyhealth/models/generators/gpt2.py 86.01% 123 / 143
pyhealth/models/generators/halo.py 91.78% 324 / 353
pyhealth/models/generators/medgan.py 98.95% 189 / 191
pyhealth/models/generators/promptehr.py 88.89% 184 / 207
pyhealth/models/generators/synthea.py 95.96% 261 / 272
pyhealth/models/glip.py 98.90% 537 / 543
pyhealth/models/hicu.py 96.61% 285 / 295
pyhealth/models/keep.py 100.00% 119 / 119
pyhealth/models/labram.py 98.81% 250 / 253
pyhealth/models/labtop.py 94.87% 37 / 39
pyhealth/models/llm_code_transfer.py 94.61% 614 / 649
pyhealth/models/medtsllm_anomaly.py 93.14% 190 / 204
pyhealth/models/mensa.py 95.65% 220 / 230
pyhealth/models/miu_vl.py 100.00% 31 / 31
pyhealth/models/motionage.py 99.22% 128 / 129
pyhealth/models/rasc_mlp.py 98.48% 65 / 66
pyhealth/models/robust_shy.py 91.67% 22 / 24
pyhealth/models/salientsleepnet.py 99.47% 189 / 190
pyhealth/models/sequence_transformer.py 95.12% 156 / 164
pyhealth/models/shy.py 94.43% 339 / 359
pyhealth/models/stagenet_mha.py 94.33% 266 / 282
pyhealth/models/stepwise_embedding.py 95.58% 173 / 181
pyhealth/models/surgical_aggregation.py 96.30% 156 / 162
pyhealth/models/survival_mdn.py 94.24% 229 / 243
pyhealth/models/t3a.py 98.11% 104 / 106
pyhealth/models/temporalscl.py 87.63% 248 / 283
pyhealth/models/tpc.py 99.29% 422 / 425
pyhealth/models/watchsleepnet.py 100.00% 107 / 107
pyhealth/processors/medmod_ehr_processor.py 97.50% 39 / 40
pyhealth/processors/seer_processor.py 95.40% 83 / 87
pyhealth/tasks/__init__.py 98.66% 147 / 149
pyhealth/tasks/barttender_chestxray14.py 94.00% 94 / 100
pyhealth/tasks/barttender_encoding.py 100.00% 126 / 126
pyhealth/tasks/barttender_giou.py 100.00% 60 / 60
pyhealth/tasks/clinical_presence_mortality_mimic3.py 98.84% 256 / 259
pyhealth/tasks/hbn_psychopathology.py 98.67% 74 / 75
pyhealth/tasks/in_hospital_mortality_48h_mimic3.py 90.11% 164 / 182
pyhealth/tasks/in_icu_mortality_emdot_mimic4.py 95.82% 275 / 287
pyhealth/tasks/lab_event_time_mimic3.py 98.44% 63 / 64
pyhealth/tasks/labtop.py 96.60% 199 / 206
pyhealth/tasks/medmod_decompensation_mimic4.py 95.40% 83 / 87
pyhealth/tasks/medmod_mortality_mimic4.py 98.44% 63 / 64
pyhealth/tasks/mimic3_icd9_category_classification.py 100.00% 70 / 70
pyhealth/tasks/mimic_cxr_study_classification.py 98.78% 81 / 82
pyhealth/tasks/mitbih.py 98.41% 62 / 63
pyhealth/tasks/multi_event_survival_rotterdam.py 100.00% 26 / 26
pyhealth/tasks/nhanes_mortality_prediction.py 96.67% 87 / 90
pyhealth/tasks/patient_summarization_filter.py 100.00% 92 / 92
pyhealth/tasks/patient_summarization_mimic4.py 100.00% 70 / 70
pyhealth/tasks/physionet2012_stepwise_mortality.py 85.42% 41 / 48
pyhealth/tasks/pmdata_stress_detection.py 94.51% 172 / 182
pyhealth/tasks/polyp_detection.py 100.00% 13 / 13
pyhealth/tasks/prior_exam_preference.py 94.22% 163 / 173
pyhealth/tasks/ptbxl_label_group_classification.py 99.10% 110 / 111
pyhealth/tasks/ptbxl_reduced_lead_rhythm.py 100.00% 23 / 23
pyhealth/tasks/seer_survival.py 96.97% 32 / 33
pyhealth/tasks/shhs_multimodal_masking.py 90.48% 57 / 63
pyhealth/tasks/shhs_multimodal_sleep_staging.py 92.03% 127 / 138
pyhealth/tasks/short_term_survival.py 93.80% 121 / 129
pyhealth/tasks/signal_forecasting.py 100.00% 99 / 99
pyhealth/tasks/sleep_staging.py 93.48% 86 / 92
pyhealth/tasks/sleep_staging_dreamt.py 100.00% 133 / 133
pyhealth/tasks/sleep_staging_v2.py 98.84% 85 / 86
pyhealth/tasks/temporal_outcome_prediction_mimic4.py 85.81% 248 / 289
pyhealth/tasks/tpc_day_one.py 95.24% 40 / 42
pyhealth/tasks/tpc_eicu.py 98.01% 197 / 201
pyhealth/tasks/tuh_referential_tasks.py 100.00% 37 / 37
pyhealth/tasks/vasopressor_onset_mimic3.py 94.98% 265 / 279
pyhealth/tasks/vasopressor_onset_mimic4.py 97.37% 37 / 38
pyhealth/tasks/wesad.py 83.15% 74 / 89

Workflow run · cfbc18f

@Rainie-Hu Rainie-Hu changed the title Add the MedMod in-hospital mortality dataset, task and EHR processor MedMod in-hospital mortality (1/4): dataset, task and EHR processor Nov 27, 2026
@solarsys

Copy link
Copy Markdown
Collaborator

/review

@github-actions github-actions Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Previous review

Reviewed commit 4401bfa

num_workers=num_workers,
)
if itemid_map is not None:
self.sub_datasets["ehr"].itemid_map = os.fspath(itemid_map)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in bd76618 and f6d0cfc: a custom itemid_map now adds a digest of its file to dataset_name, so each map gets its own cache (test: test_custom_item_map_gets_its_own_cache), and MedModMIMIC4Dataset.set_task raises a ValueError when the task's item ids are not all in the dataset's map (test: test_task_item_ids_must_be_in_the_dataset_map).

------------------

MedMod's models read their data through two code paths, and the task
reproduces each. Both use the same cohort, labels and split; only the EHR rows

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in bd76618: the "Per-model settings" section now says the task sets the EHR rows with hours_zero, returns image_path and applies no image transform, and that the "Image transform" column is what the model's own image loader applies.

@github-actions github-actions Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Previous review

AI Review

suggestion: need change
decision: human review

Thank you for this contribution. It adds MedMod's in-hospital mortality pipeline to PyHealth. That means a MIMIC-IV v1.0 + MIMIC-CXR dataset with MedMod's fixed split, a task that builds one 48 × 76 EHR sample per ICU stay, and an EHR processor. Your description of why this is a separate dataset and task is clear. The subclassing of MIMIC4Dataset and MIMIC4EHRDataset is named with its reason. Coverage meets the bar: the whole repository is at 87.14%, and every changed file under pyhealth/ is above 92%.

This is close. One documentation fix is needed.

To get this merged:

  1. In docs/api/tasks/pyhealth.tasks.MedModInHospitalMortality.rst, the "Per-model settings" section says the task reproduces each model's code path, including an "Image transform" column (ImageNet-normalized vs. pixels in [0, 1]). The task only exposes hours_zero and returns image_path. It applies no image transform and has no setting for one. Please reword that section so the image-transform column is clearly guidance for the downstream model or loader, not behavior of this task. Alternatively, remove the column.

Optional suggestions:

  • MedModMIMIC4Dataset(itemid_map=...) filters the event table before PyHealth caches it. The cache key does not include the item map. If someone uses a different map with the same cache_dir, they will silently reuse a table filtered with the old map. Consider putting a digest of the map in dataset_name or the cache path. You could also state in the docstring that a custom map needs a fresh cache_dir.
  • MedModEHRSequenceProcessor has no consumer in this PR. A short note in its docstring saying which later PR uses it would help reviewers.
  • The docs page quotes the 6,214-stay parity and the AUROC figures. The tests in this PR don't reproduce them. A one-line pointer to how you obtained them would make them easier to trust.

Reviewed commit 4401bfa

dhtrg and others added 2 commits November 27, 2026 15:33
The task page now says the image transform belongs to the model's image
loader; the task returns image_path only. A custom itemid_map adds a digest
of its file to dataset_name, so each map gets its own PyHealth cache, with a
test that builds two maps on one cache_dir.

Co-authored-by: rainiehu <57816421+Rainie-Hu@users.noreply.github.com>
The dataset drops events outside its item map before caching, so a
task whose item map has other ids would silently miss their events.
set_task now raises a ValueError naming them, with a test. This is the
second half of the AI review's item-map comment.

Co-authored-by: rainiehu <57816421+Rainie-Hu@users.noreply.github.com>
num_workers=num_workers,
)
if itemid_map is not None:
self.sub_datasets["ehr"].itemid_map = os.fspath(itemid_map)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in bd76618 and f6d0cfc: a custom itemid_map now adds a digest of its file to dataset_name, so each map gets its own cache (test: test_custom_item_map_gets_its_own_cache), and MedModMIMIC4Dataset.set_task raises a ValueError when the task's item ids are not all in the dataset's map (test: test_task_item_ids_must_be_in_the_dataset_map).

------------------

MedMod's models read their data through two code paths, and the task
reproduces each. Both use the same cohort, labels and split; only the EHR rows

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in bd76618: the "Per-model settings" section now says the task sets the EHR rows with hours_zero, returns image_path and applies no image transform, and that the "Image transform" column is what the model's own image loader applies.

@solarsys

Copy link
Copy Markdown
Collaborator

/review

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed commit f6d0cfc


def find_class(self, module: str, name: str) -> type:
if (module, name) not in self._ALLOWED:
raise pickle.UnpicklingError(f"global {module}.{name} is not allowed")

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[medium] Restricted unpickler's refusal is untested

_NumpyOnlyUnpickler.find_class raises pickle.UnpicklingError for any global outside the numpy allow-list, and Normalizer.load_params documents that other objects are refused. The MedMod tests only load the bundled ph_ts1.0.normalizer (the positive path). No test checks the refusal. Add a test in tests/core/test_medmod_mimic4_processor.py that writes a pickle whose payload references a disallowed global (for example os.system or builtins.eval) and asserts that Normalizer().load_params(path) raises pickle.UnpicklingError. Without this, the security property the docstring claims has no coverage.

return (True, False) # time bins, then features


class MedModEHRSequenceProcessor(MedModEHRProcessor):

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[low] MedModEHRSequenceProcessor is unused and undocumented in this PR

Nothing in this PR uses MedModEHRSequenceProcessor: the task uses MedModEHRProcessor, and the description does not mention the class. It is only exercised by its own test. If it is for the models PR (#1638), move it there; otherwise remove it. This keeps the processor API surface to what the description describes.

:undoc-members:
:show-inheritance:

Per-model settings

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[low] Task API page is much longer than comparable pages

The 'Per-model settings' and 'Paper vs code' sections, with file:line citations into the MedMod and MedFuse repositories and CI-level experiment numbers, add a lot to an API reference page. Keep the short 'hours_zero' and 'normalizer' explanation on the page, and move the paper-vs-code table and experiment results to the PR description or a short note. Comparable task pages in docs/api/tasks/ do not carry this detail.

"""One sample per ICU stay that survives MedMod's IHM pipeline.
Sample: ``patient_id`` (subject_id), ``visit_id`` (stay_id), ``ehr``
(float32, (48 / timestep) x 76: 48 x 76 by default), ``image_path``

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[low] Docstring says ehr is float32, but direct calls return float64

The class docstring describes the sample's ehr as float32. That holds after set_task runs the MedModEHRProcessor. task(patient) and StayResult.sample() return the unnormalized float64 array; test_sample_format asserts float64. Say that the float32, standardized tensor comes from the processor in set_task, and that __call__ returns the raw binned values.

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AI Review

suggestion: approve
decision: human review

Thank you for this contribution, and for splitting #1609 into reviewable parts. It adds MedMod's in-hospital mortality pipeline: MedModMIMIC4Dataset with the fixed MedMod split, the MedModInHospitalMortality task with its 48×76 discretized EHR, and MedModEHRProcessor. It looks ready to merge.

  • Not a duplicate: the description explains why this isn't redundant with EHRCXRMortalityMIMIC4 and MedModDecompensationMIMIC4. Those use a 34-column EHR, and this adds MedMod's 76-column one.
  • Sharing is disclosed: subclassing MIMIC4Dataset and MIMIC4EHRDataset is named in the description with its purpose, which is to reuse the MIMIC-IV loading.
  • Dataset source: the docs page and module docstring cite the MedMod paper and code, and link to the MIMIC-IV and MIMIC-CXR-JPG sources.
  • Coverage: the whole repository is at 87.14%, above the 60% bar. Every added file is above 80%, from 92.6% for extraction.py to 100% for medmod_mimic4.py.

Optional suggestions:

  • Unpickler test: add a small test that _NumpyOnlyUnpickler refuses a non-numpy global, for example a pickle that references os.system. That branch guards against a tampered normalizer file, and no test exercises it.
  • Unused processor: MedModEHRSequenceProcessor isn't used anywhere in this PR and isn't mentioned in the description. Consider a short mention that it is for the models in part 2, or move it to that PR.
  • EHR dtype: the task docstring says ehr is float32. task(patient) returns the unnormalized float64 array, and the processor casts to float32 afterwards. A clarifying phrase would avoid confusion.
  • Task cache key: custom resources files are keyed by path only, so editing a file in place won't invalidate the task cache. A note in the docs would help.
  • Docs length: the task API page is long. The "Paper vs code" section could move to a separate page, or be trimmed.

Reviewed commit f6d0cfc

@dhtrg

dhtrg commented Nov 29, 2026 •

Copy link
Copy Markdown
Contributor

@solarsys Hi Professor, could you take a look at #1637 when you have time? It's part 1 of 4 of our original PR #1609, and parts 3 and 4 build on it. I saw it's in #1668 for a licensing check. The bundled MedMod files are unchanged, and we include MedMod's Apache-2.0 license and a NOTICE listing everything we bundled or ported. We can download those files on first use instead, if you'd prefer. Please let us know if we should change anything. Thank you!

dhtrg added a commit to Rainie-Hu/PyHealth that referenced this pull request Nov 30, 2026
Same code as sunlabuiuc#1637-sunlabuiuc#1640 after their reviews. sunlabuiuc#1638 is merged as 1aaeaea.

Co-authored-by: rainiehu <57816421+Rainie-Hu@users.noreply.github.com>
Starting and stopping PyHealth's local Dask cluster took about 5 s per event-table build on 28 fake rows. The dataset tests now run the same Dask graph in the test process, and the custom item map test checks its cache key and row filter without a second build. The slowest step is now the module's one shared build (about 1.7 s); every test takes under 0.5 s.

Co-authored-by: rainiehu <57816421+Rainie-Hu@users.noreply.github.com>
dhtrg added a commit to Rainie-Hu/PyHealth that referenced this pull request Nov 30, 2026
Faster dataset tests from sunlabuiuc#1637.

Co-authored-by: rainiehu <57816421+Rainie-Hu@users.noreply.github.com>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

status: manual Pending maintainer's review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants