From 718eb31ed844c3bb71d564736af54e203ca0dc3a Mon Sep 17 00:00:00 2001 From: Osvaldo Martin Date: Wed, 10 Feb 2021 14:05:49 -0300 Subject: [PATCH] fix point_estimate mode (#1552) Co-authored-by: Oriol (ZBook) --- CHANGELOG.md | 8 ++++---- arviz/plots/plot_utils.py | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e8956ad4d6..a41456f2e5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,15 +2,15 @@ ## v0.x.x Unreleased ### New features -* Added `to_zarr` method to InferenceData -* Added `from_zarr` method to InferenceData -* Added confidence interval band to auto-correlation plot ([1535](https://github.com/arviz-devs/arviz/pull/1535)) +* Added `to_zarr` and `from_zarr` methods to InferenceData ([1518](https://github.com/arviz-devs/arviz/pull/1535)) +* Added confidence interval band to auto-correlation plot ([1535](https://github.com/arviz-devs/arviz/pull/1535)) ### Maintenance and fixes * Updated `from_cmdstan` and `from_numpyro` converter to follow schema convention ([1541](https://github.com/arviz-devs/arviz/pull/1541) and [1525](https://github.com/arviz-devs/arviz/pull/1525)) +* Fix calculation of mode as point estimate ([1552](https://github.com/arviz-devs/arviz/pull/1552)) ### Deprecation -* Removed Geweke diagnostic ([1545](https://github.com/arviz-devs/arviz/pull/1545)) +* Removed Geweke diagnostic ([1545](https://github.com/arviz-devs/arviz/pull/1545)) ### Documentation diff --git a/arviz/plots/plot_utils.py b/arviz/plots/plot_utils.py index 9e47ecb63c..553457a405 100644 --- a/arviz/plots/plot_utils.py +++ b/arviz/plots/plot_utils.py @@ -586,7 +586,7 @@ def calculate_point_estimate(point_estimate, values, bw="default", circular=Fals else: point_value = np.mean(values) elif point_estimate == "mode": - if isinstance(values[0], float): + if values.dtype.kind == "f": if bw == "default": if circular: bw = "taylor"