apsbits 1.0.5__tar.gz → 2.0.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 (140) hide show
  1. {apsbits-1.0.5 → apsbits-2.0.0}/.github/workflows/code.yml +3 -3
  2. {apsbits-1.0.5 → apsbits-2.0.0}/.github/workflows/docs.yml +2 -2
  3. {apsbits-1.0.5 → apsbits-2.0.0}/.github/workflows/pypi.yml +2 -2
  4. {apsbits-1.0.5 → apsbits-2.0.0}/.gitignore +6 -0
  5. {apsbits-1.0.5 → apsbits-2.0.0}/HISTORY.rst +25 -0
  6. {apsbits-1.0.5 → apsbits-2.0.0}/PKG-INFO +9 -6
  7. {apsbits-1.0.5 → apsbits-2.0.0}/apsbits.egg-info/PKG-INFO +9 -6
  8. {apsbits-1.0.5 → apsbits-2.0.0}/apsbits.egg-info/SOURCES.txt +8 -10
  9. {apsbits-1.0.5 → apsbits-2.0.0}/apsbits.egg-info/requires.txt +8 -5
  10. apsbits-2.0.0/docs/source/api/generated/apsbits.demo_instrument.callbacks.demo_nexus_callback.rst +17 -0
  11. apsbits-2.0.0/docs/source/api/generated/apsbits.demo_instrument.callbacks.demo_spec_callback.rst +13 -0
  12. {apsbits-1.0.5 → apsbits-2.0.0}/docs/source/api/generated/apsbits.demo_instrument.callbacks.rst +2 -2
  13. {apsbits-1.0.5 → apsbits-2.0.0}/docs/source/api/generated/apsbits.demo_instrument.plans.rst +0 -1
  14. {apsbits-1.0.5 → apsbits-2.0.0}/docs/source/api/index.rst +0 -1
  15. {apsbits-1.0.5 → apsbits-2.0.0}/docs/source/api/utils.rst +0 -1
  16. {apsbits-1.0.5 → apsbits-2.0.0}/docs/source/license.rst +1 -1
  17. {apsbits-1.0.5 → apsbits-2.0.0}/pyproject.toml +9 -6
  18. {apsbits-1.0.5 → apsbits-2.0.0}/src/apsbits/_version.py +16 -3
  19. {apsbits-1.0.5 → apsbits-2.0.0}/src/apsbits/api/create_new_instrument.py +48 -29
  20. {apsbits-1.0.5 → apsbits-2.0.0}/src/apsbits/api/delete_instrument.py +20 -17
  21. {apsbits-1.0.5 → apsbits-2.0.0}/src/apsbits/api/run_instrument.py +1 -3
  22. {apsbits-1.0.5 → apsbits-2.0.0}/src/apsbits/core/best_effort_init.py +7 -4
  23. apsbits-2.0.0/src/apsbits/core/catalog_init.py +60 -0
  24. {apsbits-1.0.5 → apsbits-2.0.0}/src/apsbits/core/instrument_init.py +79 -56
  25. {apsbits-1.0.5 → apsbits-2.0.0}/src/apsbits/core/run_engine_init.py +78 -21
  26. apsbits-2.0.0/src/apsbits/demo_instrument/README.md +10 -0
  27. {apsbits-1.0.5 → apsbits-2.0.0}/src/apsbits/demo_instrument/__init__.py +0 -4
  28. apsbits-1.0.5/src/apsbits/demo_instrument/callbacks/nexus_data_file_writer.py → apsbits-2.0.0/src/apsbits/demo_instrument/callbacks/demo_nexus_callback.py +5 -3
  29. apsbits-1.0.5/src/apsbits/demo_instrument/callbacks/spec_data_file_writer.py → apsbits-2.0.0/src/apsbits/demo_instrument/callbacks/demo_spec_callback.py +8 -4
  30. {apsbits-1.0.5 → apsbits-2.0.0}/src/apsbits/demo_instrument/configs/devices.yml +0 -4
  31. {apsbits-1.0.5 → apsbits-2.0.0}/src/apsbits/demo_instrument/configs/iconfig.yml +1 -2
  32. apsbits-2.0.0/src/apsbits/demo_instrument/plans/__init__.py +1 -0
  33. {apsbits-1.0.5 → apsbits-2.0.0}/src/apsbits/demo_instrument/plans/sim_plans.py +9 -3
  34. {apsbits-1.0.5 → apsbits-2.0.0}/src/apsbits/demo_instrument/startup.py +26 -19
  35. {apsbits-1.0.5/src/apsbits/demo_qserver → apsbits-2.0.0/src/apsbits/demo_scripts}/qs_host.sh +5 -5
  36. apsbits-2.0.0/src/apsbits/py.typed +0 -0
  37. {apsbits-1.0.5 → apsbits-2.0.0}/src/apsbits/tests/conftest.py +6 -1
  38. {apsbits-1.0.5 → apsbits-2.0.0}/src/apsbits/tests/test_delete_instrument.py +31 -29
  39. {apsbits-1.0.5 → apsbits-2.0.0}/src/apsbits/tests/test_device_factories.py +6 -4
  40. {apsbits-1.0.5 → apsbits-2.0.0}/src/apsbits/tests/test_general.py +10 -4
  41. {apsbits-1.0.5 → apsbits-2.0.0}/src/apsbits/tests/test_make_devices.py +9 -5
  42. {apsbits-1.0.5 → apsbits-2.0.0}/src/apsbits/tests/test_stored_dict.py +1 -1
  43. apsbits-2.0.0/src/apsbits/utils/__init__.py +5 -0
  44. apsbits-2.0.0/src/apsbits/utils/aps_functions.py +28 -0
  45. {apsbits-1.0.5 → apsbits-2.0.0}/src/apsbits/utils/config_loaders.py +61 -15
  46. {apsbits-1.0.5 → apsbits-2.0.0}/src/apsbits/utils/controls_setup.py +7 -7
  47. {apsbits-1.0.5 → apsbits-2.0.0}/src/apsbits/utils/helper_functions.py +46 -3
  48. {apsbits-1.0.5 → apsbits-2.0.0}/src/apsbits/utils/logging_setup.py +29 -11
  49. {apsbits-1.0.5 → apsbits-2.0.0}/src/apsbits/utils/metadata.py +15 -10
  50. {apsbits-1.0.5 → apsbits-2.0.0}/src/apsbits/utils/sim_creator.py +1 -1
  51. {apsbits-1.0.5 → apsbits-2.0.0}/src/apsbits/utils/stored_dict.py +2 -3
  52. apsbits-1.0.5/docs/source/api/generated/apsbits.demo_instrument.callbacks.nexus_data_file_writer.rst +0 -17
  53. apsbits-1.0.5/docs/source/api/generated/apsbits.demo_instrument.callbacks.spec_data_file_writer.rst +0 -19
  54. apsbits-1.0.5/docs/source/api/generated/apsbits.demo_instrument.plans.dm_plans.rst +0 -13
  55. apsbits-1.0.5/docs/source/api/generated/apsbits.utils.aps_functions.rst +0 -12
  56. apsbits-1.0.5/src/apsbits/core/catalog_init.py +0 -36
  57. apsbits-1.0.5/src/apsbits/demo_instrument/README.md +0 -1
  58. apsbits-1.0.5/src/apsbits/demo_instrument/plans/__init__.py +0 -8
  59. apsbits-1.0.5/src/apsbits/demo_instrument/plans/dm_plans.py +0 -111
  60. apsbits-1.0.5/src/apsbits/utils/__init__.py +0 -1
  61. apsbits-1.0.5/src/apsbits/utils/aps_functions.py +0 -75
  62. {apsbits-1.0.5 → apsbits-2.0.0}/.github/ISSUE_TEMPLATE/bug_report.md +0 -0
  63. {apsbits-1.0.5 → apsbits-2.0.0}/.github/ISSUE_TEMPLATE/config.yml +0 -0
  64. {apsbits-1.0.5 → apsbits-2.0.0}/.github/ISSUE_TEMPLATE/feature_request.md +0 -0
  65. {apsbits-1.0.5 → apsbits-2.0.0}/.github/ISSUE_TEMPLATE/other.md +0 -0
  66. {apsbits-1.0.5 → apsbits-2.0.0}/.github/ISSUE_TEMPLATE/question-issue-template.md +0 -0
  67. {apsbits-1.0.5 → apsbits-2.0.0}/.github/PULL_REQUEST_TEMPLATE.md +0 -0
  68. {apsbits-1.0.5 → apsbits-2.0.0}/.github/dependabot.yml +0 -0
  69. {apsbits-1.0.5 → apsbits-2.0.0}/.pre-commit-config.yaml +0 -0
  70. {apsbits-1.0.5 → apsbits-2.0.0}/LICENSE +0 -0
  71. {apsbits-1.0.5 → apsbits-2.0.0}/README.md +0 -0
  72. {apsbits-1.0.5 → apsbits-2.0.0}/apsbits.egg-info/dependency_links.txt +0 -0
  73. {apsbits-1.0.5 → apsbits-2.0.0}/apsbits.egg-info/entry_points.txt +0 -0
  74. {apsbits-1.0.5 → apsbits-2.0.0}/apsbits.egg-info/top_level.txt +0 -0
  75. {apsbits-1.0.5 → apsbits-2.0.0}/docs/Makefile +0 -0
  76. {apsbits-1.0.5 → apsbits-2.0.0}/docs/make.bat +0 -0
  77. {apsbits-1.0.5 → apsbits-2.0.0}/docs/resources/create-repository-name.webp +0 -0
  78. {apsbits-1.0.5 → apsbits-2.0.0}/docs/resources/create-repository-owner.webp +0 -0
  79. {apsbits-1.0.5 → apsbits-2.0.0}/docs/resources/demo.ipynb +0 -0
  80. {apsbits-1.0.5 → apsbits-2.0.0}/docs/resources/use-this-template-button.webp +0 -0
  81. {apsbits-1.0.5 → apsbits-2.0.0}/docs/source/_static/.gitkeep +0 -0
  82. {apsbits-1.0.5 → apsbits-2.0.0}/docs/source/api/api.rst +0 -0
  83. {apsbits-1.0.5 → apsbits-2.0.0}/docs/source/api/core.rst +0 -0
  84. {apsbits-1.0.5 → apsbits-2.0.0}/docs/source/api/demo_instrument.rst +0 -0
  85. {apsbits-1.0.5 → apsbits-2.0.0}/docs/source/api/demo_qserver.rst +0 -0
  86. {apsbits-1.0.5 → apsbits-2.0.0}/docs/source/api/generated/apsbits.core.best_effort_init.rst +0 -0
  87. {apsbits-1.0.5 → apsbits-2.0.0}/docs/source/api/generated/apsbits.core.catalog_init.rst +0 -0
  88. {apsbits-1.0.5 → apsbits-2.0.0}/docs/source/api/generated/apsbits.core.run_engine_init.rst +0 -0
  89. {apsbits-1.0.5 → apsbits-2.0.0}/docs/source/api/generated/apsbits.demo_instrument.configs.rst +0 -0
  90. {apsbits-1.0.5 → apsbits-2.0.0}/docs/source/api/generated/apsbits.demo_instrument.devices.rst +0 -0
  91. {apsbits-1.0.5 → apsbits-2.0.0}/docs/source/api/generated/apsbits.demo_instrument.plans.sim_plans.rst +0 -0
  92. {apsbits-1.0.5 → apsbits-2.0.0}/docs/source/api/generated/apsbits.demo_instrument.rst +0 -0
  93. {apsbits-1.0.5 → apsbits-2.0.0}/docs/source/api/generated/apsbits.demo_instrument.startup.rst +0 -0
  94. {apsbits-1.0.5 → apsbits-2.0.0}/docs/source/api/generated/apsbits.demo_qserver.rst +0 -0
  95. {apsbits-1.0.5 → apsbits-2.0.0}/docs/source/api/generated/apsbits.utils.config_loaders.rst +0 -0
  96. {apsbits-1.0.5 → apsbits-2.0.0}/docs/source/api/generated/apsbits.utils.controls_setup.rst +0 -0
  97. {apsbits-1.0.5 → apsbits-2.0.0}/docs/source/api/generated/apsbits.utils.helper_functions.rst +0 -0
  98. {apsbits-1.0.5 → apsbits-2.0.0}/docs/source/api/generated/apsbits.utils.logging_setup.rst +0 -0
  99. {apsbits-1.0.5 → apsbits-2.0.0}/docs/source/api/generated/apsbits.utils.metadata.rst +0 -0
  100. {apsbits-1.0.5 → apsbits-2.0.0}/docs/source/api/generated/apsbits.utils.stored_dict.rst +0 -0
  101. {apsbits-1.0.5 → apsbits-2.0.0}/docs/source/bits_overview.rst +0 -0
  102. {apsbits-1.0.5 → apsbits-2.0.0}/docs/source/conf.py +0 -0
  103. {apsbits-1.0.5 → apsbits-2.0.0}/docs/source/deprecated/console.rst +0 -0
  104. {apsbits-1.0.5 → apsbits-2.0.0}/docs/source/deprecated/dm.md +0 -0
  105. {apsbits-1.0.5 → apsbits-2.0.0}/docs/source/deprecated/logging_config.rst +0 -0
  106. {apsbits-1.0.5 → apsbits-2.0.0}/docs/source/deprecated/notebook.rst +0 -0
  107. {apsbits-1.0.5 → apsbits-2.0.0}/docs/source/deprecated/script.rst +0 -0
  108. {apsbits-1.0.5 → apsbits-2.0.0}/docs/source/guides/creating_devices.rst +0 -0
  109. {apsbits-1.0.5 → apsbits-2.0.0}/docs/source/guides/creating_instrument.rst +0 -0
  110. {apsbits-1.0.5 → apsbits-2.0.0}/docs/source/guides/developing_bits.rst +0 -0
  111. {apsbits-1.0.5 → apsbits-2.0.0}/docs/source/guides/dm.rst +0 -0
  112. {apsbits-1.0.5 → apsbits-2.0.0}/docs/source/guides/index.rst +0 -0
  113. {apsbits-1.0.5 → apsbits-2.0.0}/docs/source/guides/logging.rst +0 -0
  114. {apsbits-1.0.5 → apsbits-2.0.0}/docs/source/guides/qserver.rst +0 -0
  115. {apsbits-1.0.5 → apsbits-2.0.0}/docs/source/guides/qserver_service.rst +0 -0
  116. {apsbits-1.0.5 → apsbits-2.0.0}/docs/source/guides/sessions.rst +0 -0
  117. {apsbits-1.0.5 → apsbits-2.0.0}/docs/source/guides/setting_iconfig.rst +0 -0
  118. {apsbits-1.0.5 → apsbits-2.0.0}/docs/source/guides/startup.rst +0 -0
  119. {apsbits-1.0.5 → apsbits-2.0.0}/docs/source/guides/template_creation.rst +0 -0
  120. {apsbits-1.0.5 → apsbits-2.0.0}/docs/source/history.rst +0 -0
  121. {apsbits-1.0.5 → apsbits-2.0.0}/docs/source/index.rst +0 -0
  122. {apsbits-1.0.5 → apsbits-2.0.0}/docs/source/install.rst +0 -0
  123. {apsbits-1.0.5 → apsbits-2.0.0}/setup.cfg +0 -0
  124. {apsbits-1.0.5 → apsbits-2.0.0}/src/apsbits/__init__.py +0 -0
  125. {apsbits-1.0.5 → apsbits-2.0.0}/src/apsbits/api/__init__.py +0 -0
  126. {apsbits-1.0.5 → apsbits-2.0.0}/src/apsbits/configs/logging.yml +0 -0
  127. {apsbits-1.0.5 → apsbits-2.0.0}/src/apsbits/core/__init__.py +0 -0
  128. {apsbits-1.0.5 → apsbits-2.0.0}/src/apsbits/demo_instrument/callbacks/__init__.py +0 -0
  129. {apsbits-1.0.5 → apsbits-2.0.0}/src/apsbits/demo_instrument/configs/__init__.py +0 -0
  130. {apsbits-1.0.5 → apsbits-2.0.0}/src/apsbits/demo_instrument/configs/devices_aps_only.yml +0 -0
  131. {apsbits-1.0.5 → apsbits-2.0.0}/src/apsbits/demo_instrument/configs/extra_logging.yml +0 -0
  132. {apsbits-1.0.5 → apsbits-2.0.0}/src/apsbits/demo_instrument/devices/__init__.py +0 -0
  133. {apsbits-1.0.5/src/apsbits/demo_qserver → apsbits-2.0.0/src/apsbits/demo_instrument/qserver}/qs-config.yml +0 -0
  134. {apsbits-1.0.5/src/apsbits/demo_qserver → apsbits-2.0.0/src/apsbits/demo_instrument/qserver}/user_group_permissions.yaml +0 -0
  135. {apsbits-1.0.5 → apsbits-2.0.0}/src/apsbits/demo_instrument/suspenders/__init__.py +0 -0
  136. {apsbits-1.0.5 → apsbits-2.0.0}/src/apsbits/demo_instrument/utils/__init__.py +0 -0
  137. {apsbits-1.0.5 → apsbits-2.0.0}/src/apsbits/tests/__init__.py +0 -0
  138. {apsbits-1.0.5 → apsbits-2.0.0}/src/apsbits/tests/test_config.py +0 -0
  139. {apsbits-1.0.5 → apsbits-2.0.0}/src/apsbits/tests/test_run_instrument.py +0 -0
  140. {apsbits-1.0.5 → apsbits-2.0.0}/src/apsbits/utils/baseline_setup.py +0 -0
@@ -20,9 +20,9 @@ jobs:
20
20
  runs-on: ubuntu-latest
21
21
 
22
22
  steps:
23
- - uses: actions/checkout@v4
23
+ - uses: actions/checkout@v5
24
24
 
25
- - uses: actions/setup-python@v5
25
+ - uses: actions/setup-python@v6
26
26
  with:
27
27
  python-version: "3.11"
28
28
 
@@ -51,7 +51,7 @@ jobs:
51
51
  DISPLAY: ":99.0"
52
52
 
53
53
  steps:
54
- - uses: actions/checkout@v4
54
+ - uses: actions/checkout@v5
55
55
 
56
56
  - name: Install OS libraries to test Linux PyQt apps
57
57
  run: |
@@ -50,11 +50,11 @@ jobs:
50
50
  run: echo "TZ=America/Chicago" >> "$GITHUB_ENV"
51
51
 
52
52
  - name: Checkout
53
- uses: actions/checkout@v4
53
+ uses: actions/checkout@v5
54
54
  with:
55
55
  fetch-depth: 0 # required for push to dest repo
56
56
 
57
- - uses: actions/setup-python@v5
57
+ - uses: actions/setup-python@v6
58
58
  with:
59
59
  python-version: "3.11"
60
60
 
@@ -18,9 +18,9 @@ jobs:
18
18
  runs-on: ubuntu-latest
19
19
 
20
20
  steps:
21
- - uses: actions/checkout@v4
21
+ - uses: actions/checkout@v5
22
22
  - name: Set up Python
23
- uses: actions/setup-python@v5
23
+ uses: actions/setup-python@v6
24
24
  with:
25
25
  python-version: "3.11"
26
26
 
@@ -176,3 +176,9 @@ existing_plans_and_devices.yaml
176
176
 
177
177
  # Local Run Engine metadata dictionary
178
178
  .re_md_dict.yml
179
+
180
+ # Test/deleted artifacts
181
+ .deleted/
182
+
183
+ # Claude Code context files
184
+ CLAUDE.md
@@ -84,6 +84,31 @@ Maintenance
84
84
  * adding install docs given new workflow
85
85
  * Feature/API_functionalities and Makedevices
86
86
 
87
+ Breaking Changes
88
+ ----------------
89
+
90
+ * **Callback file renaming**: Demo callback files renamed to follow `_demo` naming convention:
91
+
92
+ * ``nexus_data_file_writer.py`` → ``demo_nexus_callback.py``
93
+ * ``spec_data_file_writer.py`` → ``demo_spec_callback.py``
94
+
95
+ Import paths updated in startup.py. Direct imports of these modules will need updating.
96
+
97
+ * **DM plans removed**: The ``dm_plans.py`` file has been removed to reduce apstools dependency.
98
+ DM configuration infrastructure remains in iconfig.yml and startup.py.
99
+
100
+ * **StoredDict implementation**: Now uses local implementation instead of ``apstools.utils.StoredDict``.
101
+ This reduces external dependencies while maintaining full compatibility.
102
+
103
+ Enhancements
104
+ ------------
105
+
106
+ * **Improved error handling**: Enhanced error messages with specific exception types and detailed context across core modules (device loading, configuration parsing, RunEngine initialization, databroker catalog setup).
107
+
108
+ * **Complete type annotations**: Added comprehensive type annotations to all public APIs for better IDE support and code maintainability.
109
+
110
+ * **Code quality improvements**: Added ``py.typed`` marker for mypy support and improved code formatting compliance.
111
+
87
112
  1.0.1
88
113
  #####
89
114
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: apsbits
3
- Version: 1.0.5
3
+ Version: 2.0.0
4
4
  Summary: Model of a Bluesky Data Acquisition Instrument in console, notebook, & queueserver.
5
5
  Author-email: Eric Codrea <ecodrea@anl.gov>, Pete Jemian <prjemian+instrument@gmail.com>, Rafael Vescovi <rvescovi@anl.gov>
6
6
  Maintainer-email: Eric Codrea <ecodrea@anl.gov>, Pete Jemian <prjemian+instrument@gmail.com>, Rafael Vescovi <rvescovi@anl.gov>
@@ -17,25 +17,27 @@ Classifier: Topic :: Utilities
17
17
  Requires-Python: >=3.11
18
18
  Description-Content-Type: text/markdown
19
19
  License-File: LICENSE
20
- Requires-Dist: apstools>=1.7.2
21
- Requires-Dist: bluesky-queueserver-api
20
+ Requires-Dist: apstools
22
21
  Requires-Dist: bluesky-queueserver>=0.0.22
22
+ Requires-Dist: bluesky-queueserver-api
23
23
  Requires-Dist: bluesky-widgets
24
24
  Requires-Dist: bluesky
25
25
  Requires-Dist: caproto
26
26
  Requires-Dist: databroker==1.2.5
27
- Requires-Dist: guarneri
27
+ Requires-Dist: guarneri>=0.4.0
28
28
  Requires-Dist: ipython
29
29
  Requires-Dist: jupyterlab
30
+ Requires-Dist: matplotlib
31
+ Requires-Dist: ophyd-async
30
32
  Requires-Dist: ophyd-registry
31
33
  Requires-Dist: ophyd
32
34
  Requires-Dist: PyQt5>5.15
33
35
  Requires-Dist: pyRestTable
34
36
  Requires-Dist: pysumreg
35
37
  Requires-Dist: qtpy
36
- Requires-Dist: toml
37
- Requires-Dist: tomli
38
+ Requires-Dist: tiled[all]
38
39
  Requires-Dist: tomli-w
40
+ Requires-Dist: tomli
39
41
  Provides-Extra: dev
40
42
  Requires-Dist: build; extra == "dev"
41
43
  Requires-Dist: isort; extra == "dev"
@@ -59,6 +61,7 @@ Requires-Dist: sphinx-tabs; extra == "doc"
59
61
  Requires-Dist: sphinx; extra == "doc"
60
62
  Requires-Dist: graphviz; extra == "doc"
61
63
  Requires-Dist: dot; extra == "doc"
64
+ Requires-Dist: tomli-w; extra == "doc"
62
65
  Provides-Extra: all
63
66
  Requires-Dist: apsbits[dev,doc]; extra == "all"
64
67
  Dynamic: license-file
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: apsbits
3
- Version: 1.0.5
3
+ Version: 2.0.0
4
4
  Summary: Model of a Bluesky Data Acquisition Instrument in console, notebook, & queueserver.
5
5
  Author-email: Eric Codrea <ecodrea@anl.gov>, Pete Jemian <prjemian+instrument@gmail.com>, Rafael Vescovi <rvescovi@anl.gov>
6
6
  Maintainer-email: Eric Codrea <ecodrea@anl.gov>, Pete Jemian <prjemian+instrument@gmail.com>, Rafael Vescovi <rvescovi@anl.gov>
@@ -17,25 +17,27 @@ Classifier: Topic :: Utilities
17
17
  Requires-Python: >=3.11
18
18
  Description-Content-Type: text/markdown
19
19
  License-File: LICENSE
20
- Requires-Dist: apstools>=1.7.2
21
- Requires-Dist: bluesky-queueserver-api
20
+ Requires-Dist: apstools
22
21
  Requires-Dist: bluesky-queueserver>=0.0.22
22
+ Requires-Dist: bluesky-queueserver-api
23
23
  Requires-Dist: bluesky-widgets
24
24
  Requires-Dist: bluesky
25
25
  Requires-Dist: caproto
26
26
  Requires-Dist: databroker==1.2.5
27
- Requires-Dist: guarneri
27
+ Requires-Dist: guarneri>=0.4.0
28
28
  Requires-Dist: ipython
29
29
  Requires-Dist: jupyterlab
30
+ Requires-Dist: matplotlib
31
+ Requires-Dist: ophyd-async
30
32
  Requires-Dist: ophyd-registry
31
33
  Requires-Dist: ophyd
32
34
  Requires-Dist: PyQt5>5.15
33
35
  Requires-Dist: pyRestTable
34
36
  Requires-Dist: pysumreg
35
37
  Requires-Dist: qtpy
36
- Requires-Dist: toml
37
- Requires-Dist: tomli
38
+ Requires-Dist: tiled[all]
38
39
  Requires-Dist: tomli-w
40
+ Requires-Dist: tomli
39
41
  Provides-Extra: dev
40
42
  Requires-Dist: build; extra == "dev"
41
43
  Requires-Dist: isort; extra == "dev"
@@ -59,6 +61,7 @@ Requires-Dist: sphinx-tabs; extra == "doc"
59
61
  Requires-Dist: sphinx; extra == "doc"
60
62
  Requires-Dist: graphviz; extra == "doc"
61
63
  Requires-Dist: dot; extra == "doc"
64
+ Requires-Dist: tomli-w; extra == "doc"
62
65
  Provides-Extra: all
63
66
  Requires-Dist: apsbits[dev,doc]; extra == "all"
64
67
  Dynamic: license-file
@@ -42,18 +42,16 @@ docs/source/api/utils.rst
42
42
  docs/source/api/generated/apsbits.core.best_effort_init.rst
43
43
  docs/source/api/generated/apsbits.core.catalog_init.rst
44
44
  docs/source/api/generated/apsbits.core.run_engine_init.rst
45
- docs/source/api/generated/apsbits.demo_instrument.callbacks.nexus_data_file_writer.rst
45
+ docs/source/api/generated/apsbits.demo_instrument.callbacks.demo_nexus_callback.rst
46
+ docs/source/api/generated/apsbits.demo_instrument.callbacks.demo_spec_callback.rst
46
47
  docs/source/api/generated/apsbits.demo_instrument.callbacks.rst
47
- docs/source/api/generated/apsbits.demo_instrument.callbacks.spec_data_file_writer.rst
48
48
  docs/source/api/generated/apsbits.demo_instrument.configs.rst
49
49
  docs/source/api/generated/apsbits.demo_instrument.devices.rst
50
- docs/source/api/generated/apsbits.demo_instrument.plans.dm_plans.rst
51
50
  docs/source/api/generated/apsbits.demo_instrument.plans.rst
52
51
  docs/source/api/generated/apsbits.demo_instrument.plans.sim_plans.rst
53
52
  docs/source/api/generated/apsbits.demo_instrument.rst
54
53
  docs/source/api/generated/apsbits.demo_instrument.startup.rst
55
54
  docs/source/api/generated/apsbits.demo_qserver.rst
56
- docs/source/api/generated/apsbits.utils.aps_functions.rst
57
55
  docs/source/api/generated/apsbits.utils.config_loaders.rst
58
56
  docs/source/api/generated/apsbits.utils.controls_setup.rst
59
57
  docs/source/api/generated/apsbits.utils.helper_functions.rst
@@ -79,6 +77,7 @@ docs/source/guides/startup.rst
79
77
  docs/source/guides/template_creation.rst
80
78
  src/apsbits/__init__.py
81
79
  src/apsbits/_version.py
80
+ src/apsbits/py.typed
82
81
  src/apsbits/api/__init__.py
83
82
  src/apsbits/api/create_new_instrument.py
84
83
  src/apsbits/api/delete_instrument.py
@@ -93,8 +92,8 @@ src/apsbits/demo_instrument/README.md
93
92
  src/apsbits/demo_instrument/__init__.py
94
93
  src/apsbits/demo_instrument/startup.py
95
94
  src/apsbits/demo_instrument/callbacks/__init__.py
96
- src/apsbits/demo_instrument/callbacks/nexus_data_file_writer.py
97
- src/apsbits/demo_instrument/callbacks/spec_data_file_writer.py
95
+ src/apsbits/demo_instrument/callbacks/demo_nexus_callback.py
96
+ src/apsbits/demo_instrument/callbacks/demo_spec_callback.py
98
97
  src/apsbits/demo_instrument/configs/__init__.py
99
98
  src/apsbits/demo_instrument/configs/devices.yml
100
99
  src/apsbits/demo_instrument/configs/devices_aps_only.yml
@@ -102,13 +101,12 @@ src/apsbits/demo_instrument/configs/extra_logging.yml
102
101
  src/apsbits/demo_instrument/configs/iconfig.yml
103
102
  src/apsbits/demo_instrument/devices/__init__.py
104
103
  src/apsbits/demo_instrument/plans/__init__.py
105
- src/apsbits/demo_instrument/plans/dm_plans.py
106
104
  src/apsbits/demo_instrument/plans/sim_plans.py
105
+ src/apsbits/demo_instrument/qserver/qs-config.yml
106
+ src/apsbits/demo_instrument/qserver/user_group_permissions.yaml
107
107
  src/apsbits/demo_instrument/suspenders/__init__.py
108
108
  src/apsbits/demo_instrument/utils/__init__.py
109
- src/apsbits/demo_qserver/qs-config.yml
110
- src/apsbits/demo_qserver/qs_host.sh
111
- src/apsbits/demo_qserver/user_group_permissions.yaml
109
+ src/apsbits/demo_scripts/qs_host.sh
112
110
  src/apsbits/tests/__init__.py
113
111
  src/apsbits/tests/conftest.py
114
112
  src/apsbits/tests/test_config.py
@@ -1,22 +1,24 @@
1
- apstools>=1.7.2
2
- bluesky-queueserver-api
1
+ apstools
3
2
  bluesky-queueserver>=0.0.22
3
+ bluesky-queueserver-api
4
4
  bluesky-widgets
5
5
  bluesky
6
6
  caproto
7
7
  databroker==1.2.5
8
- guarneri
8
+ guarneri>=0.4.0
9
9
  ipython
10
10
  jupyterlab
11
+ matplotlib
12
+ ophyd-async
11
13
  ophyd-registry
12
14
  ophyd
13
15
  PyQt5>5.15
14
16
  pyRestTable
15
17
  pysumreg
16
18
  qtpy
17
- toml
18
- tomli
19
+ tiled[all]
19
20
  tomli-w
21
+ tomli
20
22
 
21
23
  [all]
22
24
  apsbits[dev,doc]
@@ -45,3 +47,4 @@ sphinx-tabs
45
47
  sphinx
46
48
  graphviz
47
49
  dot
50
+ tomli-w
@@ -0,0 +1,17 @@
1
+ apsbits.demo\_instrument.callbacks.demo\_nexus\_callback
2
+ ======================================================
3
+
4
+ .. automodule:: apsbits.demo_instrument.callbacks.demo_nexus_callback
5
+
6
+
7
+ .. rubric:: Functions
8
+
9
+ .. autosummary::
10
+
11
+ nxwriter_init
12
+
13
+ .. rubric:: Classes
14
+
15
+ .. autosummary::
16
+
17
+ MyNXWriter
@@ -0,0 +1,13 @@
1
+ apsbits.demo\_instrument.callbacks.demo\_spec\_callback
2
+ =====================================================
3
+
4
+ .. automodule:: apsbits.demo_instrument.callbacks.demo_spec_callback
5
+
6
+
7
+ .. rubric:: Functions
8
+
9
+ .. autosummary::
10
+
11
+ spec_comment
12
+ newSpecFile
13
+ init_specwriter_with_RE
@@ -10,5 +10,5 @@ apsbits.demo\_instrument.callbacks
10
10
  :toctree:
11
11
  :recursive:
12
12
 
13
- nexus_data_file_writer
14
- spec_data_file_writer
13
+ demo_nexus_callback
14
+ demo_spec_callback
@@ -10,5 +10,4 @@ apsbits.demo\_instrument.plans
10
10
  :toctree:
11
11
  :recursive:
12
12
 
13
- dm_plans
14
13
  sim_plans
@@ -72,7 +72,6 @@ The utilities module provides helper functions and tools:
72
72
  :toctree: generated
73
73
  :recursive:
74
74
 
75
- apsbits.utils.aps_functions
76
75
  apsbits.utils.config_loaders
77
76
  apsbits.utils.controls_setup
78
77
  apsbits.utils.helper_functions
@@ -11,7 +11,6 @@ The utilities module provides helper functions and tools for working with Bluesk
11
11
  :toctree: generated
12
12
  :recursive:
13
13
 
14
- aps_functions
15
14
  config_loaders
16
15
  controls_setup
17
16
  helper_functions
@@ -6,7 +6,7 @@ Software License
6
6
  ================
7
7
 
8
8
  License
9
- =======
9
+ -------
10
10
 
11
11
  The project is licensed under the following terms:
12
12
 
@@ -33,25 +33,27 @@ classifiers = [
33
33
  "Topic :: Utilities",
34
34
  ]
35
35
  dependencies = [
36
- "apstools >= 1.7.2",
37
- "bluesky-queueserver-api",
36
+ "apstools",
38
37
  "bluesky-queueserver >=0.0.22",
38
+ "bluesky-queueserver-api",
39
39
  "bluesky-widgets",
40
40
  "bluesky",
41
41
  "caproto",
42
- "databroker ==1.2.5",
43
- "guarneri",
42
+ "databroker==1.2.5",
43
+ "guarneri>=0.4.0",
44
44
  "ipython",
45
45
  "jupyterlab",
46
+ "matplotlib",
47
+ "ophyd-async",
46
48
  "ophyd-registry",
47
49
  "ophyd",
48
50
  "PyQt5>5.15",
49
51
  "pyRestTable",
50
52
  "pysumreg",
51
53
  "qtpy",
52
- "toml",
53
- "tomli",
54
+ "tiled[all]",
54
55
  "tomli-w",
56
+ "tomli",
55
57
  ]
56
58
 
57
59
  [project.optional-dependencies]
@@ -73,6 +75,7 @@ doc = [
73
75
  "sphinx",
74
76
  "graphviz",
75
77
  "dot",
78
+ "tomli-w",
76
79
  ]
77
80
 
78
81
  all = ["apsbits[dev,doc]"]
@@ -1,7 +1,14 @@
1
1
  # file generated by setuptools-scm
2
2
  # don't change, don't track in version control
3
3
 
4
- __all__ = ["__version__", "__version_tuple__", "version", "version_tuple"]
4
+ __all__ = [
5
+ "__version__",
6
+ "__version_tuple__",
7
+ "version",
8
+ "version_tuple",
9
+ "__commit_id__",
10
+ "commit_id",
11
+ ]
5
12
 
6
13
  TYPE_CHECKING = False
7
14
  if TYPE_CHECKING:
@@ -9,13 +16,19 @@ if TYPE_CHECKING:
9
16
  from typing import Union
10
17
 
11
18
  VERSION_TUPLE = Tuple[Union[int, str], ...]
19
+ COMMIT_ID = Union[str, None]
12
20
  else:
13
21
  VERSION_TUPLE = object
22
+ COMMIT_ID = object
14
23
 
15
24
  version: str
16
25
  __version__: str
17
26
  __version_tuple__: VERSION_TUPLE
18
27
  version_tuple: VERSION_TUPLE
28
+ commit_id: COMMIT_ID
29
+ __commit_id__: COMMIT_ID
19
30
 
20
- __version__ = version = '1.0.5'
21
- __version_tuple__ = version_tuple = (1, 0, 5)
31
+ __version__ = version = '2.0.0'
32
+ __version_tuple__ = version_tuple = (2, 0, 0)
33
+
34
+ __commit_id__ = commit_id = 'g484b02f15'
@@ -15,6 +15,38 @@ import sys
15
15
  from pathlib import Path
16
16
 
17
17
 
18
+ def create_qserver_script(scripts_dir: Path, name: str) -> None:
19
+ """
20
+ Create a qserver script file in the scripts directory.
21
+ """
22
+
23
+ demo_scripts_path: Path = (
24
+ Path(__file__).resolve().parent.parent / "demo_scripts"
25
+ ).resolve()
26
+
27
+ for scripts_file in demo_scripts_path.glob("*"):
28
+ shutil.copy2(scripts_file, scripts_dir)
29
+
30
+ # Rename qs_host.sh to include the instrument name
31
+ os.rename(scripts_dir / "qs_host.sh", scripts_dir / f"{name}_qs_host.sh")
32
+
33
+ new_script_path = scripts_dir / f"{name}_qs_host.sh"
34
+
35
+ # Read script contents
36
+ with open(new_script_path, "r") as src:
37
+ script_contents = src.read()
38
+
39
+ # Replace demo package name with new instrument name
40
+ updated_contents = script_contents.replace("demo_instrument", name)
41
+
42
+ # Write updated script
43
+ with open(new_script_path, "w") as dest:
44
+ dest.write(updated_contents)
45
+
46
+ # Make script executable
47
+ os.chmod(new_script_path, new_script_path.stat().st_mode | 0o755)
48
+
49
+
18
50
  def copy_instrument(destination_dir: Path) -> None:
19
51
  """
20
52
  Copy template directory to the destination.
@@ -31,20 +63,11 @@ def copy_instrument(destination_dir: Path) -> None:
31
63
  shutil.copytree(str(demo_template_path), str(destination_dir))
32
64
 
33
65
 
34
- def create_qserver(qserver_dir: Path, name: str) -> None:
66
+ def edit_qserver_folder(qserver_dir: Path, name: str) -> None:
35
67
  """
36
68
  Create a qserver config file in the destination directory.
37
69
  """
38
70
 
39
- demo_qserver_path: Path = (
40
- Path(__file__).resolve().parent.parent / "demo_qserver"
41
- ).resolve()
42
-
43
- os.makedirs(qserver_dir, exist_ok=True)
44
- # Copy all yml files from demo_qserver to destination qserver dir
45
- for yml_file in demo_qserver_path.glob("*"):
46
- shutil.copy2(yml_file, qserver_dir)
47
-
48
71
  # Update startup module in qs-config.yml
49
72
  qs_config_path = qserver_dir / "qs-config.yml"
50
73
 
@@ -58,22 +81,6 @@ def create_qserver(qserver_dir: Path, name: str) -> None:
58
81
  with open(qs_config_path, "w") as f:
59
82
  f.write(updated_contents)
60
83
 
61
- new_script_path = qserver_dir / "qs_host.sh"
62
-
63
- # Read script contents
64
- with open(new_script_path, "r") as src:
65
- script_contents = src.read()
66
-
67
- # Replace demo package name with new instrument name
68
- updated_contents = script_contents.replace("demo_instrument", name)
69
-
70
- # Write updated script
71
- with open(new_script_path, "w") as dest:
72
- dest.write(updated_contents)
73
-
74
- # Make script executable
75
- os.chmod(new_script_path, new_script_path.stat().st_mode | 0o755)
76
-
77
84
 
78
85
  def main() -> None:
79
86
  """
@@ -97,13 +104,19 @@ def main() -> None:
97
104
 
98
105
  new_instrument_dir: Path = main_path / "src" / args.name
99
106
 
100
- new_qserver_dir: Path = main_path / "src" / f"{args.name}_qserver"
107
+ qserver_dir: Path = main_path / "src" / args.name / "qserver"
108
+
109
+ scripts_dir: Path = main_path / "scripts"
101
110
 
102
111
  print(
103
112
  f"Creating instrument '{args.name}' from demo_instrument into \
104
113
  '{new_instrument_dir}'."
105
114
  )
106
115
 
116
+ if not scripts_dir.exists():
117
+ print("Error: Destination scripts directory does not exist.", file=sys.stderr)
118
+ sys.exit(1)
119
+
107
120
  if new_instrument_dir.exists():
108
121
  print(f"Error: Destination '{new_instrument_dir}' exists.", file=sys.stderr)
109
122
  sys.exit(1)
@@ -114,10 +127,16 @@ def main() -> None:
114
127
  except Exception as exc:
115
128
  print(f"Error copying instrument: {exc}", file=sys.stderr)
116
129
  sys.exit(1)
130
+ try:
131
+ create_qserver_script(scripts_dir, args.name)
132
+ print(f"Qserver script created in '{scripts_dir}'.")
133
+ except Exception as exc:
134
+ print(f"Error creating qserver script: {exc}", file=sys.stderr)
135
+ sys.exit(1)
117
136
 
118
137
  try:
119
- create_qserver(new_qserver_dir, args.name)
120
- print(f"Qserver config created in '{new_qserver_dir}'.")
138
+ edit_qserver_folder(qserver_dir, args.name)
139
+ print(f"Qserver config created in '{qserver_dir}'.")
121
140
  except Exception as exc:
122
141
  print(f"Error creating qserver config: {exc}", file=sys.stderr)
123
142
  sys.exit(1)
@@ -15,7 +15,8 @@ import shutil
15
15
  import sys
16
16
  from datetime import datetime
17
17
  from pathlib import Path
18
- from typing import Tuple
18
+
19
+ # No typing imports needed - using built-in types
19
20
 
20
21
 
21
22
  def validate_instrument_name(name: str) -> bool:
@@ -28,7 +29,7 @@ def validate_instrument_name(name: str) -> bool:
28
29
  return re.fullmatch(r"[a-z][_a-z0-9]*", name) is not None
29
30
 
30
31
 
31
- def get_instrument_paths(name: str) -> Tuple[Path, Path]:
32
+ def get_instrument_paths(name: str) -> tuple[Path, Path]:
32
33
  """
33
34
  Get the paths to the instrument and qserver directories.
34
35
 
@@ -38,17 +39,17 @@ def get_instrument_paths(name: str) -> Tuple[Path, Path]:
38
39
  """
39
40
  main_path: Path = Path(os.getcwd()).resolve()
40
41
  instrument_dir: Path = main_path / "src" / name
41
- qserver_dir: Path = main_path / "src" / f"{name}_qserver"
42
+ qserver_script_dir: Path = main_path / "scripts" / f"{name}_qs_host.sh"
42
43
 
43
- return instrument_dir, qserver_dir
44
+ return instrument_dir, qserver_script_dir
44
45
 
45
46
 
46
- def delete_instrument(instrument_dir: Path, qserver_dir: Path) -> None:
47
+ def delete_instrument(instrument_dir: Path, qserver_script_dir: Path) -> None:
47
48
  """
48
49
  Move the instrument and qserver directories to a .deleted directory.
49
50
 
50
51
  :param instrument_dir: Path to the instrument directory.
51
- :param qserver_dir: Path to the qserver directory.
52
+ :param qserver_script_dir: Path to the qserver script.
52
53
  :return: None
53
54
  """
54
55
  main_path: Path = Path(os.getcwd()).resolve()
@@ -72,13 +73,15 @@ def delete_instrument(instrument_dir: Path, qserver_dir: Path) -> None:
72
73
  else:
73
74
  print(f"Warning: Instrument directory '{instrument_dir}' does not exist.")
74
75
 
75
- if qserver_dir.exists():
76
+ if qserver_script_dir.exists():
76
77
  # Create a new path with timestamp
77
- new_qserver_path = deleted_dir / f"{qserver_dir.name}_{timestamp}"
78
- shutil.move(str(qserver_dir), str(new_qserver_path))
79
- print(f"Qserver directory '{qserver_dir}' moved to '{new_qserver_path}'.")
78
+ new_qserver_path = deleted_dir / f"{qserver_script_dir.name}_{timestamp}"
79
+ shutil.move(str(qserver_script_dir), str(new_qserver_path))
80
+ print(
81
+ f"Qserver directory '{qserver_script_dir}' moved to '{new_qserver_path}'."
82
+ )
80
83
  else:
81
- print(f"Warning: Qserver directory '{qserver_dir}' does not exist.")
84
+ print(f"Warning: Qserver directory '{qserver_script_dir}' does not exist.")
82
85
 
83
86
 
84
87
  def main() -> None:
@@ -108,13 +111,13 @@ def main() -> None:
108
111
 
109
112
  instrument_dir, qserver_dir = get_instrument_paths(args.name)
110
113
 
111
- if not instrument_dir.exists() and not qserver_dir.exists():
112
- msg = (
113
- f"Error: Neither instrument '{args.name}' nor its qserver "
114
- f"configuration exist."
115
- )
114
+ if not instrument_dir.exists():
115
+ msg = f"Error: Instrument '{args.name}' does not exist."
116
+ print(msg, file=sys.stderr)
117
+
118
+ if not qserver_dir.exists():
119
+ msg = f"Error: Qserver script for instrument '{args.name}' does not exist."
116
120
  print(msg, file=sys.stderr)
117
- sys.exit(1)
118
121
 
119
122
  if not args.force:
120
123
  prompt = (
@@ -12,14 +12,12 @@ import argparse
12
12
  import importlib
13
13
  import sys
14
14
  from typing import Any
15
- from typing import Dict
16
15
  from typing import Optional
17
- from typing import Tuple
18
16
 
19
17
  from apsbits.core.instrument_init import oregistry as Registry
20
18
 
21
19
 
22
- def run_instrument_startup(package_name: str) -> Tuple[bool, Optional[Dict[str, Any]]]:
20
+ def run_instrument_startup(package_name: str) -> tuple[bool, Optional[dict[str, Any]]]:
23
21
  """
24
22
  Run a package's startup module and return the ophyd registry information.
25
23