pg.geno.oneof#

Accessible via pg.geno.oneof.

oneof(candidates, literal_values=None, hints=None, location=, name=None)[source]#

Returns a single choice specification.

It creates the genotype for pg.oneof.

Example:

spec = pg.geno.oneof([
    pg.geno.constant(),
    pg.geno.oneof([
        pg.geno.constant(),
        pg.geno.constant()
    ])
])
Return type:

pg.geno.Choices

Parameters:
  • candidates – A list of pg.geno.Space objects as the candidates.

  • literal_values – An optional list of string, integer, or float as the literal values for the candidates for display purpose.

  • hints – An optional hint object.

  • location – A pg.KeyPath object that indicates the location of the decision point.

  • name – An optional global unique name for identifying this decision point.

Returns:

A pg.geno.Choices object.