filters not being updated when using pvpython?

hello,

i am having a problem with one of my scripts,

i have a pipeline of 4 filters that I am changing inside a loop,
I am creating a slice (slice_0) in the XZ plane, then creating a second slice(slice_1) in the XY plane and using a clip (clip_0) in the YZ plane, lastly I generate the cell centers on the last clip.
the first gives me a complete cut of the geometry, the second two lines (as the geometry is a ‘U’ like shape) and lastly the clip makes me keep only one of the two lines.

in my script I have a triple loop (one inside the other), where the first one is changing the direction of the first slice_0, the second loop it invert or not the clip_0 and the third loop changes the second slice origin (slice_1). the idea is that I am cutting at different heights the intersection of my U geometry with the different planes +XZ / +YZ / -XZ / -YZ the idea is to check how axis symetric are my results.

to collect the data I am using fetch:

data=dsa.WrapDataObject(servermanager.Fetch(cell centers))

before the three loops I have:

animationScene1 = GetAnimationScene()
animationScene1.UpdateAnimationUsingDataTimeSteps()
animationScene1.GoToLast()
and inside the loops (inside the internal/internal loop) I am running:
UpdatePipeline()
updateFilters(filterList=[], timeStep='')

where updateFilters function looks like this:

def updateFilters(filterList=[], timeStep=''):
    if filterList==[]:
        filterList=[v for (k, v) in GetSources().items() ]
    if timeStep=='':
        try:
            animationScene1 = GetAnimationScene()
            timeStep=animationScene1.AnimationTime
        except:
            timeStep=0
            pass
    for FILTER in filterList:
        FILTER.UpdatePipeline(timeStep)
    return

so, when I run my script on the python console, paraview gives the correct result, where if I run pvpython myScript.py the data is wrong (i was having a similar issue before when doing from the python console and when I added the updateFilters(filterList=, timeStep=‘’)
it solved the issue.
when I say the data is wrong it is not that it is returning null or anything, it is simply that it is the data that corresponds to the first time step instead of the last one, eventhought i have animationScene1.GoToLast() before the loop. the exactly same script works peferctly when I run it in the python console where in the terminal it does not as expected go to last.
what I am missing?

okey, some debugying…..

I feel like it is a bug of paraview as in another section of my code I keep track of the evolution of one specific line by looping over time (for t in timeSteps:) steps and using animationScene1.AnimationTime = t

and in that case it works for the two situations (pvpython and python console)

and if instead of using animationScene1.GoToLast() i instead use animationScene1.AnimationTime = timeSteps[-1] the script works as intended.

for info the timeSteps i got them by using timeSteps=simfoam.TimestepValues

maybe I should run something ‘else’ so animationScene1.GoToLast() works? outside of what I mentionned before:

animationScene1 = GetAnimationScene()
animationScene1.UpdateAnimationUsingDataTimeSteps()