Skip to content

Commit

Permalink
Makes measurement_configs a property instead of a static access.
Browse files Browse the repository at this point in the history
  • Loading branch information
mmcdermott committed May 18, 2024
1 parent 6c20b5d commit 330f6ac
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions EventStream/data/pytorch_dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -141,9 +141,6 @@ def __init__(self, config: PytorchDatasetConfig, split: str, just_cache: bool =
logger.info("Reading splits & patient shards")
self.read_shards()

logger.info("Setting measurement configs")
self.set_measurement_configs()

logger.info("Reading patient descriptors")
self.read_patient_descriptors()

Expand Down Expand Up @@ -180,9 +177,10 @@ def read_shards(self):
self.shards = {sp: subjs for sp, subjs in all_shards.items() if sp.startswith(f"{self.split}/")}
self.subj_map = {subj: sp for sp, subjs in self.shards.items() for subj in subjs}

def set_measurement_configs(self):
"""Sets the measurement configs from the source ESGPT or MEDS dataset."""
self.measurement_configs = self.config.measurement_configs
@property
def measurement_configs(self):
"""Grabs the measurement configs from the config."""
return self.config.measurement_configs

def read_patient_descriptors(self):
"""Reads the patient descriptors from the ESGPT or MEDS dataset."""
Expand Down

0 comments on commit 330f6ac

Please sign in to comment.