Skip to content

Commit 5cdfe18

Browse files
committed
Add logging to data manger
1 parent ab19b3c commit 5cdfe18

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

decipher/data/data_manager.py

+8
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import logging
12
from pathlib import Path
23

34
import numpy.typing as npt
@@ -15,16 +16,20 @@
1516
ToExam,
1617
)
1718

19+
logger = logging.getLogger(__name__)
20+
1821

1922
class DataManager:
2023
def __init__(self, screening_path: Path, dob_path: Path) -> None:
2124
raw_data = read_raw_df(screening_data_path=screening_path)
25+
logger.debug("Read raw data")
2226

2327
self.base_pipeline = get_base_pipeline(
2428
birthday_file=dob_path, drop_missing_birthday=True
2529
)
2630

2731
base_df = self.base_pipeline.fit_transform(raw_data)
32+
logger.debug("Got base DF")
2833
exams = Pipeline(
2934
[
3035
("wide_to_long", ToExam()),
@@ -33,11 +38,14 @@ def __init__(self, screening_path: Path, dob_path: Path) -> None:
3338
],
3439
verbose=True,
3540
).fit_transform(base_df)
41+
logger.debug("Got exams DF")
3642
self.observation_data_transformer = ObservationMatrix()
3743
self.screening_data: pd.DataFrame = (
3844
self.observation_data_transformer.fit_transform(exams)
3945
)
46+
logger.debug("Got observations DF")
4047
self.person_df: pd.DataFrame = PersonStats(base_df=base_df).fit_transform(exams)
48+
logger.debug("Got person DF")
4149

4250
def shape(self) -> tuple[int, int]:
4351
n_rows = self.screening_data["row"].max() + 1

0 commit comments

Comments
 (0)