lima2.client 4.0.dev1__tar.gz → 4.0.2__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 (151) hide show
  1. lima2_client-4.0.2/.gitignore +25 -0
  2. lima2_client-4.0.2/.gitlab-ci.yml +142 -0
  3. lima2_client-4.0.2/PKG-INFO +293 -0
  4. lima2_client-4.0.2/README.md +232 -0
  5. lima2_client-4.0.2/conda/meta.yaml +59 -0
  6. lima2_client-4.0.2/conda/run_test.sh +10 -0
  7. lima2_client-4.0.2/docs/assets/lima2-components-and-repos.svg +10 -0
  8. lima2_client-4.0.2/docs/assets/lima2-conductor-communication-model.svg +10 -0
  9. lima2_client-4.0.2/docs/assets/lima2-conductor-modules.svg +10 -0
  10. lima2_client-4.0.2/docs/assets/logo-transparent-crop.png +0 -0
  11. lima2_client-4.0.2/docs/concepts.md +59 -0
  12. lima2_client-4.0.2/docs/contact.md +8 -0
  13. lima2_client-4.0.2/docs/dev/conductor_client.md +13 -0
  14. lima2_client-4.0.2/docs/dev/conductor_design.md +192 -0
  15. lima2_client-4.0.2/docs/dev/conductor_requirements.md +43 -0
  16. lima2_client-4.0.2/docs/dev/index.md +4 -0
  17. lima2_client-4.0.2/docs/features.md +70 -0
  18. lima2_client-4.0.2/docs/getting_started.md +112 -0
  19. lima2_client-4.0.2/docs/index.md +25 -0
  20. lima2_client-4.0.2/docs/license.md +3 -0
  21. lima2_client-4.0.2/docs/monitor.md +9 -0
  22. lima2_client-4.0.2/docs/reference/acquisition.md +12 -0
  23. lima2_client-4.0.2/docs/reference/detector.md +12 -0
  24. lima2_client-4.0.2/docs/reference/exceptions.md +25 -0
  25. lima2_client-4.0.2/docs/reference/index.md +9 -0
  26. lima2_client-4.0.2/docs/reference/pipeline.md +12 -0
  27. lima2_client-4.0.2/docs/reference/session.md +12 -0
  28. lima2_client-4.0.2/docs/release_notes.md +3 -0
  29. lima2_client-4.0.2/docs/shell.md +37 -0
  30. lima2_client-4.0.2/flake8.ini +8 -0
  31. lima2_client-4.0.2/mkdocs.yml +72 -0
  32. {lima2_client-4.0.dev1 → lima2_client-4.0.2}/pyproject.toml +18 -15
  33. lima2_client-4.0.2/scripts/cleanup_processing_ds.py +29 -0
  34. {lima2_client-4.0.dev1/src/lima2/conductor/server → lima2_client-4.0.2/src/lima2/client}/__init__.py +4 -1
  35. lima2_client-4.0.2/src/lima2/client/exceptions.py +24 -0
  36. lima2_client-4.0.2/src/lima2/client/services.py +415 -0
  37. lima2_client-4.0.2/src/lima2/client/session.py +135 -0
  38. {lima2_client-4.0.dev1/src/lima2/conductor → lima2_client-4.0.2/src/lima2}/client/shell.py +33 -37
  39. lima2_client-4.0.2/src/lima2/common/__init__.py +13 -0
  40. {lima2_client-4.0.dev1/src/lima2/client → lima2_client-4.0.2/src/lima2/common}/devencoded/dense_frame.py +1 -2
  41. {lima2_client-4.0.dev1/src/lima2/client → lima2_client-4.0.2/src/lima2/common}/devencoded/smx_sparse_frame.py +2 -3
  42. {lima2_client-4.0.dev1/src/lima2/client → lima2_client-4.0.2/src/lima2/common}/devencoded/sparse_frame.py +1 -1
  43. {lima2_client-4.0.dev1/src/lima2/client → lima2_client-4.0.2/src/lima2/common}/devencoded/structured_array.py +1 -2
  44. lima2_client-4.0.2/src/lima2/common/exceptions.py +148 -0
  45. lima2_client-4.0.2/src/lima2/common/pipelines.py +131 -0
  46. {lima2_client-4.0.dev1/src/lima2/client → lima2_client-4.0.2/src/lima2/common}/progress_counter.py +2 -1
  47. {lima2_client-4.0.dev1/src/lima2/client → lima2_client-4.0.2/src/lima2/common}/state.py +35 -14
  48. lima2_client-4.0.2/src/lima2/common/types.py +188 -0
  49. {lima2_client-4.0.dev1/src/lima2/client → lima2_client-4.0.2/src/lima2/conductor}/acquisition_system.py +332 -151
  50. {lima2_client-4.0.dev1/src/lima2/client → lima2_client-4.0.2/src/lima2/conductor}/processing/__init__.py +13 -23
  51. lima2_client-4.0.2/src/lima2/conductor/processing/failing.py +43 -0
  52. lima2_client-4.0.2/src/lima2/conductor/processing/legacy.py +57 -0
  53. lima2_client-4.0.2/src/lima2/conductor/processing/master_file.py +462 -0
  54. lima2_client-4.0.2/src/lima2/conductor/processing/pipeline.py +651 -0
  55. lima2_client-4.0.2/src/lima2/conductor/processing/reduced_data.py +587 -0
  56. lima2_client-4.0.2/src/lima2/conductor/processing/smx.py +71 -0
  57. lima2_client-4.0.2/src/lima2/conductor/processing/xpcs.py +58 -0
  58. lima2_client-4.0.2/src/lima2/conductor/py.typed +0 -0
  59. {lima2_client-4.0.dev1/src/lima2/client → lima2_client-4.0.2/src/lima2/conductor}/tango/control.py +40 -25
  60. {lima2_client-4.0.dev1/src/lima2/client → lima2_client-4.0.2/src/lima2/conductor}/tango/processing.py +47 -44
  61. {lima2_client-4.0.dev1/src/lima2/client → lima2_client-4.0.2/src/lima2/conductor}/tango/receiver.py +46 -29
  62. lima2_client-4.0.2/src/lima2/conductor/tango/utils.py +110 -0
  63. lima2_client-4.0.2/src/lima2/conductor/topology.py +278 -0
  64. lima2_client-4.0.2/src/lima2/conductor/utils.py +261 -0
  65. lima2_client-4.0.2/src/lima2/conductor/webservice/__init__.py +10 -0
  66. {lima2_client-4.0.dev1/src/lima2/conductor/server → lima2_client-4.0.2/src/lima2/conductor/webservice}/acquisition.py +23 -20
  67. {lima2_client-4.0.dev1/src/lima2/conductor/server → lima2_client-4.0.2/src/lima2/conductor/webservice}/cli.py +8 -8
  68. {lima2_client-4.0.dev1/src/lima2/conductor/server → lima2_client-4.0.2/src/lima2/conductor/webservice}/detector.py +1 -1
  69. {lima2_client-4.0.dev1/src/lima2/conductor/server → lima2_client-4.0.2/src/lima2/conductor/webservice}/main.py +19 -11
  70. {lima2_client-4.0.dev1/src/lima2/conductor/server → lima2_client-4.0.2/src/lima2/conductor/webservice}/pipeline.py +160 -52
  71. {lima2_client-4.0.dev1/src/lima2/conductor/server → lima2_client-4.0.2/src/lima2/conductor/webservice}/utils.py +4 -1
  72. {lima2_client-4.0.dev1/src/lima2/conductor/server → lima2_client-4.0.2/src/lima2/conductor/webservice}/webapp.py +41 -22
  73. lima2_client-4.0.2/src/lima2_client.egg-info/PKG-INFO +293 -0
  74. lima2_client-4.0.2/src/lima2_client.egg-info/SOURCES.txt +126 -0
  75. lima2_client-4.0.2/src/lima2_client.egg-info/entry_points.txt +3 -0
  76. {lima2_client-4.0.dev1 → lima2_client-4.0.2}/src/lima2_client.egg-info/requires.txt +16 -8
  77. lima2_client-4.0.2/tests/__init__.py +4 -0
  78. lima2_client-4.0.2/tests/integration/__init__.py +0 -0
  79. lima2_client-4.0.2/tests/integration/conftest.py +136 -0
  80. lima2_client-4.0.2/tests/integration/tango_db/simulator_ctl.yaml +8 -0
  81. lima2_client-4.0.2/tests/integration/tango_db/simulator_rcv1.yaml +6 -0
  82. lima2_client-4.0.2/tests/integration/tango_db/simulator_rcv2.yaml +6 -0
  83. lima2_client-4.0.2/tests/integration/test_failing.py +186 -0
  84. lima2_client-4.0.2/tests/integration/test_legacy.py +159 -0
  85. lima2_client-4.0.2/tests/unit/__init__.py +4 -0
  86. lima2_client-4.0.2/tests/unit/client/__init__.py +6 -0
  87. lima2_client-4.0.2/tests/unit/client/conftest.py +73 -0
  88. lima2_client-4.0.2/tests/unit/client/test_acquisition.py +144 -0
  89. lima2_client-4.0.2/tests/unit/client/test_detector.py +40 -0
  90. lima2_client-4.0.2/tests/unit/client/test_pipeline.py +310 -0
  91. lima2_client-4.0.2/tests/unit/client/test_session.py +174 -0
  92. lima2_client-4.0.2/tests/unit/common/__init__.py +6 -0
  93. lima2_client-4.0.2/tests/unit/common/test_dense_frame.py +155 -0
  94. lima2_client-4.0.2/tests/unit/common/test_progress_counter.py +75 -0
  95. lima2_client-4.0.2/tests/unit/common/test_smx_sparse_frame.py +149 -0
  96. lima2_client-4.0.2/tests/unit/common/test_sparse_frame.py +110 -0
  97. lima2_client-4.0.2/tests/unit/common/test_state.py +63 -0
  98. lima2_client-4.0.2/tests/unit/conductor/__init__.py +6 -0
  99. lima2_client-4.0.2/tests/unit/conductor/mock_devencoded.py +53 -0
  100. lima2_client-4.0.2/tests/unit/conductor/mock_devices.py +227 -0
  101. lima2_client-4.0.2/tests/unit/conductor/test_acquisition_system.py +714 -0
  102. lima2_client-4.0.2/tests/unit/conductor/test_master_file.py +430 -0
  103. lima2_client-4.0.2/tests/unit/conductor/test_pipeline.py +877 -0
  104. lima2_client-4.0.2/tests/unit/conductor/test_processing.py +20 -0
  105. lima2_client-4.0.2/tests/unit/conductor/test_reduced_data.py +600 -0
  106. lima2_client-4.0.2/tests/unit/conductor/test_tango_devices.py +565 -0
  107. lima2_client-4.0.2/tests/unit/conductor/test_topology.py +302 -0
  108. lima2_client-4.0.2/tests/unit/conductor/test_utils.py +157 -0
  109. lima2_client-4.0.2/tests/unit/conductor/webservice/__init__.py +6 -0
  110. lima2_client-4.0.2/tests/unit/conductor/webservice/test_acquisition.py +206 -0
  111. lima2_client-4.0.2/tests/unit/conductor/webservice/test_benchmark.py +88 -0
  112. lima2_client-4.0.2/tests/unit/conductor/webservice/test_detector.py +78 -0
  113. lima2_client-4.0.2/tests/unit/conductor/webservice/test_pipelines.py +290 -0
  114. lima2_client-4.0.2/tests/unit/conductor/webservice/test_utils.py +71 -0
  115. lima2_client-4.0.2/tests/unit/conductor/webservice/test_webapp.py +117 -0
  116. lima2_client-4.0.dev1/PKG-INFO +0 -98
  117. lima2_client-4.0.dev1/README.md +0 -43
  118. lima2_client-4.0.dev1/src/lima2/client/__init__.py +0 -14
  119. lima2_client-4.0.dev1/src/lima2/client/processing/failing.py +0 -38
  120. lima2_client-4.0.dev1/src/lima2/client/processing/frame.py +0 -91
  121. lima2_client-4.0.dev1/src/lima2/client/processing/legacy.py +0 -41
  122. lima2_client-4.0.dev1/src/lima2/client/processing/master_file.py +0 -541
  123. lima2_client-4.0.dev1/src/lima2/client/processing/pipeline.py +0 -392
  124. lima2_client-4.0.dev1/src/lima2/client/processing/reduced_data.py +0 -592
  125. lima2_client-4.0.dev1/src/lima2/client/processing/smx.py +0 -70
  126. lima2_client-4.0.dev1/src/lima2/client/processing/xpcs.py +0 -64
  127. lima2_client-4.0.dev1/src/lima2/client/tango/utils.py +0 -86
  128. lima2_client-4.0.dev1/src/lima2/client/topology.py +0 -221
  129. lima2_client-4.0.dev1/src/lima2/client/utils.py +0 -75
  130. lima2_client-4.0.dev1/src/lima2/conductor/client/__init__.py +0 -30
  131. lima2_client-4.0.dev1/src/lima2/conductor/client/acquisition.py +0 -91
  132. lima2_client-4.0.dev1/src/lima2/conductor/client/detector.py +0 -25
  133. lima2_client-4.0.dev1/src/lima2/conductor/client/exceptions.py +0 -32
  134. lima2_client-4.0.dev1/src/lima2/conductor/client/pipeline.py +0 -171
  135. lima2_client-4.0.dev1/src/lima2/conductor/client/session.py +0 -91
  136. lima2_client-4.0.dev1/src/lima2_client.egg-info/PKG-INFO +0 -98
  137. lima2_client-4.0.dev1/src/lima2_client.egg-info/SOURCES.txt +0 -56
  138. lima2_client-4.0.dev1/src/lima2_client.egg-info/entry_points.txt +0 -3
  139. {lima2_client-4.0.dev1 → lima2_client-4.0.2}/LICENSE +0 -0
  140. {lima2_client-4.0.dev1 → lima2_client-4.0.2}/setup.cfg +0 -0
  141. {lima2_client-4.0.dev1 → lima2_client-4.0.2}/src/lima2/client/py.typed +0 -0
  142. {lima2_client-4.0.dev1/src/lima2/client → lima2_client-4.0.2/src/lima2/common}/devencoded/__init__.py +0 -0
  143. {lima2_client-4.0.dev1/src/lima2/client → lima2_client-4.0.2/src/lima2/common}/devencoded/exception.py +0 -0
  144. {lima2_client-4.0.dev1/src/lima2/conductor → lima2_client-4.0.2/src/lima2/common}/py.typed +0 -0
  145. {lima2_client-4.0.dev1 → lima2_client-4.0.2}/src/lima2/conductor/__init__.py +0 -0
  146. {lima2_client-4.0.dev1/src/lima2/client → lima2_client-4.0.2/src/lima2/conductor}/tango/__init__.py +0 -0
  147. {lima2_client-4.0.dev1/src/lima2/conductor/server → lima2_client-4.0.2/src/lima2/conductor/webservice}/benchmark.py +0 -0
  148. {lima2_client-4.0.dev1/src/lima2/conductor/server → lima2_client-4.0.2/src/lima2/conductor/webservice}/benchmark_generators/__init__.py +0 -0
  149. {lima2_client-4.0.dev1/src/lima2/conductor/server → lima2_client-4.0.2/src/lima2/conductor/webservice}/benchmark_generators/rois.py +0 -0
  150. {lima2_client-4.0.dev1 → lima2_client-4.0.2}/src/lima2_client.egg-info/dependency_links.txt +0 -0
  151. {lima2_client-4.0.dev1 → lima2_client-4.0.2}/src/lima2_client.egg-info/top_level.txt +0 -0
@@ -0,0 +1,25 @@
1
+ # Byte / compiled / optimized
2
+ *.py[cod]
3
+ __pycache__/
4
+ *.so
5
+
6
+ # Distribution / packaging
7
+ /dist/
8
+ /build/
9
+ *.egg-info/
10
+ .eggs/
11
+
12
+ # Unittest / coverage
13
+ *.py,cover
14
+ .coverage.*
15
+ htmlcov/
16
+ .cache/
17
+ .pytest_cache/
18
+
19
+ # Profiler
20
+ /prof/
21
+
22
+ # mypy
23
+ .mypy_cache/
24
+ .dmypy.json
25
+ dmypy.json
@@ -0,0 +1,142 @@
1
+ stages:
2
+ - style
3
+ - tests
4
+ - build
5
+ - doc
6
+ - deploy
7
+
8
+ black-format:
9
+ stage: style
10
+ script:
11
+ - mamba install --yes -c conda-forge black=22.3
12
+ - LC_ALL=C.UTF-8 black --check .
13
+ tags:
14
+ - linux
15
+
16
+ flake-format:
17
+ stage: style
18
+ script:
19
+ - mamba install --yes -c conda-forge flake8
20
+ # disable dubious ownership check
21
+ - git config --global --add safe.directory "*"
22
+ # choose from where to diff (complete merge request or last commit otherwise)
23
+ - >
24
+ if [ $CI_PIPELINE_SOURCE == "merge_request_event" ]; then
25
+ BASE_SHA="${CI_MERGE_REQUEST_DIFF_BASE_SHA}"
26
+ else
27
+ BASE_SHA=$(git rev-parse HEAD^)
28
+ fi
29
+ # list Added/Copied/Modified .py files since $BASE_SHA
30
+ - PY_CHANGES=$(git diff $BASE_SHA --name-only --diff-filter=ACM -- "***.py")
31
+ # abort if no files
32
+ - >
33
+ if [ -z "${PY_CHANGES}" ]; then
34
+ echo "No changes."
35
+ exit 0
36
+ fi
37
+ - flake8 --config flake8.ini $PY_CHANGES
38
+ # allow failure without impacting the rest of the CI (will show an orange warning in the UI)
39
+ allow_failure: true
40
+ tags:
41
+ - linux
42
+
43
+ mypy:
44
+ stage: style
45
+ script:
46
+ - pip install .[dev]
47
+ - pip install mypy-gitlab-code-quality
48
+ - mypy --no-error-summary > mypy-out.txt || true
49
+ - mypy-gitlab-code-quality < mypy-out.txt > codequality.json
50
+ artifacts:
51
+ reports:
52
+ codequality: codequality.json
53
+ tags:
54
+ - linux
55
+ - numpy2.3+
56
+
57
+ unit-test:
58
+ stage: tests
59
+ script:
60
+ - pip install -e .[dev]
61
+ - pytest --cov lima2.client --cov lima2.conductor --cov lima2.common --cov-report term --cov-report xml:coverage.xml --junitxml junit-report.xml tests/unit
62
+ artifacts:
63
+ paths:
64
+ - junit-report.xml
65
+ - coverage.xml
66
+ reports:
67
+ junit: junit-report.xml
68
+ coverage_report:
69
+ coverage_format: cobertura
70
+ path: coverage.xml
71
+ coverage: '/TOTAL.*? (100(?:\.0+)?\%|[1-9]?\d(?:\.\d+)?\%)$/'
72
+ tags:
73
+ - linux
74
+ - numpy2.3+
75
+
76
+ build-conda:
77
+ stage: build
78
+ script:
79
+ - conda build --output-folder=dist/conda -c esrf-bcu -c conda-forge conda
80
+ artifacts:
81
+ paths:
82
+ - dist/conda/
83
+ tags:
84
+ - linux
85
+
86
+ build-pypi:
87
+ stage: build
88
+ script:
89
+ - mamba install --yes python-build
90
+ - python -m build --outdir=dist/pypi .
91
+ artifacts:
92
+ paths:
93
+ - dist/pypi/
94
+ tags:
95
+ - linux
96
+
97
+ deploy-conda:
98
+ stage: deploy
99
+ environment:
100
+ name: production/conda
101
+ url: https://anaconda.org/esrf-bcu/lima2-client
102
+ dependencies:
103
+ - build-conda
104
+ script:
105
+ - anaconda --token=$ANACONDA_TOKEN upload --user=esrf-bcu dist/conda/**/*.tar.bz2
106
+ tags:
107
+ - linux
108
+ only:
109
+ - tags
110
+
111
+ deploy-pypi:
112
+ stage: deploy
113
+ environment:
114
+ name: production/pypi
115
+ url: https://pypi.org/project/lima2.client/
116
+ dependencies:
117
+ - build-pypi
118
+ script:
119
+ - pip install twine
120
+ - pip install -U packaging
121
+ - twine upload dist/pypi/*
122
+ tags:
123
+ - linux
124
+ only:
125
+ - tags
126
+
127
+ pages:
128
+ stage: doc
129
+ before_script:
130
+ - pip install .[docs]
131
+ script:
132
+ - mkdocs build
133
+ - mv site public
134
+ tags:
135
+ - linux
136
+ - numpy2.3+
137
+ artifacts:
138
+ paths:
139
+ - public
140
+ expire_in: 7 days
141
+ only:
142
+ - main
@@ -0,0 +1,293 @@
1
+ Metadata-Version: 2.4
2
+ Name: lima2-client
3
+ Version: 4.0.2
4
+ Summary: Python client library for Lima2 detector
5
+ Author: BCU (ESRF)
6
+ License: Copyright (c) 2020-2024 Beamline Control Unit, ESRF
7
+
8
+ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
9
+
10
+ The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
11
+
12
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
13
+
14
+ Project-URL: Repository, https://gitlab.esrf.fr/limagroup/lima2-client
15
+ Project-URL: Documentation, https://limagroup.gitlab-pages.esrf.fr/lima2-client/
16
+ Classifier: Intended Audience :: Science/Research
17
+ Classifier: License :: OSI Approved :: MIT License
18
+ Classifier: Programming Language :: Python :: 3
19
+ Requires-Python: >=3.10
20
+ Description-Content-Type: text/markdown
21
+ License-File: LICENSE
22
+ Requires-Dist: h5py
23
+ Requires-Dist: jsonschema
24
+ Requires-Dist: jsonschema-default
25
+ Requires-Dist: numpy
26
+ Requires-Dist: pytango
27
+ Requires-Dist: pyyaml
28
+ Requires-Dist: requests
29
+ Requires-Dist: termcolor
30
+ Requires-Dist: typing-extensions
31
+ Requires-Dist: typer
32
+ Provides-Extra: conductor
33
+ Requires-Dist: jsonschema-rs; extra == "conductor"
34
+ Requires-Dist: orjson; extra == "conductor"
35
+ Requires-Dist: starlette; extra == "conductor"
36
+ Requires-Dist: uvicorn[standard]; extra == "conductor"
37
+ Provides-Extra: shell
38
+ Requires-Dist: ipython; extra == "shell"
39
+ Provides-Extra: dev
40
+ Requires-Dist: black==22.3; extra == "dev"
41
+ Requires-Dist: flake8; extra == "dev"
42
+ Requires-Dist: httpx; extra == "dev"
43
+ Requires-Dist: lima2-client[conductor]; extra == "dev"
44
+ Requires-Dist: lima2-client[shell]; extra == "dev"
45
+ Requires-Dist: mypy; extra == "dev"
46
+ Requires-Dist: nosqltangodb; extra == "dev"
47
+ Requires-Dist: pytest; extra == "dev"
48
+ Requires-Dist: pytest-asyncio; extra == "dev"
49
+ Requires-Dist: pytest-cov; extra == "dev"
50
+ Requires-Dist: requests-mock; extra == "dev"
51
+ Requires-Dist: types-jsonschema; extra == "dev"
52
+ Requires-Dist: types-pyyaml; extra == "dev"
53
+ Requires-Dist: types-requests; extra == "dev"
54
+ Provides-Extra: docs
55
+ Requires-Dist: mkdocs; extra == "docs"
56
+ Requires-Dist: markdown-include; extra == "docs"
57
+ Requires-Dist: mkdocs-material; extra == "docs"
58
+ Requires-Dist: mkdocstrings[python]; extra == "docs"
59
+ Requires-Dist: pygments; extra == "docs"
60
+ Dynamic: license-file
61
+
62
+ # Lima2 Client
63
+
64
+ ![pypi badge](https://badge.fury.io/py/lima2.client.svg?icon=si%3Apython)
65
+ ![pipeline badge](https://gitlab.esrf.fr/limagroup/lima2-client/badges/main/pipeline.svg)
66
+ ![coverage badge](https://gitlab.esrf.fr/limagroup/lima2-client/badges/main/coverage.svg?min_good=90&min_acceptable=80&min_medium=75)
67
+
68
+ This repo contains source code for the Lima2 Conductor, an orchestration module
69
+ for the Lima2 acquisition system, and its python client library, the
70
+ `lima2.client` package.
71
+
72
+ Install the lima2-client package:
73
+
74
+ ```sh
75
+ pip install lima2-client
76
+ ```
77
+
78
+ ## Quickstart
79
+
80
+ A minimal setup for running Lima2 requires:
81
+
82
+ - The [`lima2`](https://anaconda.org/esrf-bcu/lima2) conda package
83
+ - The [`lima2-client`](https://pypi.org/project/lima2-client/) python package
84
+ - A tango server, e.g. [`nosqltangodb`](https://pypi.org/project/nosqltangodb/)
85
+
86
+ > **_NOTE:_** In a bliss environment, the tango server comes with `bliss-demo-servers`,
87
+ > so `nosqltangodb` is not required.
88
+
89
+ Install everything into a new conda environment:
90
+
91
+ ```sh
92
+ conda create -n lima2 "python==3.10"
93
+ conda activate lima2
94
+ conda install -c esrf-bcu lima2
95
+ pip install lima2-client[conductor,shell] nosqltangodb
96
+ ```
97
+
98
+ The first step is to start the tango server. For `nosqltangodb`, example config
99
+ files can be found in the repo's
100
+ [`tests/integration/tango_db/`](https://gitlab.esrf.fr/limagroup/lima2-client/-/tree/main/tests/integration/tango_db)
101
+ directory. Fetch it into the current directory with:
102
+
103
+ ```sh
104
+ wget -qO- https://gitlab.esrf.fr/limagroup/lima2-client/-/archive/main/lima2-client-main.tar.gz?path=tests/integration/tango_db | tar -xz --strip-components=1
105
+ ```
106
+
107
+ Start the tango server:
108
+
109
+ ```sh
110
+ NosqlTangoDB --port 10000 --db_access yaml:tests/integration/tango_db/ 2
111
+ ```
112
+
113
+ Start the Lima2 devices (one control, two receivers):
114
+
115
+ ```sh
116
+ export TANGO_HOST="localhost:10000"
117
+ mpiexec -n 1 lima2_tango simulator_ctl : \
118
+ -n 1 lima2_tango simulator_rcv1 : \
119
+ -n 1 lima2_tango simulator_rcv2
120
+ ```
121
+
122
+ Start the Lima2 Conductor, which listens on port 58712 by default:
123
+
124
+ ```sh
125
+ lima2-conductor start \
126
+ localhost:10000 \
127
+ round_robin \
128
+ id00/limacontrol/simulator \
129
+ id00/limareceiver/simulator1 \
130
+ id00/limareceiver/simulator2
131
+ ```
132
+
133
+ With all parts online, a client can now make requests to the conductor to
134
+ interact with the acquisition system.
135
+
136
+ The quickest way to start is inside the interactive session (requires the
137
+ `lima2-client[shell]` extra dependencies):
138
+
139
+ ```sh
140
+ lima2-shell
141
+ ```
142
+
143
+ ```py
144
+ In [1]: run_acquisition(nb_frames=120, expo_time=0.02) # Should take 2.4 seconds
145
+ In [2]: pipeline.progress()
146
+ Out[2]: 120
147
+ ```
148
+
149
+ In the shell, the entire API of the conductor is exposed via the following
150
+ namespaces:
151
+
152
+ - `acquisition`: direct commands (prepare, start, stop, reset), system state and
153
+ progress
154
+ - `detector`: detector information, commands, capabilities and real-time status
155
+ - `pipeline`: data access (reduced data streams, frames) and detailed processing
156
+ progress
157
+
158
+ For more details, the [lima2-shell doc](https://limagroup.gitlab-pages.esrf.fr/lima2-client/shell/) and the
159
+ [API reference](https://limagroup.gitlab-pages.esrf.fr/lima2-client/reference/)
160
+ should be useful.
161
+
162
+ ## Description
163
+
164
+ This repo is organized as follows:
165
+
166
+ ```sh
167
+ lima2-client
168
+ ├── conda # Conda build configuration
169
+ ├── docs # Documentation sources
170
+ ├── scripts # Auxiliary scripts
171
+ ├── src/lima2
172
+ │   ├── client # Conductor client-side library
173
+ │   ├── conductor # Conductor server code
174
+ │   └── common # Shared definitions
175
+ └── tests
176
+ ├── integration
177
+ └── unit
178
+ ├── client
179
+ ├── conductor
180
+ └── common
181
+ ```
182
+
183
+ The project is composed of three main python packages.
184
+
185
+ ### `lima2.client`
186
+
187
+ The conductor's client-side library, meant to be imported from a control
188
+ application or a data consumer. In this package, the conductor webapp's API
189
+ endpoints are wrapped into python functions. The docs contain a complete [API
190
+ reference](https://limagroup.gitlab-pages.esrf.fr/lima2-client/reference/).
191
+
192
+ ### `lima2.conductor`
193
+
194
+ Implements the [Lima2
195
+ Conductor](https://limagroup.gitlab-pages.esrf.fr/lima2-client/dev/conductor_requirements/),
196
+ the orchestration process for distributed acquisitions.
197
+
198
+ Its central class is the
199
+ [`AcquisitionSystem`](https://limagroup.gitlab-pages.esrf.fr/lima2-client/dev/conductor_design/#acquisition-system),
200
+ which encapsulates the Lima2 acquisition, detector and processing systems.
201
+
202
+ This package also contains the `lima2.conductor.webservice` subpackage: the
203
+ conductor web server, which provides HTTP endpoints to interact with the
204
+ conductor remotely.
205
+
206
+ ### `lima2.common`
207
+
208
+ Contains type definitions and utilities meant to be imported from
209
+ `lima2.client`, `lima2.conductor`, and directly from client apps.
210
+
211
+ ## Development environment
212
+
213
+ The `dev` optional dependencies contains tools necessary for development and testing.
214
+
215
+ ### uv
216
+
217
+ Install all dependencies into a local venv:
218
+
219
+ ```sh
220
+ uv sync --extra dev
221
+ ```
222
+
223
+ Commands can be run with `uv run`:
224
+
225
+ ```sh
226
+ uv run lima2-conductor --help
227
+ uv run lima2-shell --help
228
+ ```
229
+
230
+ > **_NOTE:_** lima2-conductor has a `dev` command, which enables live code reloading
231
+ > on save.
232
+
233
+ ### conda
234
+
235
+ Create a new conda environment with python > 3.9:
236
+
237
+ ```sh
238
+ conda create -n lima2-client "python==3.10"
239
+ conda activate lima2-client
240
+ pip install -e .[dev]
241
+ ```
242
+
243
+ Execute commands directly:
244
+
245
+ ```sh
246
+ lima2-conductor --help
247
+ lima2-shell --help
248
+ ```
249
+
250
+ ## Tests
251
+
252
+ Unit and integration tests can be run locally. All dependencies for unit tests should be in the optional `dev` dependencies, and the `pyproject.toml` defines common `pytest` parameters.
253
+
254
+ After setting up your [dev environment](#development-environment), run the unit tests (prepend `uv run` if using uv):
255
+
256
+ ```sh
257
+ pytest tests/unit
258
+ # Compute coverage and output the coverage report to htmlcov/
259
+ pytest --cov lima2.client --cov lima2.conductor --cov-report html tests/unit/
260
+ ```
261
+
262
+ Integration tests require the Lima2 server, available via conda (see [install with conda](#conda)):
263
+
264
+ ```sh
265
+ conda activate lima2-client
266
+ conda install -c esrf-bcu lima2
267
+ pytest tests/integration
268
+ ```
269
+
270
+ ## Documentation
271
+
272
+ The repo's [pages](https://limagroup.gitlab-pages.esrf.fr/lima2-client/) contain
273
+ user guides, an API reference and design docs. Source files used to build the
274
+ documentation are located in the `docs/` directory.
275
+
276
+ The docs are written in markdown and rendered by
277
+ [`mkdocs`](https://www.mkdocs.org/).
278
+
279
+ ### Build the docs (uv)
280
+
281
+ ```sh
282
+ uv sync --extra docs
283
+ uv run mkdocs serve # Start the dev server at localhost:8000
284
+ uv run mkdocs build # Render HTML pages to ./site/
285
+ ```
286
+
287
+ ### Build the docs (conda/pip)
288
+
289
+ ```sh
290
+ pip install .[docs]
291
+ mkdocs serve # Start the dev server at localhost:8000
292
+ mkdocs build # Render HTML pages to ./site/
293
+ ```
@@ -0,0 +1,232 @@
1
+ # Lima2 Client
2
+
3
+ ![pypi badge](https://badge.fury.io/py/lima2.client.svg?icon=si%3Apython)
4
+ ![pipeline badge](https://gitlab.esrf.fr/limagroup/lima2-client/badges/main/pipeline.svg)
5
+ ![coverage badge](https://gitlab.esrf.fr/limagroup/lima2-client/badges/main/coverage.svg?min_good=90&min_acceptable=80&min_medium=75)
6
+
7
+ This repo contains source code for the Lima2 Conductor, an orchestration module
8
+ for the Lima2 acquisition system, and its python client library, the
9
+ `lima2.client` package.
10
+
11
+ Install the lima2-client package:
12
+
13
+ ```sh
14
+ pip install lima2-client
15
+ ```
16
+
17
+ ## Quickstart
18
+
19
+ A minimal setup for running Lima2 requires:
20
+
21
+ - The [`lima2`](https://anaconda.org/esrf-bcu/lima2) conda package
22
+ - The [`lima2-client`](https://pypi.org/project/lima2-client/) python package
23
+ - A tango server, e.g. [`nosqltangodb`](https://pypi.org/project/nosqltangodb/)
24
+
25
+ > **_NOTE:_** In a bliss environment, the tango server comes with `bliss-demo-servers`,
26
+ > so `nosqltangodb` is not required.
27
+
28
+ Install everything into a new conda environment:
29
+
30
+ ```sh
31
+ conda create -n lima2 "python==3.10"
32
+ conda activate lima2
33
+ conda install -c esrf-bcu lima2
34
+ pip install lima2-client[conductor,shell] nosqltangodb
35
+ ```
36
+
37
+ The first step is to start the tango server. For `nosqltangodb`, example config
38
+ files can be found in the repo's
39
+ [`tests/integration/tango_db/`](https://gitlab.esrf.fr/limagroup/lima2-client/-/tree/main/tests/integration/tango_db)
40
+ directory. Fetch it into the current directory with:
41
+
42
+ ```sh
43
+ wget -qO- https://gitlab.esrf.fr/limagroup/lima2-client/-/archive/main/lima2-client-main.tar.gz?path=tests/integration/tango_db | tar -xz --strip-components=1
44
+ ```
45
+
46
+ Start the tango server:
47
+
48
+ ```sh
49
+ NosqlTangoDB --port 10000 --db_access yaml:tests/integration/tango_db/ 2
50
+ ```
51
+
52
+ Start the Lima2 devices (one control, two receivers):
53
+
54
+ ```sh
55
+ export TANGO_HOST="localhost:10000"
56
+ mpiexec -n 1 lima2_tango simulator_ctl : \
57
+ -n 1 lima2_tango simulator_rcv1 : \
58
+ -n 1 lima2_tango simulator_rcv2
59
+ ```
60
+
61
+ Start the Lima2 Conductor, which listens on port 58712 by default:
62
+
63
+ ```sh
64
+ lima2-conductor start \
65
+ localhost:10000 \
66
+ round_robin \
67
+ id00/limacontrol/simulator \
68
+ id00/limareceiver/simulator1 \
69
+ id00/limareceiver/simulator2
70
+ ```
71
+
72
+ With all parts online, a client can now make requests to the conductor to
73
+ interact with the acquisition system.
74
+
75
+ The quickest way to start is inside the interactive session (requires the
76
+ `lima2-client[shell]` extra dependencies):
77
+
78
+ ```sh
79
+ lima2-shell
80
+ ```
81
+
82
+ ```py
83
+ In [1]: run_acquisition(nb_frames=120, expo_time=0.02) # Should take 2.4 seconds
84
+ In [2]: pipeline.progress()
85
+ Out[2]: 120
86
+ ```
87
+
88
+ In the shell, the entire API of the conductor is exposed via the following
89
+ namespaces:
90
+
91
+ - `acquisition`: direct commands (prepare, start, stop, reset), system state and
92
+ progress
93
+ - `detector`: detector information, commands, capabilities and real-time status
94
+ - `pipeline`: data access (reduced data streams, frames) and detailed processing
95
+ progress
96
+
97
+ For more details, the [lima2-shell doc](https://limagroup.gitlab-pages.esrf.fr/lima2-client/shell/) and the
98
+ [API reference](https://limagroup.gitlab-pages.esrf.fr/lima2-client/reference/)
99
+ should be useful.
100
+
101
+ ## Description
102
+
103
+ This repo is organized as follows:
104
+
105
+ ```sh
106
+ lima2-client
107
+ ├── conda # Conda build configuration
108
+ ├── docs # Documentation sources
109
+ ├── scripts # Auxiliary scripts
110
+ ├── src/lima2
111
+ │   ├── client # Conductor client-side library
112
+ │   ├── conductor # Conductor server code
113
+ │   └── common # Shared definitions
114
+ └── tests
115
+ ├── integration
116
+ └── unit
117
+ ├── client
118
+ ├── conductor
119
+ └── common
120
+ ```
121
+
122
+ The project is composed of three main python packages.
123
+
124
+ ### `lima2.client`
125
+
126
+ The conductor's client-side library, meant to be imported from a control
127
+ application or a data consumer. In this package, the conductor webapp's API
128
+ endpoints are wrapped into python functions. The docs contain a complete [API
129
+ reference](https://limagroup.gitlab-pages.esrf.fr/lima2-client/reference/).
130
+
131
+ ### `lima2.conductor`
132
+
133
+ Implements the [Lima2
134
+ Conductor](https://limagroup.gitlab-pages.esrf.fr/lima2-client/dev/conductor_requirements/),
135
+ the orchestration process for distributed acquisitions.
136
+
137
+ Its central class is the
138
+ [`AcquisitionSystem`](https://limagroup.gitlab-pages.esrf.fr/lima2-client/dev/conductor_design/#acquisition-system),
139
+ which encapsulates the Lima2 acquisition, detector and processing systems.
140
+
141
+ This package also contains the `lima2.conductor.webservice` subpackage: the
142
+ conductor web server, which provides HTTP endpoints to interact with the
143
+ conductor remotely.
144
+
145
+ ### `lima2.common`
146
+
147
+ Contains type definitions and utilities meant to be imported from
148
+ `lima2.client`, `lima2.conductor`, and directly from client apps.
149
+
150
+ ## Development environment
151
+
152
+ The `dev` optional dependencies contains tools necessary for development and testing.
153
+
154
+ ### uv
155
+
156
+ Install all dependencies into a local venv:
157
+
158
+ ```sh
159
+ uv sync --extra dev
160
+ ```
161
+
162
+ Commands can be run with `uv run`:
163
+
164
+ ```sh
165
+ uv run lima2-conductor --help
166
+ uv run lima2-shell --help
167
+ ```
168
+
169
+ > **_NOTE:_** lima2-conductor has a `dev` command, which enables live code reloading
170
+ > on save.
171
+
172
+ ### conda
173
+
174
+ Create a new conda environment with python > 3.9:
175
+
176
+ ```sh
177
+ conda create -n lima2-client "python==3.10"
178
+ conda activate lima2-client
179
+ pip install -e .[dev]
180
+ ```
181
+
182
+ Execute commands directly:
183
+
184
+ ```sh
185
+ lima2-conductor --help
186
+ lima2-shell --help
187
+ ```
188
+
189
+ ## Tests
190
+
191
+ Unit and integration tests can be run locally. All dependencies for unit tests should be in the optional `dev` dependencies, and the `pyproject.toml` defines common `pytest` parameters.
192
+
193
+ After setting up your [dev environment](#development-environment), run the unit tests (prepend `uv run` if using uv):
194
+
195
+ ```sh
196
+ pytest tests/unit
197
+ # Compute coverage and output the coverage report to htmlcov/
198
+ pytest --cov lima2.client --cov lima2.conductor --cov-report html tests/unit/
199
+ ```
200
+
201
+ Integration tests require the Lima2 server, available via conda (see [install with conda](#conda)):
202
+
203
+ ```sh
204
+ conda activate lima2-client
205
+ conda install -c esrf-bcu lima2
206
+ pytest tests/integration
207
+ ```
208
+
209
+ ## Documentation
210
+
211
+ The repo's [pages](https://limagroup.gitlab-pages.esrf.fr/lima2-client/) contain
212
+ user guides, an API reference and design docs. Source files used to build the
213
+ documentation are located in the `docs/` directory.
214
+
215
+ The docs are written in markdown and rendered by
216
+ [`mkdocs`](https://www.mkdocs.org/).
217
+
218
+ ### Build the docs (uv)
219
+
220
+ ```sh
221
+ uv sync --extra docs
222
+ uv run mkdocs serve # Start the dev server at localhost:8000
223
+ uv run mkdocs build # Render HTML pages to ./site/
224
+ ```
225
+
226
+ ### Build the docs (conda/pip)
227
+
228
+ ```sh
229
+ pip install .[docs]
230
+ mkdocs serve # Start the dev server at localhost:8000
231
+ mkdocs build # Render HTML pages to ./site/
232
+ ```