ansys-pyensight-core 0.9.4__tar.gz → 0.9.5__tar.gz
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-0.9.4 → ansys_pyensight_core-0.9.5}/PKG-INFO +1 -1
- {ansys_pyensight_core-0.9.4 → ansys_pyensight_core-0.9.5}/pyproject.toml +1 -1
- {ansys_pyensight_core-0.9.4 → ansys_pyensight_core-0.9.5}/src/ansys/pyensight/core/ensight_grpc.py +8 -1
- {ansys_pyensight_core-0.9.4 → ansys_pyensight_core-0.9.5}/src/ansys/pyensight/core/session.py +20 -0
- {ansys_pyensight_core-0.9.4 → ansys_pyensight_core-0.9.5}/src/ansys/pyensight/core/utils/dsg_server.py +17 -2
- {ansys_pyensight_core-0.9.4 → ansys_pyensight_core-0.9.5}/LICENSE +0 -0
- {ansys_pyensight_core-0.9.4 → ansys_pyensight_core-0.9.5}/README.rst +0 -0
- {ansys_pyensight_core-0.9.4 → ansys_pyensight_core-0.9.5}/src/ansys/pyensight/core/__init__.py +0 -0
- {ansys_pyensight_core-0.9.4 → ansys_pyensight_core-0.9.5}/src/ansys/pyensight/core/common.py +0 -0
- {ansys_pyensight_core-0.9.4 → ansys_pyensight_core-0.9.5}/src/ansys/pyensight/core/deep_pixel_view.html +0 -0
- {ansys_pyensight_core-0.9.4 → ansys_pyensight_core-0.9.5}/src/ansys/pyensight/core/dockerlauncher.py +0 -0
- {ansys_pyensight_core-0.9.4 → ansys_pyensight_core-0.9.5}/src/ansys/pyensight/core/dvs.py +0 -0
- {ansys_pyensight_core-0.9.4 → ansys_pyensight_core-0.9.5}/src/ansys/pyensight/core/enscontext.py +0 -0
- {ansys_pyensight_core-0.9.4 → ansys_pyensight_core-0.9.5}/src/ansys/pyensight/core/enshell_grpc.py +0 -0
- {ansys_pyensight_core-0.9.4 → ansys_pyensight_core-0.9.5}/src/ansys/pyensight/core/ensobj.py +0 -0
- {ansys_pyensight_core-0.9.4 → ansys_pyensight_core-0.9.5}/src/ansys/pyensight/core/launch_ensight.py +0 -0
- {ansys_pyensight_core-0.9.4 → ansys_pyensight_core-0.9.5}/src/ansys/pyensight/core/launcher.py +0 -0
- {ansys_pyensight_core-0.9.4 → ansys_pyensight_core-0.9.5}/src/ansys/pyensight/core/libuserd.py +0 -0
- {ansys_pyensight_core-0.9.4 → ansys_pyensight_core-0.9.5}/src/ansys/pyensight/core/listobj.py +0 -0
- {ansys_pyensight_core-0.9.4 → ansys_pyensight_core-0.9.5}/src/ansys/pyensight/core/locallauncher.py +0 -0
- {ansys_pyensight_core-0.9.4 → ansys_pyensight_core-0.9.5}/src/ansys/pyensight/core/py.typed +0 -0
- {ansys_pyensight_core-0.9.4 → ansys_pyensight_core-0.9.5}/src/ansys/pyensight/core/renderable.py +0 -0
- {ansys_pyensight_core-0.9.4 → ansys_pyensight_core-0.9.5}/src/ansys/pyensight/core/sgeo_poll.html +0 -0
- {ansys_pyensight_core-0.9.4 → ansys_pyensight_core-0.9.5}/src/ansys/pyensight/core/utils/__init__.py +0 -0
- {ansys_pyensight_core-0.9.4 → ansys_pyensight_core-0.9.5}/src/ansys/pyensight/core/utils/adr.py +0 -0
- {ansys_pyensight_core-0.9.4 → ansys_pyensight_core-0.9.5}/src/ansys/pyensight/core/utils/export.py +0 -0
- {ansys_pyensight_core-0.9.4 → ansys_pyensight_core-0.9.5}/src/ansys/pyensight/core/utils/omniverse.py +0 -0
- {ansys_pyensight_core-0.9.4 → ansys_pyensight_core-0.9.5}/src/ansys/pyensight/core/utils/omniverse_cli.py +0 -0
- {ansys_pyensight_core-0.9.4 → ansys_pyensight_core-0.9.5}/src/ansys/pyensight/core/utils/omniverse_dsg_server.py +0 -0
- {ansys_pyensight_core-0.9.4 → ansys_pyensight_core-0.9.5}/src/ansys/pyensight/core/utils/omniverse_glb_server.py +0 -0
- {ansys_pyensight_core-0.9.4 → ansys_pyensight_core-0.9.5}/src/ansys/pyensight/core/utils/parts.py +0 -0
- {ansys_pyensight_core-0.9.4 → ansys_pyensight_core-0.9.5}/src/ansys/pyensight/core/utils/query.py +0 -0
- {ansys_pyensight_core-0.9.4 → ansys_pyensight_core-0.9.5}/src/ansys/pyensight/core/utils/readers.py +0 -0
- {ansys_pyensight_core-0.9.4 → ansys_pyensight_core-0.9.5}/src/ansys/pyensight/core/utils/resources/Materials/000_sky.exr +0 -0
- {ansys_pyensight_core-0.9.4 → ansys_pyensight_core-0.9.5}/src/ansys/pyensight/core/utils/support.py +0 -0
- {ansys_pyensight_core-0.9.4 → ansys_pyensight_core-0.9.5}/src/ansys/pyensight/core/utils/variables.py +0 -0
- {ansys_pyensight_core-0.9.4 → ansys_pyensight_core-0.9.5}/src/ansys/pyensight/core/utils/views.py +0 -0
{ansys_pyensight_core-0.9.4 → ansys_pyensight_core-0.9.5}/src/ansys/pyensight/core/ensight_grpc.py
RENAMED
|
@@ -10,12 +10,15 @@ import platform
|
|
|
10
10
|
import sys
|
|
11
11
|
import tempfile
|
|
12
12
|
import threading
|
|
13
|
-
from typing import Any, Callable, List, Optional, Tuple, Union
|
|
13
|
+
from typing import TYPE_CHECKING, Any, Callable, List, Optional, Tuple, Union
|
|
14
14
|
import uuid
|
|
15
15
|
|
|
16
16
|
from ansys.api.pyensight.v0 import dynamic_scene_graph_pb2_grpc, ensight_pb2, ensight_pb2_grpc
|
|
17
17
|
import grpc
|
|
18
18
|
|
|
19
|
+
if TYPE_CHECKING:
|
|
20
|
+
from ansys.pyensight.core.utils.dsg_server import DSGSession
|
|
21
|
+
|
|
19
22
|
|
|
20
23
|
class EnSightGRPC(object):
|
|
21
24
|
"""Wrapper around a gRPC connection to an EnSight instance
|
|
@@ -60,6 +63,10 @@ class EnSightGRPC(object):
|
|
|
60
63
|
self._image = None
|
|
61
64
|
self._image_number = 0
|
|
62
65
|
self._sub_service = None
|
|
66
|
+
self._dsg_session: Optional["DSGSession"] = None
|
|
67
|
+
|
|
68
|
+
def set_dsg_session(self, dsg_session: "DSGSession"):
|
|
69
|
+
self._dsg_session = dsg_session
|
|
63
70
|
|
|
64
71
|
@property
|
|
65
72
|
def host(self) -> str:
|
{ansys_pyensight_core-0.9.4 → ansys_pyensight_core-0.9.5}/src/ansys/pyensight/core/session.py
RENAMED
|
@@ -45,6 +45,7 @@ if TYPE_CHECKING:
|
|
|
45
45
|
from ansys.api.pyensight import ensight_api
|
|
46
46
|
from ansys.pyensight.core import enscontext, ensight_grpc, renderable
|
|
47
47
|
from ansys.pyensight.core.ensobj import ENSOBJ
|
|
48
|
+
from ansys.pyensight.core.utils.dsg_server import DSGSession
|
|
48
49
|
|
|
49
50
|
|
|
50
51
|
class InvalidEnSightVersion(Exception):
|
|
@@ -140,6 +141,7 @@ class Session:
|
|
|
140
141
|
webui_port: Optional[int] = None,
|
|
141
142
|
) -> None:
|
|
142
143
|
# every session instance needs a unique name that can be used as a cache key
|
|
144
|
+
self._dsg_session: Optional["DSGSession"] = None
|
|
143
145
|
self._session_name = str(uuid.uuid1())
|
|
144
146
|
# when objects come into play, we can reuse them, so hash ID to instance here
|
|
145
147
|
self._ensobj_hash: Dict[int, "ENSOBJ"] = {}
|
|
@@ -962,8 +964,12 @@ class Session:
|
|
|
962
964
|
>>> print(session.cmd("10+4"))
|
|
963
965
|
14
|
|
964
966
|
"""
|
|
967
|
+
if self._dsg_session:
|
|
968
|
+
self._dsg_session._pyensight_grpc_coming = True
|
|
965
969
|
self._establish_connection()
|
|
966
970
|
ret = self._grpc.command(value, do_eval=do_eval)
|
|
971
|
+
if self._dsg_session:
|
|
972
|
+
self._dsg_session._pyensight_grpc_coming = False
|
|
967
973
|
if do_eval:
|
|
968
974
|
ret = self._convert_ctor(ret)
|
|
969
975
|
value = eval(ret, dict(session=self, ensobjlist=ensobjlist))
|
|
@@ -1820,3 +1826,17 @@ class Session:
|
|
|
1820
1826
|
cmd += f"ports = find_unused_ports({count}, start={start}, end={end}, avoid={avoid})"
|
|
1821
1827
|
self.cmd(cmd, do_eval=False)
|
|
1822
1828
|
return self.cmd("ports")
|
|
1829
|
+
|
|
1830
|
+
def set_dsg_session(self, dsg_session: "DSGSession"):
|
|
1831
|
+
"""Set a DSG Session for the current PyEnSight session.
|
|
1832
|
+
|
|
1833
|
+
This is required if a DSGSession is running together with
|
|
1834
|
+
PyEnSight and the second might send gRPC requests while the first
|
|
1835
|
+
is blocked because the gRPC queue is full.
|
|
1836
|
+
|
|
1837
|
+
Parameters
|
|
1838
|
+
----------
|
|
1839
|
+
dsg_session: DSGSession
|
|
1840
|
+
a DSGSession object
|
|
1841
|
+
"""
|
|
1842
|
+
self._dsg_session = dsg_session
|
|
@@ -6,12 +6,15 @@ import queue
|
|
|
6
6
|
import sys
|
|
7
7
|
import threading
|
|
8
8
|
import time
|
|
9
|
-
from typing import Any, Dict, List, Optional
|
|
9
|
+
from typing import TYPE_CHECKING, Any, Dict, List, Optional
|
|
10
10
|
|
|
11
11
|
from ansys.api.pyensight.v0 import dynamic_scene_graph_pb2
|
|
12
12
|
from ansys.pyensight.core import ensight_grpc
|
|
13
13
|
import numpy
|
|
14
14
|
|
|
15
|
+
if TYPE_CHECKING:
|
|
16
|
+
from ansys.pyensight.core import Session
|
|
17
|
+
|
|
15
18
|
|
|
16
19
|
class Part(object):
|
|
17
20
|
def __init__(self, session: "DSGSession"):
|
|
@@ -640,6 +643,7 @@ class DSGSession(object):
|
|
|
640
643
|
vrmode: bool = False,
|
|
641
644
|
time_scale: float = 1.0,
|
|
642
645
|
handler: UpdateHandler = UpdateHandler(),
|
|
646
|
+
session: Optional["Session"] = None,
|
|
643
647
|
):
|
|
644
648
|
"""
|
|
645
649
|
Manage a gRPC connection and link it to an UpdateHandler instance
|
|
@@ -678,6 +682,9 @@ class DSGSession(object):
|
|
|
678
682
|
"""
|
|
679
683
|
super().__init__()
|
|
680
684
|
self._grpc = ensight_grpc.EnSightGRPC(port=port, host=host, secret_key=security_code)
|
|
685
|
+
self._session = session
|
|
686
|
+
if self._session:
|
|
687
|
+
self._session.set_dsg_session(self)
|
|
681
688
|
self._callback_handler = handler
|
|
682
689
|
self._verbose = verbose
|
|
683
690
|
self._thread: Optional[threading.Thread] = None
|
|
@@ -705,6 +712,7 @@ class DSGSession(object):
|
|
|
705
712
|
# log any status changes to this file. external apps will be monitoring
|
|
706
713
|
self._status_file = os.environ.get("ANSYS_OV_SERVER_STATUS_FILENAME", "")
|
|
707
714
|
self._status = dict(status="idle", start_time=0.0, processed_buffers=0, total_buffers=0)
|
|
715
|
+
self._pyensight_grpc_coming = False
|
|
708
716
|
|
|
709
717
|
@property
|
|
710
718
|
def scene_bounds(self) -> Optional[List]:
|
|
@@ -892,6 +900,13 @@ class DSGSession(object):
|
|
|
892
900
|
cmd.init.maximum_chunk_size = 1024 * 1024
|
|
893
901
|
self._dsg_queue.put(cmd) # type:ignore
|
|
894
902
|
|
|
903
|
+
def _is_queue_full(self):
|
|
904
|
+
if not self.max_dsg_queue_size:
|
|
905
|
+
return False
|
|
906
|
+
if self._pyensight_grpc_coming:
|
|
907
|
+
return False
|
|
908
|
+
return self._message_queue.qsize() >= self.max_dsg_queue_size
|
|
909
|
+
|
|
895
910
|
def _poll_messages(self) -> None:
|
|
896
911
|
"""Core interface to grab DSG events from gRPC and queue them for processing
|
|
897
912
|
|
|
@@ -905,7 +920,7 @@ class DSGSession(object):
|
|
|
905
920
|
# if the queue is getting too deep, wait a bit to avoid holding too
|
|
906
921
|
# many messages (filling up memory)
|
|
907
922
|
if self.max_dsg_queue_size:
|
|
908
|
-
while self.
|
|
923
|
+
while self._is_queue_full():
|
|
909
924
|
time.sleep(0.001)
|
|
910
925
|
except Exception:
|
|
911
926
|
self._shutdown = True
|
|
File without changes
|
|
File without changes
|
{ansys_pyensight_core-0.9.4 → ansys_pyensight_core-0.9.5}/src/ansys/pyensight/core/__init__.py
RENAMED
|
File without changes
|
{ansys_pyensight_core-0.9.4 → ansys_pyensight_core-0.9.5}/src/ansys/pyensight/core/common.py
RENAMED
|
File without changes
|
|
File without changes
|
{ansys_pyensight_core-0.9.4 → ansys_pyensight_core-0.9.5}/src/ansys/pyensight/core/dockerlauncher.py
RENAMED
|
File without changes
|
|
File without changes
|
{ansys_pyensight_core-0.9.4 → ansys_pyensight_core-0.9.5}/src/ansys/pyensight/core/enscontext.py
RENAMED
|
File without changes
|
{ansys_pyensight_core-0.9.4 → ansys_pyensight_core-0.9.5}/src/ansys/pyensight/core/enshell_grpc.py
RENAMED
|
File without changes
|
{ansys_pyensight_core-0.9.4 → ansys_pyensight_core-0.9.5}/src/ansys/pyensight/core/ensobj.py
RENAMED
|
File without changes
|
{ansys_pyensight_core-0.9.4 → ansys_pyensight_core-0.9.5}/src/ansys/pyensight/core/launch_ensight.py
RENAMED
|
File without changes
|
{ansys_pyensight_core-0.9.4 → ansys_pyensight_core-0.9.5}/src/ansys/pyensight/core/launcher.py
RENAMED
|
File without changes
|
{ansys_pyensight_core-0.9.4 → ansys_pyensight_core-0.9.5}/src/ansys/pyensight/core/libuserd.py
RENAMED
|
File without changes
|
{ansys_pyensight_core-0.9.4 → ansys_pyensight_core-0.9.5}/src/ansys/pyensight/core/listobj.py
RENAMED
|
File without changes
|
{ansys_pyensight_core-0.9.4 → ansys_pyensight_core-0.9.5}/src/ansys/pyensight/core/locallauncher.py
RENAMED
|
File without changes
|
|
File without changes
|
{ansys_pyensight_core-0.9.4 → ansys_pyensight_core-0.9.5}/src/ansys/pyensight/core/renderable.py
RENAMED
|
File without changes
|
{ansys_pyensight_core-0.9.4 → ansys_pyensight_core-0.9.5}/src/ansys/pyensight/core/sgeo_poll.html
RENAMED
|
File without changes
|
{ansys_pyensight_core-0.9.4 → ansys_pyensight_core-0.9.5}/src/ansys/pyensight/core/utils/__init__.py
RENAMED
|
File without changes
|
{ansys_pyensight_core-0.9.4 → ansys_pyensight_core-0.9.5}/src/ansys/pyensight/core/utils/adr.py
RENAMED
|
File without changes
|
{ansys_pyensight_core-0.9.4 → ansys_pyensight_core-0.9.5}/src/ansys/pyensight/core/utils/export.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{ansys_pyensight_core-0.9.4 → ansys_pyensight_core-0.9.5}/src/ansys/pyensight/core/utils/parts.py
RENAMED
|
File without changes
|
{ansys_pyensight_core-0.9.4 → ansys_pyensight_core-0.9.5}/src/ansys/pyensight/core/utils/query.py
RENAMED
|
File without changes
|
{ansys_pyensight_core-0.9.4 → ansys_pyensight_core-0.9.5}/src/ansys/pyensight/core/utils/readers.py
RENAMED
|
File without changes
|
|
File without changes
|
{ansys_pyensight_core-0.9.4 → ansys_pyensight_core-0.9.5}/src/ansys/pyensight/core/utils/support.py
RENAMED
|
File without changes
|
|
File without changes
|
{ansys_pyensight_core-0.9.4 → ansys_pyensight_core-0.9.5}/src/ansys/pyensight/core/utils/views.py
RENAMED
|
File without changes
|