seismicrna.core.extern package

Subpackages

Submodules

exception seismicrna.core.extern.depend.DependencyError

Bases: RuntimeError

A required dependency is missing.

seismicrna.core.extern.depend.dependency_exists(dependency: str) bool

Check whether a dependency exists.

seismicrna.core.extern.depend.require_dependency(dependency: str, module: str = '')

If a dependency does not exist, return an error message.

seismicrna.core.extern.depend.require_env_var(dependency: str, module: str = '')

If a required env var is not set, return an error message.

class seismicrna.core.extern.shell.ShellCommand(action: str, mkcmd: Callable[[Any, Any, Any], str], parse: Callable[[CompletedProcess], Any] | None = None, ipath: bool = True, opath: bool = True)

Bases: object

Command that can be run in the shell.

exception seismicrna.core.extern.shell.ShellCommandFailedError

Bases: RuntimeError

A command failed that was run through the shell.

seismicrna.core.extern.shell.args_to_cmd(args: list[Any])

Join a list of arguments into a command with shlex.

seismicrna.core.extern.shell.cmds_to_pipe(cmds: list[str])

Join commands into a pipeline.

seismicrna.core.extern.shell.cmds_to_series(cmds: list[str])

Run commands in series.

seismicrna.core.extern.shell.cmds_to_subshell(cmds: list[str])

Run commands in a subshell.

seismicrna.core.extern.shell.iopaths(has_ipath: bool = True, has_opath: bool = True)

Given a function that takes an input path, output path, both, or neither, and potentially other positional/keyword arguments, return another function that takes input and output paths as its first two arguments and calls the original function with the right paths.

seismicrna.core.extern.shell.run_cmd(cmd: str, text: bool | None = True)

Run a command via subprocess.run(), with logging.