From 4d3360255ed70653c0ff1b4406e88b38601e53b2 Mon Sep 17 00:00:00 2001 From: Sooyoung Cheong <64125280+c-sooyoung@users.noreply.github.com> Date: Sun, 19 Jul 2026 18:17:09 +0900 Subject: [PATCH] simple test for bo --- ptycho/ptycho_example.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/ptycho/ptycho_example.py b/ptycho/ptycho_example.py index 8f906cd..6656a96 100644 --- a/ptycho/ptycho_example.py +++ b/ptycho/ptycho_example.py @@ -1,4 +1,6 @@ from typing import Any +import time +import random from ptycho.ptycho_base import PtychoEngine class ExamplePtychoEngine(PtychoEngine): @@ -11,7 +13,8 @@ class ExamplePtychoEngine(PtychoEngine): # run single ptychography job based on `config` def run(self) -> None: - pass + print("[ExamplePtychoEngine] Sleeping for 0.1 second.") + time.sleep(0.1) # save outputs to self._output def output(self) -> Any: @@ -37,5 +40,5 @@ class ExamplePtychoEngine(PtychoEngine): def metric(self) -> float: if self._metric is None: output = self.output() - self._metric = 0.0 + self._metric = random.uniform(0, 1) - (20 - self.config['ptycho']['params']['Nlayers'])**2 / 10 return self._metric