new structure for ptychoengine

This commit is contained in:
2026-08-05 14:06:05 +09:00
parent 882f747c27
commit 7d307be3c9
3 changed files with 40 additions and 12 deletions
+6 -4
View File
@@ -4,15 +4,17 @@ import random
from ptycho.base import PtychoEngine
class ExamplePtychoEngine(PtychoEngine):
# initialize job/engine-specific variables here
# e.g. self.output_dir
def __init__(self, config):
super().__init__(config)
self._metric = 0.0
# run single ptychography job based on `config`
def run(self, run_id="") -> None:
print(f"[{run_id}] [ExamplePtychoEngine] Sleeping for 0.1 second.")
time.sleep(0.1)
def metric(self, names):
if isinstance(names, (list, tuple)):
return [0.0] * len(names)
else:
return 0.0