Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pyhealth/data/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ class Visit:
"""This class is deprecated and should not be used."""
def __init__(self, *args, **kwargs):
import warnings
warnings.warn("The Visit class is deprecated and will be removed in a future version.", DeprecationWarning)
warnings.warn("The Visit class is deprecated and will be removed in a future version.", DeprecationWarning, stacklevel=2)
4 changes: 4 additions & 0 deletions pyhealth/datasets/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ def __init__(self, *args, **kwargs):
warnings.warn(
"The BaseEHRDataset class is deprecated and will be removed in a future version.",
DeprecationWarning,
stacklevel=2,
)


Expand All @@ -19,6 +20,7 @@ def __init__(self, *args, **kwargs):
warnings.warn(
"The BaseSignalDataset class is deprecated and will be removed in a future version.",
DeprecationWarning,
stacklevel=2,
)


Expand All @@ -31,6 +33,7 @@ def __init__(self, *args, **kwargs):
warnings.warn(
"The SampleEHRDataset class is deprecated and will be removed in a future version.",
DeprecationWarning,
stacklevel=2,
)


Expand All @@ -43,6 +46,7 @@ def __init__(self, *args, **kwargs):
warnings.warn(
"The SampleSignalDataset class is deprecated and will be removed in a future version.",
DeprecationWarning,
stacklevel=2,
)


Expand Down
1 change: 1 addition & 0 deletions pyhealth/datasets/mimic3.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ def __init__(
"Events from prescriptions table only have date timestamp (no specific time). "
"This may affect temporal ordering of events.",
UserWarning,
stacklevel=2,
)
super().__init__(
root=root,
Expand Down
2 changes: 2 additions & 0 deletions pyhealth/datasets/mimic4.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,12 +122,14 @@ def __init__(
"Events from discharge table only have date timestamp (no specific time). "
"This may affect temporal ordering of events.",
UserWarning,
stacklevel=2,
)
if "discharge_detail" in tables:
warnings.warn(
"Events from discharge_detail table only have date timestamp (no specific time). "
"This may affect temporal ordering of events.",
UserWarning,
stacklevel=2,
)
log_memory_usage(f"Before initializing {dataset_name}")
super().__init__(
Expand Down
1 change: 1 addition & 0 deletions pyhealth/models/concare.py
Original file line number Diff line number Diff line change
Expand Up @@ -954,6 +954,7 @@ def __init__(
"and sum-pooled per visit for memory efficiency. This reduces "
"per-visit code representations to a single scalar.",
UserWarning,
stacklevel=2,
)
else:
input_dim = proc.size()
Expand Down
2 changes: 2 additions & 0 deletions pyhealth/models/stagenet.py
Original file line number Diff line number Diff line change
Expand Up @@ -440,6 +440,7 @@ def forward_from_embedding(
f"StageNet format with time intervals for "
f"better performance.",
UserWarning,
stacklevel=2,
)
else:
time = time.to(self.device)
Expand All @@ -453,6 +454,7 @@ def forward_from_embedding(
f"Feature '{feature_key}' does not have mask "
f"information. Default mask will be created from "
f"embedded values. But it may not be accurate.",
stacklevel=2,
)
mask = (value.abs().sum(dim=-1) != 0).int()
elif not processor.is_token() and value.dim() == mask.dim():
Expand Down
2 changes: 2 additions & 0 deletions pyhealth/models/stagenet_mha.py
Original file line number Diff line number Diff line change
Expand Up @@ -516,6 +516,7 @@ def forward_from_embedding(
f"StageNet format with time intervals for "
f"better performance.",
UserWarning,
stacklevel=2,
)
else:
time = time.to(self.device)
Expand All @@ -528,6 +529,7 @@ def forward_from_embedding(
f"Feature '{feature_key}' does not have mask "
f"information. Default mask will be created from "
f"embedded values. But it may not be accurate.",
stacklevel=2,
)
mask = (value.abs().sum(dim=-1) != 0).int()
elif not processor.is_token() and value.dim() == mask.dim():
Expand Down
1 change: 1 addition & 0 deletions pyhealth/models/text_embedding.py
Original file line number Diff line number Diff line change
Expand Up @@ -244,6 +244,7 @@ def _chunk_and_encode(
f"Text produced {original_chunks} chunks, truncated to {self.max_chunks}. "
f"Consider increasing max_chunks or summarizing input.",
UserWarning,
stacklevel=2,
)

# Step 4: Pad chunks to uniform length for batched encoding
Expand Down