We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
pm.compare seems not compatible with az.plot_compare
If I try to run two following commands
```python
df_comp_WAIC = pm.compare({models[0]: traces[0], models[1]: traces[1]})
az.plot_compare(df_comp_WAIC);
```
I get the error:
```python
---------------------------------------------------------------------------
ValueError                                Traceback (most recent call last)
<ipython-input-208-a89027c76a69> in <module>
      3 df_comp_WAIC = pm.compare({models[0]: traces[0], models[1]: traces[1]})
----> 4 az.plot_compare(df_comp_WAIC);

~/anaconda3/lib/python3.6/site-packages/arviz/plots/compareplot.py in plot_compare(comp_df, insample_dev, plot_standard_error, plot_ic_diff, figsize, textsize, plot_kwargs, ax)
     99         raise ValueError(
    100             "comp_df must contain one of the following"
--> 101             " information criterion: {}".format(_information_criterion)
    102         )
    103 

ValueError: comp_df must contain one of the following information criterion: ['waic', 'loo']
```

Both pymc3 and arviz are the latest from github (using pip command)

--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `arviz/plots/compareplot.py`
Content:
```
1 """Summary plot for model comparison."""
2 import numpy as np
3 import matplotlib.pyplot as plt
4 from .plot_utils import _scale_fig_size
5 
6 
7 def plot_compare(
8     comp_df,
9     insample_dev=True,
10     plot_standard_error=True,
11     plot_ic_diff=True,
12     order_by_rank=True,
13     figsize=None,
14     textsize=None,
15     plot_kwargs=None,
16     ax=None,
17 ):
18     """
19     Summary plot for model comparison.
20 
21     This plot is in the style of the one used in the book Statistical Rethinking (Chapter 6)
22     by Richard McElreath.
23 
24     Notes
25     -----
26     Defaults to comparing Widely Accepted Information Criterion (WAIC) if present in comp_df column,
27     otherwise compares Leave-one-out (loo)
28 
29 
30     Parameters
31     ----------
32     comp_df : pd.DataFrame
33         Result of the `az.compare()` method
34     insample_dev : bool, optional
35         Plot in-sample deviance, that is the value of the information criteria without the
36         penalization given by the effective number of parameters (pIC). Defaults to True
37     plot_standard_error : bool, optional
38         Plot the standard error of the information criteria estimate. Defaults to True
39     plot_ic_diff : bool, optional
40         Plot standard error of the difference in information criteria between each model
41          and the top-ranked model. Defaults to True
42     order_by_rank : bool
43         If True (default) ensure the best model is used as reference.
44     figsize : tuple, optional
45         If None, size is (6, num of models) inches
46     textsize: float
47         Text size scaling factor for labels, titles and lines. If None it will be autoscaled based
48         on figsize.
49     plot_kwargs : dict, optional
50         Optional arguments for plot elements. Currently accepts 'color_ic',
51         'marker_ic', 'color_insample_dev', 'marker_insample_dev', 'color_dse',
52         'marker_dse', 'ls_min_ic' 'color_ls_min_ic',  'fontsize'
53     ax : axes, optional
54         Matplotlib axes
55 
56     Returns
57     -------
58     ax : matplotlib axes
59 
60 
61     Examples
62     --------
63     Show default compare plot
64 
65     .. plot::
66         :context: close-figs
67 
68         >>> import arviz as az
69         >>> model_compare = az.compare({'Centered 8 schools': az.load_arviz_data('centered_eight'),
70         >>>                  'Non-centered 8 schools': az.load_arviz_data('non_centered_eight')})
71         >>> az.plot_compare(model_compare)
72 
73     Plot standard error and information criteria difference only
74 
75     .. plot::
76         :context: close-figs
77 
78         >>> az.plot_compare(model_compare, insample_dev=False)
79 
80     """
81     if figsize is None:
82         figsize = (6, len(comp_df))
83 
84     figsize, ax_labelsize, _, xt_labelsize, linewidth, _ = _scale_fig_size(figsize, textsize, 1, 1)
85 
86     if ax is None:
87         _, ax = plt.subplots(figsize=figsize, constrained_layout=True)
88 
89     if plot_kwargs is None:
90         plot_kwargs = {}
91 
92     yticks_pos, step = np.linspace(0, -1, (comp_df.shape[0] * 2) - 1, retstep=True)
93     yticks_pos[1::2] = yticks_pos[1::2] + step / 2
94 
95     yticks_labels = [""] * len(yticks_pos)
96 
97     _information_criterion = ["waic", "loo"]
98     for information_criterion in _information_criterion:
99         if information_criterion in comp_df.columns:
100             break
101     else:
102         raise ValueError(
103             "comp_df must contain one of the following"
104             " information criterion: {}".format(_information_criterion)
105         )
106 
107     if order_by_rank:
108         comp_df.sort_values(by="rank", inplace=True)
109 
110     if plot_ic_diff:
111         yticks_labels[0] = comp_df.index[0]
112         yticks_labels[2::2] = comp_df.index[1:]
113         ax.set_yticks(yticks_pos)
114         ax.errorbar(
115             x=comp_df[information_criterion].iloc[1:],
116             y=yticks_pos[1::2],
117             xerr=comp_df.dse[1:],
118             color=plot_kwargs.get("color_dse", "grey"),
119             fmt=plot_kwargs.get("marker_dse", "^"),
120             mew=linewidth,
121             elinewidth=linewidth,
122         )
123 
124     else:
125         yticks_labels = comp_df.index
126         ax.set_yticks(yticks_pos[::2])
127 
128     if plot_standard_error:
129         ax.errorbar(
130             x=comp_df[information_criterion],
131             y=yticks_pos[::2],
132             xerr=comp_df.se,
133             color=plot_kwargs.get("color_ic", "k"),
134             fmt=plot_kwargs.get("marker_ic", "o"),
135             mfc="None",
136             mew=linewidth,
137             lw=linewidth,
138         )
139     else:
140         ax.plot(
141             comp_df[information_criterion],
142             yticks_pos[::2],
143             color=plot_kwargs.get("color_ic", "k"),
144             marker=plot_kwargs.get("marker_ic", "o"),
145             mfc="None",
146             mew=linewidth,
147             lw=0,
148         )
149 
150     if insample_dev:
151         ax.plot(
152             comp_df[information_criterion] - (2 * comp_df["p_" + information_criterion]),
153             yticks_pos[::2],
154             color=plot_kwargs.get("color_insample_dev", "k"),
155             marker=plot_kwargs.get("marker_insample_dev", "o"),
156             mew=linewidth,
157             lw=0,
158         )
159 
160     ax.axvline(
161         comp_df[information_criterion].iloc[0],
162         ls=plot_kwargs.get("ls_min_ic", "--"),
163         color=plot_kwargs.get("color_ls_min_ic", "grey"),
164         lw=linewidth,
165     )
166 
167     scale_col = information_criterion + "_scale"
168     if scale_col in comp_df:
169         scale = comp_df[scale_col].iloc[0].capitalize()
170     else:
171         scale = "Deviance"
172     ax.set_xlabel(scale, fontsize=ax_labelsize)
173     ax.set_yticklabels(yticks_labels)
174     ax.set_ylim(-1 + step, 0 - step)
175     ax.tick_params(labelsize=xt_labelsize)
176 
177     return ax
178
```
--- 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/arviz/plots/compareplot.py b/arviz/plots/compareplot.py
--- a/arviz/plots/compareplot.py
+++ b/arviz/plots/compareplot.py
@@ -95,8 +95,9 @@
     yticks_labels = [""] * len(yticks_pos)
 
     _information_criterion = ["waic", "loo"]
+    column_index = [c.lower() for c in comp_df.columns]
     for information_criterion in _information_criterion:
-        if information_criterion in comp_df.columns:
+        if information_criterion in column_index:
             break
     else:
         raise ValueError(

{"golden_diff": "diff --git a/arviz/plots/compareplot.py b/arviz/plots/compareplot.py\n--- a/arviz/plots/compareplot.py\n+++ b/arviz/plots/compareplot.py\n@@ -95,8 +95,9 @@\n     yticks_labels = [\"\"] * len(yticks_pos)\r\n \r\n     _information_criterion = [\"waic\", \"loo\"]\r\n+    column_index = [c.lower() for c in comp_df.columns]\r\n     for information_criterion in _information_criterion:\r\n-        if information_criterion in comp_df.columns:\r\n+        if information_criterion in column_index:\r\n             break\r\n     else:\r\n         raise ValueError(\n", "issue": "pm.compare seems not compatible with az.plot_compare\nIf I try to run two following commands\r\n```python\r\ndf_comp_WAIC = pm.compare({models[0]: traces[0], models[1]: traces[1]})\r\naz.plot_compare(df_comp_WAIC);\r\n```\r\nI get the error:\r\n```python\r\n---------------------------------------------------------------------------\r\nValueError                                Traceback (most recent call last)\r\n<ipython-input-208-a89027c76a69> in <module>\r\n      3 df_comp_WAIC = pm.compare({models[0]: traces[0], models[1]: traces[1]})\r\n----> 4 az.plot_compare(df_comp_WAIC);\r\n\r\n~/anaconda3/lib/python3.6/site-packages/arviz/plots/compareplot.py in plot_compare(comp_df, insample_dev, plot_standard_error, plot_ic_diff, figsize, textsize, plot_kwargs, ax)\r\n     99         raise ValueError(\r\n    100             \"comp_df must contain one of the following\"\r\n--> 101             \" information criterion: {}\".format(_information_criterion)\r\n    102         )\r\n    103 \r\n\r\nValueError: comp_df must contain one of the following information criterion: ['waic', 'loo']\r\n```\r\n\r\nBoth pymc3 and arviz are the latest from github (using pip command)\n", "before_files": [{"content": "\"\"\"Summary plot for model comparison.\"\"\"\r\nimport numpy as np\r\nimport matplotlib.pyplot as plt\r\nfrom .plot_utils import _scale_fig_size\r\n\r\n\r\ndef plot_compare(\r\n    comp_df,\r\n    insample_dev=True,\r\n    plot_standard_error=True,\r\n    plot_ic_diff=True,\r\n    order_by_rank=True,\r\n    figsize=None,\r\n    textsize=None,\r\n    plot_kwargs=None,\r\n    ax=None,\r\n):\r\n    \"\"\"\r\n    Summary plot for model comparison.\r\n\r\n    This plot is in the style of the one used in the book Statistical Rethinking (Chapter 6)\r\n    by Richard McElreath.\r\n\r\n    Notes\r\n    -----\r\n    Defaults to comparing Widely Accepted Information Criterion (WAIC) if present in comp_df column,\r\n    otherwise compares Leave-one-out (loo)\r\n\r\n\r\n    Parameters\r\n    ----------\r\n    comp_df : pd.DataFrame\r\n        Result of the `az.compare()` method\r\n    insample_dev : bool, optional\r\n        Plot in-sample deviance, that is the value of the information criteria without the\r\n        penalization given by the effective number of parameters (pIC). Defaults to True\r\n    plot_standard_error : bool, optional\r\n        Plot the standard error of the information criteria estimate. Defaults to True\r\n    plot_ic_diff : bool, optional\r\n        Plot standard error of the difference in information criteria between each model\r\n         and the top-ranked model. Defaults to True\r\n    order_by_rank : bool\r\n        If True (default) ensure the best model is used as reference.\r\n    figsize : tuple, optional\r\n        If None, size is (6, num of models) inches\r\n    textsize: float\r\n        Text size scaling factor for labels, titles and lines. If None it will be autoscaled based\r\n        on figsize.\r\n    plot_kwargs : dict, optional\r\n        Optional arguments for plot elements. Currently accepts 'color_ic',\r\n        'marker_ic', 'color_insample_dev', 'marker_insample_dev', 'color_dse',\r\n        'marker_dse', 'ls_min_ic' 'color_ls_min_ic',  'fontsize'\r\n    ax : axes, optional\r\n        Matplotlib axes\r\n\r\n    Returns\r\n    -------\r\n    ax : matplotlib axes\r\n\r\n\r\n    Examples\r\n    --------\r\n    Show default compare plot\r\n\r\n    .. plot::\r\n        :context: close-figs\r\n\r\n        >>> import arviz as az\r\n        >>> model_compare = az.compare({'Centered 8 schools': az.load_arviz_data('centered_eight'),\r\n        >>>                  'Non-centered 8 schools': az.load_arviz_data('non_centered_eight')})\r\n        >>> az.plot_compare(model_compare)\r\n\r\n    Plot standard error and information criteria difference only\r\n\r\n    .. plot::\r\n        :context: close-figs\r\n\r\n        >>> az.plot_compare(model_compare, insample_dev=False)\r\n\r\n    \"\"\"\r\n    if figsize is None:\r\n        figsize = (6, len(comp_df))\r\n\r\n    figsize, ax_labelsize, _, xt_labelsize, linewidth, _ = _scale_fig_size(figsize, textsize, 1, 1)\r\n\r\n    if ax is None:\r\n        _, ax = plt.subplots(figsize=figsize, constrained_layout=True)\r\n\r\n    if plot_kwargs is None:\r\n        plot_kwargs = {}\r\n\r\n    yticks_pos, step = np.linspace(0, -1, (comp_df.shape[0] * 2) - 1, retstep=True)\r\n    yticks_pos[1::2] = yticks_pos[1::2] + step / 2\r\n\r\n    yticks_labels = [\"\"] * len(yticks_pos)\r\n\r\n    _information_criterion = [\"waic\", \"loo\"]\r\n    for information_criterion in _information_criterion:\r\n        if information_criterion in comp_df.columns:\r\n            break\r\n    else:\r\n        raise ValueError(\r\n            \"comp_df must contain one of the following\"\r\n            \" information criterion: {}\".format(_information_criterion)\r\n        )\r\n\r\n    if order_by_rank:\r\n        comp_df.sort_values(by=\"rank\", inplace=True)\r\n\r\n    if plot_ic_diff:\r\n        yticks_labels[0] = comp_df.index[0]\r\n        yticks_labels[2::2] = comp_df.index[1:]\r\n        ax.set_yticks(yticks_pos)\r\n        ax.errorbar(\r\n            x=comp_df[information_criterion].iloc[1:],\r\n            y=yticks_pos[1::2],\r\n            xerr=comp_df.dse[1:],\r\n            color=plot_kwargs.get(\"color_dse\", \"grey\"),\r\n            fmt=plot_kwargs.get(\"marker_dse\", \"^\"),\r\n            mew=linewidth,\r\n            elinewidth=linewidth,\r\n        )\r\n\r\n    else:\r\n        yticks_labels = comp_df.index\r\n        ax.set_yticks(yticks_pos[::2])\r\n\r\n    if plot_standard_error:\r\n        ax.errorbar(\r\n            x=comp_df[information_criterion],\r\n            y=yticks_pos[::2],\r\n            xerr=comp_df.se,\r\n            color=plot_kwargs.get(\"color_ic\", \"k\"),\r\n            fmt=plot_kwargs.get(\"marker_ic\", \"o\"),\r\n            mfc=\"None\",\r\n            mew=linewidth,\r\n            lw=linewidth,\r\n        )\r\n    else:\r\n        ax.plot(\r\n            comp_df[information_criterion],\r\n            yticks_pos[::2],\r\n            color=plot_kwargs.get(\"color_ic\", \"k\"),\r\n            marker=plot_kwargs.get(\"marker_ic\", \"o\"),\r\n            mfc=\"None\",\r\n            mew=linewidth,\r\n            lw=0,\r\n        )\r\n\r\n    if insample_dev:\r\n        ax.plot(\r\n            comp_df[information_criterion] - (2 * comp_df[\"p_\" + information_criterion]),\r\n            yticks_pos[::2],\r\n            color=plot_kwargs.get(\"color_insample_dev\", \"k\"),\r\n            marker=plot_kwargs.get(\"marker_insample_dev\", \"o\"),\r\n            mew=linewidth,\r\n            lw=0,\r\n        )\r\n\r\n    ax.axvline(\r\n        comp_df[information_criterion].iloc[0],\r\n        ls=plot_kwargs.get(\"ls_min_ic\", \"--\"),\r\n        color=plot_kwargs.get(\"color_ls_min_ic\", \"grey\"),\r\n        lw=linewidth,\r\n    )\r\n\r\n    scale_col = information_criterion + \"_scale\"\r\n    if scale_col in comp_df:\r\n        scale = comp_df[scale_col].iloc[0].capitalize()\r\n    else:\r\n        scale = \"Deviance\"\r\n    ax.set_xlabel(scale, fontsize=ax_labelsize)\r\n    ax.set_yticklabels(yticks_labels)\r\n    ax.set_ylim(-1 + step, 0 - step)\r\n    ax.tick_params(labelsize=xt_labelsize)\r\n\r\n    return ax\r\n", "path": "arviz/plots/compareplot.py"}], "after_files": [{"content": "\"\"\"Summary plot for model comparison.\"\"\"\r\nimport numpy as np\r\nimport matplotlib.pyplot as plt\r\nfrom .plot_utils import _scale_fig_size\r\n\r\n\r\ndef plot_compare(\r\n    comp_df,\r\n    insample_dev=True,\r\n    plot_standard_error=True,\r\n    plot_ic_diff=True,\r\n    order_by_rank=True,\r\n    figsize=None,\r\n    textsize=None,\r\n    plot_kwargs=None,\r\n    ax=None,\r\n):\r\n    \"\"\"\r\n    Summary plot for model comparison.\r\n\r\n    This plot is in the style of the one used in the book Statistical Rethinking (Chapter 6)\r\n    by Richard McElreath.\r\n\r\n    Notes\r\n    -----\r\n    Defaults to comparing Widely Accepted Information Criterion (WAIC) if present in comp_df column,\r\n    otherwise compares Leave-one-out (loo)\r\n\r\n\r\n    Parameters\r\n    ----------\r\n    comp_df : pd.DataFrame\r\n        Result of the `az.compare()` method\r\n    insample_dev : bool, optional\r\n        Plot in-sample deviance, that is the value of the information criteria without the\r\n        penalization given by the effective number of parameters (pIC). Defaults to True\r\n    plot_standard_error : bool, optional\r\n        Plot the standard error of the information criteria estimate. Defaults to True\r\n    plot_ic_diff : bool, optional\r\n        Plot standard error of the difference in information criteria between each model\r\n         and the top-ranked model. Defaults to True\r\n    order_by_rank : bool\r\n        If True (default) ensure the best model is used as reference.\r\n    figsize : tuple, optional\r\n        If None, size is (6, num of models) inches\r\n    textsize: float\r\n        Text size scaling factor for labels, titles and lines. If None it will be autoscaled based\r\n        on figsize.\r\n    plot_kwargs : dict, optional\r\n        Optional arguments for plot elements. Currently accepts 'color_ic',\r\n        'marker_ic', 'color_insample_dev', 'marker_insample_dev', 'color_dse',\r\n        'marker_dse', 'ls_min_ic' 'color_ls_min_ic',  'fontsize'\r\n    ax : axes, optional\r\n        Matplotlib axes\r\n\r\n    Returns\r\n    -------\r\n    ax : matplotlib axes\r\n\r\n\r\n    Examples\r\n    --------\r\n    Show default compare plot\r\n\r\n    .. plot::\r\n        :context: close-figs\r\n\r\n        >>> import arviz as az\r\n        >>> model_compare = az.compare({'Centered 8 schools': az.load_arviz_data('centered_eight'),\r\n        >>>                  'Non-centered 8 schools': az.load_arviz_data('non_centered_eight')})\r\n        >>> az.plot_compare(model_compare)\r\n\r\n    Plot standard error and information criteria difference only\r\n\r\n    .. plot::\r\n        :context: close-figs\r\n\r\n        >>> az.plot_compare(model_compare, insample_dev=False)\r\n\r\n    \"\"\"\r\n    if figsize is None:\r\n        figsize = (6, len(comp_df))\r\n\r\n    figsize, ax_labelsize, _, xt_labelsize, linewidth, _ = _scale_fig_size(figsize, textsize, 1, 1)\r\n\r\n    if ax is None:\r\n        _, ax = plt.subplots(figsize=figsize, constrained_layout=True)\r\n\r\n    if plot_kwargs is None:\r\n        plot_kwargs = {}\r\n\r\n    yticks_pos, step = np.linspace(0, -1, (comp_df.shape[0] * 2) - 1, retstep=True)\r\n    yticks_pos[1::2] = yticks_pos[1::2] + step / 2\r\n\r\n    yticks_labels = [\"\"] * len(yticks_pos)\r\n\r\n    _information_criterion = [\"waic\", \"loo\"]\r\n    column_index = [c.lower() for c in comp_df.columns]\r\n    for information_criterion in _information_criterion:\r\n        if information_criterion in column_index:\r\n            break\r\n    else:\r\n        raise ValueError(\r\n            \"comp_df must contain one of the following\"\r\n            \" information criterion: {}\".format(_information_criterion)\r\n        )\r\n\r\n    if order_by_rank:\r\n        comp_df.sort_values(by=\"rank\", inplace=True)\r\n\r\n    if plot_ic_diff:\r\n        yticks_labels[0] = comp_df.index[0]\r\n        yticks_labels[2::2] = comp_df.index[1:]\r\n        ax.set_yticks(yticks_pos)\r\n        ax.errorbar(\r\n            x=comp_df[information_criterion].iloc[1:],\r\n            y=yticks_pos[1::2],\r\n            xerr=comp_df.dse[1:],\r\n            color=plot_kwargs.get(\"color_dse\", \"grey\"),\r\n            fmt=plot_kwargs.get(\"marker_dse\", \"^\"),\r\n            mew=linewidth,\r\n            elinewidth=linewidth,\r\n        )\r\n\r\n    else:\r\n        yticks_labels = comp_df.index\r\n        ax.set_yticks(yticks_pos[::2])\r\n\r\n    if plot_standard_error:\r\n        ax.errorbar(\r\n            x=comp_df[information_criterion],\r\n            y=yticks_pos[::2],\r\n            xerr=comp_df.se,\r\n            color=plot_kwargs.get(\"color_ic\", \"k\"),\r\n            fmt=plot_kwargs.get(\"marker_ic\", \"o\"),\r\n            mfc=\"None\",\r\n            mew=linewidth,\r\n            lw=linewidth,\r\n        )\r\n    else:\r\n        ax.plot(\r\n            comp_df[information_criterion],\r\n            yticks_pos[::2],\r\n            color=plot_kwargs.get(\"color_ic\", \"k\"),\r\n            marker=plot_kwargs.get(\"marker_ic\", \"o\"),\r\n            mfc=\"None\",\r\n            mew=linewidth,\r\n            lw=0,\r\n        )\r\n\r\n    if insample_dev:\r\n        ax.plot(\r\n            comp_df[information_criterion] - (2 * comp_df[\"p_\" + information_criterion]),\r\n            yticks_pos[::2],\r\n            color=plot_kwargs.get(\"color_insample_dev\", \"k\"),\r\n            marker=plot_kwargs.get(\"marker_insample_dev\", \"o\"),\r\n            mew=linewidth,\r\n            lw=0,\r\n        )\r\n\r\n    ax.axvline(\r\n        comp_df[information_criterion].iloc[0],\r\n        ls=plot_kwargs.get(\"ls_min_ic\", \"--\"),\r\n        color=plot_kwargs.get(\"color_ls_min_ic\", \"grey\"),\r\n        lw=linewidth,\r\n    )\r\n\r\n    scale_col = information_criterion + \"_scale\"\r\n    if scale_col in comp_df:\r\n        scale = comp_df[scale_col].iloc[0].capitalize()\r\n    else:\r\n        scale = \"Deviance\"\r\n    ax.set_xlabel(scale, fontsize=ax_labelsize)\r\n    ax.set_yticklabels(yticks_labels)\r\n    ax.set_ylim(-1 + step, 0 - step)\r\n    ax.tick_params(labelsize=xt_labelsize)\r\n\r\n    return ax\r\n", "path": "arviz/plots/compareplot.py"}]}