quactuary.utils module

Submodules

quactuary.utils.validation module

Utility functions for validating inputs or parameters used throughout the quActuary project.

quactuary.utils.validation.validate_non_negative_integer(value: int) None

Validate that a value is a non-negative integer.

Parameters:

value (int) – The value to validate.

Raises:

ValueError – If the value is not a non-negative integer.

quactuary.utils.validation.validate_positive_integer(value: int) None

Validate that a value is a positive integer.

Parameters:

value (int) – The value to validate.

Raises:

ValueError – If the value is not a positive integer.

quactuary.utils.validation.validate_probability(value: float) None

Validate that a probability value is between 0 and 1.

Parameters:

value (float) – The probability value to validate.

Raises:

ValueError – If the probability is not in the range [0, 1].

Module contents

Utility functions for validating inputs or parameters used throughout the quActuary project.

quactuary.utils.validation.validate_non_negative_integer(value: int) None

Validate that a value is a non-negative integer.

Parameters:

value (int) – The value to validate.

Raises:

ValueError – If the value is not a non-negative integer.

quactuary.utils.validation.validate_positive_integer(value: int) None

Validate that a value is a positive integer.

Parameters:

value (int) – The value to validate.

Raises:

ValueError – If the value is not a positive integer.

quactuary.utils.validation.validate_probability(value: float) None

Validate that a probability value is between 0 and 1.

Parameters:

value (float) – The probability value to validate.

Raises:

ValueError – If the probability is not in the range [0, 1].