API reference
The public surface is intentionally smaller than at_py.readwrite: the top-level
at_py package re-exports common parsers and at_py.client.ATClient. For
the full list of parser and writer symbols, see Read/write parsers. For additional names
not re-exported at the top level (e.g. at_py.readwrite.load_mat_normalized_path(),
at_py.readwrite.vector.parse_readvector_lines()), import from
at_py.readwrite.
- class at_py.client.ATClient(target: str = 'localhost:50051', runner_mode: Literal['remote', 'docker'] = 'remote', docker_image: str = 'ghcr.io/jgebbie/at-runner:v0.3.0', docker_host_port: int = 50051, backend: RunnerBackend | None = None)[source]
Bases:
objectExecute Acoustics Toolbox models via at-runner (gRPC).
Connecting to a runner
runner_mode="remote"(default): call an existing at-runner process. Settargetto itshost:port(defaultlocalhost:50051).runner_mode="docker": start the official container image on first use (requires thedockerCLI onPATH), mapdocker_host_portto the container gRPC port, then connect. Stop the container withclose()or usewith ATClient(...) as client:.
Install the Python gRPC client (import name
at_runner) from the pinned public at-runner tag documented inREADME.md. Docstrings in this package intentionally avoid heavy Sphinxversionadded/ “parity with Matlab …” boilerplate; see the Port status section inREADME.mdfor Matlab file mapping.- Parameters:
target – gRPC address when
runner_mode="remote". Ignored for Docker mode after the container is up (the backend useslocalhost:docker_host_port).
- backend: RunnerBackend | None = None
- bellhop(*, file_root: str, inputs: dict[str, bytes | str] | None = None, timeout: int | None = None) RunResult[source]
Run the
bellhopexecutable (same arguments asrun()).
- bellhop3d(*, file_root: str, inputs: dict[str, bytes | str] | None = None, timeout: int | None = None) RunResult[source]
Run
bellhop3d(same arguments asrun()).
- bounce(*, file_root: str, inputs: dict[str, bytes | str] | None = None, timeout: int | None = None) RunResult[source]
Run
bounce(same arguments asrun()).
- field(*, file_root: str, inputs: dict[str, bytes | str] | None = None, timeout: int | None = None) RunResult[source]
Run
field(same arguments asrun()).
- field3d(*, file_root: str, inputs: dict[str, bytes | str] | None = None, timeout: int | None = None) RunResult[source]
Run
field3d(same arguments asrun()).
- kraken(*, file_root: str, inputs: dict[str, bytes | str] | None = None, timeout: int | None = None) RunResult[source]
Run
kraken(same arguments asrun()).
- krakenc(*, file_root: str, inputs: dict[str, bytes | str] | None = None, timeout: int | None = None) RunResult[source]
Run
krakenc(same arguments asrun()).
- run(*, model: str, file_root: str, inputs: dict[str, bytes | str] | None = None, timeout: int | None = None) RunResult[source]
Run an Acoustics Toolbox executable via at-runner (see package docstring for install).
- Parameters:
model – Executable name (e.g.
"bellhop","kraken").file_root – Basename without extension for input files in the runner workspace.
inputs – Optional map of filename → file body (
bytesorstr).timeout – Optional gRPC deadline in seconds (backend-specific).
- scooter(*, file_root: str, inputs: dict[str, bytes | str] | None = None, timeout: int | None = None) RunResult[source]
Run
scooter(same arguments asrun()).
- class at_py.backend.AtRunnerBackend(use_docker: bool = False, docker_image: str = 'ghcr.io/jgebbie/at-runner:v0.3.0', host_port: int = 50051, docker_grpc_port: int = 50051, connect_host: str = '127.0.0.1')[source]
Bases:
objectBackend that calls
at_runner.run_sync(lazy import).Remote (default): use
ATClient(target="host:port"); this backend forwards that gRPC address to the installedat_runnerpackage.Docker: set
use_docker=Trueto start the official image (DEFAULT_AT_RUNNER_IMAGE) on first use, maphost_portto the container gRPC port, then connect tolocalhost:host_port. Requires thedockerCLI onPATH. Callclose()(or useATClientas a context manager) to stop the container.
Helpers to run the official at-runner Docker image for local gRPC.
Used by AtRunnerBackend when use_docker=True and by tests.
- at_py.runner_docker.assert_docker_available() None[source]
Raise
RuntimeErrorif thedockerCLI is not onPATH.
- at_py.runner_docker.grpc_target_for_host_port(host: str, port: int) str[source]
Format
host:portfor gRPC clienttargetarguments.
- at_py.runner_docker.start_at_runner_container(*, image: str = 'ghcr.io/jgebbie/at-runner:v0.3.0', host_port: int = 50051, container_port: int = 50051) str[source]
Start a detached container; return container id (for
stop_at_runner_container()).Maps
host_port:container_portfor the gRPC service. Raises on failure.
- at_py.runner_docker.stop_at_runner_container(container_id: str, *, timeout_s: float = 120.0) None[source]
Run
docker stopon the given container id (ignores non-zero exit).
- at_py.runner_docker.wait_tcp(host: str, port: int, *, timeout_s: float = 60.0) None[source]
Block until
host:portaccepts a TCP connection ortimeout_selapses.
- class at_py.types.RunResult(status: str, exit_code: int, stdout: str, stderr: str, elapsed: float, files: dict[str, bytes])[source]
Bases:
objectOutcome of a single at-runner model run (mirrors
at_runnergRPC response).Fields follow the remote API: process
statusandexit_code, capturedstdout/stderr, wall-clockelapsedseconds, andfilesmapping output basenames to raw bytes.