Skip to content

Python API — Static Inputs

Use StaticInputsAdapter when you want to supply all inputs directly in Python, without an Excel file.

Default values are provided for every parameter, so you only need to specify what differs from the baseline.

Prerequisites

  • The package is installed inside an active virtual environment.
  • No master sheet is required for this method.

Example

python
from haskoning_retaining_wall.constants import FactorCase, Metric
from haskoning_retaining_wall.domain.models import Water, Friction, Seismic, LoadCase
from haskoning_retaining_wall.inputs import StaticInputsAdapter
from haskoning_retaining_wall.services import RetainingWallAnalysis

# 1. Build the adapter — supply only what you want to override
adapter = StaticInputsAdapter(
    project_name="MyProject",
    water=Water(landward=1.17, seaward=0.17, w_density=10.055),
    friction=Friction(block=0.6, foundation=0.7),
    seismic=Seismic(Kh=0.12, Kv=-0.048),
    factor_cases=[FactorCase.SLS, FactorCase.DA1C1, FactorCase.DA1C2],
    load_cases=[
        LoadCase(
            name="Load_Case_1",
            uniform=0, point=0, line=0, patch=0, strip=0,
            stacked_surcharge_horizontal=0,
            stacked_surcharge_vertical=0,
        )
    ],
)

# 2. Run the analysis
analysis = RetainingWallAnalysis(
    metric=Metric.FOS,
    inputs=adapter.to_inputs(),
)

analysis.run_cases()

As with the other methods, output files are written to an outputs/ folder relative to the current working directory.

StaticInputsAdapter parameters

All constructor arguments are optional keyword arguments; anything left out falls back to the default shown below.

ParameterTypeDescriptionDefault
project_namestrProject name, used in output filenamesNone
project_numberstrProject numberNone
factor_caseslist[FactorCase]Factor cases to runSLS, EQU, DA1C1, DA1C2, SEISMIC
load_caseslist[LoadCase]Load cases to runLoad_Case_1 (all zeros)
waterWaterWater levels and densitylandward=1.17, seaward=0.17
soilslist[Soil]Soil layersbuilt-in defaults, derived from blocks
frictionFrictionBlock-to-block and block-to-soil frictionblock=0.6, foundation=0.7
seismicSeismicSeismic coefficientsKh=0.12, Kv=-0.048
blockslist[CalculationBlock]Block geometrybuilt-in defaults
concreteConcreteConcrete reduction factorsreduction_lifting=1.25, reduction_gaps=0.5
bollardsBollardBollard load configurationbuilt-in defaults
anchorsAnchorAnchor configurationbuilt-in defaults
surchargeSurchargeSurcharge loadbuilt-in defaults
stacked_surchargeStackedSurchargeStacked surcharge loadbuilt-in defaults

StaticInputsAdapter always produces a single, unnamed section, built from blocks, soils, load_cases, bollards, water, surcharge and stacked_surcharge.

When to use this instead of the master sheet

Prefer StaticInputsAdapter when:

  • You want to run the analysis as part of an automated script or test, without maintaining an Excel file.
  • You are exploring parameter sensitivity by running many variations programmatically.
  • You only need to override a handful of parameters and are comfortable with the built-in defaults for the rest.

If you already maintain a master sheet and only need occasional overrides, use Python API — Excel master sheet instead.