From f98957c74930a32e4d05130f2eacbe4b4f5ce32b Mon Sep 17 00:00:00 2001 From: Nikita Janakarajan Date: Fri, 27 Oct 2023 00:16:17 +0200 Subject: [PATCH] fix: relative to absolute imports --- sparsesurv/tests/test_aft.py | 4 ++-- sparsesurv/tests/test_breslow.py | 2 +- sparsesurv/tests/test_eh.py | 6 +++--- sparsesurv/tests/test_eh_gradient.py | 6 +++--- sparsesurv/tests/test_utils.py | 2 +- 5 files changed, 10 insertions(+), 10 deletions(-) diff --git a/sparsesurv/tests/test_aft.py b/sparsesurv/tests/test_aft.py index cdf80eb..e629782 100644 --- a/sparsesurv/tests/test_aft.py +++ b/sparsesurv/tests/test_aft.py @@ -3,10 +3,10 @@ import numpy as np import pytest import torch -from .get_data_arrays import get_1d_array +from sparsesurv.tests.get_data_arrays import get_1d_array from sparsesurv.loss import aft_negative_likelihood -from sparsesurv.utils import normal_density +from sparsesurv.tests.test_utils import normal_density def aft_calculation(linear_predictor, time, event): diff --git a/sparsesurv/tests/test_breslow.py b/sparsesurv/tests/test_breslow.py index fecad84..43b5786 100644 --- a/sparsesurv/tests/test_breslow.py +++ b/sparsesurv/tests/test_breslow.py @@ -3,7 +3,7 @@ import numpy as np import pytest -from .get_data_arrays import get_1d_array +from sparsesurv.tests.get_data_arrays import get_1d_array from sparsesurv.loss import breslow_negative_likelihood diff --git a/sparsesurv/tests/test_eh.py b/sparsesurv/tests/test_eh.py index f80fe79..a96bbd5 100644 --- a/sparsesurv/tests/test_eh.py +++ b/sparsesurv/tests/test_eh.py @@ -4,9 +4,9 @@ import pytest import torch -from ..loss import eh_negative_likelihood -from .get_data_arrays import get_2d_array -from .test_utils import normal_density +from sparsesurv.loss import eh_negative_likelihood +from sparsesurv.tests.get_data_arrays import get_2d_array +from sparsesurv.tests.test_utils import normal_density def eh_calculation(linear_predictor, time, event): diff --git a/sparsesurv/tests/test_eh_gradient.py b/sparsesurv/tests/test_eh_gradient.py index 1066b97..4a635f5 100644 --- a/sparsesurv/tests/test_eh_gradient.py +++ b/sparsesurv/tests/test_eh_gradient.py @@ -1,11 +1,11 @@ import numpy as np -import pandas as pd + import torch -from .get_data_arrays import get_2d_array +from sparsesurv.tests.get_data_arrays import get_2d_array from sparsesurv.gradients import eh_gradient -from .test_eh import eh_calculation +from sparsesurv.tests.test_eh import eh_calculation def get_eh_gradient(case="default"): diff --git a/sparsesurv/tests/test_utils.py b/sparsesurv/tests/test_utils.py index 54d8245..3c0fa8c 100644 --- a/sparsesurv/tests/test_utils.py +++ b/sparsesurv/tests/test_utils.py @@ -1,6 +1,6 @@ import torch -from ..constants import PDF_PREFACTOR +from sparsesurv.constants import PDF_PREFACTOR def normal_density(x: torch.Tensor) -> torch.Tensor: