wfcommons.utils¶
- wfcommons.utils.read_json(instance_filename: Path) Dict[str, Any][source]¶
Read the JSON from the file path.
- Parameters:
instance_filename (str) – The absolute path of the instance file.
- Returns:
The json object loaded with json data from the file
- Return type:
Dict[str, Any]
- wfcommons.utils.best_fit_distribution(data: List[float], logger: Logger | None = None) Tuple[source]¶
Fit a list of values to a distribution.
- Parameters:
data (List[float]) – List of values to be fitted to a distribution.
logger (Logger) – The logger uses to output debug information.
- Returns:
The name of the distribution and its parameters.
- Return type:
Tuple
- wfcommons.utils.generate_rvs(distribution: Dict, min_value: float, max_value: float) float[source]¶
Generate a random variable from a distribution.
- Parameters:
distribution (Dict) – Distribution dictionary (name and parameters).
min_value (float) – Minimum value accepted as a random variable.
max_value (float) – Maximum value accepted as a random variable.
- Returns:
Random variable generated from a distribution.
- Return type:
float