Skip to content

Suggestion: resolve test warnings #32

@oesteban

Description

@oesteban

Congratulations on the test deployment, I successfully run python -m pip install -r test_requirements.txt and subsequently:

(nipraxis-nme) oesteban@hos65851:~/workspace/nipraxis/diagnostics-NME$ pytest .
======================================================================================================================================================================================================= test session starts ========================================================================================================================================================================================================
platform linux -- Python 3.9.13, pytest-7.2.0, pluggy-1.0.0
rootdir: /data/home/oesteban/workspace/nipraxis/diagnostics-NME, configfile: pytest.ini
collected 3 items                                                                                                                                                                                                                                                                                                                                                                                                                  

findoutlie/tests/test_detectors.py .                                                                                                                                                                                                                                                                                                                                                                                         [ 33%]
findoutlie/tests/test_dvars.py .                                                                                                                                                                                                                                                                                                                                                                                             [ 66%]
findoutlie/tests/test_spm_funcs.py .                                                                                                                                                                                                                                                                                                                                                                                         [100%]

========================================================================================================================================================================================================= warnings summary =========================================================================================================================================================================================================
findoutlie/tests/test_detectors.py::test_iqr_detector
findoutlie/tests/test_detectors.py::test_iqr_detector
  /data/home/oesteban/workspace/nipraxis/diagnostics-NME/findoutlie/detectors.py:121: DeprecationWarning: the `interpolation=` argument to percentile was renamed to `method=`, which has additional options.
  Users of the modes 'nearest', 'lower', 'higher', or 'midpoint' are encouraged to review the method they used. (Deprecated NumPy 1.22)
    Q1 = np.percentile(measures, 25, interpolation="midpoint")

findoutlie/tests/test_detectors.py::test_iqr_detector
findoutlie/tests/test_detectors.py::test_iqr_detector
  /data/home/oesteban/workspace/nipraxis/diagnostics-NME/findoutlie/detectors.py:122: DeprecationWarning: the `interpolation=` argument to percentile was renamed to `method=`, which has additional options.
  Users of the modes 'nearest', 'lower', 'higher', or 'midpoint' are encouraged to review the method they used. (Deprecated NumPy 1.22)
    Q2 = np.percentile(measures, 50, interpolation="midpoint")

findoutlie/tests/test_detectors.py::test_iqr_detector
findoutlie/tests/test_detectors.py::test_iqr_detector
  /data/home/oesteban/workspace/nipraxis/diagnostics-NME/findoutlie/detectors.py:123: DeprecationWarning: the `interpolation=` argument to percentile was renamed to `method=`, which has additional options.
  Users of the modes 'nearest', 'lower', 'higher', or 'midpoint' are encouraged to review the method they used. (Deprecated NumPy 1.22)
    Q3 = np.percentile(measures, 75, interpolation="midpoint")

-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
================================================================================================================================================================================================== 3 passed, 6 warnings in 4.40s ===================================================================================================================================================================================================

As you can see, there are three deprecations (all in the same function). Ensuring you address deprecation in time will save maintenance time in the long term.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions