PathDescriptor#

class ansys.fluent.mcp.common.path_descriptor.PathDescriptor#

One-envelope description of a Fluent settings path.

Every field defaults to None / empty so a partially known path (e.g. schema-only, no live backend) still serializes cleanly. The invariant callers rely on: if a field is non-None it reflects a real live probe result — the composition path never fabricates defaults for missing information.

Callers must not compare with != for equality on inequal live snapshots — the frozen contract only guarantees value equality of the exact fields present. Use to_dict() for round-trip persistence.

Overview#

from_probe

Compose a descriptor from the four legacy probe payloads.

unknown

Return a descriptor that carries only the path (everything else None).

value_is_allowed

Return True/False if value is in the allowed set; None if unknown.

value_is_in_range

Return True/False if numeric value is within [min, max]; None if unknown.

to_dict

Return a JSON-safe dict of the descriptor.

is_parameter

True iff the path is a leaf value (writable via set).

is_group

True iff the path is a container of fields.

is_named_object

True iff the path is an indexed NamedObject collection.

is_command

True iff the path is a callable command.

is_bounded_enum

True iff this leaf accepts a bounded set of allowed values.

has_utl_alternate

True iff a UTL-mode sibling path exists for this setting.

Import detail#

from ansys.fluent.mcp.common.path_descriptor import PathDescriptor

Property detail#

property PathDescriptor.is_parameter: bool#

True iff the path is a leaf value (writable via set).

property PathDescriptor.is_group: bool#

True iff the path is a container of fields.

property PathDescriptor.is_named_object: bool#

True iff the path is an indexed NamedObject collection.

property PathDescriptor.is_command: bool#

True iff the path is a callable command.

property PathDescriptor.is_bounded_enum: bool#

True iff this leaf accepts a bounded set of allowed values.

property PathDescriptor.has_utl_alternate: bool#

True iff a UTL-mode sibling path exists for this setting.

Attribute detail#

PathDescriptor.path: str#
PathDescriptor.kind: str | None = None#
PathDescriptor.exists: bool | None = None#
PathDescriptor.is_active: bool | None = None#
PathDescriptor.is_user_creatable: bool | None = None#
PathDescriptor.is_read_only: bool | None = None#
PathDescriptor.child_class: str | None = None#
PathDescriptor.child_fields: tuple[str, Ellipsis] | None = None#
PathDescriptor.allowed_values: tuple[Any, Ellipsis] | None = None#
PathDescriptor.min_value: float | None = None#
PathDescriptor.max_value: float | None = None#
PathDescriptor.command_arguments: tuple[CommandArgument, Ellipsis] | None = None#
PathDescriptor.utl_alternate_path: str | None = None#
PathDescriptor.multiphase_alternate_path: str | None = None#
PathDescriptor.notes: tuple[str, Ellipsis] = ()#

Method detail#

PathDescriptor.value_is_allowed(value: Any) bool | None#

Return True/False if value is in the allowed set; None if unknown.

Comparison is exact for numerics/booleans and case-insensitive-strip for strings, matching Fluent’s settings-API tolerance on enum spellings.

PathDescriptor.value_is_in_range(value: Any) bool | None#

Return True/False if numeric value is within [min, max]; None if unknown.

PathDescriptor.to_dict() dict[str, Any]#

Return a JSON-safe dict of the descriptor.

classmethod PathDescriptor.from_probe(path: str, probe: Mapping[str, Any] | None = None, *, allowed_values: Iterable[Any] | None = None, template: Mapping[str, Any] | None = None, command_arguments: Mapping[str, Any] | None = None, utl_alternate_path: str | None = None, multiphase_alternate_path: str | None = None, notes: Iterable[str] | None = None) PathDescriptor#

Compose a descriptor from the four legacy probe payloads.

probe is the probe_path response ( {exists, is_active, is_user_creatable, kind}). allowed_values is the get_allowed_values response (None or a list). template is the describe_named_object_template response ({child_class, fields, is_active, is_user_creatable, create_command}). command_arguments is the get_command_arguments response ({argument_names, arguments}).

Every source is optional; missing sources leave the corresponding descriptor fields as None.

classmethod PathDescriptor.unknown(path: str) PathDescriptor#

Return a descriptor that carries only the path (everything else None).