FabNESO.ensemble_tools module
A module to create input directories and encode configurations for FabNESO.
- FabNESO.ensemble_tools.create_grid_ensemble(*, output_path: Path, source_path: Path, conditions_file: str, parameter_ranges: dict[str, tuple[float, float, int]]) None [source]
Create an ensemble directory corresponding to parameters on tensor product grid.
- Parameters:
output_path – Path to directory to write ensemble files to.
source_path – Path to directory containing ‘source’ configuration to create ensemble from by varying parameters in conditions file.
conditions_file – Name of conditions file in source_path directory.
parameter_ranges – Dictionary mapping from parameter names to tuples specifying in order the lower bound, upper bound and number of samples in evenly spaced grids on each parameter to be varied, with overall grid being the tensor product of these per-parameter grids.
- FabNESO.ensemble_tools.create_qmc_ensemble(*, output_path: Path, source_path: Path, conditions_file: str, n_sample: int, seed: int, rule: str, parameter_intervals: dict[str, tuple[float, float]]) None [source]
Create an ensemble directory corresponding to quasi-Monte Carlo parameter samples.
- Parameters:
output_path – Path to directory to write ensemble files to.
source_path – Path to directory containing ‘source’ configuration to create ensemble from by varying parameters in conditions file.
conditions_file – Name of conditions file in source_path directory.
parameter_intervals – Dictionary mapping from parameter names to tuples specifying in order the lower and upper bounds of uniform distribution on each each parameter to be varied, with overall joint distribution on parameters corresponding to the product of these distributions (that is assuming independence across the parameters.)
- FabNESO.ensemble_tools.list_parameter_values(conditions_file: Path, parameter_name: str) list[str] [source]
Return a list of the values of a given parameter name in conditions_file.
- Parameters:
conditions_file – Path to conditions file to inspect.
parameter_name – Name of parameter to get values for.
- Returns:
List of values for parameter with name parameter_name.
- FabNESO.ensemble_tools.edit_parameters(conditions_file: Path, parameter_overrides: Mapping[str, float | str], *, create_missing: bool = False) None [source]
Edit parameters in a conditions file.
- Parameters:
conditions_file – Source conditions file to edit parameters in.
parameter_overrides – Mapping from parameter names to values to override the default value in the conditions file with.
- Keyword Arguments:
create_missing – Whether to create new elements for parameters specified in parameter_overrides argument for which there is not an existing element in conditions file.