Sounds good.


On Sat, Mar 29, 2014 at 4:52 PM, Kyle Meyer <notifications@github.com>wrote:

> In pymc/trace.py:
>
> > @@ -266,5 +268,12 @@ def _calculate_posterior_quantiles(sample, qlist):
> >      ## Replace ends of qlist with 'lo' and 'hi'
> >      qends = {qlist[0]: 'lo', qlist[-1]: 'hi'}
> >      qkeys = {q: qends[q] if q in qends else 'q{}'.format(q) for q in qlist}
> > -    for index in range(sample.shape[1]):
> > -        yield {qkeys[q]: var_quantiles[q][index] for q in qlist}
> > +    for _, idxs in _groupby_leading_idxs(sample.shape[1:]):
> > +        yield ''
> > +        for idx in idxs:
> > +            yield {qkeys[q]: var_quantiles[q][idx] for q in qlist}
> > +
> > +
> > +def _groupby_leading_idxs(shape):
>
> Can't think of a better name than _groupby_leading_idxs right now, but
> I'll add a docstring.
>
> --
> Reply to this email directly or view it on GitHub<https://github.com/pymc-devs/pymc/pull/516/files#r11095857>
> .
>