scverse / rapids_singlecell

Rapids_singlecell: A GPU-accelerated tool for scRNA analysis. Offers seamless scverse compatibility for efficient single-cell data processing and analysis.
https://rapids-singlecell.readthedocs.io/
MIT License
105 stars 18 forks source link

[BUG] FutureWarning from Pandas 2.2.1 in groupby call #195

Closed bkmartinjr closed 1 month ago

bkmartinjr commented 1 month ago

Describe the bug When running the latest version with Pandas 2.2.1 (Python 3.11), a call to highly_variable_genes will raise a FutureWarning:

/.../miniforge3/envs/rapids_singlecell/lib/python3.11/site-packages/rapids_singlecell/preprocessing/_hvg.py:311: FutureWarning: The default of observed=False is deprecated and will be changed to True in a future version of pandas. Pass observed=False to retain current behavior or observed=True to adopt the future default and silence this warning.
disp_grouped = df.groupby("mean_bin")["dispersions"]

I believe it just needs an explicitly specified param to resolve this.

Steps/Code to reproduce bug

The method was called on an anndata without args, e.g.,

rsc.pp.highly_variable_genes(adata)

Expected behavior A clear and concise description of what you expected to happen.

Environment details (please complete the following information):

pandas                    2.2.1           py311h320fe9a_0    conda-forge
rapids                    24.04.00        cuda11_py311_240411_gb301c96_0    rapidsai
rapids-singlecell         0.10.2                   pypi_0    pypi
Intron7 commented 1 month ago

@bkmartinjr Thank you so much for reporting this. I'll test some fix and make a PR soon.

Intron7 commented 1 month ago

I just checked. This got fixed with version 0.10.3

bkmartinjr commented 1 month ago

Confirmed! Thank you for a fantastic package.