Hello,
I am trying to keep track of several numpy arrays during my experiment. I require the ability to be able to store and modify them throughout the exp, but timing and speed is not important. To do so I have been calling functions on the host to modify and update the arrays which are stored as class level variables. They do not seem to be updating as I expect them to on the top level. I've recreated a bare bones example of my issue here. Is there something I'm misunderstanding about how the timing is handled that would cause this?
`
from artiq.experiment import *
import numpy as np
class KernelTimingTest(EnvExperiment):
def build(self, **kwargs):
self.setattr_device("core")
self.setattr_device("scheduler")
self.test_vals = np.array([1,10,5,7,6,2,8], dtype=np.int32)
def prepare(self):
pass
@kernel
def run(self):
self.core.reset()
print(self.test_vals)
self.sort_list(self.test_vals) # sorts by value at each point
self.core.break_realtime()
print(self.test_vals)
@rpc(flags={"async"})
def sort_list(self, vals):
indices = np.argsort(vals)
self.test_vals = vals[indices]
`