Skip to content

Commit

Permalink
trying to finally fix linting
Browse files Browse the repository at this point in the history
  • Loading branch information
jeandut committed Aug 12, 2024
1 parent 6a64e58 commit 5c654cc
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 3 deletions.
14 changes: 11 additions & 3 deletions fedeca/strategies/fed_kaplan.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,14 @@


class FedKaplan(ComputePlanBuilder):
"""_summary_
Parameters
----------
ComputePlanBuilder : _type_
_description_
"""

def __init__(
self,
duration_col,
Expand Down Expand Up @@ -55,7 +63,7 @@ def build_compute_plan(
num_rounds: Optional[int],
clean_models: Optional[bool] = True,
):
"""_summary_
"""Build the computation plan.
Parameters
----------
Expand Down Expand Up @@ -111,7 +119,7 @@ def compute_events_statistics(
datasamples,
shared_state=None,
):
"""_summary_
"""Compute events statistics for a subset of data.
Parameters
----------
Expand Down Expand Up @@ -178,7 +186,7 @@ def aggregate_events_statistics(
self,
shared_states,
):
"""_summary_
"""Aggregate events statistics.
Parameters
----------
Expand Down
3 changes: 3 additions & 0 deletions fedeca/tests/test_km.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
"""Tests for the survival utils related to Kaplan Meier."""
import numpy as np
from lifelines import KaplanMeierFitter

from fedeca.utils.survival_utils import compute_events_statistics, km_curve


def test_compute_events_statistics():
"""Test the computation of events statistics."""
times = np.array([0.0, 3.2, 3.2, 5.5, 5.5, 10.0])
events = np.array([True, True, False, True, True, False])
unique_times_gt = np.array([0.0, 3.2, 5.5, 10.0])
Expand All @@ -24,6 +26,7 @@ def test_compute_events_statistics():


def test_km_curve():
"""Test the computation of the Kaplan Meier curve."""
rng = np.random.RandomState(42)
num_samples = 100
times = rng.randint(0, high=21, size=(num_samples,))
Expand Down

0 comments on commit 5c654cc

Please sign in to comment.