Skip to content

Commit

Permalink
reformatted with black
Browse files Browse the repository at this point in the history
  • Loading branch information
Lucas Camillo authored and Lucas Camillo committed Jan 9, 2024
1 parent d421cfd commit 54dd579
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 4 deletions.
4 changes: 3 additions & 1 deletion pyaging/predict/_pred.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,9 @@ def predict_age(
)

# Add predicted ages and clock metadata to adata
add_pred_ages_and_clock_metadata_adata(adata, predicted_ages, clock_name, dir, logger, indent_level=2)
add_pred_ages_and_clock_metadata_adata(
adata, predicted_ages, clock_name, dir, logger, indent_level=2
)

# Return adata to original size and number of features
adata = filter_missing_features(adata, logger, indent_level=2)
Expand Down
3 changes: 2 additions & 1 deletion pyaging/predict/_pred_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -695,7 +695,7 @@ def add_pred_ages_and_clock_metadata_adata(
This function appends the predicted ages, obtained from a biological aging clock or similar model, to
the AnnData object's `obs` attribute. The predicted ages are added as a new column, named after the
clock used to generate these predictions.
clock used to generate these predictions.
Parameters
----------
Expand Down Expand Up @@ -816,6 +816,7 @@ def filter_missing_features(

return adata


@progress("Set PyTorch device")
def set_torch_device(logger, indent_level: int = 1) -> None:
"""
Expand Down
7 changes: 5 additions & 2 deletions pyaging/preprocess/_preprocess_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -203,8 +203,11 @@ def create_anndata_object(
# Log the number and names of columns being dropped
num_columns_dropped = len(columns_with_nas)
if num_columns_dropped > 0:
logger.warning(f"Dropping {num_columns_dropped} columns with only NAs: {list(columns_with_nas)[:np.min([3, num_columns_dropped])]}, etc.", indent_level=indent_level+1)

logger.warning(
f"Dropping {num_columns_dropped} columns with only NAs: {list(columns_with_nas)[:np.min([3, num_columns_dropped])]}, etc.",
indent_level=indent_level + 1,
)

# Drop columns with only NAs
df = df.drop(columns=columns_with_nas, axis=1)

Expand Down

0 comments on commit 54dd579

Please sign in to comment.