[2021:13610] Bug: Script TOP copyNumpyArray does not trigger cook downstream

build: 2021.13610

copyNumpyArray in the Script TOP does not trigger a cook downstream in nodes that ask for its data.

Example attached
scriptTOP_copyNumpyArray_does_not_trigger_cook.tox (1.1 KB)

PS perhaps this is an RFE instead of a bug? not sure :thinking:

Hi.
The Script methods are intended to be used only during the onCook callback.
You should include all variations inside that callback and execute accordingly.
I’ve updated the online doc.
Sorry about the confusion.

Cheers,
Rob.

hey @rob, thanks for the info.
Actually so far I have only used it by calling the copyNumpyArray method from an extension, where I use the Script TOP as a way to write incoming data from external APIs.
I don’t really see any way I could to this in the onCook callback, so I work around it by calling
op("myScriptTOP").cook(force=True)
after each call to copyNumpyArray.

FYI this is also the way others are using it, see these threads linked below. So far I answer all of them to use the forced cooking method and that seems to make everyone happy :wink:

@rob @nettoyeur yes what about cases like this one: Im receiving stream data on a webClient operator on the onResponse function and I need to then update the scriptTOP so I need to do it from outside the onCook callback of the scriptTOP, and force the scriptTOP to recook

I’ve proposed a solution on the other thread:

1 Like