Skip to content

Commit

Permalink
plot_elpd, avoid modyfing the input dict (#1477)
Browse files Browse the repository at this point in the history
* avoid modyfing the input dict

* update changelog
  • Loading branch information
aloctavodia authored Dec 25, 2020
1 parent fc85571 commit 8fd104c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
* Automatically get the current axes instance for `plt_kde`, `plot_dist` and `plot_hdi` ([1452](https://github.com/arviz-devs/arviz/pull/1452))
* Add grid argument to manually specify the number of rows and columns ([1459](https://github.com/arviz-devs/arviz/pull/1459))
* Switch to `compact=True` by default in our plots ([1468](https://github.com/arviz-devs/arviz/issues/1468))

* `plot_elpd`, avoid modifying the input dict ([1477](https://github.com/arviz-devs/arviz/issues/1477))

### Deprecation

Expand Down
2 changes: 2 additions & 0 deletions arviz/plots/elpdplot.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Plot pointwise elpd estimations of inference data."""
from copy import deepcopy
import numpy as np

from ..data import convert_to_inference_data
Expand Down Expand Up @@ -115,6 +116,7 @@ def plot_elpd(
ic_fun = loo if ic == "loo" else waic

# Make sure all object are ELPDData
compare_dict = deepcopy(compare_dict)
for k, item in compare_dict.items():
if not isinstance(item, ELPDData):
compare_dict[k] = ic_fun(convert_to_inference_data(item), pointwise=True, scale=scale)
Expand Down

0 comments on commit 8fd104c

Please sign in to comment.