Skip to content

Commit

Permalink
refactor(logs): add single logger
Browse files Browse the repository at this point in the history
  • Loading branch information
matteo4diani committed Nov 18, 2023
1 parent fff591c commit 0e8fe99
Show file tree
Hide file tree
Showing 14 changed files with 16 additions and 42 deletions.
6 changes: 0 additions & 6 deletions auton_survival/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -472,9 +472,3 @@ class is a composite transform that does both Imputing ***and*** Scaling with
from .models.dcm import DeepCoxMixtures
from .models.cph import DeepCoxPH, DeepRecurrentCoxPH
from .models.cmhe import DeepCoxMixturesHeterogenousEffects

import warnings
from tqdm.auto import tqdm
import logging

logging.basicConfig()
4 changes: 1 addition & 3 deletions auton_survival/experiments.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,7 @@
from tqdm import tqdm


import logging

logger = logging.getLogger(__name__)
from auton_survival.logging import logger


class SurvivalRegressionCV:
Expand Down
4 changes: 4 additions & 0 deletions auton_survival/logging.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
import logging

LOGGER_NAME = "auton_survival"
logger = logging.getLogger(LOGGER_NAME)
4 changes: 1 addition & 3 deletions auton_survival/metrics.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,7 @@

import warnings

import logging

logger = logging.getLogger(__name__)
from auton_survival.logging import logger


def treatment_effect(
Expand Down
4 changes: 1 addition & 3 deletions auton_survival/models/cmhe/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,9 +85,7 @@

from auton_survival.utils import _dataframe_to_array

import logging

logger = logging.getLogger(__name__)
from auton_survival.logging import logger


class DeepCoxMixturesHeterogenousEffects:
Expand Down
4 changes: 1 addition & 3 deletions auton_survival/models/cmhe/cmhe_utilities.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,7 @@
smooth_bl_survival,
)

import logging

logger = logging.getLogger(__name__)
from auton_survival.logging import logger


def get_likelihood(model, breslow_splines, x, t, e, a):
Expand Down
4 changes: 1 addition & 3 deletions auton_survival/models/cph/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,7 @@
from auton_survival.models.utils.recurrent_nn_utils import _get_padded_targets


import logging

logger = logging.getLogger(__name__)
from auton_survival.logging import logger


DcphModel = namedtuple("DcphModel", ["module", "breslow"])
Expand Down
4 changes: 1 addition & 3 deletions auton_survival/models/cph/dcph_utilities.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,7 @@
partial_ll_loss,
)

import logging

logger = logging.getLogger(__name__)
from auton_survival.logging import logger


def fit_breslow(model, x, t, e):
Expand Down
4 changes: 1 addition & 3 deletions auton_survival/models/dcm/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,7 @@

from auton_survival.utils import _dataframe_to_array

import logging

logger = logging.getLogger(__name__)
from auton_survival.logging import logger


class DeepCoxMixtures:
Expand Down
4 changes: 1 addition & 3 deletions auton_survival/models/dcm/dcm_utilities.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,7 @@
smooth_bl_survival,
)

import logging

logger = logging.getLogger(__name__)
from auton_survival.logging import logger


def get_likelihood(model, breslow_splines, x, t, e):
Expand Down
4 changes: 1 addition & 3 deletions auton_survival/models/dsm/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -183,9 +183,7 @@
__pdoc__["DSMBase"] = False


import logging

logger = logging.getLogger(__name__)
from auton_survival.logging import logger


class DSMBase:
Expand Down
4 changes: 1 addition & 3 deletions auton_survival/models/dsm/dsm_utilities.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,7 @@
import gc


import logging

logger = logging.getLogger(__name__)
from auton_survival.logging import logger


def pretrain_dsm(
Expand Down
4 changes: 1 addition & 3 deletions auton_survival/phenotyping.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,7 @@
from auton_survival.utils import _get_method_kwargs
from auton_survival.experiments import CounterfactualSurvivalRegressionCV

import logging

logger = logging.getLogger(__name__)
from auton_survival.logging import logger


class Phenotyper:
Expand Down
4 changes: 1 addition & 3 deletions auton_survival/reporting.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,7 @@
from lifelines.plotting import add_at_risk_counts


import logging

logger = logging.getLogger(__name__)
from auton_survival.logging import logger


def plot_kaplanmeier(outcomes, groups=None, plot_counts=False, **kwargs):
Expand Down

0 comments on commit 0e8fe99

Please sign in to comment.