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=...), andrun()returns an immutable result record with a commonstatus, evaluation count andsummary().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,SORMResultorSimulationResult. Records are immutable, share astatus,n_limit_state_evaluationsandsummary(), and convert to tables withto_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,SORMOptionsandSimulationOptions, which reject unknown or unused settings.Simulations take
rng, a seed or a NumPyGenerator, instead of using NumPy’s global random state, so a seeded run repeats exactly.Invalid input raises
ModelErrorand a failed analysis raisesAnalysisError. A nonconverged analysis raises unless you passon_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 asGumbel,FrechetandGEVMin. 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), andCorrelationMatrixis validated when it is created.LimitState.evaluateevaluates a point or a batch of rows directly; distributions exposeparametersandwith_parametersfor rebuilding them; and transformations name the direction of their Jacobians,jacobian_u_wrt_xandjacobian_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):
SystemFORMfor series and parallel systems of components, composition of k-of-n, cut-set and tie-set systems inpystra.systems, and Ditlevsen bounds.Copulas and joint distributions (Copulas and isoprobabilistic transformations):
JointDistributionwith 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
Calibrationclass.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,logsfandlogpdf, 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
AnalysisErrorinstead of becoming plausible probabilities. SORM, importance sampling and line sampling detect a stale FORM analysis, andMaximumandMaxParentcompute their moments deterministically.Corrections: finite differences no longer shift SORM’s gradient points; SORM handles design directions aligned with a coordinate axis; and
GEVMinis 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.