API Reference

API Reference

API Reference

This page is the API entry point for UQPyL.

Use it when you know what object you need, but not which module page contains it. For tutorials and workflows, start from Quick Start or Examples.

Module Pages

ModuleAPI pageMain purpose
UQPyL.problemProblem APIModeling protocol, input spaces, evaluation results, decorators, and benchmark problems.
UQPyL.doeDesign of Experiment APISampling classes, design metadata, and analysis-specific designs.
UQPyL.analysisAnalysis APISensitivity analysis methods, metrics, result objects, and saved-result reader.
UQPyL.optimizationOptimization APISingle-objective, multi-objective, and expensive optimization APIs.
UQPyL.inferenceInference APIMCMC-style inference methods, chain results, and saved-run reader.
UQPyL.calibrationCalibration APICalibration methods, metric handling, result objects, and saved-run reader.
UQPyL.surrogateSurrogate APISurrogate models, scaling, splitting, metrics, uncertainty output, and tuning.

Common Workflow Protocols

Most public APIs follow one of these patterns.

WorkflowCall patternReturn
Problem evaluationproblem.evaluate(X)Eval
Samplingsampler.sample(problem, nSamples=..., seed=...)np.ndarray
Sampling with metadatasampler.sampleWithMeta(problem, ...)(X, meta)
Analysismethod.analyze(problem, X, Y=..., meta=...)AnaResult
Optimizationalgorithm.run(problem, seed=...)OptResult
Inferencemethod.run(problem, gamma=..., seed=...)InfResult
Calibrationmethod.run(modelProblem, ...)CalResult
Surrogate trainingmodel.fit(X, Y)fitted model
Surrogate predictionmodel.predict(Xnew)np.ndarray or (mean, std/var)

Core Data Objects

ObjectWhereRole
ProblemProblem APIDefines objectives, constraints, bounds, labels, and variable types.
ModelProblemProblem APIDefines simulation models with observations, masks, and simulation context.
EvalProblem APIStandard return object from evaluate().
AnaResultAnalysis APISensitivity-analysis result.
OptResultOptimization APIOptimization result.
InfResultInference APIInference chain result.
CalResultCalibration APICalibration result.

Problem.evaluate() returns an Eval object, not a dictionary. Use:

python
res = problem.evaluate(X)
objs = res.objs
cons = res.cons
sim = res.sim

Saved Result Readers

Runtime methods can save sqlite results when saveFlag=True.

ModuleReaderTypical import
AnalysisAnaReaderfrom UQPyL.analysis.runtime import AnaReader
OptimizationOptReaderfrom UQPyL.optimization.runtime import OptReader
InferenceInfReaderfrom UQPyL.inference import InfReader
CalibrationCalReaderfrom UQPyL.calibration import CalReader

Typical reader pattern:

python
with Reader("Result/example.sqlite3") as reader:
    summary = reader.get_run_summary()
    result = reader.load_result()

The exact reader class and available methods are documented on each module API page.

Runtime Controls

Runnable analysis, optimization, inference, and calibration methods commonly accept:

OptionMeaning
verboseFlagPrint runtime progress or final summaries.
verboseFreqProgress print interval where supported.
logFlagWrite text logs where supported.
saveFlagSave structured sqlite output where supported.
saveFreqSnapshot interval where supported.

For quick examples, set verboseFlag=False, logFlag=False, and saveFlag=False. For reproducible runs, pass an explicit seed to sample(), analyze(), or run() when the method supports it.

Import Cheat Sheet

NeedImport
Define ordinary problemsfrom UQPyL.problem import Problem
Define simulation problemsfrom UQPyL.problem import ModelProblem
Generate LHS samplesfrom UQPyL.doe import LHS
Run free-design sensitivity analysisfrom UQPyL.analysis import RBDFAST
Run single-objective optimizationfrom UQPyL.optimization.soea import GA
Run multi-objective optimizationfrom UQPyL.optimization.moea import NSGAII
Run MCMC inferencefrom UQPyL.inference import MH
Run GLUE calibrationfrom UQPyL.calibration import GLUE
Train an RBF surrogatefrom UQPyL.surrogate.rbf import RBF

Naming Notes

NameNote
objsObjective matrix, usually shape (n_samples, n_obj).
consConstraint matrix. Values <= 0 are feasible.
decsDecision/input matrix or sampled decision chains, depending on result object.
sims / simSimulation output from ModelProblem; shape is usually (n_samples, n_time, n_series).
bestDecsBest decision row or Pareto decision matrix, depending on method type.
bestObjsObjective value(s) associated with bestDecs.

Scope Status

All current core API modules are listed on this page. Module-specific parameters, fields, and reader methods live in the split API pages above.