def tearDown(self) -> None: try: os.remove("tmp.pkl") except FileNotFoundError: pass try: delete_experiments_folder("test") except FileNotFoundError: pass
#Done with the experiment, return the results dictionary like normal return {"number": self.r} else: #This experiment isn't done, return the progress as a tuple to update the dashboard return (self.i, self.num_calls) #Same specification as before generation_specification = { "seed": [1, 2, 3, 4, 5, 6, 7, 8], "num_calls": [1, 2, 3] } specifications = SpecificationGenerator().generate(generation_specification) name = "checkpointed_run" #This time we will run them all in parallel runner = ExperimentRunner() runner.run(name, specifications, SimpleExperiment(), specification_runner=MultiprocessingRunner()) #Some of our experiments may have failed, let's call run again to hopefully solve that runner.run(name, specifications, SimpleExperiment(), specification_runner=MultiprocessingRunner()) #Cleanup example delete_experiments_folder(name)