def __init__(self, options, name='PluginRunner'): class_name = "savu.core.transports." + options["transport"] \ + "_transport" cu.add_base(self, cu.import_class(class_name)) super(PluginRunner, self).__init__() # ********* transport function *********** self._transport_initialise(options) self.options = options # add all relevent locations to the path pu.get_plugins_paths() self.exp = Experiment(options)
def plugin_runner_load_plugin(options): plugin_runner = PluginRunner(options) plugin_runner.exp = Experiment(options) plugin_list = plugin_runner.exp.meta_data.plugin_list.plugin_list exp = plugin_runner.exp pu.plugin_loader(exp, plugin_list[0]) exp._set_nxs_file() plugin_dict = plugin_list[1] plugin = pu.get_plugin(plugin_dict['id']) plugin.exp = exp return plugin
def plugin_runner_real_plugin_run(options): plugin_runner = PluginRunner(options) plugin_runner.exp = Experiment(options) plugin_list = plugin_runner.exp.meta_data.plugin_list.plugin_list plugin_runner._run_plugin_list_check(plugin_list) exp = plugin_runner.exp pu.plugin_loader(exp, plugin_list[0]) start_in_data = copy.deepcopy(exp.index['in_data']) in_data = exp.index["in_data"][exp.index["in_data"].keys()[0]] out_data_objs, stop = in_data._load_data(1) exp._clear_data_objects() exp.index['in_data'] = copy.deepcopy(start_in_data) for key in out_data_objs[0]: exp.index["out_data"][key] = out_data_objs[0][key] plugin = pu.plugin_loader(exp, plugin_list[1]) plugin._run_plugin(exp, plugin_runner)
def _get_checkpoint(self, cfile=True): exp = Experiment(self.get_options(cfile=cfile)) checkpoint = Checkpointing(exp) return checkpoint