Skip to content

Add missing citations in PyHealth code#1181

Merged
jhnwu3 merged 2 commits into
sunlabuiuc:masterfrom
lehendo:cits
Jul 22, 2026
Merged

Add missing citations in PyHealth code#1181
jhnwu3 merged 2 commits into
sunlabuiuc:masterfrom
lehendo:cits

Conversation

@lehendo

@lehendo lehendo commented Jul 22, 2026

Copy link
Copy Markdown
Collaborator

Added to TFMTokenizer, EHRMambaCEHR, CEHR embeddings, comprehensiveness/sufficiency metrics, MLE, and NNAAR. Good context for AI when debugging/needs a reference.

Copilot AI left a comment

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.

Pull request overview

Adds literature/code citations and usage examples across several PyHealth models and evaluation metrics to improve traceability and provide better debugging/reference context in the generated docs.

Changes:

  • Added paper/code citations to TFMTokenizer, EHRMambaCEHR, and CEHR embedding docstrings.
  • Added citations for interpretability (ERASER) and generative metrics (TSTR/MLE and NNAAR).
  • Updated Sphinx API docs and an example script header to point readers to the new references.

Reviewed changes

Copilot reviewed 9 out of 9 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
pyhealth/models/tfm_tokenizer.py Adds TFM-Tokenizer paper + code citation in the model docstring.
pyhealth/models/ehrmamba_cehr.py Adds EHRMAMBA paper citation and an end-to-end usage example to the class docstring.
pyhealth/models/cehr_embeddings.py Adds EHRMAMBA/Odyssey embedding citation and a small usage example.
pyhealth/metrics/interpretability/sufficiency.py Adds ERASER paper citation to the sufficiency metric docstring.
pyhealth/metrics/interpretability/comprehensiveness.py Adds ERASER paper citation to the comprehensiveness metric docstring.
pyhealth/metrics/generative/utility.py Adds TSTR protocol citation to MLE utility metric docstring.
pyhealth/metrics/generative/privacy.py Adds NNAAR paper citation to privacy metric docstring.
examples/conformal_eeg/test_tfm_tuev_inference.py Adds a pointer to the TFMTokenizer citation for the inference example.
docs/api/metrics/pyhealth.metrics.generative.rst Updates the generative metrics API docs intro to reference per-function docstrings.
Comments suppressed due to low confidence (2)

pyhealth/models/tfm_tokenizer.py:731

  • Line contains trailing whitespace in the class docstring (blank line with spaces). This can trigger linting failures (e.g., W291) and makes diffs noisier.
    The model expects two inputs:
        - STFT spectrogram: shape (batch, n_freq, n_time)
        - Raw temporal signal: shape (batch, n_samples)
    
    Args:

pyhealth/models/ehrmamba_cehr.py:32

  • The docstring's Args section is incomplete: init accepts additional parameters (type_vocab_size, max_num_visits, time_embeddings_size, visit_segment_vocab) that are not documented here, which can mislead users reading the API docs.
    Args:
        dataset: Fitted :class:`~pyhealth.datasets.SampleDataset` with MPF task schema.
        vocab_size: Concept embedding vocabulary size (typically ``task.vocab.vocab_size``).
        embedding_dim: Hidden size (``hidden_size`` in CEHR embeddings).
        num_layers: Number of :class:`~pyhealth.models.ehrmamba.MambaBlock` layers.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines 4 to +6
Evaluation metrics for synthetic (generative) EHR data, covering privacy,
utility, and statistical fidelity.
utility, and statistical fidelity. See each function's docstring for the
paper it implements.
@jhnwu3
jhnwu3 merged commit ef48918 into sunlabuiuc:master Jul 22, 2026
2 checks passed
@lehendo
lehendo deleted the cits branch July 22, 2026 21:27
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.

3 participants