mirror of
https://github.com/c-sooyoung/bo-ptycho.git
synced 2026-09-17 20:29:07 +09:00
removed PtychoEngine unnecessary methods
This commit is contained in:
@@ -10,35 +10,9 @@ class ExamplePtychoEngine(PtychoEngine):
|
||||
|
||||
def __init__(self, config):
|
||||
super().__init__(config)
|
||||
self._metric = 0.0
|
||||
|
||||
# run single ptychography job based on `config`
|
||||
def run(self) -> None:
|
||||
print("[ExamplePtychoEngine] Sleeping for 0.1 second.")
|
||||
def run(self, run_id="") -> None:
|
||||
print(f"[{run_id}] [ExamplePtychoEngine] Sleeping for 0.1 second.")
|
||||
time.sleep(0.1)
|
||||
|
||||
# save outputs to self._output
|
||||
def output(self) -> Any:
|
||||
if self._output is None:
|
||||
pass
|
||||
return self._output
|
||||
|
||||
# return reconstructed object (numpy array)
|
||||
def recon_object(self) -> Any:
|
||||
if self._recon_object is None:
|
||||
output = self.output()
|
||||
pass
|
||||
return self._recon_object
|
||||
|
||||
# return reconstructed probe (numpy array)
|
||||
def recon_probe(self) -> Any:
|
||||
if self._recon_probe is None:
|
||||
output = self.output()
|
||||
pass
|
||||
return self._recon_probe
|
||||
|
||||
# return metric value for Bayesian optimization
|
||||
def metric(self) -> float:
|
||||
if self._metric is None:
|
||||
output = self.output()
|
||||
self._metric = random.uniform(0, 1)
|
||||
return self._metric
|
||||
|
||||
Reference in New Issue
Block a user