kiwi-scan 0.2.0__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 (75) hide show
  1. kiwi_scan-0.2.0/.gitignore +129 -0
  2. kiwi_scan-0.2.0/LICENSE +21 -0
  3. kiwi_scan-0.2.0/Makefile +70 -0
  4. kiwi_scan-0.2.0/PKG-INFO +813 -0
  5. kiwi_scan-0.2.0/README.md +772 -0
  6. kiwi_scan-0.2.0/bash-completion/actuator_runner +217 -0
  7. kiwi_scan-0.2.0/bash-completion/manifestfiles +29 -0
  8. kiwi_scan-0.2.0/bash-completion/scan_runner +104 -0
  9. kiwi_scan-0.2.0/bash-completion/scanplotter_cli +46 -0
  10. kiwi_scan-0.2.0/config/scan_config/sim.yaml +15 -0
  11. kiwi_scan-0.2.0/examples/beamline_env.sh +16 -0
  12. kiwi_scan-0.2.0/mkvenv.sh +44 -0
  13. kiwi_scan-0.2.0/pyproject.toml +84 -0
  14. kiwi_scan-0.2.0/setup.cfg +4 -0
  15. kiwi_scan-0.2.0/src/kiwi_scan/__init__.py +192 -0
  16. kiwi_scan-0.2.0/src/kiwi_scan/actuator/factory.py +69 -0
  17. kiwi_scan-0.2.0/src/kiwi_scan/actuator/multi.py +116 -0
  18. kiwi_scan-0.2.0/src/kiwi_scan/actuator/single.py +216 -0
  19. kiwi_scan-0.2.0/src/kiwi_scan/actuator_concrete/single_epics.py +512 -0
  20. kiwi_scan-0.2.0/src/kiwi_scan/actuator_concrete/single_simulation.py +377 -0
  21. kiwi_scan-0.2.0/src/kiwi_scan/actuator_concrete/undulator.py +119 -0
  22. kiwi_scan-0.2.0/src/kiwi_scan/actuator_runner.py +613 -0
  23. kiwi_scan-0.2.0/src/kiwi_scan/dataloader.py +95 -0
  24. kiwi_scan-0.2.0/src/kiwi_scan/datamodels.py +355 -0
  25. kiwi_scan-0.2.0/src/kiwi_scan/epics_wrapper.py +243 -0
  26. kiwi_scan-0.2.0/src/kiwi_scan/manifestfiles.py +118 -0
  27. kiwi_scan-0.2.0/src/kiwi_scan/manifestwriter.py +537 -0
  28. kiwi_scan-0.2.0/src/kiwi_scan/metadata_loader.py +150 -0
  29. kiwi_scan-0.2.0/src/kiwi_scan/monitor/__init__.py +0 -0
  30. kiwi_scan-0.2.0/src/kiwi_scan/monitor/base.py +26 -0
  31. kiwi_scan-0.2.0/src/kiwi_scan/monitor/factory.py +51 -0
  32. kiwi_scan-0.2.0/src/kiwi_scan/monitor_concrete/__init__.py +0 -0
  33. kiwi_scan-0.2.0/src/kiwi_scan/monitor_concrete/print.py +186 -0
  34. kiwi_scan-0.2.0/src/kiwi_scan/monitor_concrete/queue_plotter.py +138 -0
  35. kiwi_scan-0.2.0/src/kiwi_scan/plotter.py +259 -0
  36. kiwi_scan-0.2.0/src/kiwi_scan/plugin/__init__.py +0 -0
  37. kiwi_scan-0.2.0/src/kiwi_scan/plugin/base.py +160 -0
  38. kiwi_scan-0.2.0/src/kiwi_scan/plugin/registry.py +33 -0
  39. kiwi_scan-0.2.0/src/kiwi_scan/plugin_concrete/__init__.py +0 -0
  40. kiwi_scan-0.2.0/src/kiwi_scan/plugin_concrete/jog_pid.py +165 -0
  41. kiwi_scan-0.2.0/src/kiwi_scan/plugin_concrete/logging.py +58 -0
  42. kiwi_scan-0.2.0/src/kiwi_scan/postmortem.py +77 -0
  43. kiwi_scan-0.2.0/src/kiwi_scan/scan/__init__.py +0 -0
  44. kiwi_scan-0.2.0/src/kiwi_scan/scan/common.py +1215 -0
  45. kiwi_scan-0.2.0/src/kiwi_scan/scan/metadata_monitor.py +258 -0
  46. kiwi_scan-0.2.0/src/kiwi_scan/scan/range_exit_detector.py +57 -0
  47. kiwi_scan-0.2.0/src/kiwi_scan/scan/registry.py +131 -0
  48. kiwi_scan-0.2.0/src/kiwi_scan/scan/scan_abs.py +98 -0
  49. kiwi_scan-0.2.0/src/kiwi_scan/scan/subscription_manager.py +511 -0
  50. kiwi_scan-0.2.0/src/kiwi_scan/scan/sync_controller.py +123 -0
  51. kiwi_scan-0.2.0/src/kiwi_scan/scan/tools.py +130 -0
  52. kiwi_scan-0.2.0/src/kiwi_scan/scan/trigger_manager.py +149 -0
  53. kiwi_scan-0.2.0/src/kiwi_scan/scan_concrete/__init__.py +0 -0
  54. kiwi_scan-0.2.0/src/kiwi_scan/scan_concrete/approach.py +53 -0
  55. kiwi_scan-0.2.0/src/kiwi_scan/scan_concrete/cm.py +206 -0
  56. kiwi_scan-0.2.0/src/kiwi_scan/scan_concrete/linear.py +114 -0
  57. kiwi_scan-0.2.0/src/kiwi_scan/scan_concrete/poll.py +177 -0
  58. kiwi_scan-0.2.0/src/kiwi_scan/scan_runner.py +316 -0
  59. kiwi_scan-0.2.0/src/kiwi_scan/scanplotter_cli.py +184 -0
  60. kiwi_scan-0.2.0/src/kiwi_scan/stats.py +162 -0
  61. kiwi_scan-0.2.0/src/kiwi_scan/test_support.py +198 -0
  62. kiwi_scan-0.2.0/src/kiwi_scan/yaml_loader.py +114 -0
  63. kiwi_scan-0.2.0/src/kiwi_scan.egg-info/PKG-INFO +813 -0
  64. kiwi_scan-0.2.0/src/kiwi_scan.egg-info/SOURCES.txt +73 -0
  65. kiwi_scan-0.2.0/src/kiwi_scan.egg-info/dependency_links.txt +1 -0
  66. kiwi_scan-0.2.0/src/kiwi_scan.egg-info/entry_points.txt +5 -0
  67. kiwi_scan-0.2.0/src/kiwi_scan.egg-info/requires.txt +11 -0
  68. kiwi_scan-0.2.0/src/kiwi_scan.egg-info/top_level.txt +1 -0
  69. kiwi_scan-0.2.0/tests/test_actuator.py +332 -0
  70. kiwi_scan-0.2.0/tests/test_epics_wrapper_integration.py +240 -0
  71. kiwi_scan-0.2.0/tests/test_manifest_writer.py +211 -0
  72. kiwi_scan-0.2.0/tests/test_registry_trigger_and_callbacks.py +199 -0
  73. kiwi_scan-0.2.0/tests/test_scanlib.py +428 -0
  74. kiwi_scan-0.2.0/tests/test_stats.py +62 -0
  75. kiwi_scan-0.2.0/tests/test_subscription_manager.py +144 -0
@@ -0,0 +1,129 @@
1
+ # Byte-compiled / optimized / DLL files
2
+ __pycache__/
3
+ *.py[cod]
4
+ *$py.class
5
+
6
+ # C extensions
7
+ *.so
8
+
9
+ # Distribution / packaging
10
+ .Python
11
+ build/
12
+ develop-eggs/
13
+ dist/
14
+ downloads/
15
+ eggs/
16
+ .eggs/
17
+ lib/
18
+ lib64/
19
+ parts/
20
+ sdist/
21
+ var/
22
+ wheels/
23
+ *.egg-info/
24
+ .installed.cfg
25
+ *.egg
26
+ MANIFEST
27
+ .kiwi_sync/
28
+
29
+ # PyInstaller
30
+ *.manifest
31
+ *.spec
32
+ *.patch
33
+
34
+ # Installer logs
35
+ pip-log.txt
36
+ pip-delete-this-directory.txt
37
+
38
+ # Unit test / coverage reports
39
+ htmlcov/
40
+ .tox/
41
+ .nox/
42
+ .coverage
43
+ .coverage.*
44
+ .cache
45
+ nosetests.xml
46
+ coverage.xml
47
+ *.cover
48
+ *.py,cover
49
+ .pytest_cache/
50
+ pytestdebug.log
51
+ LOG
52
+ LOG.*
53
+
54
+ # Type checker
55
+ .mypy_cache/
56
+ .dmypy.json
57
+ dmypy.json
58
+ .pyre/
59
+
60
+ # PyCharm
61
+ .idea/
62
+
63
+ # VS Code
64
+ .vscode/
65
+
66
+ # Virtual environments
67
+ .env
68
+ .venv
69
+ env/
70
+ venv/
71
+ ENV/
72
+ env.bak/
73
+ venv.bak/
74
+
75
+ # pipenv
76
+ Pipfile.lock
77
+
78
+ # poetry
79
+ poetry.lock
80
+
81
+ # Jupyter
82
+ .ipynb_checkpoints
83
+
84
+ # IPython
85
+ profile_default/
86
+ ipython_config.py
87
+
88
+ # Logs
89
+ *.log
90
+
91
+ # Local runtime data
92
+ *.sqlite3
93
+ *.db
94
+
95
+ # OS files
96
+ .DS_Store
97
+ Thumbs.db
98
+
99
+ # Build documentation
100
+ docs/_build/
101
+
102
+ # tags
103
+ cscope.files
104
+ cscope.out
105
+ tags
106
+
107
+ # Temporary files
108
+ *.tmp
109
+ *.swp
110
+ *.swo
111
+ *~
112
+
113
+ # Python packaging metadata
114
+ *.dist-info/
115
+
116
+ # Ruff / Black / other tooling caches
117
+ .ruff_cache/
118
+ .black/
119
+
120
+ # Project-specific: scan output files (timestamped names like base-YYYYMMDDHHMMSS.txt)
121
+ # Matches e.g. "results-20260315123045.txt" or "scan-20260315123045.txt"
122
+ *-??????????????.*
123
+
124
+ # Optional: exclude scan data directory if you create one
125
+ scandata/
126
+ data/
127
+
128
+ *.orig
129
+ *.1st
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Helmholtz-Zentrum Berlin
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,70 @@
1
+ SHELL := /bin/bash
2
+ VERSION ?= 0.2.0
3
+ .DEFAULT_GOAL := help
4
+
5
+ BASH_COMPLETION_DIR ?= ~/.bash_completion.d
6
+ WITH_VENV = if [ -z "$$VIRTUAL_ENV" ]; then source "$(CURDIR)/mkvenv.sh"; fi
7
+
8
+ SCRIPTS = \
9
+ scan_runner \
10
+ actuator_runner \
11
+ scanplotter_cli \
12
+ manifestfiles
13
+
14
+ SCRIPT_PATHS = $(foreach script,$(SCRIPTS),$(BASH_COMPLETION_DIR)/$(script))
15
+
16
+ .PHONY: help all install_completion uninstall_completion clean cscope tag lint test
17
+
18
+ help: ## Show available development targets
19
+ @echo "kiwi-scan development targets"
20
+ @echo
21
+ @awk 'BEGIN {FS = ":.*## "} /^[a-zA-Z0-9_.-]+:.*## / { printf " %-22s %s\n", $$1, $$2 }' $(MAKEFILE_LIST)
22
+
23
+ all: install_completion ## Install bash completion scripts
24
+
25
+ install_completion: ## Install bash completion files and add source lines to ~/.bashrc
26
+ @mkdir -p $(BASH_COMPLETION_DIR)
27
+ @for script in $(SCRIPTS); do \
28
+ cp bash-completion/$$script $(BASH_COMPLETION_DIR)/$$script; \
29
+ grep -q "$$script" ~/.bashrc || echo "source $(BASH_COMPLETION_DIR)/$$script" >> ~/.bashrc; \
30
+ done
31
+ @echo "Bash completion for $(SCRIPTS) installed. Reload your shell to activate."
32
+
33
+ uninstall_completion: ## Remove installed bash completion files
34
+ @for script in $(SCRIPTS); do \
35
+ rm -f $(BASH_COMPLETION_DIR)/$$script; \
36
+ done
37
+ @echo "Bash completion for $(SCRIPTS) removed. Edit your .bashrc and remove the source lines."
38
+
39
+ clean: ## Remove local virtualenv, caches, tags, and egg-info
40
+ @rm -rf .venv
41
+ @rm -f tags cscope.files cscope.out
42
+ @find src -maxdepth 1 -type d -name "*.egg-info" -exec rm -rf {} +
43
+ @find . -type d -name "__pycache__" -exec rm -r {} +
44
+
45
+ cscope: ## Build cscope and ctags indexes for the repository
46
+ find . -path ./.venv -prune -o -name "*.py" -print > cscope.files
47
+ cscope -b -i cscope.files
48
+ ctags -R --languages=Python .
49
+
50
+ tag: ## Create a version+timestamp git tag from HEAD
51
+ @ts=$$(git show -s --format=%cd --date=format:%Y%m%d.%H%M%S HEAD); \
52
+ tag="$(VERSION)+$$ts"; \
53
+ echo "Creating tag $$tag"; \
54
+ git tag -a $$tag -m "Release $$tag"
55
+
56
+ lint: ## Run pylint on src/kiwi_scan (uses mkvenv.sh when needed)
57
+ @echo 'For pylint install extra packages: pip install -e ".[dev]"'
58
+ @$(WITH_VENV); \
59
+ PYTHONPATH=src pylint --disable=C,R,W src/kiwi_scan || true
60
+
61
+ test: ## Run the current test scripts (uses mkvenv.sh when needed)
62
+ @if [ -z "$$KIWI_SCAN_DATA_DIR" ]; then mkdir -p scandata; fi
63
+ @$(WITH_VENV); \
64
+ python3 tests/test_actuator.py; \
65
+ EPICS_WRITETEST=1 python3 tests/test_epics_wrapper_integration.py; \
66
+ python3 tests/test_stats.py; \
67
+ python3 tests/test_registry_trigger_and_callbacks.py; \
68
+ python3 tests/test_subscription_manager.py; \
69
+ python3 tests/test_scanlib.py; \
70
+ python3 tests/test_manifest_writer.py