Skip to content

Commit afa3970

Browse files
committed
[OMCSessionZMQ] remove depreciated function execute()
1 parent b1aba64 commit afa3970

File tree

2 files changed

+3
-17
lines changed

2 files changed

+3
-17
lines changed

OMPython/OMCSession.py

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,6 @@
5151
import time
5252
from typing import Any, Optional, Tuple
5353
import uuid
54-
import warnings
5554
import zmq
5655

5756
import psutil
@@ -598,9 +597,6 @@ def run_model_executable(self, cmd_run_data: OMCSessionRunData) -> int:
598597
"""
599598
return self.omc_process.run_model_executable(cmd_run_data=cmd_run_data)
600599

601-
def execute(self, command: str):
602-
return self.omc_process.execute(command=command)
603-
604600
def sendExpression(self, command: str, parsed: bool = True) -> Any:
605601
"""
606602
Send an expression to the OMC server and return the result.
@@ -882,14 +878,6 @@ def run_model_executable(self, cmd_run_data: OMCSessionRunData) -> int:
882878

883879
return returncode
884880

885-
def execute(self, command: str):
886-
warnings.warn(message="This function is depreciated and will be removed in future versions; "
887-
"please use sendExpression() instead",
888-
category=DeprecationWarning,
889-
stacklevel=2)
890-
891-
return self.sendExpression(command, parsed=False)
892-
893881
def sendExpression(self, command: str, parsed: bool = True) -> Any:
894882
"""
895883
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)