Having trouble getting previous value for a variable

I’m having problems accessing a historical state. I’m just sticking in a variable for testing for now, and have a PSUB that calls this:

def updateLookback(params, step, sL, s, _input):
y = ‘lookback’
x = access_block(sL, “last_x”, -1)[-1][‘stateVariable’]
return(y,x)

When I run the execution, my jupyter notebook just hangs - that cell doesn’t resolve.

Do you mind posting a link to the full notebook or a subset of it that reproduces the error?

Well, after a system update and restart it’s actually working now. Not sure what was causing the problem - but evidently wasn’t the code itself.

1 Like