Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rename flat_inference_data_to_dict (fixes #999) #1003

Merged
merged 2 commits into from
Jan 15, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions arviz/plots/backends/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,12 +63,12 @@ def to_cds(
-------
bokeh.models.ColumnDataSource object
"""
from ...utils import flat_inference_data_to_dict
from ...utils import flatten_inference_data_to_dict

if var_name_format is None:
var_name_format = "cds"

cds_dict = flat_inference_data_to_dict(
cds_dict = flatten_inference_data_to_dict(
data=data,
var_names=var_names,
groups=groups,
Expand Down
6 changes: 3 additions & 3 deletions arviz/tests/test_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
one_de,
two_de,
expand_dims,
flat_inference_data_to_dict,
flatten_inference_data_to_dict,
)
from ..data import load_arviz_data, from_dict
from ..stats.stats_utils import stats_variance_2d as svar
Expand Down Expand Up @@ -275,11 +275,11 @@ def test_expand_dims(data):
"var_name_format", [None, "brackets", "underscore", "cds", ((",", "[", "]"), ("_", ""))]
)
@pytest.mark.parametrize("index_origin", [None, 0, 1])
def test_flat_inference_data_to_dict(
def test_flatten_inference_data_to_dict(
inference_data, var_names, groups, dimensions, group_info, var_name_format, index_origin
):
"""Test flattening (stacking) inference data (subgroups) for dictionary."""
res_dict = flat_inference_data_to_dict(
res_dict = flatten_inference_data_to_dict(
data=inference_data,
var_names=var_names,
groups=groups,
Expand Down
2 changes: 1 addition & 1 deletion arviz/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -325,7 +325,7 @@ def full(shape, x, dtype=None):
return np.full(shape, x, dtype=dtype)


def flat_inference_data_to_dict(
def flatten_inference_data_to_dict(
data,
var_names=None,
groups=None,
Expand Down