Hello,
I guess the experts will ask you to provide a complete working snippet of your example. try to keep it as simple as possible, ie. no class, just functions (ie. I see self.f so I imagine that you have extracted the code from a class). Then, expose your problem with some outputs for instance.
Then, I can run your example and try to reproduce your problem.