yawning_titan.envs.generic.helpers.environment_input_validation#

Functions

check_type

Check data item_types contained within a dictionary is one of a list of item_types.

check_within_range

Check that an item belonging to a dictionary fits within a certain numerical range (either inclusive or not).

yawning_titan.envs.generic.helpers.environment_input_validation.check_type(data, name, types)[source]#

Check data item_types contained within a dictionary is one of a list of item_types.

Parameters:
  • data – The dictionary

  • name – The name of the key of the item to check

  • types – A list of item_types that the item must belong to

yawning_titan.envs.generic.helpers.environment_input_validation.check_within_range(data, name, lower, upper, l_inclusive, u_inclusive)[source]#

Check that an item belonging to a dictionary fits within a certain numerical range (either inclusive or not).

If upper or lower are None then ignores that direction.

Parameters:
  • data – The dictionary where the item is held

  • name – The name of the key that corresponds to the item

  • lower – The lower bound for the range (None means no lower bound)

  • upper – The upper bound for the range (None means no upper bound)

  • l_inclusive – Boolean - True for inclusive, False for not

  • u_inclusive – Boolean - True for inclusive, False for not