rsseismic package#

class rsseismic.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.

class rsseismic.BatchComputeJobResult(file_path: str, success: bool, partial_success: bool, error_message: str, motion_names: tuple[str, ...] = ())#

Bases: object

Outcome of compute for one project in a batch.

file_path: str#
success: bool#
partial_success: bool#
error_message: str#
motion_names: tuple[str, ...] = ()#
class rsseismic.BatchComputeResult(results: list[BatchComputeJobResult], requested_parallel_degree: int, effective_parallel_degree: int)#

Bases: object

Aggregate outcome of runBatchCompute.

results: list[BatchComputeJobResult]#
requested_parallel_degree: int#
effective_parallel_degree: int#
property ok: bool#

True when every job completed with full success (no partial failures).

class rsseismic.Model(client: Client, modelId: str)#

Bases: _ProxyObject

Handle for an open RSSeismic project.

Obtain a Model from RSSeismicApplication.openFile(path) or RSSeismicApplication.newProject().

Use the attributes on this object to work with project data: Profiles, Motions, Results, MeanProfile, ProjectSettings, ProfileGenerationSettings, and SoilLayers.

property modelId: str#
save() None#

Save the project to its current file path.

saveAs(filePath: str) None#

Save the project to a new file path.

close(saveProject: bool = False) None#

Close the project in RSSeismic.

When saveProject is True, the project is saved before it is closed.

runCompute(timeout: float | None = None) RunComputeResult#

Run analysis for all selected profile and motion combinations.

Returns a RunComputeResult. Check result.ok for full success. When partialSuccess is True, some pairs completed but others failed; see errorMessage for details.

Optional timeout is the maximum wait time in seconds for long runs. When omitted, the call waits until compute finishes.

clearResults() None#

Remove stored analysis results from the project.

resetGeneratedProfiles() ResetGeneratedProfilesResult#

Clear the generated-profiles state so profiles can be generated again.

Does not remove profiles already in the project. Requires automatic profile generation to be enabled in project settings.

generateProfiles(seed: int = 0, timeout: float | None = None) GenerateProfilesResult#

Create individual profiles from the mean profile template.

Validates model.MeanProfile first, then replaces the profiles in the project with the newly generated set. Configure how many profiles to create with model.ProfileGenerationSettings before calling this method.

When seed is 0, RSSeismic chooses a random seed. Use a fixed seed to reproduce the same generated profiles.

Optional timeout is the maximum wait time in seconds. When omitted, the call waits until generation finishes.

Raises:

ScriptingError – Validation failed or generation could not complete.

class rsseismic.RunComputeResult(success: bool, partialSuccess: bool, errorMessage: str)#

Bases: object

Outcome of Model.runCompute().

success: bool#
partialSuccess: bool#
errorMessage: str#
property ok: bool#

True when every selected profile and motion pair completed successfully.

class rsseismic.Results(client: Client, modelId: str)#

Bases: _ProxyObject

Query computed analysis results for an open project.

Access via model.Results. After model.runCompute(), use listResultDatabases or listResultMotions() to discover valid profile and motion names, then fetch tabular data as pandas DataFrame objects.

Use getResultDatabasePath to see which result files exist for a profile/motion pair before calling specialized queries (strain convergence, displacement animation, etc.).

getResultsRoot() str#

Return the folder where RSSeismic stores computed results for this project.

listResultDatabases(profileName: str = '', onlyExisting: bool = False) list[ResultDatabaseInfo]#

List profile/motion pairs and their result file paths.

When profileName is empty, entries for all profiles are returned. When onlyExisting is True, only pairs whose main result database file exists on disk are included.

Use the motionName values from these entries (or from listResultMotions) when calling result DataFrame methods — they may differ from names shown in the Motion view, especially for complementary analyses.

getResultDatabasePath(profileName: str, motionName: str) ResultDatabaseInfo#

Return result file paths and availability flags for one profile and motion.

motionName must be a compute-aligned name from listResultDatabases or listResultMotions after runCompute(). Check fields such as resultDatabaseExists, strainConvergenceExists, and deconvolutionBedrockMotionExists before calling related DataFrame methods.

listResultMotions() list[ResultMotionSummary]#

List motion names available for result queries after compute.

Includes complementary motions when project settings add them (for example ChiChi-EL derived from selected motion ChiChi). Prefer these names over Motion-view labels when fetching results.

listResultLayers(profileName: str) list[ResultLayerSummary]#

List layers that can be used with layer-scoped result queries for a profile.

Includes soil layers with result output enabled and the top-of-rock layer when bedrock output is configured.

getTopOfRockLayerId(profileName: str) str#

Return the layer ID to use for top-of-rock result queries on a profile.

Raises ValueError when top of rock output is not available in listResultLayers(profileName).

getLayerTimeHistoryDataFrame(profileName: str, motionName: str, layerID: str) pandas.DataFrame#

Return layer time-history results as a pandas DataFrame.

Columns typically include time, acceleration, velocity, and related series for the given layer. For finite-element analysis, effective vertical stress may also be included.

motionName must be compute-aligned. layerID comes from listResultLayers(profileName) or listSoilLayers() on the same profile. Column units are in dataframe.attrs["column_units"] when available.

getProfileResultsDataFrame(profileName: str, motionName: str) pandas.DataFrame#

Return profile-level summary results as a pandas DataFrame.

Provides depth-based summary columns for the profile (for example maximum strain by layer). Not available for deconvolution profiles — use layer-scoped methods instead.

motionName must be compute-aligned after runCompute().

getResultSeriesDataFrame(profileName: str, motionName: str, kind: ResultSeriesKind, layerID: str = '') pandas.DataFrame#

Return one result chart series as a pandas DataFrame.

Pass a ResultSeriesKind value for kind (for example MAX_STRAIN, PGA, ACCELERATION). When kind.requires_layer is True, layerID is required — use listResultLayers(profileName) to obtain valid IDs.

motionName must be compute-aligned after runCompute().

getStrainConvergenceDataFrame(profileName: str, motionName: str) pandas.DataFrame#

Return equivalent-linear strain convergence data as a pandas DataFrame.

Table columns show iteration and per-layer strain values. Requires equivalent-linear analysis and a computed strain-convergence file for the motion. Check getResultDatabasePath(...).strainConvergenceExists before calling.

For complementary equivalent-linear runs, pass the complementary motion name (for example ChiChi-EL).

getRealTimeDisplacementDataFrame(profileName: str, motionName: str) pandas.DataFrame#

Return real-time relative displacement at each layer as a pandas DataFrame.

Requires the displacement animation option enabled in project settings and a standard result database for the motion.

getAllStrainConvergenceDataFrames(profileName: str, *, skipErrors: bool = True) dict[str, pandas.DataFrame]#

Fetch strain convergence DataFrames for all motions on the Check convergence tab.

Uses the same motion list as that tab in the RSSeismic UI: primary equivalent-linear motions, plus complementary EL motions when that option is enabled. Each entry is loaded via getStrainConvergenceDataFrame.

When skipErrors is True (default), motions without convergence data are skipped instead of raising an error.

getAllRealTimeDisplacementDataFrames(profileName: str, *, skipErrors: bool = True) dict[str, pandas.DataFrame]#

Fetch real-time displacement DataFrames for all result motions on a profile.

Uses the same motion list as the displacement animation tab. Requires the displacement animation project setting. When skipErrors is True (default), motions without data are skipped instead of raising an error.

getAllResultSeriesDataFrames(profileName: str, kind: ResultSeriesKind, motionTypeFilters: Sequence[ResultMotionType] | None = None, layerIds: Sequence[str] | None = None, *, skipErrors: bool = True) dict[str, pandas.DataFrame] | dict[tuple[str, str], pandas.DataFrame]#

Fetch one result series kind for many motions (and layers when required).

Returns a dict keyed by motion name for profile-level series, or by (motion_name, layer_id) when kind.requires_layer is True.

motionTypeFilters limits which motion variants are included (standard, complementary equivalent-linear, complementary nonlinear total stress). Pass None or an empty sequence to include all types.

layerIds limits layer-scoped series. When omitted or empty and kind requires a layer, all layers from listResultLayers(profileName) are used.

When skipErrors is True (default), missing combinations are skipped instead of raising an error.

class rsseismic.DynamicsPoint(strain: float, ggmax: float, damping: float, strength: float)#

Bases: object

Dynamics curve point (strain, G/Gmax, damping, strength).

strain: float#
ggmax: float#
damping: float#
strength: float#
class rsseismic.DiscretePoint(strain: float, ggmax: float, damping: float)#

Bases: object

Discrete curve point for Points soil model (strain, G/Gmax, damping).

strain: float#
ggmax: float#
damping: float#
class rsseismic.ProfileSummary(name: str, isActive: bool, layerCount: int, totalThickness: float)#

Bases: object

Summary of a profile in the project.

name: str#
isActive: bool#
layerCount: int#
totalThickness: float#
class rsseismic.ActiveProfile(profileName: str, layerCount: int, totalThickness: float)#

Bases: object

Summary of the active profile.

profileName: str#
layerCount: int#
totalThickness: float#
class rsseismic.SoilLayerSummary(layerID: str, index1Based: int, name: str, thickness: float)#

Bases: object

Summary of a soil layer in a profile.

layerID: str#
index1Based: int#
name: str#
thickness: float#
class rsseismic.BedrockLayerSummary(layerID: str, name: str, thickness: float)#

Bases: object

Summary of the bedrock layer in a profile.

layerID: str#
name: str#
thickness: float#
class rsseismic.DeleteProfileResult(deletedProfileName: str, activeProfileName: str)#

Bases: object

Result of Profiles.deleteProfile().

deletedProfileName: str#
activeProfileName: str#
class rsseismic.MotionInfo(name: str, filePath: str, isSelected: bool)#

Bases: object

Ground motion entry for a project.

name: str#
filePath: str#
isSelected: bool#
class rsseismic.MotionPairInfo(pairId: str, motionH1Name: str, motionH2Name: str, motionH1FilePath: str, motionH2FilePath: str, isSelected: bool)#

Bases: object

Horizontal motion pair inferred from motion file naming.

pairId: str#
motionH1Name: str#
motionH2Name: str#
motionH1FilePath: str#
motionH2FilePath: str#
isSelected: bool#
class rsseismic.ResultDatabaseInfo(profileName: str, motionName: str, motionType: str, resultsFolderPath: str, resultDatabasePath: str, resultDatabaseExists: bool, complementaryResultDatabasePath: str, complementaryResultDatabaseExists: bool, inputFilePath: str, inputFileExists: bool, strainConvergencePath: str, strainConvergenceExists: bool, strainNonConvergenceIdPath: str, strainNonConvergenceExists: bool, deconvolutionBedrockMotionPath: str, deconvolutionBedrockMotionExists: bool, deconvolutionBedrockFasTransferFunctionPath: str, deconvolutionBedrockFasTransferFunctionExists: bool, deconvolutionLayerFiles: tuple[DeconvolutionLayerResultFiles, ...], topOfRockOutputEnabled: bool = False, topOfRockLayerID: str = '', topOfRockLayerIndex1Based: int = 0)#

Bases: object

Computed result file paths for one profile/motion pair.

profileName: str#
motionName: str#
motionType: str#
resultsFolderPath: str#
resultDatabasePath: str#
resultDatabaseExists: bool#
complementaryResultDatabasePath: str#
complementaryResultDatabaseExists: bool#
inputFilePath: str#
inputFileExists: bool#
strainConvergencePath: str#
strainConvergenceExists: bool#
strainNonConvergenceIdPath: str#
strainNonConvergenceExists: bool#
deconvolutionBedrockMotionPath: str#
deconvolutionBedrockMotionExists: bool#
deconvolutionBedrockFasTransferFunctionPath: str#
deconvolutionBedrockFasTransferFunctionExists: bool#
deconvolutionLayerFiles: tuple[DeconvolutionLayerResultFiles, ...]#
topOfRockOutputEnabled: bool = False#
topOfRockLayerID: str = ''#
topOfRockLayerIndex1Based: int = 0#
class rsseismic.ResultLayerSummary(layerID: str, index1Based: int, name: str, isTopOfRock: bool)#

Bases: object

A profile layer that can be used with layer-scoped result queries.

layerID: str#
index1Based: int#
name: str#
isTopOfRock: bool#
class rsseismic.ResultMotionSummary(motionName: str, motionType: str, sourceMotionName: str)#

Bases: object

A motion name in the compute-aligned result motion set.

motionName: str#
motionType: str#
sourceMotionName: str#
class rsseismic.ResultMotionType(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)#

Bases: IntEnum

Motion variants in the compute-aligned result motion set.

STANDARD = 1#
COMPLEMENTARY_EQUIVALENT_LINEAR = 2#
COMPLEMENTARY_NONLINEAR_TOTAL_STRESS_LUMPED_MASS = 3#
class rsseismic.ResultSeriesKind(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)#

Bases: IntEnum

Chart series available from computed profile results.

ACCELERATION = 1#
VELOCITY = 2#
DISPLACEMENT = 3#
ARIAS = 4#
SHEAR_STRAIN = 5#
SHEAR_STRESS_RATIO = 6#
PWP_RATIO = 7#
RESPONSE_SPECTRA = 8#
FAS = 9#
FAS_RATIO = 10#
PGA = 11#
PGD = 12#
MAX_STRAIN = 13#
MAX_STRESS = 14#
MAX_PWP_RATIO = 15#
EFFECTIVE_STRESS = 16#
MOBILIZED_STRESS = 17#
NORMALIZED_STRESS = 18#
MOBILIZED_FRICTION_ANGLE = 19#
EFFECTIVE_VERTICAL_STRESS = 20#
property requires_layer: bool#

True when getResultSeriesDataFrame requires a layerID.

class rsseismic.InsertLayerResult(profileName: str, layerID: str, index1Based: int)#

Bases: object

Result of inserting or duplicating a soil layer.

profileName: str#
layerID: str#
index1Based: int#
class rsseismic.AppendLayersResult(profileName: str, layerIDs: tuple[str, ...])#

Bases: object

Result of appending one or more soil layers.

profileName: str#
layerIDs: tuple[str, ...]#
class rsseismic.DeleteLayerResult(profileName: str, deletedLayerID: str)#

Bases: object

Result of deleting a soil layer.

profileName: str#
deletedLayerID: str#
class rsseismic.MoveLayerResult(profileName: str, layerID: str, index1Based: int)#

Bases: object

Result of moving a soil layer.

profileName: str#
layerID: str#
index1Based: int#
class rsseismic.MeanProfileSummary(profileName: str, layerCount: int, totalThickness: float)#

Bases: object

Summary of the mean (representative) profile.

profileName: str#
layerCount: int#
totalThickness: float#
class rsseismic.MeanProfileInsertLayerResult(layerID: str, index1Based: int)#

Bases: object

Result of inserting or duplicating a mean-profile soil layer.

layerID: str#
index1Based: int#
class rsseismic.MeanProfileAppendLayersResult(layerIDs: tuple[str, ...])#

Bases: object

Result of appending one or more mean-profile soil layers.

layerIDs: tuple[str, ...]#
class rsseismic.MeanProfileDeleteLayerResult(deletedLayerID: str)#

Bases: object

Result of deleting a mean-profile soil layer.

deletedLayerID: str#
class rsseismic.MeanProfileMoveLayerResult(layerID: str, index1Based: int)#

Bases: object

Result of moving a mean-profile soil layer.

layerID: str#
index1Based: int#
class rsseismic.GqHFittingLimits(enableModulusMin: bool = False, modulusMin: float = 0.0, enableModulusMax: bool = False, modulusMax: float = 0.0, enableStrengthMin: bool = False, strengthMin: float = 0.0, enableDampMin: bool = False, dampMin: float = 0.0, enableDampMax: bool = False, dampMax: float = 0.0, enableFixTheta3: bool = False, fixTheta3: float = 0.0)#

Bases: object

Optional G/Gmax and damping limits for curve fitting.

enableModulusMin: bool = False#
modulusMin: float = 0.0#
enableModulusMax: bool = False#
modulusMax: float = 0.0#
enableStrengthMin: bool = False#
strengthMin: float = 0.0#
enableDampMin: bool = False#
dampMin: float = 0.0#
enableDampMax: bool = False#
dampMax: float = 0.0#
enableFixTheta3: bool = False#
fixTheta3: float = 0.0#
class rsseismic.UnitSystem(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)#

Bases: Enum

Project unit system (maps to server isMetric / useMetric RPC flags).

Metric = 'Metric'#
Imperial = 'Imperial'#
to_use_metric() bool#

Return the useMetric / isMetric flag sent on the wire.

classmethod from_is_metric(is_metric: bool) UnitSystem#