lima2.client 3.0.0__tar.gz → 3.0a1__tar.gz

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.
Files changed (48) hide show
  1. {lima2_client-3.0.0/src/lima2_client.egg-info → lima2_client-3.0a1}/PKG-INFO +1 -1
  2. {lima2_client-3.0.0 → lima2_client-3.0a1}/src/lima2/client/pipeline.py +16 -16
  3. {lima2_client-3.0.0 → lima2_client-3.0a1}/src/lima2/client/topology.py +6 -11
  4. {lima2_client-3.0.0 → lima2_client-3.0a1/src/lima2_client.egg-info}/PKG-INFO +1 -1
  5. {lima2_client-3.0.0 → lima2_client-3.0a1}/LICENSE +0 -0
  6. {lima2_client-3.0.0 → lima2_client-3.0a1}/README.md +0 -0
  7. {lima2_client-3.0.0 → lima2_client-3.0a1}/pyproject.toml +0 -0
  8. {lima2_client-3.0.0 → lima2_client-3.0a1}/setup.cfg +0 -0
  9. {lima2_client-3.0.0 → lima2_client-3.0a1}/src/finite_state_machine/__init__.py +0 -0
  10. {lima2_client-3.0.0 → lima2_client-3.0a1}/src/finite_state_machine/draw_state_diagram.py +0 -0
  11. {lima2_client-3.0.0 → lima2_client-3.0a1}/src/finite_state_machine/examples/__init__.py +0 -0
  12. {lima2_client-3.0.0 → lima2_client-3.0a1}/src/finite_state_machine/examples/async_github_pull_request.py +0 -0
  13. {lima2_client-3.0.0 → lima2_client-3.0a1}/src/finite_state_machine/examples/async_turnstile.py +0 -0
  14. {lima2_client-3.0.0 → lima2_client-3.0a1}/src/finite_state_machine/examples/boolean_field.py +0 -0
  15. {lima2_client-3.0.0 → lima2_client-3.0a1}/src/finite_state_machine/examples/github_pull_request.py +0 -0
  16. {lima2_client-3.0.0 → lima2_client-3.0a1}/src/finite_state_machine/examples/turnstile.py +0 -0
  17. {lima2_client-3.0.0 → lima2_client-3.0a1}/src/finite_state_machine/exceptions.py +0 -0
  18. {lima2_client-3.0.0 → lima2_client-3.0a1}/src/finite_state_machine/state_machine.py +0 -0
  19. {lima2_client-3.0.0 → lima2_client-3.0a1}/src/lima2/client/__init__.py +0 -0
  20. {lima2_client-3.0.0 → lima2_client-3.0a1}/src/lima2/client/client.py +0 -0
  21. {lima2_client-3.0.0 → lima2_client-3.0a1}/src/lima2/client/convert.py +0 -0
  22. {lima2_client-3.0.0 → lima2_client-3.0a1}/src/lima2/client/detector.py +0 -0
  23. {lima2_client-3.0.0 → lima2_client-3.0a1}/src/lima2/client/devencoded/__init__.py +0 -0
  24. {lima2_client-3.0.0 → lima2_client-3.0a1}/src/lima2/client/devencoded/dense_frame.py +0 -0
  25. {lima2_client-3.0.0 → lima2_client-3.0a1}/src/lima2/client/devencoded/exception.py +0 -0
  26. {lima2_client-3.0.0 → lima2_client-3.0a1}/src/lima2/client/devencoded/smx_sparse_frame.py +0 -0
  27. {lima2_client-3.0.0 → lima2_client-3.0a1}/src/lima2/client/devencoded/sparse_frame.py +0 -0
  28. {lima2_client-3.0.0 → lima2_client-3.0a1}/src/lima2/client/devencoded/structured_array.py +0 -0
  29. {lima2_client-3.0.0 → lima2_client-3.0a1}/src/lima2/client/pipelines/__init__.py +0 -0
  30. {lima2_client-3.0.0 → lima2_client-3.0a1}/src/lima2/client/pipelines/failing.py +0 -0
  31. {lima2_client-3.0.0 → lima2_client-3.0a1}/src/lima2/client/pipelines/legacy.py +0 -0
  32. {lima2_client-3.0.0 → lima2_client-3.0a1}/src/lima2/client/pipelines/smx.py +0 -0
  33. {lima2_client-3.0.0 → lima2_client-3.0a1}/src/lima2/client/pipelines/xpcs.py +0 -0
  34. {lima2_client-3.0.0 → lima2_client-3.0a1}/src/lima2/client/progress_counter.py +0 -0
  35. {lima2_client-3.0.0 → lima2_client-3.0a1}/src/lima2/client/py.typed +0 -0
  36. {lima2_client-3.0.0 → lima2_client-3.0a1}/src/lima2/client/shell.py +0 -0
  37. {lima2_client-3.0.0 → lima2_client-3.0a1}/src/lima2/client/state_machine.py +0 -0
  38. {lima2_client-3.0.0 → lima2_client-3.0a1}/src/lima2/client/utils.py +0 -0
  39. {lima2_client-3.0.0 → lima2_client-3.0a1}/src/lima2/master_file/generate.py +0 -0
  40. {lima2_client-3.0.0 → lima2_client-3.0a1}/src/lima2/server/__init__.py +0 -0
  41. {lima2_client-3.0.0 → lima2_client-3.0a1}/src/lima2/server/control.py +0 -0
  42. {lima2_client-3.0.0 → lima2_client-3.0a1}/src/lima2/server/receiver.py +0 -0
  43. {lima2_client-3.0.0 → lima2_client-3.0a1}/src/lima2/server/timer.py +0 -0
  44. {lima2_client-3.0.0 → lima2_client-3.0a1}/src/lima2_client.egg-info/SOURCES.txt +0 -0
  45. {lima2_client-3.0.0 → lima2_client-3.0a1}/src/lima2_client.egg-info/dependency_links.txt +0 -0
  46. {lima2_client-3.0.0 → lima2_client-3.0a1}/src/lima2_client.egg-info/entry_points.txt +0 -0
  47. {lima2_client-3.0.0 → lima2_client-3.0a1}/src/lima2_client.egg-info/requires.txt +0 -0
  48. {lima2_client-3.0.0 → lima2_client-3.0a1}/src/lima2_client.egg-info/top_level.txt +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: lima2-client
3
- Version: 3.0.0
3
+ Version: 3.0a1
4
4
  Summary: Python client library for Lima2 detector
5
5
  Author: BCU (ESRF)
6
6
  License: Copyright (c) 2020-2024 Beamline Control Unit, ESRF
@@ -379,13 +379,13 @@ class Pipeline:
379
379
 
380
380
  # Pop stats for new frames from each receiver and concatenate, mixing in cached data.
381
381
  # Data comes from server as 1D array with size (num_frames * num_rois)
382
- def pop_data(dev) -> np.ndarray:
383
- return structured_array.decode(dev.popRoiStatistics(), dtype)
384
-
385
- num_rcvs = len(self._devs)
386
- with ThreadPoolExecutor(max_workers=num_rcvs) as pool:
387
- flat_cache = [cache.flatten()]
388
- new_data = np.concatenate(flat_cache + list(pool.map(pop_data, self._devs)))
382
+ new_data = np.concatenate(
383
+ [cache.flatten()]
384
+ + [
385
+ structured_array.decode(dev.popRoiStatistics(), dtype)
386
+ for dev in self._devs
387
+ ]
388
+ )
389
389
 
390
390
  # Guess number of frames from the data
391
391
  num_frames = np.unique(new_data["frame_idx"]).size
@@ -473,13 +473,13 @@ class Pipeline:
473
473
 
474
474
  # Pop profiles for new frames from each receiver and concatenate, mixing in cached data.
475
475
  # Data comes from server as 1D array with size (num_frames * sum(roi_lengths))
476
- def pop_data(dev) -> np.ndarray:
477
- return structured_array.decode(dev.popRoiProfiles(), dtype)
478
-
479
- num_rcvs = len(self._devs)
480
- with ThreadPoolExecutor(max_workers=num_rcvs) as pool:
481
- flat_cache = [cache.flatten()]
482
- new_data = np.concatenate(flat_cache + list(pool.map(pop_data, self._devs)))
476
+ new_data = np.concatenate(
477
+ [cache.flatten()]
478
+ + [
479
+ structured_array.decode(dev.popRoiProfiles(), dtype)
480
+ for dev in self._devs
481
+ ]
482
+ )
483
483
 
484
484
  # Reshape into (num_frames, sum(roi_lengths))
485
485
  new_data = new_data.reshape((-1, sum(roi_lengths)))
@@ -654,9 +654,9 @@ class Pipeline:
654
654
  "no associated label"
655
655
  )
656
656
 
657
- def last_frames(rcv_idx: int) -> int:
657
+ def last_frames(rcv_idx):
658
658
  last_frames_str = self._devs[rcv_idx].last_frames
659
- return int(json.loads(last_frames_str)[f"{source.label}_idx"])
659
+ return json.loads(last_frames_str)[f"{source.label}_idx"]
660
660
 
661
661
  num_rcvs = len(self._devs)
662
662
  with ThreadPoolExecutor(max_workers=num_rcvs) as pool:
@@ -9,7 +9,6 @@ import copy
9
9
  from abc import ABC, abstractmethod
10
10
  from collections.abc import Callable
11
11
  from enum import Enum
12
- from concurrent.futures import ThreadPoolExecutor
13
12
 
14
13
  import tango as tg
15
14
  from beartype import beartype
@@ -108,22 +107,18 @@ class UnevenTopology(Topology):
108
107
  If the frame is found on multiple devices (e.g. frame_idx=-1),
109
108
  return the one found last (not necessarily the most recent).
110
109
  """
110
+ frame: EncodedFrame | None = None
111
111
 
112
- def get_frame(rcv_idx) -> EncodedFrame | None:
112
+ for i in range(self.num_receivers):
113
113
  try:
114
- frame: EncodedFrame = getters[rcv_idx](frame_idx)
115
- return frame
114
+ frame = getters[i](frame_idx)
116
115
  except tg.DevFailed:
117
- return None
116
+ pass
118
117
 
119
- num_rcvs = self.num_receivers
120
- with ThreadPoolExecutor(max_workers=num_rcvs) as pool:
121
- frames = [f for f in pool.map(get_frame, range(num_rcvs)) if f is not None]
122
-
123
- if len(frames) == 0:
118
+ if frame is None:
124
119
  raise IndexError(f"Frame {frame_idx} not available from any receiver")
125
120
 
126
- return frames[0]
121
+ return frame
127
122
 
128
123
 
129
124
  def distribute_acq(
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: lima2-client
3
- Version: 3.0.0
3
+ Version: 3.0a1
4
4
  Summary: Python client library for Lima2 detector
5
5
  Author: BCU (ESRF)
6
6
  License: Copyright (c) 2020-2024 Beamline Control Unit, ESRF
File without changes
File without changes
File without changes