ehrdata_blobs stores the time series in the default 3D .X - #285
Open
sueoglu wants to merge 3 commits into
Open
Conversation
sueoglu
marked this pull request as ready for review
August 6, 2026 14:34
eroell
approved these changes
Aug 7, 2026
eroell
left a comment
Collaborator
There was a problem hiding this comment.
This looks good!
If you merge main into this branch, the last CI check should also pass.
Please add an entry in the release notes (Claude sometimes creates a bit overly verbose release note comments, maybe shorten the first suggestion it makes), then this is ready to merge!
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #284
ehrdata_blobswas the last dataset loader still defaulting its tensor to .layers["tem_data"]. It now takes layer: str | None = None and puts the time series in the default 3D .X, matching physionet2012 / physionet2019.What changed
The 2D static X is gone. The generator built the tensor first, then overwrote X with a per-observation mid-timepoint slice of it. Verified before removal, the old X was reproducible from the tensor to max abs diff: 0.0.
Docstring fixes. layer was documented twice in the Args block, and the first entry claimed "If not specified, uses X", the opposite of what the old default did. Collapsed to one accurate entry. The intermediate X variable is renamed base_values, since nothing named X is returned any more and the old name actively misleads about what .X holds.
Also corrected the to_pandas docstring, which advertised shape of .X: (2, 2) plus a .R field that no longer exists.
Requires anndata >=0.13 to use the default
ehrdata_blobs()with defaults now raises onanndata<0.13, which rejects a >2DXat construction:On older anndata the time series has to go in a layer, so
ehrdata_blobs(layer="tem_data", ...)remains the way to use it there.Tests
tests/dt/test_dt.py updated: assertions read the tensor from .X, and a new test_ehrdata_blobs_layer covers the named-layer path, which had no coverage before, it asserts X is None and that both paths produce an identical tensor.
Two assertion groups were deleted rather than adapted, because they pinned the snapshot relationship this PR removes by design: