DPF mesh.mesh_get_attribute error
Code:
from ansys.dpf import core as dpf dpf.__version__ mesh_attr_op = dpf.operators.mesh.mesh_get_attribute() '0.8.1'
Returns:
'0.8.1' --------------------------------------------------------------------------- KeyError Traceback (most recent call last) Cell In[8], line 1 ----> 1 mesh_attr_op = dpf.operators.mesh.mesh_get_attribute() 2 print(mesh_attr_op.inputs) 3 print(mesh_attr_op.outputs) File c:\users\e092220\.venv\3.9.6\pyansys-latest\lib\site-packages\ansys\dpf\core\operators\mesh\mesh_get_attribute.py:74, in mesh_get_attribute.__init__(self, abstract_meshed_region, property_name, property_identifier, config, server) 66 def __init__( 67 self, 68 abstract_meshed_region=None, (...) 72 server=None, 73 ): ---> 74 super().__init__(name="mesh::get_attribute", config=config, server=server) 75 self._inputs = InputsMeshGetAttribute(self) 76 self._outputs = OutputsMeshGetAttribute(self) File c:\users\e092220\.venv\3.9.6\pyansys-latest\lib\site-packages\ansys\dpf\core\dpf_operator.py:120, in Operator.__init__(self, name, config, server) 117 self._internal_obj = self._api.operator_new(self.name) 119 if self._internal_obj is None: --> 120 raise KeyError( 121 f"The operator {self.name} doesn't exist in the registry. " 122 f"Check its spelling in the documentation or verify its availability " 123 f"in your Context (Entry/Premium) and in your loaded plugins." 124 ) 126 self._spec = Specification(operator_name=self.name, server=self._server) 127 # add dynamic inputs KeyError: "The operator mesh::get_attribute doesn't exist in the registry. Check its spelling in the documentation or verify its availability in your Context (Entry/Premium) and in your loaded plugins."
On Windows, with ANSYS 2022R2 installed. Can you please explain what is going on here?
Answers
-
Hi @cvaero,
You are trying to use mesh.get_attribute operator on a DPF Server packaged with Ansys 2022R2.
Sadly, this operator and other "*get_attribute" operators are only available starting with the new DPF server 2023-2-pre1.
This operator is simply not available for this Ansys version.
We are working on setting a minimal required server version for operators in the documentation.
Of way of checking whether an operator is available is to use the operator documentation from the first PyDPF-Core release compatible with the 2022R2 Ansys version. If you check here, you can see it is ansys-dpf-core==0.5.0.
When looking in the corresponding operator documentation here, we can see that the "mesh::get_attribute" operator is not available.
0 -
I am wondering if you can update the DPF compatibility table to clearly state that new features in later DPF core versions will not work for older ANSYS server versions. The way it currently says that ANSYS 2022R2 is compatible with DPF core 0.5 or later hides that fact. It would also be useful if the error message thrown in this case was a bit more descriptive, and the documentation explicitly showed the DPF version at which a feature first became available.
https://dpf.docs.pyansys.com/version/stable/getting_started/compatibility.html
0