Skip to content

Commit 64e4265

Browse files
committed
[OMCSessionZMQ] remove depreciated function execute()
1 parent af2833e commit 64e4265

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.
@@ -850,14 +846,6 @@ def run_model_executable(self, cmd_run_data: OMCSessionRunData) -> int:
850846

851847
return returncode
852848

853-
def execute(self, command: str):
854-
warnings.warn(message="This function is depreciated and will be removed in future versions; "
855-
"please use sendExpression() instead",
856-
category=DeprecationWarning,
857-
stacklevel=2)
858-
859-
return self.sendExpression(command, parsed=False)
860-
861849
def sendExpression(self, expr: str, parsed: bool = True) -> Any:
862850
"""
863851
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)