Skip to content

Commit

Permalink
bump api repo version and stop numpy 2 for the moment (#348)
Browse files Browse the repository at this point in the history
  • Loading branch information
mariostieriansys authored Jan 16, 2024
1 parent 826ab5e commit b66a794
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 12 deletions.
4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,11 @@ classifiers = [

dependencies = [
"importlib-metadata>=4.0; python_version<='3.8'",
"ansys-api-pyensight==0.3.3",
"ansys-api-pyensight==0.3.4",
"requests>=2.28.2",
"docker>=6.1.0",
"urllib3<2",
"numpy>=1.21.0",
"numpy>=1.21.0,<2",
"Pillow>=9.3.0",
]

Expand Down
29 changes: 19 additions & 10 deletions src/ansys/pyensight/core/renderable.py
Original file line number Diff line number Diff line change
Expand Up @@ -579,21 +579,30 @@ def update(self):
class RenderableVNCAngular(Renderable):
def __init__(self, *args, **kwargs) -> None:
super().__init__(*args, **kwargs)
self._query_params = {
"autoconnect": "true",
"host": self._session.hostname,
"port": self._session.ws_port,
"secretKey": self._session.secret_key,
}
self._generate_url()
self._rendertype = "remote"
self.update()

def update(self):
version = _get_ansysnexus_version(self._session._cei_suffix)
url = f"{self._http_protocol}://{self._session.html_hostname}:{self._session.html_port}"
url += f"/ansys{version}/nexus/angular/viewer_angular_pyensight.html"
url += self._get_query_parameters_str(self._query_params)
self._url = url
base_content = f"""
<!doctype html>
<html lang="en" class="dark">
<head><base href="/ansys{version}/nexus/angular/">
<meta charset="utf-8">
<title>WebEnSight</title>
<script src="/ansys{version}/nexus/viewer-loader.js"></script>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="icon" type="image/x-icon" href="ensight.ico">
<link rel="stylesheet" href="styles.css"></head>
<body>
"""
module_with_attributes = "\n <web-en-sight "
module_with_attributes += f'wsPort="{self._session.ws_port}" '
module_with_attributes += f'secretKey="{self._session.secret_key}">\n'
script_src = '<script src="runtime.js" type="module"></script><script src="polyfills.js" type="module"></script><script src="main.js" type="module"></script></body>\n</html>'
content = base_content + module_with_attributes + script_src
self._save_remote_html_page(content)
super().update()


Expand Down

0 comments on commit b66a794

Please sign in to comment.