We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
Always get warnings.warn("All-NaN slice encountered", RuntimeWarning) for Overlay
I always get this error when creating an `hv.Overlay`:

``` python
x = np.linspace(0, 1)
hv.Path((x,x)) + hv.Path((x,x))
```

```
/home/bnijholt/anaconda3/lib/python3.5/site-packages/numpy/lib/nanfunctions.py:326: RuntimeWarning: All-NaN slice encountered
  warnings.warn("All-NaN slice encountered", RuntimeWarning)
```

if run with:

```
import warnings
warnings.simplefilter('error')
```

it generates this traceback:

```
RuntimeWarningTraceback (most recent call last)
/home/bnijholt/anaconda3/lib/python3.5/site-packages/IPython/core/formatters.py in __call__(self, obj)
    337                 pass
    338             else:
--> 339                 return printer(obj)
    340             # Finally look for special method names
    341             method = _safe_get_formatter_method(obj, self.print_method)

/home/bnijholt/anaconda3/lib/python3.5/site-packages/holoviews/ipython/display_hooks.py in pprint_display(obj)
    214     if not ip.display_formatter.formatters['text/plain'].pprint:
    215         return None
--> 216     return display(obj, raw=True)
    217 
    218 

/home/bnijholt/anaconda3/lib/python3.5/site-packages/holoviews/ipython/display_hooks.py in display(obj, raw, **kwargs)
    198         html = element_display(obj)
    199     elif isinstance(obj, (Layout, NdLayout, AdjointLayout)):
--> 200         html = layout_display(obj)
    201     elif isinstance(obj, (HoloMap, DynamicMap)):
    202         html = map_display(obj)

/home/bnijholt/anaconda3/lib/python3.5/site-packages/holoviews/ipython/display_hooks.py in wrapped(element)
    101             html = fn(element,
    102                       max_frames=OutputMagic.options['max_frames'],
--> 103                       max_branches = OutputMagic.options['max_branches'])
    104 
    105             # Only want to add to the archive for one display hook...

/home/bnijholt/anaconda3/lib/python3.5/site-packages/holoviews/ipython/display_hooks.py in layout_display(layout, max_frames, max_branches)
    172                 return '<tt>'+ sanitize_HTML(layout) + '</tt>'
    173 
--> 174     return render(layout)
    175 
    176 

/home/bnijholt/anaconda3/lib/python3.5/site-packages/holoviews/ipython/display_hooks.py in render(obj, **kwargs)
     49 
     50     backend = Store.current_backend
---> 51     return Store.renderers[backend].html(obj, **kwargs)
     52 
     53 

/home/bnijholt/anaconda3/lib/python3.5/site-packages/holoviews/plotting/renderer.py in html(self, obj, fmt, css)
    247         Renders plot or data structure and wraps the output in HTML.
    248         """
--> 249         plot, fmt =  self._validate(obj, fmt)
    250         figdata, _ = self(plot, fmt)
    251         if css is None: css = self.css

/home/bnijholt/anaconda3/lib/python3.5/site-packages/holoviews/plotting/renderer.py in _validate(self, obj, fmt)
    187         if isinstance(obj, tuple(self.widgets.values())):
    188             return obj, 'html'
--> 189         plot = self.get_plot(obj)
    190 
    191         fig_formats = self.mode_formats['fig'][self.mode]

/home/bnijholt/anaconda3/lib/python3.5/site-packages/holoviews/plotting/renderer.py in get_plot(self_or_cls, obj)
    173             obj = Layout.from_values(obj) if isinstance(obj, AdjointLayout) else obj
    174             plot_opts = self_or_cls.plot_options(obj, self_or_cls.size)
--> 175             plot = self_or_cls.plotting_class(obj)(obj, **plot_opts)
    176             plot.update(0)
    177         else:

/home/bnijholt/anaconda3/lib/python3.5/site-packages/holoviews/plotting/mpl/plot.py in __init__(self, layout, **params)
    715     def __init__(self, layout, **params):
    716         super(LayoutPlot, self).__init__(layout=layout, **params)
--> 717         self.subplots, self.subaxes, self.layout = self._compute_gridspec(layout)
    718 
    719 

/home/bnijholt/anaconda3/lib/python3.5/site-packages/holoviews/plotting/mpl/plot.py in _compute_gridspec(self, layout)
    804                            for ratios in col[1] for r in ratios])/4
    805 
--> 806         wr_unnormalized = compute_ratios(col_widthratios, False)
    807         hr_list = compute_ratios(row_heightratios)
    808         wr_list = compute_ratios(col_widthratios)

/home/bnijholt/anaconda3/lib/python3.5/site-packages/holoviews/plotting/mpl/util.py in compute_ratios(ratios, normalized)
     48         unpacked = normalize_ratios(unpacked)
     49     sorted_ratios = sorted(unpacked.items())
---> 50     return np.nanmax(np.vstack([v for _, v in sorted_ratios]), axis=0)

/home/bnijholt/anaconda3/lib/python3.5/site-packages/numpy/lib/nanfunctions.py in nanmax(a, axis, out, keepdims)
    324         res = np.fmax.reduce(a, axis=axis, out=out, keepdims=keepdims)
    325         if np.isnan(res).any():
--> 326             warnings.warn("All-NaN slice encountered", RuntimeWarning)
    327     else:
    328         # Slow, but safe for subclasses of ndarray

RuntimeWarning: All-NaN slice encountered
```


--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `holoviews/plotting/mpl/util.py`
Content:
```
1 import re
2 import inspect
3 
4 import numpy as np
5 from matplotlib import ticker
6 
7 from ...core.util import basestring
8 
9 
10 def wrap_formatter(formatter):
11     """
12     Wraps formatting function or string in
13     appropriate matplotlib formatter type.
14     """
15     if isinstance(formatter, ticker.Formatter):
16         return formatter
17     elif callable(formatter):
18         args = [arg for arg in inspect.getargspec(formatter).args
19                 if arg != 'self']
20         wrapped = formatter
21         if len(args) == 1:
22             def wrapped(val, pos=None):
23                 return formatter(val)
24         return ticker.FuncFormatter(wrapped)
25     elif isinstance(formatter, basestring):
26         if re.findall(r"\{(\w+)\}", formatter):
27             return ticker.StrMethodFormatter(formatter)
28         else:
29             return ticker.FormatStrFormatter(formatter)
30 
31 def unpack_adjoints(ratios):
32     new_ratios = {}
33     offset = 0
34     for k, (num, ratios) in sorted(ratios.items()):
35         unpacked = [[] for _ in range(num)]
36         for r in ratios:
37             nr = len(r)
38             for i in range(num):
39                 unpacked[i].append(r[i] if i < nr else np.nan)
40         for i, r in enumerate(unpacked):
41             new_ratios[k+i+offset] = r
42         offset += num-1
43     return new_ratios
44 
45 def normalize_ratios(ratios):
46     normalized = {}
47     for i, v in enumerate(zip(*ratios.values())):
48         arr = np.array(v)
49         normalized[i] = arr/float(np.nanmax(arr))
50     return normalized
51 
52 def compute_ratios(ratios, normalized=True):
53     unpacked = unpack_adjoints(ratios)
54     if normalized:
55         unpacked = normalize_ratios(unpacked)
56     sorted_ratios = sorted(unpacked.items())
57     return np.nanmax(np.vstack([v for _, v in sorted_ratios]), axis=0)
58
```
--- END FILES ---

Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.

Here is an example:

```diff
diff --git a/examples/server_async.py b/examples/server_async.py
--- a/examples/server_async.py
+++ b/examples/server_async.py
@@ -313,4 +313,4 @@
 
 
 if __name__ == "__main__":
-    asyncio.run(run_async_server("."), debug=True)
+    asyncio.run(run_async_server(), debug=True)
diff --git a/examples/server_sync.py b/examples/server_sync.py
--- a/examples/server_sync.py
+++ b/examples/server_sync.py
@@ -313,5 +313,5 @@
 
 
 if __name__ == "__main__":
-    server = run_sync_server(".")
+    server = run_sync_server()
     server.shutdown()

```

diff --git a/holoviews/plotting/mpl/util.py b/holoviews/plotting/mpl/util.py
--- a/holoviews/plotting/mpl/util.py
+++ b/holoviews/plotting/mpl/util.py
@@ -1,5 +1,6 @@
 import re
 import inspect
+import warnings
 
 import numpy as np
 from matplotlib import ticker
@@ -54,4 +55,6 @@
     if normalized:
         unpacked = normalize_ratios(unpacked)
     sorted_ratios = sorted(unpacked.items())
-    return np.nanmax(np.vstack([v for _, v in sorted_ratios]), axis=0)
+    with warnings.catch_warnings():
+        warnings.filterwarnings('ignore', r'All-NaN (slice|axis) encountered')
+        return np.nanmax(np.vstack([v for _, v in sorted_ratios]), axis=0)

{"golden_diff": "diff --git a/holoviews/plotting/mpl/util.py b/holoviews/plotting/mpl/util.py\n--- a/holoviews/plotting/mpl/util.py\n+++ b/holoviews/plotting/mpl/util.py\n@@ -1,5 +1,6 @@\n import re\n import inspect\n+import warnings\n \n import numpy as np\n from matplotlib import ticker\n@@ -54,4 +55,6 @@\n     if normalized:\n         unpacked = normalize_ratios(unpacked)\n     sorted_ratios = sorted(unpacked.items())\n-    return np.nanmax(np.vstack([v for _, v in sorted_ratios]), axis=0)\n+    with warnings.catch_warnings():\n+        warnings.filterwarnings('ignore', r'All-NaN (slice|axis) encountered')\n+        return np.nanmax(np.vstack([v for _, v in sorted_ratios]), axis=0)\n", "issue": "Always get warnings.warn(\"All-NaN slice encountered\", RuntimeWarning) for Overlay\nI always get this error when creating an `hv.Overlay`:\n\n``` python\nx = np.linspace(0, 1)\nhv.Path((x,x)) + hv.Path((x,x))\n```\n\n```\n/home/bnijholt/anaconda3/lib/python3.5/site-packages/numpy/lib/nanfunctions.py:326: RuntimeWarning: All-NaN slice encountered\n  warnings.warn(\"All-NaN slice encountered\", RuntimeWarning)\n```\n\nif run with:\n\n```\nimport warnings\nwarnings.simplefilter('error')\n```\n\nit generates this traceback:\n\n```\nRuntimeWarningTraceback (most recent call last)\n/home/bnijholt/anaconda3/lib/python3.5/site-packages/IPython/core/formatters.py in __call__(self, obj)\n    337                 pass\n    338             else:\n--> 339                 return printer(obj)\n    340             # Finally look for special method names\n    341             method = _safe_get_formatter_method(obj, self.print_method)\n\n/home/bnijholt/anaconda3/lib/python3.5/site-packages/holoviews/ipython/display_hooks.py in pprint_display(obj)\n    214     if not ip.display_formatter.formatters['text/plain'].pprint:\n    215         return None\n--> 216     return display(obj, raw=True)\n    217 \n    218 \n\n/home/bnijholt/anaconda3/lib/python3.5/site-packages/holoviews/ipython/display_hooks.py in display(obj, raw, **kwargs)\n    198         html = element_display(obj)\n    199     elif isinstance(obj, (Layout, NdLayout, AdjointLayout)):\n--> 200         html = layout_display(obj)\n    201     elif isinstance(obj, (HoloMap, DynamicMap)):\n    202         html = map_display(obj)\n\n/home/bnijholt/anaconda3/lib/python3.5/site-packages/holoviews/ipython/display_hooks.py in wrapped(element)\n    101             html = fn(element,\n    102                       max_frames=OutputMagic.options['max_frames'],\n--> 103                       max_branches = OutputMagic.options['max_branches'])\n    104 \n    105             # Only want to add to the archive for one display hook...\n\n/home/bnijholt/anaconda3/lib/python3.5/site-packages/holoviews/ipython/display_hooks.py in layout_display(layout, max_frames, max_branches)\n    172                 return '<tt>'+ sanitize_HTML(layout) + '</tt>'\n    173 \n--> 174     return render(layout)\n    175 \n    176 \n\n/home/bnijholt/anaconda3/lib/python3.5/site-packages/holoviews/ipython/display_hooks.py in render(obj, **kwargs)\n     49 \n     50     backend = Store.current_backend\n---> 51     return Store.renderers[backend].html(obj, **kwargs)\n     52 \n     53 \n\n/home/bnijholt/anaconda3/lib/python3.5/site-packages/holoviews/plotting/renderer.py in html(self, obj, fmt, css)\n    247         Renders plot or data structure and wraps the output in HTML.\n    248         \"\"\"\n--> 249         plot, fmt =  self._validate(obj, fmt)\n    250         figdata, _ = self(plot, fmt)\n    251         if css is None: css = self.css\n\n/home/bnijholt/anaconda3/lib/python3.5/site-packages/holoviews/plotting/renderer.py in _validate(self, obj, fmt)\n    187         if isinstance(obj, tuple(self.widgets.values())):\n    188             return obj, 'html'\n--> 189         plot = self.get_plot(obj)\n    190 \n    191         fig_formats = self.mode_formats['fig'][self.mode]\n\n/home/bnijholt/anaconda3/lib/python3.5/site-packages/holoviews/plotting/renderer.py in get_plot(self_or_cls, obj)\n    173             obj = Layout.from_values(obj) if isinstance(obj, AdjointLayout) else obj\n    174             plot_opts = self_or_cls.plot_options(obj, self_or_cls.size)\n--> 175             plot = self_or_cls.plotting_class(obj)(obj, **plot_opts)\n    176             plot.update(0)\n    177         else:\n\n/home/bnijholt/anaconda3/lib/python3.5/site-packages/holoviews/plotting/mpl/plot.py in __init__(self, layout, **params)\n    715     def __init__(self, layout, **params):\n    716         super(LayoutPlot, self).__init__(layout=layout, **params)\n--> 717         self.subplots, self.subaxes, self.layout = self._compute_gridspec(layout)\n    718 \n    719 \n\n/home/bnijholt/anaconda3/lib/python3.5/site-packages/holoviews/plotting/mpl/plot.py in _compute_gridspec(self, layout)\n    804                            for ratios in col[1] for r in ratios])/4\n    805 \n--> 806         wr_unnormalized = compute_ratios(col_widthratios, False)\n    807         hr_list = compute_ratios(row_heightratios)\n    808         wr_list = compute_ratios(col_widthratios)\n\n/home/bnijholt/anaconda3/lib/python3.5/site-packages/holoviews/plotting/mpl/util.py in compute_ratios(ratios, normalized)\n     48         unpacked = normalize_ratios(unpacked)\n     49     sorted_ratios = sorted(unpacked.items())\n---> 50     return np.nanmax(np.vstack([v for _, v in sorted_ratios]), axis=0)\n\n/home/bnijholt/anaconda3/lib/python3.5/site-packages/numpy/lib/nanfunctions.py in nanmax(a, axis, out, keepdims)\n    324         res = np.fmax.reduce(a, axis=axis, out=out, keepdims=keepdims)\n    325         if np.isnan(res).any():\n--> 326             warnings.warn(\"All-NaN slice encountered\", RuntimeWarning)\n    327     else:\n    328         # Slow, but safe for subclasses of ndarray\n\nRuntimeWarning: All-NaN slice encountered\n```\n\n", "before_files": [{"content": "import re\nimport inspect\n\nimport numpy as np\nfrom matplotlib import ticker\n\nfrom ...core.util import basestring\n\n\ndef wrap_formatter(formatter):\n    \"\"\"\n    Wraps formatting function or string in\n    appropriate matplotlib formatter type.\n    \"\"\"\n    if isinstance(formatter, ticker.Formatter):\n        return formatter\n    elif callable(formatter):\n        args = [arg for arg in inspect.getargspec(formatter).args\n                if arg != 'self']\n        wrapped = formatter\n        if len(args) == 1:\n            def wrapped(val, pos=None):\n                return formatter(val)\n        return ticker.FuncFormatter(wrapped)\n    elif isinstance(formatter, basestring):\n        if re.findall(r\"\\{(\\w+)\\}\", formatter):\n            return ticker.StrMethodFormatter(formatter)\n        else:\n            return ticker.FormatStrFormatter(formatter)\n\ndef unpack_adjoints(ratios):\n    new_ratios = {}\n    offset = 0\n    for k, (num, ratios) in sorted(ratios.items()):\n        unpacked = [[] for _ in range(num)]\n        for r in ratios:\n            nr = len(r)\n            for i in range(num):\n                unpacked[i].append(r[i] if i < nr else np.nan)\n        for i, r in enumerate(unpacked):\n            new_ratios[k+i+offset] = r\n        offset += num-1\n    return new_ratios\n\ndef normalize_ratios(ratios):\n    normalized = {}\n    for i, v in enumerate(zip(*ratios.values())):\n        arr = np.array(v)\n        normalized[i] = arr/float(np.nanmax(arr))\n    return normalized\n\ndef compute_ratios(ratios, normalized=True):\n    unpacked = unpack_adjoints(ratios)\n    if normalized:\n        unpacked = normalize_ratios(unpacked)\n    sorted_ratios = sorted(unpacked.items())\n    return np.nanmax(np.vstack([v for _, v in sorted_ratios]), axis=0)\n", "path": "holoviews/plotting/mpl/util.py"}], "after_files": [{"content": "import re\nimport inspect\nimport warnings\n\nimport numpy as np\nfrom matplotlib import ticker\n\nfrom ...core.util import basestring\n\n\ndef wrap_formatter(formatter):\n    \"\"\"\n    Wraps formatting function or string in\n    appropriate matplotlib formatter type.\n    \"\"\"\n    if isinstance(formatter, ticker.Formatter):\n        return formatter\n    elif callable(formatter):\n        args = [arg for arg in inspect.getargspec(formatter).args\n                if arg != 'self']\n        wrapped = formatter\n        if len(args) == 1:\n            def wrapped(val, pos=None):\n                return formatter(val)\n        return ticker.FuncFormatter(wrapped)\n    elif isinstance(formatter, basestring):\n        if re.findall(r\"\\{(\\w+)\\}\", formatter):\n            return ticker.StrMethodFormatter(formatter)\n        else:\n            return ticker.FormatStrFormatter(formatter)\n\ndef unpack_adjoints(ratios):\n    new_ratios = {}\n    offset = 0\n    for k, (num, ratios) in sorted(ratios.items()):\n        unpacked = [[] for _ in range(num)]\n        for r in ratios:\n            nr = len(r)\n            for i in range(num):\n                unpacked[i].append(r[i] if i < nr else np.nan)\n        for i, r in enumerate(unpacked):\n            new_ratios[k+i+offset] = r\n        offset += num-1\n    return new_ratios\n\ndef normalize_ratios(ratios):\n    normalized = {}\n    for i, v in enumerate(zip(*ratios.values())):\n        arr = np.array(v)\n        normalized[i] = arr/float(np.nanmax(arr))\n    return normalized\n\ndef compute_ratios(ratios, normalized=True):\n    unpacked = unpack_adjoints(ratios)\n    if normalized:\n        unpacked = normalize_ratios(unpacked)\n    sorted_ratios = sorted(unpacked.items())\n    with warnings.catch_warnings():\n        warnings.filterwarnings('ignore', r'All-NaN (slice|axis) encountered')\n        return np.nanmax(np.vstack([v for _, v in sorted_ratios]), axis=0)\n", "path": "holoviews/plotting/mpl/util.py"}]}