Skip to content

Commit e8f6fc5

Browse files
cbellot000PProfizi
andauthored
Wrong scripting name in ResultInfo (#2245)
* Wrong scripting name * retro --------- Co-authored-by: Paul Profizi <[email protected]>
1 parent eb9035f commit e8f6fc5

File tree

2 files changed

+13
-3
lines changed

2 files changed

+13
-3
lines changed

src/ansys/dpf/core/available_result.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -195,8 +195,8 @@ def __repr__(self):
195195
@property
196196
def name(self):
197197
"""Result operator."""
198-
if hasattr(self, "properties") and "scripting_name" in self._properties.keys():
199-
name = self.properties["scripting_name"]
198+
if self._properties and "scripting_name" in self._properties.keys():
199+
name = self._properties["scripting_name"]
200200
elif self.operator_name in _result_properties:
201201
name = _result_properties[self.operator_name]["scripting_name"]
202202
else:

tests/test_resultinfo.py

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
import pytest
2424

2525
from ansys import dpf
26-
from ansys.dpf.core import Model
26+
from ansys.dpf.core import Model, examples
2727
from conftest import (
2828
SERVERS_VERSION_GREATER_THAN_OR_EQUAL_TO_5_0,
2929
SERVERS_VERSION_GREATER_THAN_OR_EQUAL_TO_6_0,
@@ -303,3 +303,13 @@ def test_result_info_add_result(model):
303303
dimensions=None,
304304
description="description",
305305
)
306+
307+
308+
@pytest.mark.skipif(
309+
not SERVERS_VERSION_GREATER_THAN_OR_EQUAL_TO_8_0, reason="Available for servers >=8.0"
310+
)
311+
def test_scripting_name():
312+
model = Model(examples.download_all_kinds_of_complexity_modal())
313+
scripting_names = [res.name for res in model.metadata.result_info]
314+
assert "nmisc" in scripting_names
315+
assert "smisc" in scripting_names

0 commit comments

Comments
 (0)