xyzpy.gen.prepare¶
Attributes¶
Functions¶
|
Ensure x is at least a 1-tuple of str. |
|
Ensure x is a dict. |
|
Parse function arguments into a tuple of argument names. |
|
Raise if duplicate values are provided for combo argument |
|
Turn dicts and single tuples into proper form for combo runners. |
|
Normalize combo results to a tuple when a single output is used. |
|
Normalize cases into a tuple of dicts keyed by |
|
Normalize case results to tuples for single-output functions. |
|
Normalize variable names to a tuple (or |
|
Parse function mapping parameters into standard form. |
Module Contents¶
- xyzpy.gen.prepare.parse_fn_args(fn, fn_args)[source]¶
Parse function arguments into a tuple of argument names.
- xyzpy.gen.prepare.check_for_duplicates(arg, values)[source]¶
Raise if duplicate values are provided for combo argument
arg.
- xyzpy.gen.prepare.parse_combos(combos) tuple[tuple[str, list], Ellipsis][source]¶
Turn dicts and single tuples into proper form for combo runners.
- xyzpy.gen.prepare.parse_combo_results(results, var_names)[source]¶
Normalize combo results to a tuple when a single output is used.
- xyzpy.gen.prepare.parse_cases(cases, fn_args=None)[source]¶
Normalize cases into a tuple of dicts keyed by
fn_args.
- xyzpy.gen.prepare.parse_case_results(results, var_names)[source]¶
Normalize case results to tuples for single-output functions.
- xyzpy.gen.prepare.parse_var_names(var_names)[source]¶
Normalize variable names to a tuple (or
(None,)).
- xyzpy.gen.prepare.parse_var_dims(var_dims, var_names)[source]¶
Parse function mapping parameters into standard form.
- Parameters:
var_dims (dict, tuple, or str) –
- dict
Mapping of each output to its dimensions, each either str or tuple of str. The keys themselves can be a tuple of several output names if they all have the same dimensions.
- tuple
List of output dimensions directly corresponding to list of var_names. Must be same length as var_names
- str
Only allowed for single output with single dimension.
var_names (tuple of str, str, or None) –
- tuple of str
List of names of var_names.
- str
Single named output.
- None
Automatic result output using Dataset/DataArray, in this case check that var_dims is None as well.