Skip to content

Commit 16649fe

Browse files
Change version number to 3.0.0 + Rename package.
1 parent 93293be commit 16649fe

23 files changed

+95
-85
lines changed

.gitignore

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/build
22
/dist
3-
/qtm.egg-info
3+
/qtm_rt.egg-info
44
/env
55
/env3
66
/.idea

README.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,11 @@ The Qualisys SDK for Python implements our RealTime(RT) protocol and works with
66
Installation
77
------------
88

9-
The easiest way to install the qtm package is by using [pip]((https://pip.pypa.io/en/stable/installing/)):
9+
The easiest way to install the qtm_rt package is by using [pip]((https://pip.pypa.io/en/stable/installing/)):
1010

1111
```
1212
python -m pip install pip --upgrade # Upgrade to latest pip
13-
python -m pip install qtm
13+
python -m pip install qtm-rt
1414
```
1515

1616
It's also possible to install from github:
@@ -19,7 +19,7 @@ It's also possible to install from github:
1919
python -m pip install git+https://github.com/qualisys/qualisys_python_sdk.git
2020
```
2121

22-
Or just clone the repo and copy the qtm folder into you project folder,
22+
Or just clone the repo and copy the qtm_rt folder into you project folder,
2323

2424
Documentation
2525
-------------

docs/deprecated.rst

+13-3
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,25 @@
11
.. _deprecated_version:
22

3-
Upgrade information
3+
3.0.0
4+
-------------------
5+
6+
The package has been renamed to qtm_rt (qtm-rt on pip). Otherwise everything is identical to 2.1.2.
7+
Older versions will remain under the qtm name to avoid breaking existing code.
8+
9+
To install the old version:
10+
11+
.. code-block:: console
12+
13+
python -m pip install qtm==2.1.2
14+
15+
2.0.0
416
-------------------
517

618
The basic functionality is the same, but the package now
719
uses `asyncio <https://docs.python.org/3.5/library/asyncio.html>`_ instead of `twisted <https://twistedmatrix.com/>`_.
820
This reduces dependencies and simplifies installation but raises the required version of Python to 3.5.
921
If you cannot use Python 3, stay on the earlier versions of this SDK.
1022

11-
QRest is still not implemented in 2.0.
12-
1323
To install the old version:
1424

1525
.. code-block:: console

docs/index.rst

+10-10
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
Welcome to Qualisys SDK for Python's documentation!
22
===================================================
33

4-
This document describes the Qualisys SDK for Python version 2.1.2
4+
This document describes the Qualisys SDK for Python version 3.0.0
55

6-
**NOTE:** Version 2.0.0 introduces breaking changes. :ref:`More info...<deprecated_version>`
6+
**NOTE:** Major versions introduces breaking changes. :ref:`More info...<deprecated_version>`
77

88
.. contents::
99
:depth: 2
@@ -22,7 +22,7 @@ This package is a pure python package and requires at least Python 3.5.3, the ea
2222

2323
.. code-block:: console
2424
25-
python -m pip install qtm
25+
python -m pip install qtm-rt
2626
2727
Example usage:
2828
--------------
@@ -36,40 +36,40 @@ already streaming data, either live or RT from file.
3636
QTM RT Protocol
3737
---------------
3838

39-
An instance of QRTConnection is returned when qtm.connect_ successfully connects to QTM.
39+
An instance of QRTConnection is returned when qtm_rt.connect_ successfully connects to QTM.
4040

4141
Functions marked as coroutines need to be run in a async function and awaited, please see example above.
4242

43-
.. autocofunction:: qtm.connect
43+
.. autocofunction:: qtm_rt.connect
4444

4545
QRTConnection
4646
~~~~~~~~~~~~~
4747

48-
.. autoclass:: qtm.QRTConnection
48+
.. autoclass:: qtm_rt.QRTConnection
4949
:members:
5050

5151
QRTPacket
5252
~~~~~~~~~
5353

54-
.. autoclass:: qtm.QRTPacket
54+
.. autoclass:: qtm_rt.QRTPacket
5555
:members:
5656

5757
QRTEvent
5858
~~~~~~~~~
5959

60-
.. autoclass:: qtm.QRTEvent
60+
.. autoclass:: qtm_rt.QRTEvent
6161
:members:
6262
:undoc-members:
6363

6464
QRTComponentType
6565
~~~~~~~~~~~~~~~~
6666

67-
.. autoclass:: qtm.packet.QRTComponentType
67+
.. autoclass:: qtm_rt.packet.QRTComponentType
6868
:members:
6969
:undoc-members:
7070

7171
Exceptions
7272
~~~~~~~~~~
7373

74-
.. autoclass:: qtm.QRTCommandException
74+
.. autoclass:: qtm_rt.QRTCommandException
7575

examples/advanced_example.py

+5-5
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
import asyncio
44
import logging
55

6-
import qtm
6+
import qtm_rt
77

88
LOG = logging.getLogger("example")
99

@@ -47,18 +47,18 @@ async def shutdown(delay, connection, receiver_future, queue):
4747
async def setup():
4848
""" main function """
4949

50-
connection = await qtm.connect("127.0.0.1")
50+
connection = await qtm_rt.connect("127.0.0.1")
5151

5252
if connection is None:
5353
return -1
5454

55-
async with qtm.TakeControl(connection, "password"):
55+
async with qtm_rt.TakeControl(connection, "password"):
5656

5757
state = await connection.get_state()
58-
if state != qtm.QRTEvent.EventConnected:
58+
if state != qtm_rt.QRTEvent.EventConnected:
5959
await connection.new()
6060
try:
61-
await connection.await_event(qtm.QRTEvent.EventConnected, timeout=10)
61+
await connection.await_event(qtm_rt.QRTEvent.EventConnected, timeout=10)
6262
except asyncio.TimeoutError:
6363
LOG.error("Failed to start new measurement")
6464
return -1

examples/asyncio_everything.py

+11-11
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,14 @@
55
import argparse
66
import pkg_resources
77

8-
import qtm
8+
import qtm_rt
99

1010

1111
logging.basicConfig(level=logging.INFO)
1212
LOG = logging.getLogger("example")
1313

1414

15-
QTM_FILE = pkg_resources.resource_filename("qtm", "data/Demo.qtm")
15+
QTM_FILE = pkg_resources.resource_filename("qtm_rt", "data/Demo.qtm")
1616

1717

1818
class AsyncEnumerate:
@@ -48,7 +48,7 @@ async def choose_qtm_instance(interface):
4848
""" List running QTM instances, asks for input and return chosen QTM """
4949
instances = {}
5050
print("Available QTM instances:")
51-
async for i, qtm_instance in AsyncEnumerate(qtm.Discover(interface), start=1):
51+
async for i, qtm_instance in AsyncEnumerate(qtm_rt.Discover(interface), start=1):
5252
instances[i] = qtm_instance
5353
print("{} - {}".format(i, qtm_instance.info))
5454

@@ -75,19 +75,19 @@ async def main(interface=None):
7575

7676
while True:
7777

78-
connection = await qtm.connect(qtm_ip, 22223, version="1.18")
78+
connection = await qtm_rt.connect(qtm_ip, 22223, version="1.18")
7979

8080
if connection is None:
8181
return
8282

8383
await connection.get_state()
8484
await connection.byte_order()
8585

86-
async with qtm.TakeControl(connection, "password"):
86+
async with qtm_rt.TakeControl(connection, "password"):
8787

8888
result = await connection.close()
8989
if result == b"Closing connection":
90-
await connection.await_event(qtm.QRTEvent.EventConnectionClosed)
90+
await connection.await_event(qtm_rt.QRTEvent.EventConnectionClosed)
9191

9292
await connection.load(QTM_FILE)
9393

@@ -103,7 +103,7 @@ async def main(interface=None):
103103
await connection.stream_frames(
104104
components=["incorrect"], on_packet=queue.put_nowait
105105
)
106-
except qtm.QRTCommandException as exception:
106+
except qtm_rt.QRTCommandException as exception:
107107
LOG.info("exception %s", exception)
108108

109109
await connection.stream_frames(
@@ -122,13 +122,13 @@ async def main(interface=None):
122122
await connection.await_event()
123123

124124
await connection.new()
125-
await connection.await_event(qtm.QRTEvent.EventConnected)
125+
await connection.await_event(qtm_rt.QRTEvent.EventConnected)
126126

127127
await connection.start()
128-
await connection.await_event(qtm.QRTEvent.EventWaitingForTrigger)
128+
await connection.await_event(qtm_rt.QRTEvent.EventWaitingForTrigger)
129129

130130
await connection.trig()
131-
await connection.await_event(qtm.QRTEvent.EventCaptureStarted)
131+
await connection.await_event(qtm_rt.QRTEvent.EventCaptureStarted)
132132

133133
await asyncio.sleep(0.5)
134134

@@ -139,7 +139,7 @@ async def main(interface=None):
139139
await asyncio.sleep(0.5)
140140

141141
await connection.stop()
142-
await connection.await_event(qtm.QRTEvent.EventCaptureStopped)
142+
await connection.await_event(qtm_rt.QRTEvent.EventCaptureStopped)
143143

144144
await connection.save(r"measurement.qtm")
145145

examples/basic_example.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"""
66

77
import asyncio
8-
import qtm
8+
import qtm_rt
99

1010

1111
def on_packet(packet):
@@ -19,7 +19,7 @@ def on_packet(packet):
1919

2020
async def setup():
2121
""" Main function """
22-
connection = await qtm.connect("127.0.0.1")
22+
connection = await qtm_rt.connect("127.0.0.1")
2323
if connection is None:
2424
return
2525

examples/calibration_example.py

+5-5
Original file line numberDiff line numberDiff line change
@@ -2,26 +2,26 @@
22

33
import asyncio
44
import logging
5-
import qtm
5+
import qtm_rt
66
from lxml import etree
77

88
LOG = logging.getLogger("example")
99

1010
async def setup():
1111
""" main function """
1212

13-
connection = await qtm.connect("127.0.0.1")
13+
connection = await qtm_rt.connect("127.0.0.1")
1414

1515
if connection is None:
1616
return -1
1717

18-
async with qtm.TakeControl(connection, "password"):
18+
async with qtm_rt.TakeControl(connection, "password"):
1919

2020
state = await connection.get_state()
21-
if state != qtm.QRTEvent.EventConnected:
21+
if state != qtm_rt.QRTEvent.EventConnected:
2222
await connection.new()
2323
try:
24-
await connection.await_event(qtm.QRTEvent.EventConnected, timeout=10)
24+
await connection.await_event(qtm_rt.QRTEvent.EventConnected, timeout=10)
2525
except asyncio.TimeoutError:
2626
LOG.error("Failed to start new measurement")
2727
return -1

examples/qt_example/qt_example.py

+6-6
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@
1717
from PyQt5.QtCore import pyqtSignal, QObject, pyqtProperty
1818
from PyQt5 import uic
1919

20-
import qtm
21-
from qtm import QRTEvent
20+
import qtm_rt
21+
from qtm_rt import QRTEvent
2222
from quamash import QSelectorEventLoop
2323

2424
main_window_class, _ = uic.loadUiType("./ui/main.ui")
@@ -67,7 +67,7 @@ def discover(self):
6767
async def _discover_qtm(self, interface):
6868

6969
try:
70-
async for qtm_instance in qtm.Discover(interface):
70+
async for qtm_instance in qtm_rt.Discover(interface):
7171
info = qtm_instance.info.decode("utf-8").split(",")[0]
7272

7373
if not info in self._found_qtms:
@@ -155,7 +155,7 @@ def connect_qtm(self):
155155
async def _connect_qtm(self):
156156
ip = self.qtm_combo.currentText().split(" ")[1]
157157

158-
self._connection = await qtm.connect(
158+
self._connection = await qtm_rt.connect(
159159
ip, on_disconnect=self.on_disconnect, on_event=self.on_event
160160
)
161161

@@ -193,15 +193,15 @@ def set_3d_values(self, controls, values):
193193
control.setText("{0:.3f}".format(component))
194194

195195
def on_packet(self, packet):
196-
if qtm.packet.QRTComponentType.Component3d in packet.components:
196+
if qtm_rt.packet.QRTComponentType.Component3d in packet.components:
197197
_, markers = packet.get_3d_markers()
198198
if self._trajectory_index is not None:
199199
marker = markers[self._trajectory_index]
200200
self.set_3d_values(
201201
[self.x_trajectory, self.y_trajectory, self.z_trajectory], marker
202202
)
203203

204-
if qtm.packet.QRTComponentType.Component6d in packet.components:
204+
if qtm_rt.packet.QRTComponentType.Component6d in packet.components:
205205
_, sixdofs = packet.get_6d()
206206
if self._sixdof_index is not None:
207207
position, _ = sixdofs[self._sixdof_index]

examples/qt_example/requirements.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
qtm
1+
qtm_rt
22
PyQt5==5.9
33
Quamash==0.6.1

examples/stream_6dof_example.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@
66
import xml.etree.ElementTree as ET
77
import pkg_resources
88

9-
import qtm
9+
import qtm_rt
1010

11-
QTM_FILE = pkg_resources.resource_filename("qtm", "data/Demo.qtm")
11+
QTM_FILE = pkg_resources.resource_filename("qtm_rt", "data/Demo.qtm")
1212

1313

1414
def create_body_index(xml_string):
@@ -28,15 +28,15 @@ def body_enabled_count(xml_string):
2828
async def main():
2929

3030
# Connect to qtm
31-
connection = await qtm.connect("127.0.0.1")
31+
connection = await qtm_rt.connect("127.0.0.1")
3232

3333
# Connection failed?
3434
if connection is None:
3535
print("Failed to connect")
3636
return
3737

3838
# Take control of qtm, context manager will automatically release control after scope end
39-
async with qtm.TakeControl(connection, "password"):
39+
async with qtm_rt.TakeControl(connection, "password"):
4040

4141
realtime = False
4242

qtm/__init__.py renamed to qtm_rt/__init__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818

1919
# pylint: disable=C0330
2020

21-
LOG = logging.getLogger("qtm")
21+
LOG = logging.getLogger("qtm_rt")
2222
LOG_LEVEL = os.getenv("QTM_LOGGING", None)
2323

2424
LEVEL = logging.DEBUG if LOG_LEVEL == "debug" else logging.INFO

qtm/control.py renamed to qtm_rt/control.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
from .qrt import QRTConnection
55

6-
LOG = logging.getLogger("qtm")
6+
LOG = logging.getLogger("qtm_rt")
77

88

99
class TakeControl:
File renamed without changes.

0 commit comments

Comments
 (0)