FlowsheetSpec

class flexcore.config.spec.FlowsheetSpec(*, schema_version: Annotated[str, _PydanticGeneralMetadata(pattern='^\\d+\\.\\d+\\.\\d+$')], name: str, solver: str | None = None, elements: list[Annotated[TimeElement | PropertyPackageElement | CostingElement | NetworkElement | PlantElement | SetElement | UnitElement | SurrogateElement | RampElement | StatusElement | StartupShutdownElement | DwellElement | BypassElement | StartupDelayElement | ConditionalElement | ParallelGroupElement | DegradationElement | DispatchElement | FixElement | UnfixElement | ExtensionElement | ObjectiveElement, FieldInfo(annotation=NoneType, required=True, discriminator='kind')]], fix_on_violation: Literal['error', 'warn', 'skip'] = 'error', fix_tolerance: Annotated[float, Ge(ge=0)] = 1e-09)

A flowsheet as a flat list of elements, in any order.

model_config = {'extra': 'forbid'}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

model_post_init(context: Any, /) → None

This function is meant to behave like a BaseModel method to initialize private attributes.

It takes context as an argument since that’s what pydantic-core passes when calling it.

Parameters:
  • self – The BaseModel instance.

  • context – The context.

of_kind(*kinds: str) → list

Return the elements of the given kinds, in file order.