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

Fix warnings #192

Closed
shntnu opened this issue Apr 1, 2022 · 0 comments · Fixed by #194
Closed

Fix warnings #192

shntnu opened this issue Apr 1, 2022 · 0 comments · Fixed by #194

Comments

@shntnu
Copy link
Member

shntnu commented Apr 1, 2022

Fix these these warnings that pop up upon testing

pytest
======================================================================== test session starts ========================================================================
platform darwin -- Python 3.9.6, pytest-7.1.1, pluggy-1.0.0
rootdir: /Users/shsingh/work/repos/software/cytominer/cytomining/pycytominer
collected 129 items                                                                                                                                                 

pycytominer/tests/test_aggregate.py .........                                                                                                                 [  6%]
pycytominer/tests/test_annotate.py ...                                                                                                                        [  9%]
pycytominer/tests/test_consensus.py ..                                                                                                                        [ 10%]
pycytominer/tests/test_feature_select.py .........                                                                                                            [ 17%]
pycytominer/tests/test_normalize.py ...........                                                                                                               [ 26%]
pycytominer/tests/test_cyto_utils/test_DeepProfiler_processing.py .....                                                                                       [ 30%]
pycytominer/tests/test_cyto_utils/test_annotate_custom.py ......                                                                                              [ 34%]
pycytominer/tests/test_cyto_utils/test_cells.py .................                                                                                             [ 48%]
pycytominer/tests/test_cyto_utils/test_cp_image_features.py ..                                                                                                [ 49%]
pycytominer/tests/test_cyto_utils/test_feature_blocklist.py ..                                                                                                [ 51%]
pycytominer/tests/test_cyto_utils/test_feature_drop_outlier.py ....                                                                                           [ 54%]
pycytominer/tests/test_cyto_utils/test_feature_infer.py .....                                                                                                 [ 58%]
pycytominer/tests/test_cyto_utils/test_features_count_na.py .                                                                                                 [ 58%]
pycytominer/tests/test_cyto_utils/test_features_util.py .                                                                                                     [ 59%]
pycytominer/tests/test_cyto_utils/test_load.py ....                                                                                                           [ 62%]
pycytominer/tests/test_cyto_utils/test_modz.py .......                                                                                                        [ 68%]
pycytominer/tests/test_cyto_utils/test_output.py ......                                                                                                       [ 72%]
pycytominer/tests/test_cyto_utils/test_single_cell_ingest_utils.py ...                                                                                        [ 75%]
pycytominer/tests/test_cyto_utils/test_util.py ............                                                                                                   [ 84%]
pycytominer/tests/test_cyto_utils/test_write_gct.py ....                                                                                                      [ 87%]
pycytominer/tests/test_operations/test_correlation_threshold.py ....                                                                                          [ 90%]
pycytominer/tests/test_operations/test_get_na_columns.py ...                                                                                                  [ 93%]
pycytominer/tests/test_operations/test_sparse_random_projection.py ..                                                                                         [ 94%]
pycytominer/tests/test_operations/test_transform.py ....                                                                                                      [ 97%]
pycytominer/tests/test_operations/test_variance_threshold.py ...                                                                                              [100%]

========================================================================= warnings summary ==========================================================================
pycytominer/cyto_utils/util.py:61
  /Users/shsingh/work/repos/software/cytominer/cytomining/pycytominer/pycytominer/cyto_utils/util.py:61: UserWarning: Non-canonical compartment detected: new
    warnings.warn(warn_str)

pycytominer/tests/test_consensus.py: 6 warnings
pycytominer/tests/test_feature_select.py: 5 warnings
pycytominer/tests/test_cyto_utils/test_modz.py: 20 warnings
pycytominer/tests/test_cyto_utils/test_util.py: 1 warning
pycytominer/tests/test_operations/test_correlation_threshold.py: 5 warnings
  /Users/shsingh/work/repos/software/cytominer/cytomining/pycytominer/pycytominer/cyto_utils/util.py:338: DeprecationWarning: `np.bool` is a deprecated alias for the builtin `bool`. To silence this warning, use `bool` by itself. Doing this will not modify any behavior and is safe. If you specifically wanted the numpy scalar type, use `np.bool_` here.
  Deprecated in NumPy 1.20; for more details and guidance: https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations
    np.tril(np.ones(data_cor_natri_df.shape), k=-1).astype(np.bool)

pycytominer/tests/test_feature_select.py::test_feature_select_noise_removal
pycytominer/tests/test_feature_select.py::test_feature_select_noise_removal
pycytominer/tests/test_feature_select.py::test_feature_select_noise_removal
pycytominer/tests/test_feature_select.py::test_feature_select_noise_removal
pycytominer/tests/test_feature_select.py::test_feature_select_noise_removal
pycytominer/tests/test_feature_select.py::test_feature_select_noise_removal
pycytominer/tests/test_feature_select.py::test_feature_select_noise_removal
  /usr/local/lib/python3.9/site-packages/numpy/core/fromnumeric.py:3613: FutureWarning: Dropping of nuisance columns in DataFrame reductions (with 'numeric_only=None') is deprecated; in a future version this will raise TypeError.  Select only valid columns before calling the reduction.
    return std(axis=axis, dtype=dtype, out=out, ddof=ddof, **kwargs)

pycytominer/tests/test_normalize.py::test_normalize_robustize_mad_allsamples
pycytominer/tests/test_normalize.py::test_normalize_robustize_mad_allsamples_novar
pycytominer/tests/test_operations/test_transform.py::test_robust_mad
  /Users/shsingh/work/repos/software/cytominer/cytomining/pycytominer/pycytominer/operations/transform.py:131: DeprecationWarning: `median_absolute_deviation` is deprecated, use `median_abs_deviation` instead!
  
  To preserve the existing default behavior, use
  `scipy.stats.median_abs_deviation(..., scale=1/1.4826)`.
  The value 1.4826 is not numerically precise for scaling
  with a normal distribution. For a numerically precise value, use
  `scipy.stats.median_abs_deviation(..., scale='normal')`.
  
    median_absolute_deviation(X, nan_policy="omit"), index=self.median.index

pycytominer/tests/test_cyto_utils/test_cells.py::test_merge_single_cells
pycytominer/tests/test_cyto_utils/test_cells.py::test_merge_single_cells
pycytominer/tests/test_cyto_utils/test_cells.py::test_merge_single_cells
pycytominer/tests/test_cyto_utils/test_cells.py::test_merge_single_cells
  /Users/shsingh/work/repos/software/cytominer/cytomining/pycytominer/pycytominer/cyto_utils/cells.py:693: FutureWarning: Passing 'suffixes' which cause duplicate columns {'ObjectNumber_cytoplasm'} in the result is deprecated and will raise a MergeError in a future version.
    sc_df = sc_df.merge(

pycytominer/tests/test_cyto_utils/test_modz.py::test_modz_base
  /Users/shsingh/work/repos/software/cytominer/cytomining/pycytominer/pycytominer/tests/test_cyto_utils/test_modz.py:48: FutureWarning: The 'check_less_precise' keyword in testing.assert_*_equal is deprecated and will be removed in a future version. You can stop passing 'check_less_precise' to silence this warning.
    pd.testing.assert_series_equal(

pycytominer/tests/test_cyto_utils/test_modz.py::test_modz
  /Users/shsingh/work/repos/software/cytominer/cytomining/pycytominer/pycytominer/tests/test_cyto_utils/test_modz.py:71: FutureWarning: The 'check_less_precise' keyword in testing.assert_*_equal is deprecated and will be removed in a future version. You can stop passing 'check_less_precise' to silence this warning.
    pd.testing.assert_frame_equal(

pycytominer/tests/test_cyto_utils/test_modz.py::test_modz_multiple_columns
  /Users/shsingh/work/repos/software/cytominer/cytomining/pycytominer/pycytominer/tests/test_cyto_utils/test_modz.py:118: FutureWarning: The 'check_less_precise' keyword in testing.assert_*_equal is deprecated and will be removed in a future version. You can stop passing 'check_less_precise' to silence this warning.
    pd.testing.assert_frame_equal(

pycytominer/tests/test_cyto_utils/test_modz.py::test_modz_multiple_columns_one_metadata_column
  /Users/shsingh/work/repos/software/cytominer/cytomining/pycytominer/pycytominer/tests/test_cyto_utils/test_modz.py:148: FutureWarning: The 'check_less_precise' keyword in testing.assert_*_equal is deprecated and will be removed in a future version. You can stop passing 'check_less_precise' to silence this warning.
    pd.testing.assert_frame_equal(

pycytominer/tests/test_cyto_utils/test_output.py::test_compress
  /Users/shsingh/work/repos/software/cytominer/cytomining/pycytominer/pycytominer/tests/test_cyto_utils/test_output.py:57: FutureWarning: The 'check_less_precise' keyword in testing.assert_*_equal is deprecated and will be removed in a future version. You can stop passing 'check_less_precise' to silence this warning.
    pd.testing.assert_frame_equal(

pycytominer/tests/test_cyto_utils/test_output.py::test_compress_tsv
  /Users/shsingh/work/repos/software/cytominer/cytomining/pycytominer/pycytominer/tests/test_cyto_utils/test_output.py:74: FutureWarning: The 'check_less_precise' keyword in testing.assert_*_equal is deprecated and will be removed in a future version. You can stop passing 'check_less_precise' to silence this warning.
    pd.testing.assert_frame_equal(

pycytominer/tests/test_cyto_utils/test_output.py::test_output_none
  /Users/shsingh/work/repos/software/cytominer/cytomining/pycytominer/pycytominer/tests/test_cyto_utils/test_output.py:90: FutureWarning: The 'check_less_precise' keyword in testing.assert_*_equal is deprecated and will be removed in a future version. You can stop passing 'check_less_precise' to silence this warning.
    pd.testing.assert_frame_equal(

pycytominer/tests/test_operations/test_transform.py::test_low_variance_spherize
  /usr/local/lib/python3.9/site-packages/numpy/lib/function_base.py:2829: RuntimeWarning: invalid value encountered in true_divide
    c /= stddev[:, None]

pycytominer/tests/test_operations/test_transform.py::test_low_variance_spherize
  /usr/local/lib/python3.9/site-packages/numpy/lib/function_base.py:2830: RuntimeWarning: invalid value encountered in true_divide
    c /= stddev[None, :]

pycytominer/tests/test_operations/test_transform.py::test_robust_mad
  /Users/shsingh/work/repos/software/cytominer/cytomining/pycytominer/pycytominer/tests/test_operations/test_transform.py:86: DeprecationWarning: `median_absolute_deviation` is deprecated, use `median_abs_deviation` instead!
  
  To preserve the existing default behavior, use
  `scipy.stats.median_abs_deviation(..., scale=1/1.4826)`.
  The value 1.4826 is not numerically precise for scaling
  with a normal distribution. For a numerically precise value, use
  `scipy.stats.median_abs_deviation(..., scale='normal')`.
  
    result = median_absolute_deviation(transform_df).sum()

-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
============================================================ 129 passed, 62 warnings in 63.04s (0:01:03) ============================================================
(pycytominer) pycytominer$ 
@johnarevalo johnarevalo linked a pull request May 4, 2022 that will close this issue
8 tasks
gwaybio added a commit that referenced this issue Aug 1, 2022
Fix #192 warnings for scipy mad func and other deprecated params
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant