in pplbench/ppls/stan/noisy_or_topic.py [0:0]
def format_data_to_stan(self, data: xr.Dataset) -> Dict:
"""
Take data from the model generator and the previously passed model
arguments to construct a data dictionary to pass to Stan.
:param data: A dataset from the model generator
:returns: a dictionary that can be passed to stan
"""
# transpose the dataset to ensure that it is the way we expect
data = data.transpose("sentence", "word")
assert self.attrs["n"] == 1
self.attrs["S"] = data.S.values[0]
self.attrs["tau"] = 0.1
# note: attrs should already contain n, edge_weight, num_topics and num_words
return self.attrs