Skip to content

Commit

Permalink
linting
Browse files Browse the repository at this point in the history
  • Loading branch information
jeandut committed Aug 12, 2024
1 parent cc03227 commit b74aff6
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
2 changes: 0 additions & 2 deletions fedeca/utils/moments_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ def compute_uncentered_moment(data, order):
NotImplementedError
Raised if the data type is not Dataframe nor np.ndarray.
"""

if isinstance(data, (pd.DataFrame, pd.Series)):
moment = data.select_dtypes(include=np.number).pow(order).mean(skipna=True)
elif isinstance(data, np.ndarray):
Expand Down Expand Up @@ -99,7 +98,6 @@ def aggregation_mean(local_means: List[Any], n_local_samples: List[int]):
Any
Aggregated mean. Same type of the local means
"""

tot_samples = np.nan_to_num(np.copy(n_local_samples[0]), nan=0, copy=False)
tot_mean = np.nan_to_num(np.copy(local_means[0]), nan=0, copy=False)
for mean, n_sample in zip(local_means[1:], n_local_samples[1:]):
Expand Down
7 changes: 4 additions & 3 deletions fedeca/utils/survival_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -1588,8 +1588,9 @@ def build_X_y_function(
shared_state={},
global_moments={},
):
"""Build the inputs for a propensity model and for a Cox model as well as y directly
from the output of the opener.
"""Build the inputs for a propensity model and for a Cox model and y.
Does that directly on data from opener.
This function 1. uses the event column to inject the censorship
information present in the duration column (given in absolute values)
Expand Down Expand Up @@ -1729,7 +1730,7 @@ def compute_X_y_and_propensity_weights_function(
if propensity_model is not None:
assert (
treated is not None
), f"""If you are using a propensity model the Treated
), """If you are using a propensity model the Treated
column should be available"""
assert np.all(
np.in1d(np.unique(treated.astype("uint8"))[0], [0, 1])
Expand Down

0 comments on commit b74aff6

Please sign in to comment.