horiba-sdk 0.6.0__py3-none-any.whl → 0.7.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- horiba_sdk/communication/messages.py +6 -5
- horiba_sdk/core/acquisition_format.py +1 -2
- horiba_sdk/core/stitching/__init__.py +1 -1
- horiba_sdk/core/stitching/linear_spectra_stitch.py +7 -7
- horiba_sdk/devices/device_manager.py +3 -5
- {horiba_sdk-0.6.0.dist-info → horiba_sdk-0.7.0.dist-info}/METADATA +1 -1
- {horiba_sdk-0.6.0.dist-info → horiba_sdk-0.7.0.dist-info}/RECORD +9 -9
- {horiba_sdk-0.6.0.dist-info → horiba_sdk-0.7.0.dist-info}/LICENSE +0 -0
- {horiba_sdk-0.6.0.dist-info → horiba_sdk-0.7.0.dist-info}/WHEEL +0 -0
@@ -1,6 +1,6 @@
|
|
1
1
|
import json
|
2
2
|
from itertools import count
|
3
|
-
from typing import Any,
|
3
|
+
from typing import Any, Optional, Union, final
|
4
4
|
|
5
5
|
|
6
6
|
class Command:
|
@@ -21,7 +21,7 @@ class Command:
|
|
21
21
|
|
22
22
|
_id_counter = count(start=1) # Starts counting from 1
|
23
23
|
|
24
|
-
def __init__(self, command: str, parameters:
|
24
|
+
def __init__(self, command: str, parameters: dict[str, Any]):
|
25
25
|
self.id = next(self._id_counter) # Automatically assigns the next unique ID
|
26
26
|
self.command = command
|
27
27
|
self.parameters = parameters
|
@@ -44,9 +44,10 @@ class Response:
|
|
44
44
|
|
45
45
|
def __init__(
|
46
46
|
self,
|
47
|
-
id: int,
|
48
|
-
|
49
|
-
|
47
|
+
id: int,
|
48
|
+
command: str,
|
49
|
+
results: Optional[Union[dict[str, Any], Any]] = None,
|
50
|
+
errors: Optional[list[str]] = None,
|
50
51
|
):
|
51
52
|
self.id = id
|
52
53
|
self.command = command
|
@@ -3,4 +3,4 @@ from .simple_cut_spectra_stitch import SimpleCutSpectraStitch
|
|
3
3
|
from .spectra_stitch import SpectraStitch
|
4
4
|
from .y_displacement_spectra_stitch import YDisplacementSpectraStitch
|
5
5
|
|
6
|
-
__all__ = ['LinearSpectraStitch', 'SimpleCutSpectraStitch', 'YDisplacementSpectraStitch', 'SpectraStitch']
|
6
|
+
__all__ = ['LinearSpectraStitch', 'SimpleCutSpectraStitch', 'YDisplacementSpectraStitch', 'SpectraStitch']
|
@@ -1,4 +1,4 @@
|
|
1
|
-
from typing import Any
|
1
|
+
from typing import Any
|
2
2
|
|
3
3
|
from loguru import logger
|
4
4
|
from numpy import argsort, array, concatenate, dtype, interp, ndarray
|
@@ -10,7 +10,7 @@ from horiba_sdk.core.stitching.spectra_stitch import SpectraStitch
|
|
10
10
|
class LinearSpectraStitch(SpectraStitch):
|
11
11
|
"""Stitches a list of spectra using a linear model"""
|
12
12
|
|
13
|
-
def __init__(self, spectra_list:
|
13
|
+
def __init__(self, spectra_list: list[list[list[float]]]) -> None:
|
14
14
|
"""Constructs a linear stitch of spectra.
|
15
15
|
|
16
16
|
.. warning:: The spectra in the list must overlap
|
@@ -24,7 +24,7 @@ class LinearSpectraStitch(SpectraStitch):
|
|
24
24
|
for i in range(1, len(spectra_list)):
|
25
25
|
stitched_spectrum = self._stitch_spectra(stitched_spectrum, spectra_list[i])
|
26
26
|
|
27
|
-
self._stitched_spectrum:
|
27
|
+
self._stitched_spectrum: list[list[float]] = stitched_spectrum
|
28
28
|
|
29
29
|
@override
|
30
30
|
def stitch_with(self, other_stitch: SpectraStitch) -> SpectraStitch:
|
@@ -48,7 +48,7 @@ class LinearSpectraStitch(SpectraStitch):
|
|
48
48
|
"""
|
49
49
|
return self._stitched_spectrum
|
50
50
|
|
51
|
-
def _stitch_spectra(self, spectrum1:
|
51
|
+
def _stitch_spectra(self, spectrum1: list[list[float]], spectrum2: list[list[float]]) -> list[list[float]]:
|
52
52
|
fx1 = spectrum1[0]
|
53
53
|
fy1 = spectrum1[1][0]
|
54
54
|
fx2 = spectrum2[0]
|
@@ -77,9 +77,9 @@ class LinearSpectraStitch(SpectraStitch):
|
|
77
77
|
overlap_start = max(x1_min, x2_min)
|
78
78
|
overlap_end = min(x1_max, x2_max)
|
79
79
|
|
80
|
-
logger.debug(f
|
81
|
-
logger.debug(f
|
82
|
-
logger.debug(f
|
80
|
+
logger.debug(f'Spectrum 1 range: {x1_min} to {x1_max}')
|
81
|
+
logger.debug(f'Spectrum 2 range: {x2_min} to {x2_max}')
|
82
|
+
logger.debug(f'Overlap region: {overlap_start} to {overlap_end}')
|
83
83
|
|
84
84
|
if overlap_start >= overlap_end:
|
85
85
|
logger.error(f'No overlap between spectra: [{x1_min}, {x1_max}] and [{x2_min}, {x2_max}]')
|
@@ -67,7 +67,7 @@ class DeviceManager(AbstractDeviceManager):
|
|
67
67
|
icl_ip: str = '127.0.0.1',
|
68
68
|
icl_port: str = '25010',
|
69
69
|
enable_binary_messages: bool = True,
|
70
|
-
enable_logging: bool = False
|
70
|
+
enable_logging: bool = False,
|
71
71
|
):
|
72
72
|
"""
|
73
73
|
Initializes the DeviceManager with the specified communicator class.
|
@@ -82,7 +82,7 @@ class DeviceManager(AbstractDeviceManager):
|
|
82
82
|
# By default, logging is disabled for a library, so if desired it can be enabled
|
83
83
|
root_name_space: str = __name__.split('.')[0]
|
84
84
|
if enable_logging:
|
85
|
-
logger.info(f
|
85
|
+
logger.info(f'Initializing logger for namespace: {root_name_space}')
|
86
86
|
logger.enable(root_name_space)
|
87
87
|
else:
|
88
88
|
logger.disable(root_name_space)
|
@@ -232,9 +232,7 @@ class DeviceManager(AbstractDeviceManager):
|
|
232
232
|
await monochromators_discovery.execute(error_on_no_device)
|
233
233
|
self._monochromators = monochromators_discovery.monochromators()
|
234
234
|
|
235
|
-
spectracq3_discovery: SpectrAcq3Discovery = SpectrAcq3Discovery(
|
236
|
-
self._icl_communicator, self._icl_error_db
|
237
|
-
)
|
235
|
+
spectracq3_discovery: SpectrAcq3Discovery = SpectrAcq3Discovery(self._icl_communicator, self._icl_error_db)
|
238
236
|
await spectracq3_discovery.execute(error_on_no_device)
|
239
237
|
self._spectracq3_devices = spectracq3_discovery.spectracq3_devices()
|
240
238
|
|
@@ -2,15 +2,15 @@ horiba_sdk/__init__.py,sha256=J8jCV90BJ2SCDFSpacDeAAsJa8PFqBUDpREOJeAgXug,679
|
|
2
2
|
horiba_sdk/communication/__init__.py,sha256=nhS1rw1ZojM8zmRIx0VEFtYge0IH-B_L4zNBUNBJZYE,1564
|
3
3
|
horiba_sdk/communication/abstract_communicator.py,sha256=E80dfOjrfuNay3W5jeSn4T2tUas6vygRcF46kSoP5j8,1498
|
4
4
|
horiba_sdk/communication/communication_exception.py,sha256=d2ouOoVI6Q69_JL1bUEjjQOmjiO0CEm8K20WsaUuhB0,583
|
5
|
-
horiba_sdk/communication/messages.py,sha256=
|
5
|
+
horiba_sdk/communication/messages.py,sha256=7PCCkIpicq0CbN95nLoxIpsXlPd0c5lKbW92rn8h-6w,2701
|
6
6
|
horiba_sdk/communication/websocket_communicator.py,sha256=IFP6dfuqiwGsNymPtT4Hqmii_8n2pO1Jv_k31GfrM8s,8331
|
7
7
|
horiba_sdk/core/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
8
|
-
horiba_sdk/core/acquisition_format.py,sha256=
|
8
|
+
horiba_sdk/core/acquisition_format.py,sha256=CWyLgCotx60-vBAv6ZzMoCpKDXFtS43Q5reiKcYmF6U,350
|
9
9
|
horiba_sdk/core/clean_count_mode.py,sha256=7guLd3eUV3Y2Cnj3w0JJ7ry74I8a6MFQiqbK5pTb3oU,185
|
10
10
|
horiba_sdk/core/resolution.py,sha256=VOQonjPBqZ2TbtiNVDBT3TI1Aymj1pPYWMoobFaXjG8,1029
|
11
|
-
horiba_sdk/core/stitching/__init__.py,sha256=
|
11
|
+
horiba_sdk/core/stitching/__init__.py,sha256=Ih8CHdb9VnoM1DHAO-T3w7IGxZHZqSlnI2AeAuJq7qc,337
|
12
12
|
horiba_sdk/core/stitching/labspec6_spectra_stitch.py,sha256=8oc1DoEtnBhYaOXfLFQBBc12DEh_wRVDI_lu9ELnP6Q,3093
|
13
|
-
horiba_sdk/core/stitching/linear_spectra_stitch.py,sha256=
|
13
|
+
horiba_sdk/core/stitching/linear_spectra_stitch.py,sha256=epA2_pMlJVJ83oBn_4W1IWb3ImIzag61E2XrR-0MpCI,3968
|
14
14
|
horiba_sdk/core/stitching/simple_cut_spectra_stitch.py,sha256=yMqy1T_GwViG4pBwZIDg557gFPR8qMhJv8v1-9eQnTY,2920
|
15
15
|
horiba_sdk/core/stitching/spectra_stitch.py,sha256=Y63e4_sm2fU6GKYphopCWec1n29yMX-fDIyIrjKRuoc,447
|
16
16
|
horiba_sdk/core/stitching/y_displacement_spectra_stitch.py,sha256=YA1RefdJCe5U22gkqQQNi5mLgZ4A7dZxBiezkP0FsAI,3189
|
@@ -21,7 +21,7 @@ horiba_sdk/devices/__init__.py,sha256=YYsJL2CSJwc2vsAjFQEKXjA5_QAnKlxSwlx32EgzFM
|
|
21
21
|
horiba_sdk/devices/abstract_device_discovery.py,sha256=04ZCEB5IZkUuJxSisS78eW6lAQNXG4uaDoPv-eBccBA,178
|
22
22
|
horiba_sdk/devices/abstract_device_manager.py,sha256=RXj5_pzFHpiolJe3ZfFsofwpD1hlwUMwYD1DyWMmlI0,1717
|
23
23
|
horiba_sdk/devices/ccd_discovery.py,sha256=nGuskZ07Y9myI__dU8LeLnrNiJEBpGPby21EEwgSVUk,2376
|
24
|
-
horiba_sdk/devices/device_manager.py,sha256=
|
24
|
+
horiba_sdk/devices/device_manager.py,sha256=0C5qZK7ekZL7A68yXWiUHRYCVqQ1fjioL3861DP1gkY,11548
|
25
25
|
horiba_sdk/devices/fake_device_manager.py,sha256=Tr4Z067smYfy-ya29PO4PK4EWF6Sa1R2UQFZCWfPePE,5015
|
26
26
|
horiba_sdk/devices/fake_icl_server.py,sha256=aVmUZfBddz_w6HX2L6KS_9ei-a4SKtkh5Q8MuUV3szA,2757
|
27
27
|
horiba_sdk/devices/fake_responses/ccd.json,sha256=sMg-UqU6W1I01n2kEbkFc5J0XF8E3JVdOjB-1MhufzM,17020
|
@@ -41,7 +41,7 @@ horiba_sdk/icl_error/abstract_error_db.py,sha256=IJ3wGb6DWxnY35VIUwZX0X80IPi5k4Q
|
|
41
41
|
horiba_sdk/icl_error/error_list.json,sha256=wyDYZPeH2sYMRPoL-JBoDul4uaYvoqp7SJg0zypfl40,5977
|
42
42
|
horiba_sdk/icl_error/icl_error.py,sha256=IElsKl5nvLjprIV_ub9MacJmdSS327iNwOXhSiJXTc0,755
|
43
43
|
horiba_sdk/icl_error/icl_error_db.py,sha256=5Jbs_ZlMp8Bjr4u8reIxxfOSFYYkzWTfKIqOQ4oUSXQ,2603
|
44
|
-
horiba_sdk-0.
|
45
|
-
horiba_sdk-0.
|
46
|
-
horiba_sdk-0.
|
47
|
-
horiba_sdk-0.
|
44
|
+
horiba_sdk-0.7.0.dist-info/LICENSE,sha256=JD-7TpNZoT7emooLwaTU9bJZbFbeM1ba90b8gpCYxzM,1083
|
45
|
+
horiba_sdk-0.7.0.dist-info/METADATA,sha256=l-MRWVpfMYjW3dovj-kzSGahIZTe8mQsT5nxh1aaOfw,14391
|
46
|
+
horiba_sdk-0.7.0.dist-info/WHEEL,sha256=Zb28QaM1gQi8f4VCBhsUklF61CTlNYfs9YAZn-TOGFk,88
|
47
|
+
horiba_sdk-0.7.0.dist-info/RECORD,,
|
File without changes
|
File without changes
|