Repository: dask/dask-image

Issue:
DOC: How to create testing environments
Add a note to CONTRIBUTING.rst under the headings 'Fix bugs' and 'Implement features' to say how to create the development conda environment (they're hiding in the hidden folders for travis, appveyor and circleCI). As an example, PR ( https://github.com/dask/dask-image/pull/90 ) shows the text added for testing the docs.

Comments:

Patch:
diff --git a/CONTRIBUTING.rst b/CONTRIBUTING.rst
index 05e334d..1c53012 100644
--- a/CONTRIBUTING.rst
+++ b/CONTRIBUTING.rst
@@ -125,9 +125,71 @@ Before you submit a pull request, check that it meets these guidelines:
    and make sure that the tests pass for all supported Python versions
    and platforms.
 
-Tips
-----
+Running tests locally
+---------------------
 
-To run a subset of tests::
+To setup a local testing environment that matches the test environments we use
+for our continuous integration services, you can use the ``.yml``
+conda environment files included in the dask-image repository.
 
-    $ py.test tests/test_dask_image.py
+The test environment ``.yml`` files are included in hidden folders:
+
+- Linux test environment files are found in ``.circleci/environments``
+- MacOS test environment files are found in ``.travis_support/environments``
+- Windows test environment files are found in ``.appveyor_support\environments``
+
+There is a separate environment file for each supported Python version.
+
+.. note::
+    If you do not have Anaconda/miniconda installed, please follow
+    `these instructions <https://docs.conda.io/projects/conda/en/latest/user-guide/install/>`_.
+
+
+We will use conda to
+`create an environment from a file
+<https://docs.conda.io/projects/conda/en/latest/user-guide/tasks/manage-environments.html#creating-an-environment-from-an-environment-yml-file>`_
+(``conda env create -f name-of-environment-file.yml``).
+
+
+For example, to make a Python 3.8 test environment on Linux, MacOS, or Windows,
+we would use the command shown in the table below:
+
+.. list-table:: Creating a test environment for dask-image with Python 3.8
+    :widths: 20 50
+    :header-rows: 1
+
+    * - OS
+      - conda command
+    * - Linux
+      - ``conda env create -f .circleci/environments/tst_py38.yml``
+    * - MacOS
+      - ``conda env create -f .travis_support/environment/tst_py38.yml``
+    * - Windows
+      - ``conda env create -f .appveyor_support\environments\tst_py38.yml``
+
+
+This command will create a new conda test environment for Python 3.8,
+called ``dask_image_py38_env`` with all the dependencies.
+
+Now you can activate your new testing environment with::
+
+.. code-block:: console
+
+    $ conda activate dask_image_py38_env
+
+Finally, install the development version of dask-image::
+
+.. code-block:: console
+
+    $ pip install -e .
+
+For local testing, please run ``pytest`` in the test environment::
+
+.. code-block:: console
+
+    $ pytest
+
+
+To run a subset of tests, for example all the tests for ndfourier::
+
+    $ pytest tests/test_dask_image/test_ndfourier
diff --git a/dask_image/ndmeasure/__init__.py b/dask_image/ndmeasure/__init__.py
index c3c109d..ded8bc8 100644
--- a/dask_image/ndmeasure/__init__.py
+++ b/dask_image/ndmeasure/__init__.py
@@ -30,6 +30,7 @@ __all__ = [
     "minimum_position",
     "standard_deviation",
     "sum",
+    "sum_labels",
     "variance",
 ]
 
@@ -678,9 +679,9 @@ def standard_deviation(image, label_image=None, index=None):
     return std_lbl
 
 
-def sum(image, label_image=None, index=None):
+def sum_labels(image, label_image=None, index=None):
     """
-    Find the sum over an image at specified subregions.
+    Find the sum of all pixels over specified subregions of an image.
 
     Parameters
     ----------
@@ -696,7 +697,7 @@ def sum(image, label_image=None, index=None):
 
     Returns
     -------
-    sum : ndarray
+    sum_lbl : ndarray
         Sum of ``image`` over the ``index`` selected regions from
         ``label_image``.
     """
@@ -712,6 +713,12 @@ def sum(image, label_image=None, index=None):
     return sum_lbl
 
 
+def sum(image, label_image=None, index=None):
+    """DEPRECATED FUNCTION. Use `sum_labels` instead."""
+    warnings.warn("DEPRECATED FUNCTION. Use `sum_labels` instead.", DeprecationWarning)
+    return sum_labels(image, label_image=label_image, index=index)
+
+
 def variance(image, label_image=None, index=None):
     """
     Find the variance over an image at specified subregions.
diff --git a/docs/coverage.rst b/docs/coverage.rst
index bea2893..6e3fe96 100644
--- a/docs/coverage.rst
+++ b/docs/coverage.rst
@@ -212,7 +212,7 @@ This table shows which SciPy ndimage functions are supported by dask-image.
    * - ``standard_deviation``
      - ✓
      - ✓
-   * - ``sum``
+   * - ``sum_labels``
      - ✓
      - ✓
    * - ``uniform_filter``
diff --git a/docs/quickstart.rst b/docs/quickstart.rst
index 83ab611..e047ad6 100644
--- a/docs/quickstart.rst
+++ b/docs/quickstart.rst
@@ -83,7 +83,8 @@ Here are some talks and slides that you can watch to learn dask-image:
 
 - 2020, Genevieve Buckley's talk at PyConAU and SciPy Japan
 
-  - `Watch the talk <https://www.youtube.com/watch?v=MpjgzNeISeI&list=PLs4CJRBY5F1IEFq-wumrBDRCu2EqkpY-R&index=2>`_
+  - `Watch the talk in PyConAU <https://www.youtube.com/watch?v=MpjgzNeISeI&list=PLs4CJRBY5F1IEFq-wumrBDRCu2EqkpY-R&index=2>`_
+  - `Scipy Japanのトークを見る(プレゼンテーション:英語, 字幕:日本語) <https://www.youtube.com/watch?v=dP0m2iZX0PU>`_ Watch the talk at SciPy Japan (presentation in English, captions in Japanese)
   - `See the slides <https://genevievebuckley.github.io/dask-image-talk-2020>`_
 
 - 2019, John Kirkham's SciPy talk


Test patch:
diff --git a/tests/test_dask_image/test_ndmeasure/test_core.py b/tests/test_dask_image/test_ndmeasure/test_core.py
index b3eaa17..3d66cac 100644
--- a/tests/test_dask_image/test_ndmeasure/test_core.py
+++ b/tests/test_dask_image/test_ndmeasure/test_core.py
@@ -2,7 +2,8 @@
 # -*- coding: utf-8 -*-
 
 from __future__ import absolute_import
-
+from distutils.version import LooseVersion
+import scipy
 import itertools as it
 import warnings as wrn
 
@@ -10,6 +11,7 @@ import pytest
 
 import numpy as np
 
+import scipy
 import scipy.ndimage as spnd
 
 import dask.array as da
@@ -28,7 +30,7 @@ import dask_image.ndmeasure
         "minimum",
         "minimum_position",
         "standard_deviation",
-        "sum",
+        "sum_labels",
         "variance",
     ]
 )
@@ -88,7 +90,7 @@ def test_center_of_mass(datatype):
         "minimum",
         "minimum_position",
         "standard_deviation",
-        "sum",
+        "sum_labels",
         "variance",
     ]
 )
@@ -110,7 +112,13 @@ def test_center_of_mass(datatype):
     ]
 )
 def test_measure_props(funcname, shape, chunks, has_lbls, ind):
-    sp_func = getattr(spnd, funcname)
+    # early scipy version uses a different name sum insted of sum_labels.
+    if funcname == 'sum_labels' and scipy.__version__ < LooseVersion('1.5.0'):
+        scipy_funcname = 'sum'
+    else:
+        scipy_funcname = funcname
+
+    sp_func = getattr(spnd, scipy_funcname)
     da_func = getattr(dask_image.ndmeasure, funcname)
 
     a = np.random.random(shape)