saealib.core.contracts.ProposalBatch#

class saealib.core.contracts.ProposalBatch(*, proposal_id, candidates, relations, requirements, metadata=<factory>)[source]#

Bases: object

A candidate population plus its relations and feedback requirement.

Parameters:
  • proposal_id (int)

  • candidates (CandidatePopulation)

  • relations (ProposalRelations)

  • requirements (FeedbackRequirement)

  • metadata (Mapping[str, float | int | bool | str | ndarray | Mapping[str, object] | Sequence[object]])

Methods

__init__

from_allocator

Allocate the proposal id explicitly from an existing allocator.

take

Take the same candidate rows and relation rows together.

Method Details

ProposalBatch.__init__(*, proposal_id, candidates, relations, requirements, metadata=<factory>)#
Parameters:
  • proposal_id (int)

  • candidates (CandidatePopulation)

  • relations (ProposalRelations)

  • requirements (FeedbackRequirement)

  • metadata (Mapping[str, float | int | bool | str | ndarray | Mapping[str, object] | Sequence[object]])

Return type:

None

classmethod ProposalBatch.from_allocator(allocator, **kwargs)[source]#

Allocate the proposal id explicitly from an existing allocator.

Parameters:
  • allocator (IDAllocator)

  • kwargs (Any)

Return type:

ProposalBatch

ProposalBatch.take(indices)[source]#

Take the same candidate rows and relation rows together.

Parameters:

indices (Any)

Return type:

ProposalBatch