Appearance
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.
| Parameter | Type | Description | Default |
|---|---|---|---|
project_name | str | Project name, used in output filenames | None |
project_number | str | Project number | None |
factor_cases | list[FactorCase] | Factor cases to run | SLS, EQU, DA1C1, DA1C2, SEISMIC |
load_cases | list[LoadCase] | Load cases to run | Load_Case_1 (all zeros) |
water | Water | Water levels and density | landward=1.17, seaward=0.17 |
soils | list[Soil] | Soil layers | built-in defaults, derived from blocks |
friction | Friction | Block-to-block and block-to-soil friction | block=0.6, foundation=0.7 |
seismic | Seismic | Seismic coefficients | Kh=0.12, Kv=-0.048 |
blocks | list[CalculationBlock] | Block geometry | built-in defaults |
concrete | Concrete | Concrete reduction factors | reduction_lifting=1.25, reduction_gaps=0.5 |
bollards | Bollard | Bollard load configuration | built-in defaults |
anchors | Anchor | Anchor configuration | built-in defaults |
surcharge | Surcharge | Surcharge load | built-in defaults |
stacked_surcharge | StackedSurcharge | Stacked surcharge load | built-in defaults |
StaticInputsAdapteralways produces a single, unnamed section, built fromblocks,soils,load_cases,bollards,water,surchargeandstacked_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.