ansys-pyensight-core 0.7.8__py3-none-any.whl → 0.7.10__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of ansys-pyensight-core might be problematic. Click here for more details.
- ansys/pyensight/core/__init__.py +1 -1
- ansys/pyensight/core/dockerlauncher.py +52 -44
- ansys/pyensight/core/enscontext.py +17 -15
- ansys/pyensight/core/enshell_grpc.py +8 -8
- ansys/pyensight/core/ensight_grpc.py +37 -35
- ansys/pyensight/core/ensobj.py +4 -4
- ansys/pyensight/core/launch_ensight.py +2 -2
- ansys/pyensight/core/launcher.py +4 -4
- ansys/pyensight/core/listobj.py +18 -16
- ansys/pyensight/core/renderable.py +803 -798
- ansys/pyensight/core/session.py +33 -29
- ansys/pyensight/core/utils/export.py +9 -9
- ansys/pyensight/core/utils/omniverse_dsg_server.py +1 -0
- ansys/pyensight/core/utils/parts.py +50 -36
- ansys/pyensight/core/utils/query.py +41 -35
- ansys/pyensight/core/utils/variables.py +158 -139
- ansys/pyensight/core/utils/views.py +14 -14
- {ansys_pyensight_core-0.7.8.dist-info → ansys_pyensight_core-0.7.10.dist-info}/METADATA +2 -2
- ansys_pyensight_core-0.7.10.dist-info/RECORD +34 -0
- ansys_pyensight_core-0.7.8.dist-info/RECORD +0 -34
- {ansys_pyensight_core-0.7.8.dist-info → ansys_pyensight_core-0.7.10.dist-info}/LICENSE +0 -0
- {ansys_pyensight_core-0.7.8.dist-info → ansys_pyensight_core-0.7.10.dist-info}/WHEEL +0 -0
ansys/pyensight/core/listobj.py
CHANGED
|
@@ -107,12 +107,14 @@ class ensobjlist(List[T]): # noqa: N801
|
|
|
107
107
|
value_list = [value]
|
|
108
108
|
out_list: ensobjlist[Any] = ensobjlist(session=self._session)
|
|
109
109
|
for item in self:
|
|
110
|
-
if isinstance(item, ENSOBJ):
|
|
110
|
+
if isinstance(item, ENSOBJ): # pragma: no cover
|
|
111
111
|
try:
|
|
112
112
|
item_value = item.getattr(attr)
|
|
113
113
|
for check_value in value_list:
|
|
114
114
|
if wildcard == 2:
|
|
115
|
-
if fnmatch.fnmatch(
|
|
115
|
+
if fnmatch.fnmatch(
|
|
116
|
+
str(item_value), str(check_value)
|
|
117
|
+
): # pragma: no cover
|
|
116
118
|
out_list.append(item)
|
|
117
119
|
break
|
|
118
120
|
elif wildcard > 0:
|
|
@@ -123,14 +125,14 @@ class ensobjlist(List[T]): # noqa: N801
|
|
|
123
125
|
if item_value == check_value:
|
|
124
126
|
out_list.append(item)
|
|
125
127
|
break
|
|
126
|
-
except RuntimeError:
|
|
127
|
-
pass
|
|
128
|
+
except RuntimeError: # pragma: no cover
|
|
129
|
+
pass # pragma: no cover
|
|
128
130
|
if group:
|
|
129
131
|
# This is a bit of a hack, but the find() method generates a local list of
|
|
130
132
|
# proxy objects. We want to put that in a group. We do that by running
|
|
131
133
|
# a script in EnSight that creates an empty group and then adds those
|
|
132
134
|
# children to the group. The output becomes the remote referenced ENS_GROUP.
|
|
133
|
-
if self._session is not None:
|
|
135
|
+
if self._session is not None: # pragma: no cover
|
|
134
136
|
ens_group_cmd = "ensight.objs.core.VPORTS.find('__unknown__', group=1)"
|
|
135
137
|
ens_group = self._session.cmd(ens_group_cmd)
|
|
136
138
|
ens_group.addchild(out_list)
|
|
@@ -163,14 +165,14 @@ class ensobjlist(List[T]): # noqa: N801
|
|
|
163
165
|
"""
|
|
164
166
|
session = None
|
|
165
167
|
objid_list = [x.__OBJID__ for x in self if isinstance(x, ENSOBJ)]
|
|
166
|
-
for item in self:
|
|
167
|
-
if hasattr(item, "_session"):
|
|
168
|
+
for item in self: # pragma: no cover
|
|
169
|
+
if hasattr(item, "_session"): # pragma: no cover
|
|
168
170
|
session = item._session
|
|
169
171
|
break
|
|
170
|
-
if session:
|
|
172
|
+
if session: # pragma: no cover
|
|
171
173
|
msg = f"ensight.objs.ensobjlist(ensight.objs.wrap_id(x) for x in {objid_list}).set_attr({attr.__repr__()}, {value.__repr__()})"
|
|
172
174
|
return session.cmd(msg)
|
|
173
|
-
return 0
|
|
175
|
+
return 0 # pragma: no cover
|
|
174
176
|
|
|
175
177
|
def get_attr(self, attr: Any, default: Optional[Any] = None):
|
|
176
178
|
"""Query a specific attribute for all ENSOBJ objects in the list
|
|
@@ -199,20 +201,20 @@ class ensobjlist(List[T]): # noqa: N801
|
|
|
199
201
|
"""
|
|
200
202
|
session = None
|
|
201
203
|
objid_list = [x.__OBJID__ for x in self if isinstance(x, ENSOBJ)]
|
|
202
|
-
for item in self:
|
|
203
|
-
if hasattr(item, "_session"):
|
|
204
|
+
for item in self: # pragma: no cover
|
|
205
|
+
if hasattr(item, "_session"): # pragma: no cover
|
|
204
206
|
session = item._session
|
|
205
207
|
break
|
|
206
208
|
value = None
|
|
207
|
-
if session:
|
|
208
|
-
if default:
|
|
209
|
-
msg = f"ensight.objs.ensobjlist(ensight.objs.wrap_id(x) for x in {objid_list}).get_attr({attr.__repr__()}, {default.__repr__()})"
|
|
209
|
+
if session: # pragma: no cover
|
|
210
|
+
if default: # pragma: no cover
|
|
211
|
+
msg = f"ensight.objs.ensobjlist(ensight.objs.wrap_id(x) for x in {objid_list}).get_attr({attr.__repr__()}, {default.__repr__()})" # pragma: no cover
|
|
210
212
|
else:
|
|
211
213
|
msg = f"ensight.objs.ensobjlist(ensight.objs.wrap_id(x) for x in {objid_list}).get_attr({attr.__repr__()})"
|
|
212
214
|
value = session.cmd(msg)
|
|
213
|
-
if value:
|
|
215
|
+
if value: # pragma: no cover
|
|
214
216
|
return value
|
|
215
|
-
return [default] * len(objid_list)
|
|
217
|
+
return [default] * len(objid_list) # pragma: no cover
|
|
216
218
|
|
|
217
219
|
@overload
|
|
218
220
|
def __getitem__(self, index: SupportsIndex) -> T:
|