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

kwargs update to include observed data causes problem in to dataset #23

Open
hyunjimoon opened this issue Nov 29, 2022 · 1 comment
Open

Comments

@hyunjimoon
Copy link
Contributor

File ~/Dropbox/stanify/venv/lib/python3.10/site-packages/arviz/data/base.py:316, in dict_to_dataset(data, attrs, library, coords, dims, default_dims, index_origin, skip_event_dims)
    303 if dims is None:
    304     dims = {}
    306 data_vars = {
    307     key: numpy_to_data_array(
    308         values,
    309         var_name=key,
    310         coords=coords,
    311         dims=dims.get(key),
    312         default_dims=default_dims,
    313         index_origin=index_origin,
    314         skip_event_dims=skip_event_dims,
    315     )
--> 316     for key, values in data.items()
    317 }
    318 return xr.Dataset(data_vars=data_vars, attrs=make_attrs(attrs=attrs, library=library))

AttributeError: 'list' object has no attribute 'items'

I will first delete obs but we need this for plot_ppc()

@hyunjimoon
Copy link
Contributor Author

This is resolved by delivering the dictionary for only _obs directly to stan.sample.

However, the idata_kwargs auto update is needed: code ran without the following line (and we drew plot_ppc), but need rechecking before closing this issue.

#idata_kwargs["coords"]["obsereved_data"] = model.get_obs_vector_names()

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant