That's right (I have renamed to dataset_db as that is more obvious) but essentially I am using this simply to obtain the list of keys passed to get_dataset automatically, without needing to hand-code the list of parameters.
The parameters are now automatically loaded into the archive of the experiment .h5 file and can be re-loaded and re-submitted into the master to recreate an experiment using a simple script that connects to the master using the same approach as the artiq_client interface.
def build(self):
#Obtain list of keys in Master dataset database
for key, val in self.get_dataset_db().items():
#Determine if key is part of Parameters set
if key.startswith('Parameters'):
#Load and archive
self.get_dataset(key,archive=True)
To get this work, the get_dataset_db() method requires modifying the following classes: within environments.py, worker_impl.py, database.py and worker_db.py:
databases.py
class DatasetDB(TaskObject):
def get_dataset_db(self):
return self.data.raw_view
worker_db.py
class DatasetManager
def get_dataset_db(self):
#Returns the full contents of the dataset database.
return self.ddb.get_dataset_db()
worker_impl.py
class ParentDatasetDB
get_dataset_db = make_parent_action("get_dataset_db")
class ExamineDatasetMgr
get_dataset_db = make_parent_action("get_dataset_db")
environment.py
class HasEnvironment
@rpc(flags={"async"})
def get_dataset_db(self):
#Returns the full contents of the dataset database.
return self.__dataset_mgr.get_dataset_db()