saealib.AsyncEvaluator#

class saealib.AsyncEvaluator(evaluator=None, *, max_workers=1)[ソース]#

ベースクラス: Evaluator

Thread-backed asynchronous evaluator.

パラメータ:
  • evaluator (Evaluator | None)

  • max_workers (int)

Methods

__init__

acknowledge

Acknowledge one asynchronous update.

can_reattach

Return whether pending work can be restored after checkpoint load.

cancel

Cancel work that has not started.

close

Release worker resources.

collect

Collect one completed update, optionally without waiting.

contract

Return the evaluator family contract.

detach

Detach a running future and discard its eventual result.

evaluate_batch

Evaluate one batch on the wrapped evaluator.

evaluate_request

Evaluate a request, including its public metadata boundary.

has_partial_lifecycle_override

Return whether lifecycle adapter methods are only partly overridden.

reattach

Restore a pending request or raise when unsupported.

submit

Submit work without blocking the caller.

supports_batch_rollback

Return whether submitted futures can be detached.

Method Details

AsyncEvaluator.__init__(evaluator=None, *, max_workers=1)[ソース]#
パラメータ:
  • evaluator (Evaluator | None)

  • max_workers (int)

戻り値の型:

None

AsyncEvaluator.acknowledge(handle, sequence)[ソース]#

Acknowledge one asynchronous update.

パラメータ:
戻り値の型:

None

AsyncEvaluator.can_reattach(pending)#

Return whether pending work can be restored after checkpoint load.

パラメータ:

pending (PendingEvaluation)

戻り値の型:

bool

AsyncEvaluator.cancel(handle)[ソース]#

Cancel work that has not started.

パラメータ:

handle (EvaluationHandle)

戻り値の型:

bool

AsyncEvaluator.close()[ソース]#

Release worker resources.

戻り値の型:

None

AsyncEvaluator.collect(handle, *, wait=True)[ソース]#

Collect one completed update, optionally without waiting.

パラメータ:
戻り値の型:

list[EvaluationUpdate]

AsyncEvaluator.contract()#

Return the evaluator family contract.

戻り値の型:

ComponentContract

AsyncEvaluator.detach(handle)[ソース]#

Detach a running future and discard its eventual result.

パラメータ:

handle (EvaluationHandle)

戻り値の型:

bool

AsyncEvaluator.evaluate_batch(x, problem)[ソース]#

Evaluate one batch on the wrapped evaluator.

パラメータ:
  • x (GenomeBatch | np.ndarray)

  • problem (Problem)

戻り値の型:

EvaluationResult

AsyncEvaluator.evaluate_request(request, problem)#

Evaluate a request, including its public metadata boundary.

パラメータ:
戻り値の型:

EvaluationResult

classmethod AsyncEvaluator.has_partial_lifecycle_override()#

Return whether lifecycle adapter methods are only partly overridden.

戻り値の型:

bool

AsyncEvaluator.reattach(pending, problem)#

Restore a pending request or raise when unsupported.

パラメータ:
戻り値の型:

EvaluationHandle

AsyncEvaluator.submit(request, problem)[ソース]#

Submit work without blocking the caller.

パラメータ:
戻り値の型:

EvaluationHandle

AsyncEvaluator.supports_batch_rollback()[ソース]#

Return whether submitted futures can be detached.

戻り値の型:

bool