aind_behavior_curriculum.curriculum.Policy

class aind_behavior_curriculum.curriculum.Policy(function: Callable[[_P], _R], *, skip_validation: bool = False)[source]

Bases: _Rule[(<class ‘aind_behavior_curriculum.curriculum.Metrics’>, <class ‘aind_behavior_curriculum.task.TaskParameters’>), TaskParameters]

User-defined function that defines how current Task parameters change according to metrics. It subclasses _Rule.

__init__(function: Callable[[_P], _R], *, skip_validation: bool = False) None[source]

Initializes a new instance of the class. :param function: The function to be used. If an instance of _Rule is passed,

the callable attribute of the _Rule instance will be used.

Parameters:

skip_validation (bool, optional) – If set to True, skips the validation of the callable’s typing. Defaults to False.

Returns:

None

Methods

__init__(function, *[, skip_validation])

Initializes a new instance of the class. :param function: The function to be used. If an instance of _Rule is passed, the callable attribute of the _Rule instance will be used. :type function: Callable[_P, _R] :param skip_validation: If set to True, skips the validation of the callable's typing. Defaults to False. :type skip_validation: bool, optional.

invoke(*args, **kwargs)

Wraps the inner callable.

normalize_rule_or_callable(rule)

Ensures the outgoing type is normalized from a Callable or _Rule.

serialize_rule(value)

Custom Serialization.

Attributes

callable

Returns the wrapped callable.

name

Name of the Rule.

property callable: Callable[[_P], _R][source]

Returns the wrapped callable.

invoke(*args: ~typing.~_P, **kwargs: ~typing.~_P) _R[source]

Wraps the inner callable.

property name: str[source]

Name of the Rule.

classmethod normalize_rule_or_callable(rule: Callable | _Rule) Self[source]

Ensures the outgoing type is normalized from a Callable or _Rule.

classmethod serialize_rule(value: str | _Rule[_P, _R]) str[source]

Custom Serialization. Simply exports reference to function as package + function name.