emodpy.utils package#
- emodpy.utils.validate_value_range(param: float | int, param_name: str, min_value: float | None = None, max_value: float | None = None, param_type: type = <class 'float'>)[source]#
Validate that the parameter is within the specified range and of the specified type(float or int only). Return the parameter value if it passes the validation.
- emodpy.utils.validate_bins(bins: list[float], param_name: str, min_value: float | None = None, max_value: float | None = None)[source]#
Validate that the array’s values are within the specified range and of the specified type(float or int only) and in ascending order.
Return the parameter value if it passes the validation.
- emodpy.utils.validate_node_ids(node_ids: list[int] | None) list[int][source]#
todo: validate node_ids against nodes in the demographics file
- emodpy.utils.validate_node_property(node_property: str) str[source]#
Checks if a node property is valid.
- emodpy.utils.validate_individual_property(individual_property: str) str[source]#
Checks if an individual property is valid.
- emodpy.utils.validate_intervention_name(intervention_name: str) str[source]#
Checks if an individual intervention name is valid.
- emodpy.utils.validate_individual_event(event: str) str[source]#
Checks if an individual event is valid.
- emodpy.utils.validate_coordinator_event(event: str) str[source]#
Checks if an coordinator event is valid.
- emodpy.utils.validate_surveillance_event(event: str)[source]#
Checks if an coordinator event is valid.
- emodpy.utils.validate_list_of_strings(strings: list[str], param_name: str, process_string_callback: Callable | None = None, empty_list_ok: bool = False) list[str][source]#
Helper function to validate a list of strings, ensuring they meet specified conditions.
Future Work: - Ensure the events we are listening for actually exist in the campaign.
- Parameters:
- Returns:
The validated list of strings.
- Return type:
- Raises:
ValueError – If the list is empty and empty_list_ok is False.
ValueError – If strings is not a list.
ValueError – If any string in strings does not meet validation criteria.
Submodules#
- emodpy.utils.collections_utils module
- emodpy.utils.distributions module
- emodpy.utils.emod_constants module
- emodpy.utils.emod_enum module
StrEnumDistributionTypeDistributionType.NOT_INITIALIZEDDistributionType.CONSTANT_DISTRIBUTIONDistributionType.UNIFORM_DISTRIBUTIONDistributionType.GAUSSIAN_DISTRIBUTIONDistributionType.EXPONENTIAL_DISTRIBUTIONDistributionType.POISSON_DISTRIBUTIONDistributionType.LOG_NORMAL_DISTRIBUTIONDistributionType.DUAL_CONSTANT_DISTRIBUTIONDistributionType.WEIBULL_DISTRIBUTIONDistributionType.DUAL_EXPONENTIAL_DISTRIBUTIONDistributionType.BIMODAL_DISTRIBUTION
NodeSelectionTypeVaccineTypeSensitivityTypeEventOrConfigSettingType
- emodpy.utils.targeting_config module