def before_experiment_run(self, parameter_type): if parameter_type == "output": CSV_File.before_experiment_run(self, "output") self.event_file = CSV_File(self.path + ".events") self.event_file.before_experiment_run("output") self.thread = thread.start_new_thread(self.monitor_thread, tuple())
class CSVExperiment(Experiment): inputs = {} outputs = {"csv": CSV_File("csv_output")} def run(self): self.outputs.csv.value.append([1, 2, 3])
def inp_extract_cmdline_parser(self, opts, args): CSV_File.inp_parser_extract(self, opts, None) self.event_file = CSV_File(self.path + ".events")
from __future__ import print_function from versuchung.experiment import Experiment from versuchung.files import CSV_File class CSVExperiment(Experiment): inputs = {} outputs = {"csv": CSV_File("csv_output")} def run(self): self.outputs.csv.value.append([1, 2, 3]) if __name__ == "__main__": import shutil, sys experiment = CSVExperiment() dirname = experiment(sys.argv) csv = CSV_File(dirname + "/" + "csv_output") assert csv.value == [["1", "2", "3"]] if dirname: shutil.rmtree(dirname) print("success")