pg.hyper.Float

Accessible via pg.hyper.Float.

class Float(min_value, max_value, scale=None, name=None, hints=None)[source]

Bases: pg.hyper.HyperPrimitive

A continuous value within a range.

Example:

# A float value between between 0.0 and 1.0.
v = pg.floatv(0.0, 1.0)

Methods:

custom_apply(path, value_spec[, ...])

Validate candidates during value_spec binding time.

dna_spec([location])

Returns corresponding DNASpec.

encode(value)

Encode a float value into a DNA.

is_leaf()

Returns whether this is a leaf node.

custom_apply(path, value_spec, allow_partial=False, child_transform=None)[source]

Validate candidates during value_spec binding time.

Return type:

Tuple[bool, pg.hyper.Float]

dna_spec(location=None)[source]

Returns corresponding DNASpec.

Return type:

pg.geno.Float

encode(value)[source]

Encode a float value into a DNA.

Return type:

pg.DNA

is_leaf()[source]

Returns whether this is a leaf node.

Return type:

bool