Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add option to start the gRPC connections without secret keys and add … #290

Merged
merged 2 commits into from
Aug 22, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
3 changes: 2 additions & 1 deletion src/ansys/pyensight/core/locallauncher.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,8 @@ def start(self) -> "pyensight.Session":
# Launch EnSight
# create the environmental variables
local_env = os.environ.copy()
local_env["ENSIGHT_SECURITY_TOKEN"] = self._secret_key
if not local_env.get("ENSIGHT_GRPC_DISABLE_SECURITY_TOKEN"):
local_env["ENSIGHT_SECURITY_TOKEN"] = self._secret_key
local_env["WEBSOCKETSERVER_SECURITY_TOKEN"] = self._secret_key
local_env["ENSIGHT_SESSION_TEMPDIR"] = self.session_directory
# If for some reason, the ENSIGHT_ANSYS_LAUNCH is set previously,
Expand Down
7 changes: 6 additions & 1 deletion src/ansys/pyensight/core/session.py
Original file line number Diff line number Diff line change
Expand Up @@ -964,6 +964,10 @@ def _build_utils_interface(self) -> None:
# Warn on import errors
print(f"Error loading ensight.utils from: '{_filename}' : {e}")

MONITOR_NEW_TIMESTEPS_OFF = "off"
MONITOR_NEW_TIMESTEPS_STAY_AT_CURRENT = "stay_at_current"
MONITOR_NEW_TIMESTEPS_JUMP_TO_END = "jump_to_end"

def load_data(
self,
data_file: str,
Expand All @@ -972,6 +976,7 @@ def load_data(
reader_options: Optional[dict] = None,
new_case: bool = False,
representation: str = "3D_feature_2D_full",
monitor_new_timesteps: str = MONITOR_NEW_TIMESTEPS_OFF,
mariostieriansys marked this conversation as resolved.
Show resolved Hide resolved
) -> None:
"""Load a dataset into the EnSight instance.

Expand Down Expand Up @@ -1076,7 +1081,7 @@ def load_data(
if result_file:
cmds.append(f'ensight.data.result(r"""{result_file}""")')
cmds.append("ensight.data.shift_time(1.000000, 0.000000, 0.000000)")
cmds.append('ensight.solution_time.monitor_for_new_steps("off")')
cmds.append(f'ensight.solution_time.monitor_for_new_steps("{monitor_new_timesteps}")')
cmds.append(f'ensight.data.replace(r"""{data_file}""")')
for cmd in cmds:
if self.cmd(cmd) != 0:
Expand Down
Loading