I’m finding that when I launch a workspace file with MWClient, sometimes it looks like the Python Client Bridge script runs before the MWEL is done loading, and so it doesn’t initialize properly. I think you fixed some race like this before, is that right? I’m using the snapshot from 2021.01.08.
Yes, when loading a workspace that contains an experiment path, the client doesn’t wait for the experiment to finish loading before launching the Python bridge or any other plugin window. I don’t think this issue has come up before, which is surprising.
I will work on fixing this. In the meantime, you may be able to avoid the issue by adding a short wait at the start of your Python bridge script – maybe a second or two, depending on how long your experiment takes to load.
Sorry about this!
I have a strong feeling that you and I discussed this before, but perhaps my memory is broken on this. I think I’m overfilling it.
I’m looking at this now, and I’m having trouble understanding where this is causing problems for you. Can you tell me exactly how the script’s initialization fails? Is it expecting a particular value for a variable and not seeing it?
I saw this with the following:
An experiment that takes longer to load than the Python bridge script takes to register callbacks on variables.
The error I got looked to be something like ‘variable missing’.
Any chance you can see this if you use an expt that takes a long time to load?
I still can’t reproduce this. Even if I try to register a callback for a non-existent variable, I never get an error message (which isn’t a great outcome, obviously, but beside the point here).
Can you send me an example experiment and Python script that have produced this issue? I don’t necessarily need to be able to run them. I mainly want to see how you’re setting things up, as there may be relevant details that I’m missing.