<p dir="auto">Crap, missed something here in one of the <code class="notranslate">ndimage</code> refactoring PRs - the build is broken on OS X as of commit <a class="commit-link" data-hovercard-type="commit" data-hovercard-url="https://github.com/scipy/scipy/commit/9b576070d25cae4cc5b00a2a4c523f4dcdc6a77a/hovercard" href="https://github.com/scipy/scipy/commit/9b576070d25cae4cc5b00a2a4c523f4dcdc6a77a"><tt>9b57607</tt></a> (Python 3.5, NumPy 1.13.0, OS X 10.12, Clang 8.1.0):</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="    scipy/ndimage/src/ni_morphology.c:470:13: warning: comparison of integers of different signs: 'npy_uint' (aka 'unsigned int') and 'int' [-Wsign-compare]
                CASE_ERODE_POINT2(NPY_UINT, npy_uint,
                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    scipy/ndimage/src/ni_morphology.c:317:55: note: expanded from macro 'CASE_ERODE_POINT2'
            if (_to != _bf_value &amp;&amp; *(_type *)(_pi + _to) == _true) {             \
                                    ~~~~~~~~~~~~~~~~~~~~~ ^  ~~~~~
    scipy/ndimage/src/ni_morphology.c:476:13: warning: comparison of integers of different signs: 'npy_ulong' (aka 'unsigned long') and 'int' [-Wsign-compare]
                CASE_ERODE_POINT2(NPY_ULONG, npy_ulong,
                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    scipy/ndimage/src/ni_morphology.c:317:55: note: expanded from macro 'CASE_ERODE_POINT2'
            if (_to != _bf_value &amp;&amp; *(_type *)(_pi + _to) == _true) {             \
                                    ~~~~~~~~~~~~~~~~~~~~~ ^  ~~~~~
    scipy/ndimage/src/ni_morphology.c:482:13: warning: comparison of integers of different signs: 'npy_ulonglong' (aka 'unsigned long long') and 'int' [-Wsign-compare]
                CASE_ERODE_POINT2(NPY_ULONGLONG, npy_ulonglong,
                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    scipy/ndimage/src/ni_morphology.c:317:55: note: expanded from macro 'CASE_ERODE_POINT2'
            if (_to != _bf_value &amp;&amp; *(_type *)(_pi + _to) == _true) {             \
                                    ~~~~~~~~~~~~~~~~~~~~~ ^  ~~~~~
    In file included from scipy/ndimage/src/ni_morphology.c:32:
    In file included from scipy/ndimage/src/ni_support.h:42:
    In file included from scipy/ndimage/src/nd_image.h:38:
    In file included from /Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/numpy/core/include/numpy/arrayobject.h:4:
    In file included from /Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/numpy/core/include/numpy/ndarrayobject.h:27:
    /Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/numpy/core/include/numpy/__multiarray_api.h:1453:1: warning: unused function '_import_array' [-Wunused-function]
    _import_array(void)
    ^
    4 warnings generated.
    /usr/bin/clang -bundle -undefined dynamic_lookup -arch i386 -arch x86_64 -g build/temp.macosx-10.6-intel-3.5/scipy/ndimage/src/nd_image.o build/temp.macosx-10.6-intel-3.5/scipy/ndimage/src/ni_filters.o build/temp.macosx-10.6-intel-3.5/scipy/ndimage/src/ni_fourier.o build/temp.macosx-10.6-intel-3.5/scipy/ndimage/src/ni_interpolation.o build/temp.macosx-10.6-intel-3.5/scipy/ndimage/src/ni_measure.o build/temp.macosx-10.6-intel-3.5/scipy/ndimage/src/ni_morphology.o build/temp.macosx-10.6-intel-3.5/scipy/ndimage/src/ni_support.o -Lbuild/temp.macosx-10.6-intel-3.5 -o scipy/ndimage/_nd_image.cpython-35m-darwin.so
    duplicate symbol __scipy_ndimage_ARRAY_API in:
        build/temp.macosx-10.6-intel-3.5/scipy/ndimage/src/nd_image.o
        build/temp.macosx-10.6-intel-3.5/scipy/ndimage/src/ni_filters.o
    duplicate symbol __scipy_ndimage_ARRAY_API in:
        build/temp.macosx-10.6-intel-3.5/scipy/ndimage/src/nd_image.o
        build/temp.macosx-10.6-intel-3.5/scipy/ndimage/src/ni_fourier.o
    duplicate symbol __scipy_ndimage_ARRAY_API in:
        build/temp.macosx-10.6-intel-3.5/scipy/ndimage/src/nd_image.o
        build/temp.macosx-10.6-intel-3.5/scipy/ndimage/src/ni_interpolation.o
    duplicate symbol __scipy_ndimage_ARRAY_API in:
        build/temp.macosx-10.6-intel-3.5/scipy/ndimage/src/nd_image.o
        build/temp.macosx-10.6-intel-3.5/scipy/ndimage/src/ni_measure.o
    duplicate symbol __scipy_ndimage_ARRAY_API in:
        build/temp.macosx-10.6-intel-3.5/scipy/ndimage/src/nd_image.o
        build/temp.macosx-10.6-intel-3.5/scipy/ndimage/src/ni_support.o
    duplicate symbol __scipy_ndimage_ARRAY_API in:
        build/temp.macosx-10.6-intel-3.5/scipy/ndimage/src/nd_image.o
        build/temp.macosx-10.6-intel-3.5/scipy/ndimage/src/ni_morphology.o
    ld: 6 duplicate symbols for architecture i386
    clang: error: linker command failed with exit code 1 (use -v to see invocation)
    duplicate symbol __scipy_ndimage_ARRAY_API in:
        build/temp.macosx-10.6-intel-3.5/scipy/ndimage/src/nd_image.o
        build/temp.macosx-10.6-intel-3.5/scipy/ndimage/src/ni_filters.o
    duplicate symbol __scipy_ndimage_ARRAY_API in:
        build/temp.macosx-10.6-intel-3.5/scipy/ndimage/src/nd_image.o
        build/temp.macosx-10.6-intel-3.5/scipy/ndimage/src/ni_fourier.o
    duplicate symbol __scipy_ndimage_ARRAY_API in:
        build/temp.macosx-10.6-intel-3.5/scipy/ndimage/src/nd_image.o
        build/temp.macosx-10.6-intel-3.5/scipy/ndimage/src/ni_interpolation.o
    duplicate symbol __scipy_ndimage_ARRAY_API in:
        build/temp.macosx-10.6-intel-3.5/scipy/ndimage/src/nd_image.o
        build/temp.macosx-10.6-intel-3.5/scipy/ndimage/src/ni_measure.o
    duplicate symbol __scipy_ndimage_ARRAY_API in:
        build/temp.macosx-10.6-intel-3.5/scipy/ndimage/src/nd_image.o
        build/temp.macosx-10.6-intel-3.5/scipy/ndimage/src/ni_support.o
    duplicate symbol __scipy_ndimage_ARRAY_API in:
        build/temp.macosx-10.6-intel-3.5/scipy/ndimage/src/nd_image.o
        build/temp.macosx-10.6-intel-3.5/scipy/ndimage/src/ni_morphology.o
    ld: 6 duplicate symbols for architecture i386
    clang: error: linker command failed with exit code 1 (use -v to see invocation)
    error: Command &quot;/usr/bin/clang -bundle -undefined dynamic_lookup -arch i386 -arch x86_64 -g build/temp.macosx-10.6-intel-3.5/scipy/ndimage/src/nd_image.o build/temp.macosx-10.6-intel-3.5/scipy/ndimage/src/ni_filters.o build/temp.macosx-10.6-intel-3.5/scipy/ndimage/src/ni_fourier.o build/temp.macosx-10.6-intel-3.5/scipy/ndimage/src/ni_interpolation.o build/temp.macosx-10.6-intel-3.5/scipy/ndimage/src/ni_measure.o build/temp.macosx-10.6-intel-3.5/scipy/ndimage/src/ni_morphology.o build/temp.macosx-10.6-intel-3.5/scipy/ndimage/src/ni_support.o -Lbuild/temp.macosx-10.6-intel-3.5 -o scipy/ndimage/_nd_image.cpython-35m-darwin.so&quot; failed with exit status 1"><pre class="notranslate"><code class="notranslate">    scipy/ndimage/src/ni_morphology.c:470:13: warning: comparison of integers of different signs: 'npy_uint' (aka 'unsigned int') and 'int' [-Wsign-compare]
                CASE_ERODE_POINT2(NPY_UINT, npy_uint,
                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    scipy/ndimage/src/ni_morphology.c:317:55: note: expanded from macro 'CASE_ERODE_POINT2'
            if (_to != _bf_value &amp;&amp; *(_type *)(_pi + _to) == _true) {             \
                                    ~~~~~~~~~~~~~~~~~~~~~ ^  ~~~~~
    scipy/ndimage/src/ni_morphology.c:476:13: warning: comparison of integers of different signs: 'npy_ulong' (aka 'unsigned long') and 'int' [-Wsign-compare]
                CASE_ERODE_POINT2(NPY_ULONG, npy_ulong,
                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    scipy/ndimage/src/ni_morphology.c:317:55: note: expanded from macro 'CASE_ERODE_POINT2'
            if (_to != _bf_value &amp;&amp; *(_type *)(_pi + _to) == _true) {             \
                                    ~~~~~~~~~~~~~~~~~~~~~ ^  ~~~~~
    scipy/ndimage/src/ni_morphology.c:482:13: warning: comparison of integers of different signs: 'npy_ulonglong' (aka 'unsigned long long') and 'int' [-Wsign-compare]
                CASE_ERODE_POINT2(NPY_ULONGLONG, npy_ulonglong,
                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    scipy/ndimage/src/ni_morphology.c:317:55: note: expanded from macro 'CASE_ERODE_POINT2'
            if (_to != _bf_value &amp;&amp; *(_type *)(_pi + _to) == _true) {             \
                                    ~~~~~~~~~~~~~~~~~~~~~ ^  ~~~~~
    In file included from scipy/ndimage/src/ni_morphology.c:32:
    In file included from scipy/ndimage/src/ni_support.h:42:
    In file included from scipy/ndimage/src/nd_image.h:38:
    In file included from /Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/numpy/core/include/numpy/arrayobject.h:4:
    In file included from /Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/numpy/core/include/numpy/ndarrayobject.h:27:
    /Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/numpy/core/include/numpy/__multiarray_api.h:1453:1: warning: unused function '_import_array' [-Wunused-function]
    _import_array(void)
    ^
    4 warnings generated.
    /usr/bin/clang -bundle -undefined dynamic_lookup -arch i386 -arch x86_64 -g build/temp.macosx-10.6-intel-3.5/scipy/ndimage/src/nd_image.o build/temp.macosx-10.6-intel-3.5/scipy/ndimage/src/ni_filters.o build/temp.macosx-10.6-intel-3.5/scipy/ndimage/src/ni_fourier.o build/temp.macosx-10.6-intel-3.5/scipy/ndimage/src/ni_interpolation.o build/temp.macosx-10.6-intel-3.5/scipy/ndimage/src/ni_measure.o build/temp.macosx-10.6-intel-3.5/scipy/ndimage/src/ni_morphology.o build/temp.macosx-10.6-intel-3.5/scipy/ndimage/src/ni_support.o -Lbuild/temp.macosx-10.6-intel-3.5 -o scipy/ndimage/_nd_image.cpython-35m-darwin.so
    duplicate symbol __scipy_ndimage_ARRAY_API in:
        build/temp.macosx-10.6-intel-3.5/scipy/ndimage/src/nd_image.o
        build/temp.macosx-10.6-intel-3.5/scipy/ndimage/src/ni_filters.o
    duplicate symbol __scipy_ndimage_ARRAY_API in:
        build/temp.macosx-10.6-intel-3.5/scipy/ndimage/src/nd_image.o
        build/temp.macosx-10.6-intel-3.5/scipy/ndimage/src/ni_fourier.o
    duplicate symbol __scipy_ndimage_ARRAY_API in:
        build/temp.macosx-10.6-intel-3.5/scipy/ndimage/src/nd_image.o
        build/temp.macosx-10.6-intel-3.5/scipy/ndimage/src/ni_interpolation.o
    duplicate symbol __scipy_ndimage_ARRAY_API in:
        build/temp.macosx-10.6-intel-3.5/scipy/ndimage/src/nd_image.o
        build/temp.macosx-10.6-intel-3.5/scipy/ndimage/src/ni_measure.o
    duplicate symbol __scipy_ndimage_ARRAY_API in:
        build/temp.macosx-10.6-intel-3.5/scipy/ndimage/src/nd_image.o
        build/temp.macosx-10.6-intel-3.5/scipy/ndimage/src/ni_support.o
    duplicate symbol __scipy_ndimage_ARRAY_API in:
        build/temp.macosx-10.6-intel-3.5/scipy/ndimage/src/nd_image.o
        build/temp.macosx-10.6-intel-3.5/scipy/ndimage/src/ni_morphology.o
    ld: 6 duplicate symbols for architecture i386
    clang: error: linker command failed with exit code 1 (use -v to see invocation)
    duplicate symbol __scipy_ndimage_ARRAY_API in:
        build/temp.macosx-10.6-intel-3.5/scipy/ndimage/src/nd_image.o
        build/temp.macosx-10.6-intel-3.5/scipy/ndimage/src/ni_filters.o
    duplicate symbol __scipy_ndimage_ARRAY_API in:
        build/temp.macosx-10.6-intel-3.5/scipy/ndimage/src/nd_image.o
        build/temp.macosx-10.6-intel-3.5/scipy/ndimage/src/ni_fourier.o
    duplicate symbol __scipy_ndimage_ARRAY_API in:
        build/temp.macosx-10.6-intel-3.5/scipy/ndimage/src/nd_image.o
        build/temp.macosx-10.6-intel-3.5/scipy/ndimage/src/ni_interpolation.o
    duplicate symbol __scipy_ndimage_ARRAY_API in:
        build/temp.macosx-10.6-intel-3.5/scipy/ndimage/src/nd_image.o
        build/temp.macosx-10.6-intel-3.5/scipy/ndimage/src/ni_measure.o
    duplicate symbol __scipy_ndimage_ARRAY_API in:
        build/temp.macosx-10.6-intel-3.5/scipy/ndimage/src/nd_image.o
        build/temp.macosx-10.6-intel-3.5/scipy/ndimage/src/ni_support.o
    duplicate symbol __scipy_ndimage_ARRAY_API in:
        build/temp.macosx-10.6-intel-3.5/scipy/ndimage/src/nd_image.o
        build/temp.macosx-10.6-intel-3.5/scipy/ndimage/src/ni_morphology.o
    ld: 6 duplicate symbols for architecture i386
    clang: error: linker command failed with exit code 1 (use -v to see invocation)
    error: Command "/usr/bin/clang -bundle -undefined dynamic_lookup -arch i386 -arch x86_64 -g build/temp.macosx-10.6-intel-3.5/scipy/ndimage/src/nd_image.o build/temp.macosx-10.6-intel-3.5/scipy/ndimage/src/ni_filters.o build/temp.macosx-10.6-intel-3.5/scipy/ndimage/src/ni_fourier.o build/temp.macosx-10.6-intel-3.5/scipy/ndimage/src/ni_interpolation.o build/temp.macosx-10.6-intel-3.5/scipy/ndimage/src/ni_measure.o build/temp.macosx-10.6-intel-3.5/scipy/ndimage/src/ni_morphology.o build/temp.macosx-10.6-intel-3.5/scipy/ndimage/src/ni_support.o -Lbuild/temp.macosx-10.6-intel-3.5 -o scipy/ndimage/_nd_image.cpython-35m-darwin.so" failed with exit status 1
</code></pre></div>
<p dir="auto">Will investigate tomorrow. Works fine on Linux, not clear what the difference is.</p>
<p dir="auto">Also some warnings about unsigned int comparisons (more of the same that I didn't copy in).</p>
<p dir="auto">Scipy has <code class="notranslate">stats.median_abs_deviation</code> implemented, which means this supports non-parametric/'median-stack' stats. There is <code class="notranslate">stats.zscore</code>, which is mean-std stack. This feature would be very helpful when working with skewed data or data with outliers.</p>
<p dir="auto">I'm just wondering if we could have modified z-score with median and median abs deviation implemented?</p>
<p dir="auto">I am happy to work on this if maintainer would approve. Suggestion on how to implement is appreciated.</p>