Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Future warning in \preprocessing\_highly_variable_genes.py:226 #2967

Open
2 of 3 tasks
dorzhey opened this issue Mar 26, 2024 · 3 comments
Open
2 of 3 tasks

Future warning in \preprocessing\_highly_variable_genes.py:226 #2967

dorzhey opened this issue Mar 26, 2024 · 3 comments
Labels
Bug 🐛 Closing candidate Issue that can probably be closed

Comments

@dorzhey
Copy link

dorzhey commented Mar 26, 2024

Please make sure these conditions are met

  • I have checked that this issue has not already been reported.
  • I have confirmed this bug exists on the latest version of scanpy.
  • (optional) I have confirmed this bug exists on the main branch of scanpy.

What happened?

Python compiler of Pandas is giving Future Warning that in line:
disp_grouped = df.groupby("mean_bin")["dispersions"]
at \preprocessing_highly_variable_genes.py:226
Gives this warning:
"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."

Minimal code sample

disp_grouped = df.groupby("mean_bin", observed=False)["dispersions"]

Error output

\scanpy\preprocessing\_highly_variable_genes.py:226: 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.

Versions

-----
anndata     0.10.5.post1
scanpy      1.9.8
-----
PIL                 10.2.0
beta_ufunc          NA
binom_ufunc         NA
colorama            0.4.6
cycler              0.10.0
cython_runtime      NA
dateutil            2.8.2
google              NA
h5py                3.9.0
hypergeom_ufunc     NA
igraph              0.11.4
invgauss_ufunc      NA
joblib              1.2.0
kiwisolver          1.4.4
leidenalg           0.10.2
llvmlite            0.42.0
matplotlib          3.8.0
mkl                 2.4.0
mpl_toolkits        NA
natsort             7.1.1
nbinom_ufunc        NA
ncf_ufunc           NA
nct_ufunc           NA
ncx2_ufunc          NA
nt                  NA
numba               0.59.0
numpy               1.26.4
packaging           23.1
pandas              2.2.1
psutil              5.9.8
pyparsing           3.0.9
pythoncom           NA
pytz                2023.3.post1
pywin32_system32    NA
pywintypes          NA
scipy               1.11.4
session_info        1.0.0
setuptools          68.2.2
six                 1.16.0
skewnorm_ufunc      NA
sklearn             1.2.2
texttable           1.7.0
threadpoolctl       2.2.0
torch               2.2.1
torchgen            NA
tqdm                4.65.0
typing_extensions   NA
wcwidth             0.2.13
win32api            NA
win32com            NA
yaml                6.0.1
zoneinfo            NA
-----
Python 3.11.7 | packaged by Anaconda, Inc. | (main, Dec 15 2023, 18:05:47) [MSC v.1916 64 bit (AMD64)]
Windows-10-10.0.22621-SP0
-----
Session information updated at 2024-03-26 18:50
@ivirshup
Copy link
Member

@dorzhey can you reproduce this with the latest scanpy release? I believe it should be fixed there.

@ivirshup ivirshup added the Needs info❔ More information needed label Mar 27, 2024
@dorzhey
Copy link
Author

dorzhey commented Mar 29, 2024

@ivirshup Yes it still there

@Zethson Zethson removed the Needs info❔ More information needed label Apr 2, 2024
@ivirshup
Copy link
Member

ivirshup commented Apr 3, 2024

In scanpy 1.10, the line referenced is:

But in 1.9.8 the line is:

So, to me it seems like the warning would require running an older version of the code.

Can you demonstrate that in a session where sc.__version__ == "1.10.0" you get this warning and show that here? Something like:

import scanpy as sc
sc.pp.highly_variable_genes(sc.pp.pbmc3k_processed())
sc.logging.print_versions()

@ivirshup ivirshup added the Closing candidate Issue that can probably be closed label Apr 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug 🐛 Closing candidate Issue that can probably be closed
Projects
None yet
Development

No branches or pull requests

3 participants