scanpy icon indicating copy to clipboard operation
scanpy copied to clipboard

irrelevant warning in sc.read

Open yotamcons opened this issue 2 years ago • 3 comments

Hi there, using sc.read(filename, ext='txt') I get the following irrelevant warning: WARNING: Your filename has more than two extensions: ['.5_E9', '.0_E9', '.5', '.txt']. Only considering the two last: ['.5', '.txt']. WARNING: Your filename has more than two extensions: ['.5_E9', '.0_E9', '.5', '.txt']. Only considering the two last: ['.5', '.txt']. (filename is GSE136689_Counts_Matrix_AllCells_E8.5_E9.0_E9.5.txt)

digging in the error is raised by the readwrite module's function is_valid_filename(filename), that checks the extensions regardless of the 'ext' parameter the sc.read function gets, and if it passes it sends it to _read.

inside the _read function, there is a second call to is_valid_filename, which raises the second warning (with exactly the same text)

seeing as this is the process, i don't get why even have the ext parameter, because currently it seams like it is only used to indicate when someone uses an unsupported extension

Versions


anndata 0.8.0 scanpy 1.9.1

PIL 9.1.0 PyQt5 NA appnope 0.1.3 atomicwrites 1.4.0 autoreload NA backcall 0.2.0 beta_ufunc NA binom_ufunc NA brotli NA bs4 4.11.1 certifi 2022.05.18.1 cffi 1.15.0 chardet 4.0.0 charset_normalizer 2.0.12 cloudpickle 2.0.0 colorama 0.4.4 cycler 0.10.0 cython_runtime NA cytoolz 0.11.2 dask 2022.05.0 dateutil 2.8.2 debugpy 1.6.0 decorator 5.1.1 defusedxml 0.7.1 entrypoints 0.4 fastcluster 1.1.26 fsspec 2022.3.0 gprofiler 1.0.0 h5py 3.6.0 idna 3.3 igraph 0.9.9 ipykernel 6.13.0 ipython_genutils 0.2.0 ipywidgets 7.7.0 jedi 0.18.1 jinja2 3.1.2 joblib 1.1.0 jupyter_server 1.17.0 kiwisolver 1.4.2 leidenalg 0.8.8 llvmlite 0.38.0 louvain 0.7.1 markupsafe 2.1.1 matplotlib 3.5.1 matplotlib_inline NA mpl_toolkits NA natsort 8.1.0 nbinom_ufunc NA networkx 2.6.3 numba 0.55.0 numpy 1.21.5 packaging 21.3 pandas 1.4.0 parso 0.8.3 pexpect 4.8.0 phyloproc NA pickleshare 0.7.5 pkg_resources NA prompt_toolkit 3.0.29 psutil 5.9.0 ptyprocess 0.7.0 pydev_ipython NA pydevconsole NA pydevd 2.8.0 pydevd_file_utils NA pydevd_plugins NA pydevd_tracing NA pygments 2.12.0 pyparsing 3.0.9 pytz 2022.1 requests 2.27.1 scipy 1.7.3 seaborn 0.11.2 session_info 1.0.0 setuptools 62.2.0 sip NA six 1.16.0 sklearn 1.0.2 socks 1.7.1 soupsieve 2.3.1 sphinxcontrib NA spyder 5.2.2 spyder_kernels 2.2.1 spydercustomize NA statsmodels 0.13.2 storemagic NA texttable 1.6.4 threadpoolctl 3.1.0 tlz 0.11.2 toolz 0.11.2 tornado 6.1 traitlets 5.2.0 typing_extensions NA unicodedata2 NA urllib3 1.26.9 wcwidth 0.2.5 wurlitzer 3.0.2 yaml 6.0 zipp NA zmq 22.3.0

IPython 7.33.0 jupyter_client 7.3.1 jupyter_core 4.10.0 jupyterlab 3.2.8 notebook 6.4.11

Python 3.9.12 | packaged by conda-forge | (main, Mar 24 2022, 23:27:05) [Clang 12.0.1 ] macOS-12.4-x86_64-i386-64bit

Session information updated at 2022-07-03 15:14

yotamcons avatar Jul 03 '22 12:07 yotamcons

Would you be interested in filing up a PR to improve this behavior? I'd encourage you to do so. Thank you!

Zethson avatar Aug 11 '22 17:08 Zethson

Would love to starting November, ping me if thats still relevant

yotamcons avatar Aug 31 '22 16:08 yotamcons

Go ahead

Zethson avatar Aug 31 '22 17:08 Zethson