AiiDA workchain caching?

Where there some changes in the way how WorkChain source code is fetched and run?

So after a while start to write myself a new WorkChain. I wrote a first draft and I wanted to run it. I registered a new WorkChain. However ,subsequent changes in the source code does not seams to affect the run of WorkChain. Even when I reinstall the package and remove all caches.

I cannot do a reproducer, it just acts weird. As it remembers first two version of python binary a tries to execute one of those.

Hi, when you change the workflow code, you need to restart the daemon with verdi daemon restart --reset. This is because python will keep the old code in memory unless you restart the code. You should also make sure that, if your workchain is in an installed package, you installed in editable mode with pip install -e <folder_name>.

Thank you, I guess each daemon has its own cache. I have multiple daemons running and each one remembered a different version of the code. Not having reproducible outcome was very frustrating.

It is not really a cache. It is not an AiiDA specific thing, but just a property of Python. The same happens when you are in an interactive shell, like ipython, or a Jupyter notebook, for example. If you load a Python module there, and then you change the source code, those changes will not be seen by the interpreter and it will continue running the “old” version. You have to restart the interpreter (kernel) to force it to read the source code again.

1 Like

@sphuber Thanks for the clarification