Skip to content

Commit b046f90

Browse files
committed
[OMCSessionZMQ] remove depreciated function execute()
1 parent 9da5630 commit b046f90

2 files changed

Lines changed: 3 additions & 17 deletions

File tree

OMPython/OMCSession.py

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@
2222
import time
2323
from typing import Any, Optional, Tuple
2424
import uuid
25-
import warnings
2625
import zmq
2726

2827
import psutil
@@ -563,9 +562,6 @@ def run_model_executable(self, cmd_run_data: OMCSessionRunData) -> int:
563562
"""
564563
return self.omc_process.run_model_executable(cmd_run_data=cmd_run_data)
565564

566-
def execute(self, command: str):
567-
return self.omc_process.execute(command=command)
568-
569565
def sendExpression(self, command: str, parsed: bool = True) -> Any:
570566
"""
571567
Send an expression to the OMC server and return the result.
@@ -847,14 +843,6 @@ def run_model_executable(self, cmd_run_data: OMCSessionRunData) -> int:
847843

848844
return returncode
849845

850-
def execute(self, command: str):
851-
warnings.warn(message="This function is depreciated and will be removed in future versions; "
852-
"please use sendExpression() instead",
853-
category=DeprecationWarning,
854-
stacklevel=2)
855-
856-
return self.sendExpression(command, parsed=False)
857-
858846
def sendExpression(self, command: str, parsed: bool = True) -> Any:
859847
"""
860848
Send an expression to the OMC server and return the result.

tests/test_ZMQ.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -37,11 +37,9 @@ def test_Simulate(omcs, model_time_str):
3737
assert omcs.sendExpression('res.resultFile')
3838

3939

40-
def test_execute(omcs):
41-
with pytest.deprecated_call():
42-
assert omcs.execute('"HelloWorld!"') == '"HelloWorld!"\n'
43-
assert omcs.sendExpression('"HelloWorld!"', parsed=False) == '"HelloWorld!"\n'
44-
assert omcs.sendExpression('"HelloWorld!"', parsed=True) == 'HelloWorld!'
40+
def test_sendExpression(om):
41+
assert om.sendExpression('"HelloWorld!"', parsed=False) == '"HelloWorld!"\n'
42+
assert om.sendExpression('"HelloWorld!"', parsed=True) == 'HelloWorld!'
4543

4644

4745
def test_omcprocessport_execute(omcs):

0 commit comments

Comments
 (0)