Skip to content

Result classes

Returned from various Project methods. All are plain dataclasses.

cfdtwin.SimulationResult

cfdtwin.results.SimulationResult dataclass

Summary of a Project.run_simulations(...) call.

cfdtwin.TrainingResult

cfdtwin.results.TrainingResult dataclass

Summary of a Project.train(...) call.

best_model

best_model() -> ModelInfo | None

Return the sub-model with the highest test R². None if no models.

cfdtwin.PredictionResult

cfdtwin.results.PredictionResult dataclass

Output of Project.predict(...).

values is shape (n_samples, n_points)n_points == 1 for 1D scalars, larger for 2D/3D field models. coordinates is (n_points, 3) for fields or None for scalars.

cfdtwin.ModelInfo

cfdtwin.results.ModelInfo dataclass

Static info about a single trained sub-model.

A Project.train(...) call can produce several of these — one per (output_location, field_variable) pair the trainer consumed. Returned by Project.model_info(name) and as elements of TrainingResult.models.

from_metadata classmethod

from_metadata(meta: dict) -> ModelInfo

Build from the JSON dict the trainer writes to *_metadata.json.

cfdtwin.Metrics

cfdtwin.results.Metrics dataclass

Numeric quality metrics for one trained sub-model.