Specification#

class ansys.dpf.core.operator_specification.Specification(operator_name: str | None = None, specification: Specification | None = None, server: ansys.dpf.core.server.BaseServer | None = None)#

Bases: SpecificationBase

Documents an Operator with its description (what the Operator does), its inputs and outputs and some properties.

Examples

Get the Specification of an operator by its name >>> from ansys.dpf import core as dpf >>> spec = dpf.operator_specification.Specification(“U”) >>> # or >>> spec = dpf.Operator.operator_specification(“U”)

Get the specification of an instantiated operator >>> from ansys.dpf import core as dpf >>> operator = dpf.operators.result.displacement() >>> spec = operator.specification

Display the Specification attributes >>> spec.description ‘Read/compute nodal displacements by calling the readers defined by the datasources.’ >>> 4 in spec.inputs.keys() True >>> spec.outputs.keys() dict_keys([0]) >>> spec.inputs[4].document ‘result file path container, used if no streams are set’

Overview#

properties

Additional properties of the Operator.

description

Returns a description of the operation applied by the Operator.

inputs

Returns a dictionary mapping the input pin numbers to their PinSpecification.

outputs

Returns a dictionary mapping the output pin numbers to their PinSpecification.

config_specification

Documents the available configuration options supported by the Operator.

__str__

Provide more details in the string representation of the instance.

Import detail#

from ansys.dpf.core.operator_specification import Specification

Property detail#

property Specification.properties: dict#

Additional properties of the Operator.

Some additional properties of the Operator, like the category, the exposure, the scripting and user names, and the plugin

Examples

>>> from ansys.dpf import core as dpf
>>> operator = dpf.operators.math.add()
>>> operator.specification.properties
{'category': 'math', 'exposure': 'public', 'plugin': 'core', 'user_name': '+'}
property Specification.description: str#

Returns a description of the operation applied by the Operator.

Return type:

str

Examples

>>> from ansys.dpf import core as dpf
>>> operator = dpf.operators.math.scale()
>>> operator.specification.description
'Scales a field by a constant factor...'
property Specification.inputs: dict#

Returns a dictionary mapping the input pin numbers to their PinSpecification.

Returns:

inputs

Return type:

dict[int:PinSpecification]

Examples

>>> from ansys.dpf import core as dpf
>>> operator = dpf.operators.mesh.mesh_provider()
>>> 4 in operator.specification.inputs.keys()
True
>>> operator.specification.inputs[4]
PinSpecification(name='data_sources', _type_names=['data_sources'], ...set', ellipsis=False,
 name_derived_class='')
property Specification.outputs: dict#

Returns a dictionary mapping the output pin numbers to their PinSpecification.

Returns:

outputs

Return type:

dict[int:PinSpecification]

Examples

>>> from ansys.dpf import core as dpf
>>> operator = dpf.operators.mesh.mesh_provider()
>>> operator.specification.outputs
{0: PinSpecification(name='mesh', _type_names=['abstract_meshed_region'], ...=False,
 name_derived_class='')}
property Specification.config_specification: ConfigSpecification#

Documents the available configuration options supported by the Operator.

Return type:

ConfigSpecification

Attribute detail#

Specification.operator_name#

Method detail#

Specification.__str__()#

Provide more details in the string representation of the instance.