gfn.utils.handlers

Attributes

logger

Functions

has_conditions_exception_handler(target_name, target)

Catches TypeError when calling a target with conditions and logs context.

is_callable_exception_handler(target_name, target)

Catches exceptions when calling a target that may not be callable.

no_conditions_exception_handler(target_name, target)

Catches TypeError when calling a target without conditions and logs context.

warn_about_recalculating_logprobs(obj, ...)

Warns the user if logprobs are being recalculated.

Module Contents

gfn.utils.handlers.has_conditions_exception_handler(target_name, target)

Catches TypeError when calling a target with conditions and logs context.

Parameters:
  • target_name (str)

  • target (Any)

gfn.utils.handlers.is_callable_exception_handler(target_name, target)

Catches exceptions when calling a target that may not be callable.

Parameters:
  • target_name (str)

  • target (Any)

gfn.utils.handlers.logger
gfn.utils.handlers.no_conditions_exception_handler(target_name, target)

Catches TypeError when calling a target without conditions and logs context.

Parameters:
  • target_name (str)

  • target (Any)

gfn.utils.handlers.warn_about_recalculating_logprobs(obj, recalculate_all_logprobs)

Warns the user if logprobs are being recalculated.

Parameters:
  • obj (gfn.containers.Container) – The container to check for logprobs.

  • recalculate_all_logprobs (bool) – Whether to recalculate all logprobs.