rsseismic.Application module#

class rsseismic.Application.RSSeismicApplication(port: int = 60058, host: str = 'localhost')#

Bases: object

Entry point for connecting to a running RSSeismic scripting server.

Mirrors RS3’s RS3Modeler: connect on a port, open projects, return Model proxies. Use startApplication() to launch RSSeismic with -startScriptingServer when it is not already running.

property port: int#
property client: Client#
classmethod startApplication(port: int = 60058, overridePathToExecutable: str | None = None, timeout: float = 120.0) None#

Launch RSSeismic and wait until the scripting server on port accepts ping.

Parameters:
  • port – Scripting port (49152–65535). Same value as DEFAULT_SCRIPTING_PORT / 60058.

  • overridePathToExecutable – Full path to RSSeismic.exe. When omitted, the latest RSSeismic install is resolved from the Windows registry.

  • timeout – Seconds to wait for the server to become reachable.

Raises:
  • ValueError – port out of range

  • RuntimeError – port occupied, executable not found, or registry lookup failed

  • TimeoutError – server not ready within timeout

ping() None#

Verify the scripting server is reachable.

getMaxConcurrentAnalyses() int#

Return the effective maxConcurrentAnalyses from RSSeismic preferences.

This is the within-project cap on simultaneous engine runs used during RunCompute. Batch parallel_degree capping uses this value when available.

setMaxConcurrentAnalyses(maxConcurrentAnalyses: int) int#

Set maxConcurrentAnalyses in RSSeismic preferences (within-project engine cap).

Values are clamped to 1..256, matching the Preferences UI. Returns the effective value after save (same semantics as getMaxConcurrentAnalyses).

openFile(path: str) Model#

Open a DeepSoil project file and return a Model handle.

newProject() Model#

Create a blank project with default settings and return a Model handle.

runBatchCompute(file_paths: list[str], motion_names: list[str] | None = None, *, parallel_degree: int = 1, max_concurrent_analyses: int | None = None, timeout: float | None = None, close_save_project: bool = False, continue_on_error: bool = True) BatchComputeResult#

Run compute for many project files (open → motion selection → compute → close).

Motion selection applies to the open session only; it is not stored in the project file. Each job calls setMotionSelection before runCompute.

Parameters:
  • file_paths – Project files to process (.rsseismicfile). Duplicate paths are omitted.

  • motion_names – Motions to select for every project. When None, each project keeps its current selection or uses the first available motion.

  • parallel_degree – How many projects may run at once (cross-project only). Capped using maxConcurrentAnalyses from RSSeismic preferences when available.

  • max_concurrent_analyses – When set, applies this within-project engine cap for the batch via setMaxConcurrentAnalyses and restores the previous preference after the batch. When None, uses getMaxConcurrentAnalyses().

  • timeout – Optional RunCompute deadline in seconds for each project.

  • close_save_project – When True, save each project on close.

  • continue_on_error – When False, stop starting new jobs after the first failure (in-flight jobs may still finish).

Returns:

BatchComputeResult with per-file outcomes in input order.

close() None#

Close the gRPC connection.