Skip to content

Commit

Permalink
Bypass location in available results when LegacyGrpc as it is too slow
Browse files Browse the repository at this point in the history
  • Loading branch information
PProfizi committed Nov 21, 2023
1 parent 4208f96 commit e9a2888
Showing 1 changed file with 17 additions and 16 deletions.
33 changes: 17 additions & 16 deletions src/ansys/dpf/core/result_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,19 +113,23 @@ def __init__(self, result_info, server=None):

def __str__(self):
try:
txt = (
"%s analysis\n" % self.analysis_type.capitalize()
+ "Unit system: %s\n" % self.unit_system
+ "Physics Type: %s\n" % self.physics_type.capitalize()
+ "Available results:\n"
)
for res in self.available_results:
line = [
"",
"-",
f"{res.name}: {res.native_location} {res.physical_name}",
]
txt += "{0:^4} {1:^2} {2:<30}".format(*line) + "\n"
from ansys.dpf.core import AvailableServerConfigs
if self._server.config == AvailableServerConfigs.LegacyGrpcServer:
txt = self._description
else:
txt = (
"%s analysis\n" % self.analysis_type.capitalize()
+ "Unit system: %s\n" % self.unit_system
+ "Physics Type: %s\n" % self.physics_type.capitalize()
+ "Available results:\n"
)
for res in self.available_results:
line = [
"",
"-",
f"{res.name}: {res.native_location} {res.physical_name}",
]
txt += "{0:^4} {1:^2} {2:<30}".format(*line) + "\n"

if self._server.meet_version("7.0"):
qualifiers_labels = self.available_qualifier_labels
Expand All @@ -144,9 +148,6 @@ def __str__(self):
return txt
except Exception as e:
raise e
from ansys.dpf.core.core import _description

return _description(self._internal_obj, self._server)

@property
def _description(self):
Expand Down

0 comments on commit e9a2888

Please sign in to comment.