xyzpy.gen.prepare ================= .. py:module:: xyzpy.gen.prepare Attributes ---------- .. autoapisummary:: xyzpy.gen.prepare.parse_var_coords xyzpy.gen.prepare.parse_constants xyzpy.gen.prepare.parse_resources xyzpy.gen.prepare.parse_attrs Functions --------- .. autoapisummary:: xyzpy.gen.prepare._str_2_tuple xyzpy.gen.prepare.dictify xyzpy.gen.prepare.parse_fn_args xyzpy.gen.prepare.check_for_duplicates xyzpy.gen.prepare.parse_combos xyzpy.gen.prepare.parse_combo_results xyzpy.gen.prepare.parse_cases xyzpy.gen.prepare.parse_case_results xyzpy.gen.prepare.parse_var_names xyzpy.gen.prepare.parse_var_dims Module Contents --------------- .. py:function:: _str_2_tuple(x) Ensure `x` is at least a 1-tuple of str. .. py:function:: dictify(x) Ensure `x` is a dict. .. py:function:: parse_fn_args(fn, fn_args) Parse function arguments into a tuple of argument names. .. py:function:: check_for_duplicates(arg, values) Raise if duplicate values are provided for combo argument ``arg``. .. py:function:: parse_combos(combos) -> tuple[tuple[str, list], Ellipsis] Turn dicts and single tuples into proper form for combo runners. .. py:function:: parse_combo_results(results, var_names) Normalize combo results to a tuple when a single output is used. .. py:function:: parse_cases(cases, fn_args=None) Normalize cases into a tuple of dicts keyed by ``fn_args``. .. py:function:: parse_case_results(results, var_names) Normalize case results to tuples for single-output functions. .. py:function:: parse_var_names(var_names) Normalize variable names to a tuple (or ``(None,)``). .. py:function:: parse_var_dims(var_dims, var_names) Parse function mapping parameters into standard form. :param var_dims: * 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. :type var_dims: dict, tuple, or str :param var_names: * 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. :type var_names: tuple of str, str, or None .. py:data:: parse_var_coords .. py:data:: parse_constants .. py:data:: parse_resources .. py:data:: parse_attrs