What’s new in PySTRA 2.0#

PySTRA 2.0 is a new major version. It gives every analysis one consistent interface, adds reliability methods and engineering workflows, and keeps its numerics accurate far into the tails. It is not compatible with 1.x: Migrating from 1.x to 2.0 shows how to update a script, and python -m pystra.migrate makes the unambiguous changes for you.

Highlights#

  • One consistent interface. Analyses take (model, limit_state, *, options=...), and run() returns an immutable result record with a common status, evaluation count and summary().

  • More methods. Active learning with Kriging, sparse PCE and PC-Kriging surrogates; system reliability; explicit copulas; and the Strong Maximum Test, alongside FORM, SORM and the simulation methods.

  • Engineering workflows. Code calibration with normalized reliability, load combinations, and design-decision and target-reliability studies.

  • Accurate at high reliability. Tail probabilities are evaluated where they are small, and in log space where they underflow, so transformations and estimators stay accurate at very large reliability indices.

A consistent interface#

  • Every analysis returns a result record, such as FORMResult, SORMResult or SimulationResult. Records are immutable, share a status, n_limit_state_evaluations and summary(), and convert to tables with to_dataframe(). FORM records give convergence diagnostics and the design point in physical and standard normal coordinates. See Interpreting results and convergence.

  • Settings are frozen, validated options objects, FORMOptions, SORMOptions and SimulationOptions, which reject unknown or unused settings.

  • Simulations take rng, a seed or a NumPy Generator, instead of using NumPy’s global random state, so a seeded run repeats exactly.

  • Invalid input raises ModelError and a failed analysis raises AnalysisError. A nonconverged analysis raises unless you pass on_failure="return", which returns its record instead.

  • Names follow PEP 8, with acronyms capitalized in class names: FORM, SORM, SystemFORM. Extreme-value distributions are named by family, such as Gumbel, Frechet and GEVMin. The top-level namespace is curated, and old names raise errors that name their replacements.

  • Distributions take native parameters as keywords, as in Gumbel("Q", loc=8.9, scale=1.56), and CorrelationMatrix is validated when it is created.

  • LimitState.evaluate evaluates a point or a batch of rows directly; distributions expose parameters and with_parameters for rebuilding them; and transformations name the direction of their Jacobians, jacobian_u_wrt_x and jacobian_x_wrt_u.

New methods#

  • Active learning (Active-learning methods and literature): Kriging with U and EFF learning, adaptive sparse bootstrap PCE, sequential PC-Kriging, bootstrap voting and active Gaussian-mixture importance sampling, with independent final sampling, convergence diagnostics and UQLab comparisons.

  • System reliability (System reliability): SystemFORM for series and parallel systems of components, composition of k-of-n, cut-set and tie-set systems in pystra.systems, and Ditlevsen bounds.

  • Copulas and joint distributions (Copulas and isoprobabilistic transformations): JointDistribution with Gaussian, Student-t, independent and Frank copulas, with Rosenblatt and generalized Nataf transformations, including FORM in Student-t space.

  • Strong Maximum Test (Strong Maximum Test): a post-FORM check for competing design points.

Engineering workflows#

  • Code calibration (Calibrating code factors): target solving, factor derivation, selection, design and verification as explicit operations with normalized reliability, replacing the stateful Calibration class.

  • Assessment (Comparing structural assessment scenarios) and load combinations with explicit cases and roles.

  • Decisions: design-decision optimization, the life quality index, societal willingness to pay and target reliability, in pystra.decision.

  • Plotting (Reliability figures): helpers for common reliability figures.

Numerical accuracy#

  • High reliability (Working at high reliability): every distribution provides sf, isf, logcdf, logsf and logpdf, and the transformations evaluate each tail where its probability is small. SORM, importance sampling and line sampling keep a finite reliability index when the probability underflows.

  • Robust runs: nonfinite limit-state values and failing external solvers raise AnalysisError instead of becoming plausible probabilities. SORM, importance sampling and line sampling detect a stale FORM analysis, and Maximum and MaxParent compute their moments deterministically.

  • Corrections: finite differences no longer shift SORM’s gradient points; SORM handles design directions aligned with a coordinate axis; and GEVMin is the correct reflection of the GEV. The Changelog lists every correction whose results change.

Performance#

On the fixed benchmark cases in the performance evidence, FORM is 12–37% faster than in 1.6.0 and SORM 17% faster, with the same number of limit-state evaluations, and crude Monte Carlo and importance sampling process more than six times as many samples per second. These benchmarks use inexpensive limit states; when an external solver dominates the cost, the difference is smaller.

Documentation#

The documentation has a user guide organized by task, 22 executed tutorials, including an external finite-element solver with OpenSeesPy, published benchmark problems with their references, theory pages for each topic, and guides to the extreme-value families (Choosing an extreme-value distribution) and to sensitivity analysis (Computing reliability sensitivities).

Requirements#

Python 3.12 or later, NumPy 1.26 or later, SciPy 1.11.2 or later, pandas 2.1.1 or later and Matplotlib 3.8 or later. The active-learning methods need the al extra (scikit-learn 1.3.1 or later); see Installation. PySTRA is tested on Linux, Windows and macOS with Python 3.12 to 3.14, and with the oldest supported dependencies.