seismicrna.core.arg package

Submodules

seismicrna.core.arg.cli.merge_params(*param_lists: list[Parameter], exclude: Iterable[Parameter] = ())

Merge lists of Click parameters, dropping duplicates.

seismicrna.core.arg.cli.optional_path(path_or_none: Path | str | None)
seismicrna.core.arg.docdef.auto(*, extra_defaults: dict[str, Any] | None = None, exclude_defaults: Iterable[str] = (), extra_docstrs: dict[str, str] | None = None, return_docstr: str = '')

Combine auto_defaults and auto_docstrs, in that order.

seismicrna.core.arg.docdef.auto_defaults(extra_defaults: dict[str, Any] | None = None, exclude_defaults: Iterable[str] = ())

Call paramdef and automatically infer default values from the CLI and API. Extra defaults (if needed) may be given as keyword arguments.

seismicrna.core.arg.docdef.auto_docstrs(extra_docstrs: dict[str, str] | None = None, return_docstr: str = '')

Call param_docstrs and automatically infer descriptions and type annotations about all parameters from the CLI and API. Documentation of any extra parameters may also be given.

seismicrna.core.arg.docdef.get_docstr_lines(func: Callable, param_lines: list[str], return_docstr: str)
seismicrna.core.arg.docdef.get_param_default(param: Parameter, defaults: dict[str, Any], exclude_defaults: Iterable[str])

Return the parameter, possibly with a new default value.

seismicrna.core.arg.docdef.get_param_lines(func: Callable, docstrs: dict[str, str])
seismicrna.core.arg.docdef.param_defaults(defaults: dict[str, Any], exclude_defaults: Iterable[str] = ())

Give the keyword argments of a function default values.

seismicrna.core.arg.docdef.param_docstrs(docstrs: dict[str, str], return_docstr: str)

Give a function a new docstring where each parameter gets annotated with the text given in the keyword arguments (param_docs).

Parameters:
  • docstrs (dict[str, str]) – Description of each parameter, keyed by name

  • return_docstr (str) – Description of the return value; will occur at end of docstring

Returns:

Function with new docstring

Return type:

callable