Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/ansys/dpf/core/available_result.py
Original file line number Diff line number Diff line change
Expand Up @@ -195,8 +195,8 @@ def __repr__(self):
@property
def name(self):
"""Result operator."""
if hasattr(self, "properties") and "scripting_name" in self._properties.keys():
name = self.properties["scripting_name"]
if self._properties and "scripting_name" in self._properties.keys():
name = self._properties["scripting_name"]
elif self.operator_name in _result_properties:
name = _result_properties[self.operator_name]["scripting_name"]
else:
Expand Down
12 changes: 11 additions & 1 deletion tests/test_resultinfo.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
import pytest

from ansys import dpf
from ansys.dpf.core import Model
from ansys.dpf.core import Model, examples
from conftest import (
SERVERS_VERSION_GREATER_THAN_OR_EQUAL_TO_5_0,
SERVERS_VERSION_GREATER_THAN_OR_EQUAL_TO_6_0,
Expand Down Expand Up @@ -303,3 +303,13 @@ def test_result_info_add_result(model):
dimensions=None,
description="description",
)


@pytest.mark.skipif(
not SERVERS_VERSION_GREATER_THAN_OR_EQUAL_TO_8_0, reason="Available for servers >=8.0"
)
def test_scripting_name():
model = Model(examples.download_all_kinds_of_complexity_modal())
scripting_names = [res.name for res in model.metadata.result_info]
assert "nmisc" in scripting_names
assert "smisc" in scripting_names
Loading