apsbits 1.0.1__tar.gz → 1.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 (145) hide show
  1. {apsbits-1.0.1 → apsbits-1.0.2}/.github/workflows/code.yml +1 -1
  2. {apsbits-1.0.1 → apsbits-1.0.2}/.github/workflows/docs.yml +3 -0
  3. {apsbits-1.0.1 → apsbits-1.0.2}/.gitignore +1 -0
  4. {apsbits-1.0.1 → apsbits-1.0.2}/.pre-commit-config.yaml +8 -7
  5. apsbits-1.0.2/HISTORY.rst +61 -0
  6. {apsbits-1.0.1/apsbits.egg-info → apsbits-1.0.2}/PKG-INFO +11 -52
  7. apsbits-1.0.2/README.md +38 -0
  8. {apsbits-1.0.1 → apsbits-1.0.2/apsbits.egg-info}/PKG-INFO +11 -52
  9. {apsbits-1.0.1 → apsbits-1.0.2}/apsbits.egg-info/SOURCES.txt +48 -15
  10. apsbits-1.0.2/apsbits.egg-info/entry_points.txt +5 -0
  11. {apsbits-1.0.1 → apsbits-1.0.2}/apsbits.egg-info/requires.txt +3 -0
  12. apsbits-1.0.2/docs/source/api/api.rst +49 -0
  13. apsbits-1.0.2/docs/source/api/core.rst +49 -0
  14. apsbits-1.0.2/docs/source/api/demo_instrument.rst +55 -0
  15. apsbits-1.0.2/docs/source/api/demo_qserver.rst +30 -0
  16. apsbits-1.0.2/docs/source/api/generated/apsbits.core.best_effort_init.rst +11 -0
  17. apsbits-1.0.2/docs/source/api/generated/apsbits.core.catalog_init.rst +11 -0
  18. apsbits-1.0.2/docs/source/api/generated/apsbits.core.run_engine_init.rst +11 -0
  19. apsbits-1.0.2/docs/source/api/generated/apsbits.demo_instrument.callbacks.nexus_data_file_writer.rst +17 -0
  20. apsbits-1.0.2/docs/source/api/generated/apsbits.demo_instrument.callbacks.rst +14 -0
  21. apsbits-1.0.2/docs/source/api/generated/apsbits.demo_instrument.callbacks.spec_data_file_writer.rst +19 -0
  22. apsbits-1.0.2/docs/source/api/generated/apsbits.demo_instrument.configs.rst +4 -0
  23. apsbits-1.0.2/docs/source/api/generated/apsbits.demo_instrument.devices.rst +4 -0
  24. apsbits-1.0.2/docs/source/api/generated/apsbits.demo_instrument.plans.dm_plans.rst +13 -0
  25. apsbits-1.0.2/docs/source/api/generated/apsbits.demo_instrument.plans.rst +14 -0
  26. apsbits-1.0.2/docs/source/api/generated/apsbits.demo_instrument.plans.sim_plans.rst +13 -0
  27. apsbits-1.0.2/docs/source/api/generated/apsbits.demo_instrument.rst +17 -0
  28. apsbits-1.0.2/docs/source/api/generated/apsbits.demo_instrument.startup.rst +4 -0
  29. apsbits-1.0.2/docs/source/api/generated/apsbits.demo_qserver.rst +4 -0
  30. apsbits-1.0.2/docs/source/api/generated/apsbits.utils.aps_functions.rst +12 -0
  31. apsbits-1.0.2/docs/source/api/generated/apsbits.utils.config_loaders.rst +14 -0
  32. apsbits-1.0.2/docs/source/api/generated/apsbits.utils.controls_setup.rst +20 -0
  33. apsbits-1.0.2/docs/source/api/generated/apsbits.utils.helper_functions.rst +16 -0
  34. apsbits-1.0.2/docs/source/api/generated/apsbits.utils.logging_setup.rst +12 -0
  35. apsbits-1.0.2/docs/source/api/generated/apsbits.utils.metadata.rst +12 -0
  36. apsbits-1.0.2/docs/source/api/generated/apsbits.utils.stored_dict.rst +11 -0
  37. apsbits-1.0.2/docs/source/api/index.rst +106 -0
  38. apsbits-1.0.2/docs/source/api/utils.rst +54 -0
  39. apsbits-1.0.2/docs/source/bits_overview.rst +99 -0
  40. {apsbits-1.0.1 → apsbits-1.0.2}/docs/source/conf.py +7 -1
  41. {apsbits-1.0.1/docs/source → apsbits-1.0.2/docs/source/deprecated}/console.rst +3 -3
  42. apsbits-1.0.2/docs/source/deprecated/logging_config.rst +43 -0
  43. {apsbits-1.0.1/docs/source → apsbits-1.0.2/docs/source/deprecated}/notebook.rst +4 -11
  44. {apsbits-1.0.1/docs/source → apsbits-1.0.2/docs/source/deprecated}/script.rst +1 -1
  45. apsbits-1.0.2/docs/source/guides/creating_devices.rst +77 -0
  46. apsbits-1.0.2/docs/source/guides/creating_instrument.rst +19 -0
  47. apsbits-1.0.2/docs/source/guides/developing_bits.rst +48 -0
  48. {apsbits-1.0.1 → apsbits-1.0.2}/docs/source/guides/dm.md +2 -2
  49. apsbits-1.0.2/docs/source/guides/index.rst +29 -0
  50. {apsbits-1.0.1/docs/source → apsbits-1.0.2/docs/source/guides}/qserver.rst +54 -21
  51. apsbits-1.0.2/docs/source/guides/qserver_service.rst +191 -0
  52. apsbits-1.0.2/docs/source/guides/sessions.rst +38 -0
  53. apsbits-1.0.2/docs/source/guides/setting_iconfig.rst +144 -0
  54. apsbits-1.0.2/docs/source/guides/template_creation.rst +32 -0
  55. apsbits-1.0.2/docs/source/history.rst +6 -0
  56. apsbits-1.0.2/docs/source/index.rst +55 -0
  57. apsbits-1.0.2/docs/source/install.rst +19 -0
  58. apsbits-1.0.2/docs/source/license.rst +14 -0
  59. {apsbits-1.0.1 → apsbits-1.0.2}/pyproject.toml +15 -2
  60. {apsbits-1.0.1 → apsbits-1.0.2}/src/apsbits/_version.py +2 -2
  61. apsbits-1.0.2/src/apsbits/api/__init__.py +6 -0
  62. apsbits-1.0.2/src/apsbits/api/delete_instrument.py +142 -0
  63. apsbits-1.0.2/src/apsbits/api/run_instrument.py +97 -0
  64. {apsbits-1.0.1 → apsbits-1.0.2}/src/apsbits/core/catalog_init.py +3 -3
  65. apsbits-1.0.2/src/apsbits/core/run_engine_init.py +123 -0
  66. {apsbits-1.0.1 → apsbits-1.0.2}/src/apsbits/demo_instrument/configs/devices.yml +2 -0
  67. {apsbits-1.0.1 → apsbits-1.0.2}/src/apsbits/demo_instrument/configs/iconfig.yml +2 -3
  68. apsbits-1.0.2/src/apsbits/demo_instrument/suspenders/__init__.py +1 -0
  69. apsbits-1.0.2/src/apsbits/demo_instrument/utils/__init__.py +1 -0
  70. apsbits-1.0.2/src/apsbits/tests/test_delete_instrument.py +487 -0
  71. apsbits-1.0.2/src/apsbits/tests/test_run_instrument.py +310 -0
  72. {apsbits-1.0.1 → apsbits-1.0.2}/src/apsbits/utils/config_loaders.py +71 -0
  73. {apsbits-1.0.1 → apsbits-1.0.2}/src/apsbits/utils/make_devices.py +52 -32
  74. {apsbits-1.0.1 → apsbits-1.0.2}/src/apsbits/utils/metadata.py +0 -1
  75. {apsbits-1.0.1 → apsbits-1.0.2}/src/apsbits/utils/stored_dict.py +73 -49
  76. apsbits-1.0.1/README.md +0 -82
  77. apsbits-1.0.1/apsbits.egg-info/entry_points.txt +0 -2
  78. apsbits-1.0.1/docs/source/api/callbacks.rst +0 -16
  79. apsbits-1.0.1/docs/source/api/configs.rst +0 -44
  80. apsbits-1.0.1/docs/source/api/core.rst +0 -19
  81. apsbits-1.0.1/docs/source/api/devices.rst +0 -309
  82. apsbits-1.0.1/docs/source/api/index.rst +0 -42
  83. apsbits-1.0.1/docs/source/api/plans.rst +0 -15
  84. apsbits-1.0.1/docs/source/api/startup.rst +0 -19
  85. apsbits-1.0.1/docs/source/api/utils.rst +0 -28
  86. apsbits-1.0.1/docs/source/guides/index.rst +0 -13
  87. apsbits-1.0.1/docs/source/guides/template_sync.rst +0 -133
  88. apsbits-1.0.1/docs/source/index.rst +0 -71
  89. apsbits-1.0.1/docs/source/install.rst +0 -70
  90. apsbits-1.0.1/docs/source/license.rst +0 -6
  91. apsbits-1.0.1/docs/source/logging_config.rst +0 -76
  92. apsbits-1.0.1/docs/source/sessions.rst +0 -15
  93. apsbits-1.0.1/docs/template_creation.md +0 -31
  94. apsbits-1.0.1/src/apsbits/core/run_engine_init.py +0 -115
  95. {apsbits-1.0.1 → apsbits-1.0.2}/.github/ISSUE_TEMPLATE/bug_report.md +0 -0
  96. {apsbits-1.0.1 → apsbits-1.0.2}/.github/ISSUE_TEMPLATE/config.yml +0 -0
  97. {apsbits-1.0.1 → apsbits-1.0.2}/.github/ISSUE_TEMPLATE/feature_request.md +0 -0
  98. {apsbits-1.0.1 → apsbits-1.0.2}/.github/ISSUE_TEMPLATE/other.md +0 -0
  99. {apsbits-1.0.1 → apsbits-1.0.2}/.github/ISSUE_TEMPLATE/question-issue-template.md +0 -0
  100. {apsbits-1.0.1 → apsbits-1.0.2}/.github/PULL_REQUEST_TEMPLATE.md +0 -0
  101. {apsbits-1.0.1 → apsbits-1.0.2}/.github/dependabot.yml +0 -0
  102. {apsbits-1.0.1 → apsbits-1.0.2}/.github/workflows/pypi.yml +0 -0
  103. {apsbits-1.0.1 → apsbits-1.0.2}/LICENSE +0 -0
  104. {apsbits-1.0.1 → apsbits-1.0.2}/apsbits.egg-info/dependency_links.txt +0 -0
  105. {apsbits-1.0.1 → apsbits-1.0.2}/apsbits.egg-info/top_level.txt +0 -0
  106. {apsbits-1.0.1 → apsbits-1.0.2}/docs/Makefile +0 -0
  107. {apsbits-1.0.1 → apsbits-1.0.2}/docs/make.bat +0 -0
  108. {apsbits-1.0.1 → apsbits-1.0.2}/docs/resources/create-repository-name.webp +0 -0
  109. {apsbits-1.0.1 → apsbits-1.0.2}/docs/resources/create-repository-owner.webp +0 -0
  110. {apsbits-1.0.1/docs/source → apsbits-1.0.2/docs/resources}/demo.ipynb +0 -0
  111. {apsbits-1.0.1 → apsbits-1.0.2}/docs/resources/use-this-template-button.webp +0 -0
  112. {apsbits-1.0.1 → apsbits-1.0.2}/docs/source/_static/.gitkeep +0 -0
  113. {apsbits-1.0.1 → apsbits-1.0.2}/setup.cfg +0 -0
  114. {apsbits-1.0.1 → apsbits-1.0.2}/src/apsbits/__init__.py +0 -0
  115. {apsbits-1.0.1/src/apsbits/utils → apsbits-1.0.2/src/apsbits/api}/create_new_instrument.py +0 -0
  116. {apsbits-1.0.1 → apsbits-1.0.2}/src/apsbits/core/__init__.py +0 -0
  117. {apsbits-1.0.1 → apsbits-1.0.2}/src/apsbits/core/best_effort_init.py +0 -0
  118. {apsbits-1.0.1 → apsbits-1.0.2}/src/apsbits/demo_instrument/README.md +0 -0
  119. {apsbits-1.0.1 → apsbits-1.0.2}/src/apsbits/demo_instrument/__init__.py +0 -0
  120. {apsbits-1.0.1 → apsbits-1.0.2}/src/apsbits/demo_instrument/callbacks/__init__.py +0 -0
  121. {apsbits-1.0.1 → apsbits-1.0.2}/src/apsbits/demo_instrument/callbacks/nexus_data_file_writer.py +0 -0
  122. {apsbits-1.0.1 → apsbits-1.0.2}/src/apsbits/demo_instrument/callbacks/spec_data_file_writer.py +0 -0
  123. {apsbits-1.0.1 → apsbits-1.0.2}/src/apsbits/demo_instrument/configs/__init__.py +0 -0
  124. {apsbits-1.0.1 → apsbits-1.0.2}/src/apsbits/demo_instrument/configs/devices_aps_only.yml +0 -0
  125. {apsbits-1.0.1 → apsbits-1.0.2}/src/apsbits/demo_instrument/configs/logging.yml +0 -0
  126. {apsbits-1.0.1 → apsbits-1.0.2}/src/apsbits/demo_instrument/devices/__init__.py +0 -0
  127. {apsbits-1.0.1 → apsbits-1.0.2}/src/apsbits/demo_instrument/plans/__init__.py +0 -0
  128. {apsbits-1.0.1 → apsbits-1.0.2}/src/apsbits/demo_instrument/plans/dm_plans.py +0 -0
  129. {apsbits-1.0.1 → apsbits-1.0.2}/src/apsbits/demo_instrument/plans/sim_plans.py +0 -0
  130. {apsbits-1.0.1 → apsbits-1.0.2}/src/apsbits/demo_instrument/startup.py +0 -0
  131. {apsbits-1.0.1 → apsbits-1.0.2}/src/apsbits/demo_qserver/qs-config.yml +0 -0
  132. {apsbits-1.0.1 → apsbits-1.0.2}/src/apsbits/demo_qserver/qs_host.sh +0 -0
  133. {apsbits-1.0.1 → apsbits-1.0.2}/src/apsbits/demo_qserver/user_group_permissions.yaml +0 -0
  134. {apsbits-1.0.1 → apsbits-1.0.2}/src/apsbits/tests/__init__.py +0 -0
  135. {apsbits-1.0.1 → apsbits-1.0.2}/src/apsbits/tests/conftest.py +0 -0
  136. {apsbits-1.0.1 → apsbits-1.0.2}/src/apsbits/tests/test_config.py +0 -0
  137. {apsbits-1.0.1 → apsbits-1.0.2}/src/apsbits/tests/test_device_factories.py +0 -0
  138. {apsbits-1.0.1 → apsbits-1.0.2}/src/apsbits/tests/test_general.py +0 -0
  139. {apsbits-1.0.1 → apsbits-1.0.2}/src/apsbits/tests/test_stored_dict.py +0 -0
  140. {apsbits-1.0.1 → apsbits-1.0.2}/src/apsbits/utils/__init__.py +0 -0
  141. {apsbits-1.0.1 → apsbits-1.0.2}/src/apsbits/utils/aps_functions.py +0 -0
  142. {apsbits-1.0.1 → apsbits-1.0.2}/src/apsbits/utils/controls_setup.py +0 -0
  143. {apsbits-1.0.1 → apsbits-1.0.2}/src/apsbits/utils/helper_functions.py +0 -0
  144. {apsbits-1.0.1 → apsbits-1.0.2}/src/apsbits/utils/logging_setup.py +0 -0
  145. {apsbits-1.0.1 → apsbits-1.0.2}/src/apsbits/utils/sim_creator.py +0 -0
@@ -104,7 +104,7 @@ jobs:
104
104
  shell: bash -l {0}
105
105
  run: |
106
106
  set -vxeuo pipefail
107
- pip install -e .
107
+ pip install -e .[dev]
108
108
 
109
109
  - name: Run tests with pytest & coverage
110
110
  shell: bash -l {0}
@@ -43,6 +43,9 @@ jobs:
43
43
  sudo apt-get update
44
44
  sudo apt-get -y install pandoc
45
45
 
46
+ - name: Install graphviz
47
+ run: sudo apt install graphviz
48
+
46
49
  - name: Set time zone
47
50
  run: echo "TZ=America/Chicago" >> "$GITHUB_ENV"
48
51
 
@@ -166,6 +166,7 @@ _version.py
166
166
 
167
167
  # Developer content
168
168
  dev_*
169
+ .deleted/
169
170
 
170
171
  existing_plans_and_devices.yaml
171
172
  .vscode/
@@ -15,14 +15,9 @@ repos:
15
15
  - id: end-of-file-fixer
16
16
  - id: trailing-whitespace
17
17
  - id: check-case-conflict
18
- # - id: check-json
19
- # - id: check-symlinks
18
+ - id: check-json
19
+ - id: check-symlinks
20
20
  - id: check-executables-have-shebangs
21
- # Don't strip output from jupyter notebooks ATM.
22
- # - repo: https://github.com/kynan/nbstripout
23
- # rev: 0.7.1
24
- # hooks:
25
- # - id: nbstripout
26
21
  - repo: https://github.com/astral-sh/ruff-pre-commit
27
22
  rev: v0.4.8
28
23
  hooks:
@@ -30,3 +25,9 @@ repos:
30
25
  args:
31
26
  - --fix
32
27
  - id: ruff-format # replaces Black
28
+ - repo: https://github.com/sphinx-contrib/sphinx-lint
29
+ rev: v1.0.0
30
+ hooks:
31
+ - id: sphinx-lint
32
+ args:
33
+ - docs
@@ -0,0 +1,61 @@
1
+ ..
2
+ This file describes user-visible changes between the versions.
3
+ At this time, there is no automation to update this file.
4
+ Try to describe in human terms what is relevant for each release.
5
+
6
+ Revise this file before tagging a new release.
7
+
8
+ Subsections could include these headings (in this order), omit if no content.
9
+
10
+ Notice
11
+ Breaking Changes
12
+ New Features
13
+ Enhancements
14
+ Fixes
15
+ Maintenance
16
+ Deprecations
17
+ New Contributors
18
+
19
+ .. _release_notes:
20
+
21
+ ========
22
+ Releases
23
+ ========
24
+
25
+ Brief notes describing each release and what's new.
26
+
27
+ Project `milestones <https://github.com/prjemian/hklpy2/milestones>`_
28
+ describe future plans.
29
+
30
+ .. Coming release content can be gathered here.
31
+ Some people object to publishing unreleased changes.
32
+
33
+ 1.0.2
34
+ #####
35
+
36
+ release expected 2025-Q2
37
+
38
+ 1.0.1
39
+ #####
40
+
41
+ released 2025-03-24
42
+
43
+ Fixes
44
+ -----
45
+
46
+ * Calling RE(make_devices()) twice raises a lot of errors.
47
+ * startup sequence needs revision
48
+ * make_devices() needs a 'clear 'option
49
+ * make_devices() is noisy
50
+ * Why does make_devices() add all ophyd.sim simulator objects to ophyd registry?
51
+ * First argument to logger.LEVEL() should not be an f-string
52
+ * Adjust the order of steps when creating RE
53
+ * bp.scan (& others) missing in queueserver
54
+ * QS restart does not restart when QS was running
55
+
56
+ 1.0.0
57
+ #####
58
+
59
+ released 2025-03-21
60
+
61
+ Initial public release.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: apsbits
3
- Version: 1.0.1
3
+ Version: 1.0.2
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>
@@ -42,6 +42,7 @@ Requires-Dist: isort; extra == "dev"
42
42
  Requires-Dist: mypy; extra == "dev"
43
43
  Requires-Dist: pre-commit; extra == "dev"
44
44
  Requires-Dist: pytest; extra == "dev"
45
+ Requires-Dist: pytest-mock; extra == "dev"
45
46
  Requires-Dist: ruff; extra == "dev"
46
47
  Provides-Extra: doc
47
48
  Requires-Dist: babel; extra == "doc"
@@ -56,6 +57,8 @@ Requires-Dist: pygments; extra == "doc"
56
57
  Requires-Dist: sphinx-design; extra == "doc"
57
58
  Requires-Dist: sphinx-tabs; extra == "doc"
58
59
  Requires-Dist: sphinx; extra == "doc"
60
+ Requires-Dist: graphviz; extra == "doc"
61
+ Requires-Dist: dot; extra == "doc"
59
62
  Provides-Extra: all
60
63
  Requires-Dist: apsbits[dev,doc]; extra == "all"
61
64
  Dynamic: license-file
@@ -76,16 +79,17 @@ queueserver.
76
79
  Please create a bits instrument using our template repository: https://github.com/BCDA-APS/DEMO-BITS
77
80
 
78
81
 
79
- ## Installing the BITS Package for Development
82
+ ## Installing the BITS Package
80
83
 
81
84
  ```bash
82
- git clone github.com:BCDA-APS/BITS.git
83
- cd BITS
84
- conda create -y -n BITS_env python=3.11 pyepics
85
- conda activate BITS_env
86
- pip install -e ."[all]"
85
+ export INSTALL_ENVIRONMENT_NAME=apsbits_env
86
+ conda create -y -n "${INSTALL_ENVIRONMENT_NAME}" python=3.11 pyepics
87
+ conda activate "${INSTALL_ENVIRONMENT_NAME}"
88
+ pip install apsbits
87
89
  ```
88
90
 
91
+ For development please reference our documentation
92
+
89
93
  ## Testing the apsbits base installation
90
94
 
91
95
  On an ipython console
@@ -97,48 +101,3 @@ RE(sim_print_plan())
97
101
  RE(sim_count_plan())
98
102
  RE(sim_rel_scan_plan())
99
103
  ```
100
-
101
- ## Testing
102
-
103
- Use this command to run the test suite locally:
104
-
105
- ```bash
106
- pytest -vvv --lf ./src
107
- ```
108
-
109
- ## Documentation
110
-
111
- <details>
112
- <summary>prerequisite</summary>
113
-
114
- To build the documentation locally, install [`pandoc`](https://pandoc.org/) in
115
- your conda environment:
116
-
117
- ```bash
118
- conda install conda-forge::pandoc
119
- ```
120
-
121
- </details>
122
-
123
- Use this command to build the documentation locally:
124
-
125
- ```bash
126
- make -C docs clean html
127
- ```
128
-
129
- Once the documentation builds, view the HTML pages using your web browser:
130
-
131
- ```bash
132
- BROWSER ./docs/build/html/index.html &
133
- ```
134
-
135
- ### Adding to the documentation source
136
-
137
- The documentation source is located in files and directories under
138
- `./docs/source`. Various examples are provided.
139
-
140
- Documentation can be added in these formats:
141
- [`.rst`](https://www.sphinx-doc.org/en/master/usage/restructuredtext/basics.html)
142
- (reStructured text), [`.md`](https://en.wikipedia.org/wiki/Markdown) (markdown),
143
- and [`.ipynb`](https://jupyter.org/) (Jupyter notebook). For more information,
144
- see the [Sphinx](https://www.sphinx-doc.org/) documentation.
@@ -0,0 +1,38 @@
1
+ # APSBITS: Template Package for Bluesky Instruments
2
+
3
+ | PyPI | Coverage |
4
+ | --- | --- |
5
+ [![PyPi](https://img.shields.io/pypi/v/apsbits.svg)](https://pypi.python.org/pypi/apsbits) | [![Coverage Status](https://coveralls.io/repos/github/BCDA-APS/BITS/badge.svg?branch=main)](https://coveralls.io/github/BCDA-APS/BITS?branch=main) |
6
+
7
+ BITS: **B**luesky **I**nstrument **T**emplate **S**tructure
8
+
9
+ Template of a Bluesky Data Acquisition Instrument in console, notebook, &
10
+ queueserver.
11
+
12
+ ## Production use of BITS
13
+
14
+ Please create a bits instrument using our template repository: https://github.com/BCDA-APS/DEMO-BITS
15
+
16
+
17
+ ## Installing the BITS Package
18
+
19
+ ```bash
20
+ export INSTALL_ENVIRONMENT_NAME=apsbits_env
21
+ conda create -y -n "${INSTALL_ENVIRONMENT_NAME}" python=3.11 pyepics
22
+ conda activate "${INSTALL_ENVIRONMENT_NAME}"
23
+ pip install apsbits
24
+ ```
25
+
26
+ For development please reference our documentation
27
+
28
+ ## Testing the apsbits base installation
29
+
30
+ On an ipython console
31
+
32
+ ```py
33
+ from apsbits.demo_instrument.startup import *
34
+ listobjects()
35
+ RE(sim_print_plan())
36
+ RE(sim_count_plan())
37
+ RE(sim_rel_scan_plan())
38
+ ```
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: apsbits
3
- Version: 1.0.1
3
+ Version: 1.0.2
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>
@@ -42,6 +42,7 @@ Requires-Dist: isort; extra == "dev"
42
42
  Requires-Dist: mypy; extra == "dev"
43
43
  Requires-Dist: pre-commit; extra == "dev"
44
44
  Requires-Dist: pytest; extra == "dev"
45
+ Requires-Dist: pytest-mock; extra == "dev"
45
46
  Requires-Dist: ruff; extra == "dev"
46
47
  Provides-Extra: doc
47
48
  Requires-Dist: babel; extra == "doc"
@@ -56,6 +57,8 @@ Requires-Dist: pygments; extra == "doc"
56
57
  Requires-Dist: sphinx-design; extra == "doc"
57
58
  Requires-Dist: sphinx-tabs; extra == "doc"
58
59
  Requires-Dist: sphinx; extra == "doc"
60
+ Requires-Dist: graphviz; extra == "doc"
61
+ Requires-Dist: dot; extra == "doc"
59
62
  Provides-Extra: all
60
63
  Requires-Dist: apsbits[dev,doc]; extra == "all"
61
64
  Dynamic: license-file
@@ -76,16 +79,17 @@ queueserver.
76
79
  Please create a bits instrument using our template repository: https://github.com/BCDA-APS/DEMO-BITS
77
80
 
78
81
 
79
- ## Installing the BITS Package for Development
82
+ ## Installing the BITS Package
80
83
 
81
84
  ```bash
82
- git clone github.com:BCDA-APS/BITS.git
83
- cd BITS
84
- conda create -y -n BITS_env python=3.11 pyepics
85
- conda activate BITS_env
86
- pip install -e ."[all]"
85
+ export INSTALL_ENVIRONMENT_NAME=apsbits_env
86
+ conda create -y -n "${INSTALL_ENVIRONMENT_NAME}" python=3.11 pyepics
87
+ conda activate "${INSTALL_ENVIRONMENT_NAME}"
88
+ pip install apsbits
87
89
  ```
88
90
 
91
+ For development please reference our documentation
92
+
89
93
  ## Testing the apsbits base installation
90
94
 
91
95
  On an ipython console
@@ -97,48 +101,3 @@ RE(sim_print_plan())
97
101
  RE(sim_count_plan())
98
102
  RE(sim_rel_scan_plan())
99
103
  ```
100
-
101
- ## Testing
102
-
103
- Use this command to run the test suite locally:
104
-
105
- ```bash
106
- pytest -vvv --lf ./src
107
- ```
108
-
109
- ## Documentation
110
-
111
- <details>
112
- <summary>prerequisite</summary>
113
-
114
- To build the documentation locally, install [`pandoc`](https://pandoc.org/) in
115
- your conda environment:
116
-
117
- ```bash
118
- conda install conda-forge::pandoc
119
- ```
120
-
121
- </details>
122
-
123
- Use this command to build the documentation locally:
124
-
125
- ```bash
126
- make -C docs clean html
127
- ```
128
-
129
- Once the documentation builds, view the HTML pages using your web browser:
130
-
131
- ```bash
132
- BROWSER ./docs/build/html/index.html &
133
- ```
134
-
135
- ### Adding to the documentation source
136
-
137
- The documentation source is located in files and directories under
138
- `./docs/source`. Various examples are provided.
139
-
140
- Documentation can be added in these formats:
141
- [`.rst`](https://www.sphinx-doc.org/en/master/usage/restructuredtext/basics.html)
142
- (reStructured text), [`.md`](https://en.wikipedia.org/wiki/Markdown) (markdown),
143
- and [`.ipynb`](https://jupyter.org/) (Jupyter notebook). For more information,
144
- see the [Sphinx](https://www.sphinx-doc.org/) documentation.
@@ -1,5 +1,6 @@
1
1
  .gitignore
2
2
  .pre-commit-config.yaml
3
+ HISTORY.rst
3
4
  LICENSE
4
5
  README.md
5
6
  pyproject.toml
@@ -21,35 +22,64 @@ apsbits.egg-info/requires.txt
21
22
  apsbits.egg-info/top_level.txt
22
23
  docs/Makefile
23
24
  docs/make.bat
24
- docs/template_creation.md
25
25
  docs/resources/create-repository-name.webp
26
26
  docs/resources/create-repository-owner.webp
27
+ docs/resources/demo.ipynb
27
28
  docs/resources/use-this-template-button.webp
29
+ docs/source/bits_overview.rst
28
30
  docs/source/conf.py
29
- docs/source/console.rst
30
- docs/source/demo.ipynb
31
+ docs/source/history.rst
31
32
  docs/source/index.rst
32
33
  docs/source/install.rst
33
34
  docs/source/license.rst
34
- docs/source/logging_config.rst
35
- docs/source/notebook.rst
36
- docs/source/qserver.rst
37
- docs/source/script.rst
38
- docs/source/sessions.rst
39
35
  docs/source/_static/.gitkeep
40
- docs/source/api/callbacks.rst
41
- docs/source/api/configs.rst
36
+ docs/source/api/api.rst
42
37
  docs/source/api/core.rst
43
- docs/source/api/devices.rst
38
+ docs/source/api/demo_instrument.rst
39
+ docs/source/api/demo_qserver.rst
44
40
  docs/source/api/index.rst
45
- docs/source/api/plans.rst
46
- docs/source/api/startup.rst
47
41
  docs/source/api/utils.rst
42
+ docs/source/api/generated/apsbits.core.best_effort_init.rst
43
+ docs/source/api/generated/apsbits.core.catalog_init.rst
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
46
+ docs/source/api/generated/apsbits.demo_instrument.callbacks.rst
47
+ docs/source/api/generated/apsbits.demo_instrument.callbacks.spec_data_file_writer.rst
48
+ docs/source/api/generated/apsbits.demo_instrument.configs.rst
49
+ docs/source/api/generated/apsbits.demo_instrument.devices.rst
50
+ docs/source/api/generated/apsbits.demo_instrument.plans.dm_plans.rst
51
+ docs/source/api/generated/apsbits.demo_instrument.plans.rst
52
+ docs/source/api/generated/apsbits.demo_instrument.plans.sim_plans.rst
53
+ docs/source/api/generated/apsbits.demo_instrument.rst
54
+ docs/source/api/generated/apsbits.demo_instrument.startup.rst
55
+ docs/source/api/generated/apsbits.demo_qserver.rst
56
+ docs/source/api/generated/apsbits.utils.aps_functions.rst
57
+ docs/source/api/generated/apsbits.utils.config_loaders.rst
58
+ docs/source/api/generated/apsbits.utils.controls_setup.rst
59
+ docs/source/api/generated/apsbits.utils.helper_functions.rst
60
+ docs/source/api/generated/apsbits.utils.logging_setup.rst
61
+ docs/source/api/generated/apsbits.utils.metadata.rst
62
+ docs/source/api/generated/apsbits.utils.stored_dict.rst
63
+ docs/source/deprecated/console.rst
64
+ docs/source/deprecated/logging_config.rst
65
+ docs/source/deprecated/notebook.rst
66
+ docs/source/deprecated/script.rst
67
+ docs/source/guides/creating_devices.rst
68
+ docs/source/guides/creating_instrument.rst
69
+ docs/source/guides/developing_bits.rst
48
70
  docs/source/guides/dm.md
49
71
  docs/source/guides/index.rst
50
- docs/source/guides/template_sync.rst
72
+ docs/source/guides/qserver.rst
73
+ docs/source/guides/qserver_service.rst
74
+ docs/source/guides/sessions.rst
75
+ docs/source/guides/setting_iconfig.rst
76
+ docs/source/guides/template_creation.rst
51
77
  src/apsbits/__init__.py
52
78
  src/apsbits/_version.py
79
+ src/apsbits/api/__init__.py
80
+ src/apsbits/api/create_new_instrument.py
81
+ src/apsbits/api/delete_instrument.py
82
+ src/apsbits/api/run_instrument.py
53
83
  src/apsbits/core/__init__.py
54
84
  src/apsbits/core/best_effort_init.py
55
85
  src/apsbits/core/catalog_init.py
@@ -69,20 +99,23 @@ src/apsbits/demo_instrument/devices/__init__.py
69
99
  src/apsbits/demo_instrument/plans/__init__.py
70
100
  src/apsbits/demo_instrument/plans/dm_plans.py
71
101
  src/apsbits/demo_instrument/plans/sim_plans.py
102
+ src/apsbits/demo_instrument/suspenders/__init__.py
103
+ src/apsbits/demo_instrument/utils/__init__.py
72
104
  src/apsbits/demo_qserver/qs-config.yml
73
105
  src/apsbits/demo_qserver/qs_host.sh
74
106
  src/apsbits/demo_qserver/user_group_permissions.yaml
75
107
  src/apsbits/tests/__init__.py
76
108
  src/apsbits/tests/conftest.py
77
109
  src/apsbits/tests/test_config.py
110
+ src/apsbits/tests/test_delete_instrument.py
78
111
  src/apsbits/tests/test_device_factories.py
79
112
  src/apsbits/tests/test_general.py
113
+ src/apsbits/tests/test_run_instrument.py
80
114
  src/apsbits/tests/test_stored_dict.py
81
115
  src/apsbits/utils/__init__.py
82
116
  src/apsbits/utils/aps_functions.py
83
117
  src/apsbits/utils/config_loaders.py
84
118
  src/apsbits/utils/controls_setup.py
85
- src/apsbits/utils/create_new_instrument.py
86
119
  src/apsbits/utils/helper_functions.py
87
120
  src/apsbits/utils/logging_setup.py
88
121
  src/apsbits/utils/make_devices.py
@@ -0,0 +1,5 @@
1
+ [console_scripts]
2
+ bits-create = apsbits.api.create_new_instrument:main
3
+ bits-delete = apsbits.api.delete_instrument:main
4
+ bits-run = apsbits.api.run_instrument:main
5
+ create-bits = apsbits.api.create_new_instrument:main
@@ -27,6 +27,7 @@ isort
27
27
  mypy
28
28
  pre-commit
29
29
  pytest
30
+ pytest-mock
30
31
  ruff
31
32
 
32
33
  [doc]
@@ -42,3 +43,5 @@ pygments
42
43
  sphinx-design
43
44
  sphinx-tabs
44
45
  sphinx
46
+ graphviz
47
+ dot
@@ -0,0 +1,49 @@
1
+ .. _api.api:
2
+
3
+ API
4
+ ===
5
+
6
+ The API module provides command-line interfaces for instrument management:
7
+
8
+ .. autosummary::
9
+ :toctree: generated
10
+ :recursive:
11
+
12
+ apsbits.api.create_new_instrument
13
+ apsbits.api.delete_instrument
14
+ apsbits.api.run_instrument
15
+
16
+ These command-line tools help with:
17
+
18
+ 1. Creating new instruments from templates
19
+ 2. Deleting instruments and their associated qserver configurations
20
+ 3. Running instruments and retrieving their ophyd registry information
21
+
22
+ Example Usage
23
+ -------------
24
+
25
+ Create a new instrument:
26
+
27
+ .. code-block:: bash
28
+
29
+ create-bits --name my_instrument --path /path/to/instrument
30
+
31
+ Delete an instrument:
32
+
33
+ .. code-block:: bash
34
+
35
+ delete-bits --name my_instrument --path /path/to/instrument
36
+
37
+ Run an instrument:
38
+
39
+ .. code-block:: bash
40
+
41
+ run-bits --name my_instrument --path /path/to/instrument
42
+
43
+ API Reference
44
+ -------------
45
+
46
+ .. automodule:: apsbits.api
47
+ :members:
48
+ :undoc-members:
49
+ :show-inheritance:
@@ -0,0 +1,49 @@
1
+ .. _api.core:
2
+
3
+ Core Components
4
+ ===============
5
+
6
+ The core module provides fundamental components for building a Bluesky data acquisition system.
7
+
8
+ .. currentmodule:: apsbits.core
9
+
10
+ .. autosummary::
11
+ :toctree: generated
12
+ :recursive:
13
+
14
+ best_effort_init
15
+ catalog_init
16
+ run_engine_init
17
+
18
+ These components are used to:
19
+
20
+ 1. Initialize the Run Engine
21
+ 2. Set up data catalogs
22
+ 3. Configure best-effort callbacks
23
+ 4. Establish baseline configurations
24
+
25
+ Example Usage
26
+ -------------
27
+
28
+ Here's how to initialize the Run Engine, set up data catalogs, and configure best-effort callbacks:
29
+
30
+ .. code-block:: python
31
+
32
+ from apsbits.core import run_engine_init, catalog_init, best_effort_init
33
+
34
+ # Initialize the Run Engine
35
+ RE = run_engine_init()
36
+
37
+ # Set up data catalogs
38
+ cat = catalog_init()
39
+
40
+ # Configure best-effort callbacks
41
+ bec = best_effort_init(RE)
42
+
43
+ API Reference
44
+ -------------
45
+
46
+ .. automodule:: apsbits.core
47
+ :members:
48
+ :undoc-members:
49
+ :show-inheritance:
@@ -0,0 +1,55 @@
1
+ .. _api.demo_instrument:
2
+
3
+ Demo Instrument
4
+ ===============
5
+
6
+ .. currentmodule:: apsbits.demo_instrument
7
+
8
+ .. autosummary::
9
+ :toctree: generated
10
+ :recursive:
11
+
12
+ startup
13
+ callbacks
14
+ devices
15
+ plans
16
+
17
+ Example Usage
18
+ -------------
19
+
20
+ .. code-block:: py
21
+
22
+ from apsbits.demo_instrument.startup import *
23
+
24
+ Components
25
+ ----------
26
+
27
+ The demo instrument is organized into several components:
28
+
29
+ callbacks
30
+ ~~~~~~~~~
31
+
32
+ .. autosummary::
33
+ :toctree: generated
34
+ :recursive:
35
+
36
+ callbacks.nexus_data_file_writer
37
+ callbacks.spec_data_file_writer
38
+
39
+ devices
40
+ ~~~~~~~
41
+
42
+ .. autosummary::
43
+ :toctree: generated
44
+ :recursive:
45
+
46
+
47
+ plans
48
+ ~~~~~
49
+
50
+ .. autosummary::
51
+ :toctree: generated
52
+ :recursive:
53
+
54
+ plans.dm_plans
55
+ plans.sim_plans
@@ -0,0 +1,30 @@
1
+ .. _api.demo_qserver:
2
+
3
+ Demo Queue Server
4
+ =================
5
+
6
+ .. currentmodule:: apsbits.demo_qserver
7
+
8
+
9
+
10
+ Starting the Server
11
+ ===================
12
+
13
+ .. code-block:: bash
14
+
15
+ ./qs_host.sh
16
+
17
+ Configuration
18
+ -------------
19
+
20
+ .. code-block:: yaml
21
+
22
+ # qs-config.yml
23
+ host: localhost
24
+ port: 8080
25
+ name: demo_qserver
26
+ log_level: INFO
27
+
28
+ The demo queue server provides an example implementation of a Bluesky Queue Server using APSBITS.
29
+
30
+ For more details on using the Queue Server, see :doc:`../guides/qserver_service`.
@@ -0,0 +1,11 @@
1
+ apsbits.core.best\_effort\_init
2
+ ===============================
3
+
4
+ .. automodule:: apsbits.core.best_effort_init
5
+
6
+
7
+ .. rubric:: Functions
8
+
9
+ .. autosummary::
10
+
11
+ init_bec_peaks
@@ -0,0 +1,11 @@
1
+ apsbits.core.catalog\_init
2
+ ==========================
3
+
4
+ .. automodule:: apsbits.core.catalog_init
5
+
6
+
7
+ .. rubric:: Functions
8
+
9
+ .. autosummary::
10
+
11
+ init_catalog