genotoul-bioinfo / Binette

A fast and accurate binning refinement tool to constructs high quality MAGs from the output of multiple binning tools.
https://binette.readthedocs.io
MIT License
16 stars 1 forks source link

Warning with pytest #17

Closed lskatz closed 2 months ago

lskatz commented 2 months ago

Hi, I followed the tests as described in #15 and came across this warning. Is there any cause for concern?

(removing my computer and home directory info)

(binette) $ pytest .
============================================= test session starts =============================================
platform linux -- Python 3.8.19, pytest-8.2.2, pluggy-1.5.0
rootdir: /src/Binette
configfile: pyproject.toml
plugins: cov-5.0.0
collected 90 items

tests/bin_manager_test.py ...................................                                           [ 38%]
tests/bin_quality_test.py ........                                                                      [ 47%]
tests/cds_test.py .........                                                                             [ 57%]
tests/contig_manager_test.py .....                                                                      [ 63%]
tests/diamonds_test.py .........                                                                        [ 73%]
tests/io_manager_test.py .........                                                                      [ 83%]
tests/main_binette_test.py ...............                                                              [100%]

============================================== warnings summary ===============================================
tests/bin_quality_test.py: 634 warnings
/bin/miniconda3/envs/binette/lib/python3.8/site-packages/checkm2/keggData.py:54: Perfo rmanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times , which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a d e-fragmented frame, use `newframe = frame.copy()`
    KO_gene_data[vector] = (presence_absence_subset[self.path_category_mapping[self.path_category_mapping[group ] == vector]['Kegg_ID'].values].sum(axis=1)) / length

tests/bin_quality_test.py::test_assess_bins_quality
  /bin/miniconda3/envs/binette/lib/python3.8/site-packages/numpy/matrixlib/defmatrix.py: 69: PendingDeprecationWarning: the matrix subclass is not the recommended way to represent matrices or deal wit h linear algebra (see https://docs.scipy.org/doc/numpy/user/numpy-for-matlab-users.html). Please adjust your co de to use regular ndarray.
    return matrix(data, dtype=dtype, copy=False)

-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
====================================== 90 passed, 635 warnings in 28.07s ======================================
JeanMainguy commented 2 months ago

Hello, I've also noticed those warnings. They're all coming from the checkM2 functions in Binette, and I don't have control over fixing them in the Binette code. As far as I can tell, they appear to be performance-related warnings rather than something that would affect the integrity of the results.

lskatz commented 2 months ago

Thank you for the clarification!