Trace slice error: "Stop value in slice not suported"

Hi everyone,
I am trying to do something like:

with model:
    trace = pm.backends.text.load('trace')
trace_truncated = trace[start:stop]

but I am getting ValueError: Stop value in slice not supported.

Any suggestion how to get slice like the one above?

Thanks :slight_smile:

If you refer the source (of PyMC3) you can observe that this error can be avoided only by setting the stop value in the slice to none. It seems for some reason PyMC3 does not support slicing the stop index.

I’m very curious to know why isn’t it supported?
@junpenglao any ideas?

Not sure as well. Something to do with the text file format?
We have been planning to improve the trace backend to something more robust for a while now…