aps-ai-beamline-controller 0.0.1__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 (130) hide show
  1. aps_ai_beamline_controller-0.0.1/LICENSE +36 -0
  2. aps_ai_beamline_controller-0.0.1/MANIFEST.in +4 -0
  3. aps_ai_beamline_controller-0.0.1/PKG-INFO +50 -0
  4. aps_ai_beamline_controller-0.0.1/README.md +2 -0
  5. aps_ai_beamline_controller-0.0.1/aps/__init__.py +47 -0
  6. aps_ai_beamline_controller-0.0.1/aps/ai/__init__.py +47 -0
  7. aps_ai_beamline_controller-0.0.1/aps/ai/beamline_controller/__init__.py +47 -0
  8. aps_ai_beamline_controller-0.0.1/aps/ai/beamline_controller/__main__.py +76 -0
  9. aps_ai_beamline_controller-0.0.1/aps/ai/beamline_controller/agent/__init__.py +46 -0
  10. aps_ai_beamline_controller-0.0.1/aps/ai/beamline_controller/agent/agent_listener_factory.py +63 -0
  11. aps_ai_beamline_controller-0.0.1/aps/ai/beamline_controller/agent/facade.py +66 -0
  12. aps_ai_beamline_controller-0.0.1/aps/ai/beamline_controller/agent/machine_learning/__init__.py +58 -0
  13. aps_ai_beamline_controller-0.0.1/aps/ai/beamline_controller/agent/machine_learning/deep_kernel_model/__example_code/__init__.py +46 -0
  14. aps_ai_beamline_controller-0.0.1/aps/ai/beamline_controller/agent/machine_learning/deep_kernel_model/__example_code/ai_jam/__init__.py +46 -0
  15. aps_ai_beamline_controller-0.0.1/aps/ai/beamline_controller/agent/machine_learning/deep_kernel_model/__example_code/ai_jam/dkgp.py +192 -0
  16. aps_ai_beamline_controller-0.0.1/aps/ai/beamline_controller/agent/machine_learning/deep_kernel_model/__example_code/ai_jam/neural_network_surrogate.py +228 -0
  17. aps_ai_beamline_controller-0.0.1/aps/ai/beamline_controller/agent/machine_learning/deep_kernel_model/__example_code/example_from_internet.py +191 -0
  18. aps_ai_beamline_controller-0.0.1/aps/ai/beamline_controller/agent/machine_learning/deep_kernel_model/__example_code/from_open_ai.py +195 -0
  19. aps_ai_beamline_controller-0.0.1/aps/ai/beamline_controller/agent/machine_learning/deep_kernel_model/__example_code/from_open_ai_fixed.py +135 -0
  20. aps_ai_beamline_controller-0.0.1/aps/ai/beamline_controller/agent/machine_learning/deep_kernel_model/__example_code/gaussian_process_model.py +117 -0
  21. aps_ai_beamline_controller-0.0.1/aps/ai/beamline_controller/agent/machine_learning/deep_kernel_model/__example_code/gpytorch_deep_gaussian_processes.py +226 -0
  22. aps_ai_beamline_controller-0.0.1/aps/ai/beamline_controller/agent/machine_learning/deep_kernel_model/__example_code/gpytorch_exact_DKL.py +163 -0
  23. aps_ai_beamline_controller-0.0.1/aps/ai/beamline_controller/agent/machine_learning/deep_kernel_model/__example_code/runyu/__init__.py +46 -0
  24. aps_ai_beamline_controller-0.0.1/aps/ai/beamline_controller/agent/machine_learning/deep_kernel_model/__example_code/runyu/ax_developer_classes.py +741 -0
  25. aps_ai_beamline_controller-0.0.1/aps/ai/beamline_controller/agent/machine_learning/deep_kernel_model/__example_code/runyu/bo_modular.py +741 -0
  26. aps_ai_beamline_controller-0.0.1/aps/ai/beamline_controller/agent/machine_learning/deep_kernel_model/__example_code/runyu/extended_surrogate.py +116 -0
  27. aps_ai_beamline_controller-0.0.1/aps/ai/beamline_controller/agent/machine_learning/deep_kernel_model/__example_code/runyu/run_ax_bom.py +34 -0
  28. aps_ai_beamline_controller-0.0.1/aps/ai/beamline_controller/agent/machine_learning/deep_kernel_model/__example_code/runyu/run_ax_developer.py +38 -0
  29. aps_ai_beamline_controller-0.0.1/aps/ai/beamline_controller/agent/machine_learning/deep_kernel_model/__init__.py +46 -0
  30. aps_ai_beamline_controller-0.0.1/aps/ai/beamline_controller/agent/machine_learning/deep_kernel_model/ax/__init__.py +46 -0
  31. aps_ai_beamline_controller-0.0.1/aps/ai/beamline_controller/agent/machine_learning/deep_kernel_model/deep_kernel_gp.py +134 -0
  32. aps_ai_beamline_controller-0.0.1/aps/ai/beamline_controller/agent/machine_learning/neural_networks/__init__.py +46 -0
  33. aps_ai_beamline_controller-0.0.1/aps/ai/beamline_controller/agent/machine_learning/neural_networks/adapters/__init__.py +46 -0
  34. aps_ai_beamline_controller-0.0.1/aps/ai/beamline_controller/agent/machine_learning/neural_networks/adapters/hypervolume_manager_adapter.py +88 -0
  35. aps_ai_beamline_controller-0.0.1/aps/ai/beamline_controller/agent/machine_learning/neural_networks/facade.py +159 -0
  36. aps_ai_beamline_controller-0.0.1/aps/ai/beamline_controller/agent/machine_learning/neural_networks/neural_network_manager.py +181 -0
  37. aps_ai_beamline_controller-0.0.1/aps/ai/beamline_controller/agent/machine_learning/neural_networks/neural_network_manager_factory.py +66 -0
  38. aps_ai_beamline_controller-0.0.1/aps/ai/beamline_controller/agent/machine_learning/neural_networks/neural_network_models.py +290 -0
  39. aps_ai_beamline_controller-0.0.1/aps/ai/beamline_controller/agent/machine_learning/neural_networks/tandem_neural_network.py +293 -0
  40. aps_ai_beamline_controller-0.0.1/aps/ai/beamline_controller/agent/machine_learning/surrogates/__init__.py +46 -0
  41. aps_ai_beamline_controller-0.0.1/aps/ai/beamline_controller/agent/machine_learning/surrogates/ax/__init__.py +46 -0
  42. aps_ai_beamline_controller-0.0.1/aps/ai/beamline_controller/agent/machine_learning/surrogates/ax/ax_custom_surrogate.py +141 -0
  43. aps_ai_beamline_controller-0.0.1/aps/ai/beamline_controller/agent/machine_learning/surrogates/ax/ax_dkl_surrogate.py +156 -0
  44. aps_ai_beamline_controller-0.0.1/aps/ai/beamline_controller/agent/optimization/__init__.py +46 -0
  45. aps_ai_beamline_controller-0.0.1/aps/ai/beamline_controller/agent/optimization/abstract_optimizer.py +371 -0
  46. aps_ai_beamline_controller-0.0.1/aps/ai/beamline_controller/agent/optimization/common/__init__.py +46 -0
  47. aps_ai_beamline_controller-0.0.1/aps/ai/beamline_controller/agent/optimization/common/bayesian/__init__.py +46 -0
  48. aps_ai_beamline_controller-0.0.1/aps/ai/beamline_controller/agent/optimization/common/bayesian/abstract_hypervolume_manager.py +241 -0
  49. aps_ai_beamline_controller-0.0.1/aps/ai/beamline_controller/agent/optimization/common/bayesian/abstract_optimizer.py +217 -0
  50. aps_ai_beamline_controller-0.0.1/aps/ai/beamline_controller/agent/optimization/common/bayesian/facade.py +293 -0
  51. aps_ai_beamline_controller-0.0.1/aps/ai/beamline_controller/agent/optimization/common/plot_utility.py +152 -0
  52. aps_ai_beamline_controller-0.0.1/aps/ai/beamline_controller/agent/optimization/common/transfer_learning.py +121 -0
  53. aps_ai_beamline_controller-0.0.1/aps/ai/beamline_controller/agent/optimization/decorators/__init__.py +46 -0
  54. aps_ai_beamline_controller-0.0.1/aps/ai/beamline_controller/agent/optimization/decorators/abstract_hypervolume_manager_decorator.py +142 -0
  55. aps_ai_beamline_controller-0.0.1/aps/ai/beamline_controller/agent/optimization/decorators/direct_beam_image_decorator.py +159 -0
  56. aps_ai_beamline_controller-0.0.1/aps/ai/beamline_controller/agent/optimization/decorators/speckle_analysis_decorator.py +81 -0
  57. aps_ai_beamline_controller-0.0.1/aps/ai/beamline_controller/agent/optimization/decorators/wavefront_analysis_decorator.py +155 -0
  58. aps_ai_beamline_controller-0.0.1/aps/ai/beamline_controller/agent/optimization/facade.py +585 -0
  59. aps_ai_beamline_controller-0.0.1/aps/ai/beamline_controller/agent/optimization/hypervolume_manager_factory.py +64 -0
  60. aps_ai_beamline_controller-0.0.1/aps/ai/beamline_controller/agent/optimization/moo/__init__.py +46 -0
  61. aps_ai_beamline_controller-0.0.1/aps/ai/beamline_controller/agent/optimization/moo/bayesian/__init__.py +46 -0
  62. aps_ai_beamline_controller-0.0.1/aps/ai/beamline_controller/agent/optimization/moo/bayesian/abstract_hypervolume_manager.py +83 -0
  63. aps_ai_beamline_controller-0.0.1/aps/ai/beamline_controller/agent/optimization/moo/bayesian/abstract_optimizer.py +193 -0
  64. aps_ai_beamline_controller-0.0.1/aps/ai/beamline_controller/agent/optimization/moo/bayesian/ax/__init__.py +46 -0
  65. aps_ai_beamline_controller-0.0.1/aps/ai/beamline_controller/agent/optimization/moo/bayesian/ax/hypervolume_manager.py +208 -0
  66. aps_ai_beamline_controller-0.0.1/aps/ai/beamline_controller/agent/optimization/moo/bayesian/ax/optimization_listener.py +59 -0
  67. aps_ai_beamline_controller-0.0.1/aps/ai/beamline_controller/agent/optimization/moo/bayesian/ax/optimizer.py +667 -0
  68. aps_ai_beamline_controller-0.0.1/aps/ai/beamline_controller/agent/optimization/moo/bayesian/bloptools/__init__.py +46 -0
  69. aps_ai_beamline_controller-0.0.1/aps/ai/beamline_controller/agent/optimization/moo/bayesian/bloptools/__test/__init__.py +46 -0
  70. aps_ai_beamline_controller-0.0.1/aps/ai/beamline_controller/agent/optimization/moo/bayesian/bloptools/__test/optimizer/__init__.py +46 -0
  71. aps_ai_beamline_controller-0.0.1/aps/ai/beamline_controller/agent/optimization/moo/bayesian/bloptools/__test/optimizer/aps_ai_configuration.py +166 -0
  72. aps_ai_beamline_controller-0.0.1/aps/ai/beamline_controller/agent/optimization/moo/bayesian/bloptools/__test/optimizer/bloptools_optimization.py +182 -0
  73. aps_ai_beamline_controller-0.0.1/aps/ai/beamline_controller/agent/optimization/moo/bayesian/bloptools/hypervolume_manager.py +220 -0
  74. aps_ai_beamline_controller-0.0.1/aps/ai/beamline_controller/agent/optimization/moo/bayesian/bloptools/optimization_listener.py +72 -0
  75. aps_ai_beamline_controller-0.0.1/aps/ai/beamline_controller/agent/optimization/moo/bayesian/bloptools/optimizer.py +300 -0
  76. aps_ai_beamline_controller-0.0.1/aps/ai/beamline_controller/agent/optimization/moo/bayesian/common/__init__.py +46 -0
  77. aps_ai_beamline_controller-0.0.1/aps/ai/beamline_controller/agent/optimization/moo/bayesian/common/pareto.py +223 -0
  78. aps_ai_beamline_controller-0.0.1/aps/ai/beamline_controller/agent/optimization/moo/bayesian/common/plot_utility.py +185 -0
  79. aps_ai_beamline_controller-0.0.1/aps/ai/beamline_controller/agent/optimization/moo/bayesian/facade.py +176 -0
  80. aps_ai_beamline_controller-0.0.1/aps/ai/beamline_controller/agent/optimization/moo/bayesian/optuna/__init__.py +46 -0
  81. aps_ai_beamline_controller-0.0.1/aps/ai/beamline_controller/agent/optimization/moo/bayesian/optuna/botorch/__init__.py +46 -0
  82. aps_ai_beamline_controller-0.0.1/aps/ai/beamline_controller/agent/optimization/moo/bayesian/optuna/botorch/botorch_acquisition_functions.py +550 -0
  83. aps_ai_beamline_controller-0.0.1/aps/ai/beamline_controller/agent/optimization/moo/bayesian/optuna/botorch/botorch_sampler.py +276 -0
  84. aps_ai_beamline_controller-0.0.1/aps/ai/beamline_controller/agent/optimization/moo/bayesian/optuna/hypervolume_manager.py +207 -0
  85. aps_ai_beamline_controller-0.0.1/aps/ai/beamline_controller/agent/optimization/moo/bayesian/optuna/optimization_listener.py +60 -0
  86. aps_ai_beamline_controller-0.0.1/aps/ai/beamline_controller/agent/optimization/moo/bayesian/optuna/optimizer.py +235 -0
  87. aps_ai_beamline_controller-0.0.1/aps/ai/beamline_controller/agent/optimization/optimizer_factory.py +66 -0
  88. aps_ai_beamline_controller-0.0.1/aps/ai/beamline_controller/agent/optimization/soo/__init__.py +46 -0
  89. aps_ai_beamline_controller-0.0.1/aps/ai/beamline_controller/agent/optimization/soo/bayesian/__init__.py +46 -0
  90. aps_ai_beamline_controller-0.0.1/aps/ai/beamline_controller/agent/optimization/soo/bayesian/abstract_hypervolume_manager.py +67 -0
  91. aps_ai_beamline_controller-0.0.1/aps/ai/beamline_controller/agent/optimization/soo/bayesian/abstract_optimizer.py +76 -0
  92. aps_ai_beamline_controller-0.0.1/aps/ai/beamline_controller/agent/optimization/soo/bayesian/ax/__init__.py +46 -0
  93. aps_ai_beamline_controller-0.0.1/aps/ai/beamline_controller/agent/optimization/soo/bayesian/ax/hypervolume_manager.py +183 -0
  94. aps_ai_beamline_controller-0.0.1/aps/ai/beamline_controller/agent/optimization/soo/bayesian/ax/optimization_listener.py +59 -0
  95. aps_ai_beamline_controller-0.0.1/aps/ai/beamline_controller/agent/optimization/soo/bayesian/ax/optimizer.py +509 -0
  96. aps_ai_beamline_controller-0.0.1/aps/ai/beamline_controller/agent/optimization/soo/bayesian/facade.py +153 -0
  97. aps_ai_beamline_controller-0.0.1/aps/ai/beamline_controller/agent/optimization/soo/nonlinear/__init__.py +0 -0
  98. aps_ai_beamline_controller-0.0.1/aps/ai/beamline_controller/agent/optimization/soo/nonlinear/abstract_hypervolume_manager.py +213 -0
  99. aps_ai_beamline_controller-0.0.1/aps/ai/beamline_controller/agent/optimization/soo/nonlinear/abstract_optimizer.py +85 -0
  100. aps_ai_beamline_controller-0.0.1/aps/ai/beamline_controller/agent/optimization/soo/nonlinear/facade.py +170 -0
  101. aps_ai_beamline_controller-0.0.1/aps/ai/beamline_controller/agent/optimization/soo/nonlinear/scipy/__init__.py +0 -0
  102. aps_ai_beamline_controller-0.0.1/aps/ai/beamline_controller/agent/optimization/soo/nonlinear/scipy/hypervolume_manager.py +94 -0
  103. aps_ai_beamline_controller-0.0.1/aps/ai/beamline_controller/agent/optimization/soo/nonlinear/scipy/optimization_listener.py +65 -0
  104. aps_ai_beamline_controller-0.0.1/aps/ai/beamline_controller/agent/optimization/soo/nonlinear/scipy/optimizer.py +322 -0
  105. aps_ai_beamline_controller-0.0.1/aps/ai/beamline_controller/common/__init__.py +46 -0
  106. aps_ai_beamline_controller-0.0.1/aps/ai/beamline_controller/common/bluesky_utility.py +88 -0
  107. aps_ai_beamline_controller-0.0.1/aps/ai/beamline_controller/common/legacy_keys.py +60 -0
  108. aps_ai_beamline_controller-0.0.1/aps/ai/beamline_controller/common/utility.py +71 -0
  109. aps_ai_beamline_controller-0.0.1/aps/ai/beamline_controller/execution/__init__.py +46 -0
  110. aps_ai_beamline_controller-0.0.1/aps/ai/beamline_controller/execution/execution_initialization_parameters.py +205 -0
  111. aps_ai_beamline_controller-0.0.1/aps/ai/beamline_controller/execution/execution_manager.py +1378 -0
  112. aps_ai_beamline_controller-0.0.1/aps/ai/beamline_controller/gui/__init__.py +46 -0
  113. aps_ai_beamline_controller-0.0.1/aps/ai/beamline_controller/gui/beamline_controller.py +126 -0
  114. aps_ai_beamline_controller-0.0.1/aps/ai/beamline_controller/gui/beamline_controller_widget.py +1585 -0
  115. aps_ai_beamline_controller-0.0.1/aps/ai/beamline_controller/gui/main_beamline_controller.py +156 -0
  116. aps_ai_beamline_controller-0.0.1/aps/ai/beamline_controller/initialization/__init__.py +46 -0
  117. aps_ai_beamline_controller-0.0.1/aps/ai/beamline_controller/initialization/agent_initializer_factory.py +64 -0
  118. aps_ai_beamline_controller-0.0.1/aps/ai/beamline_controller/initialization/control_systems/__init__.py +0 -0
  119. aps_ai_beamline_controller-0.0.1/aps/ai/beamline_controller/initialization/control_systems/bluesky/__init__.py +0 -0
  120. aps_ai_beamline_controller-0.0.1/aps/ai/beamline_controller/initialization/control_systems/bluesky/agent_initializer.py +75 -0
  121. aps_ai_beamline_controller-0.0.1/aps/ai/beamline_controller/initialization/facade.py +89 -0
  122. aps_ai_beamline_controller-0.0.1/aps/ai/beamline_controller/initialization/initializer_decorators.py +188 -0
  123. aps_ai_beamline_controller-0.0.1/aps_ai_beamline_controller.egg-info/PKG-INFO +50 -0
  124. aps_ai_beamline_controller-0.0.1/aps_ai_beamline_controller.egg-info/SOURCES.txt +128 -0
  125. aps_ai_beamline_controller-0.0.1/aps_ai_beamline_controller.egg-info/dependency_links.txt +1 -0
  126. aps_ai_beamline_controller-0.0.1/aps_ai_beamline_controller.egg-info/not-zip-safe +1 -0
  127. aps_ai_beamline_controller-0.0.1/aps_ai_beamline_controller.egg-info/requires.txt +6 -0
  128. aps_ai_beamline_controller-0.0.1/aps_ai_beamline_controller.egg-info/top_level.txt +1 -0
  129. aps_ai_beamline_controller-0.0.1/setup.cfg +4 -0
  130. aps_ai_beamline_controller-0.0.1/setup.py +131 -0
@@ -0,0 +1,36 @@
1
+ Copyright (c) 2025, UChicago Argonne, LLC
2
+
3
+ All Rights Reserved
4
+
5
+ Software Name: AI-Beamline-Controller
6
+ By: Argonne National Laboratory, Advanced Photon Source
7
+
8
+ Redistribution and use in source and binary forms, with or without
9
+ modification, are permitted provided that the following conditions are met:
10
+
11
+ 1. Redistributions of source code must retain the above copyright notice, this
12
+ list of conditions and the following disclaimer.
13
+
14
+ 2. Redistributions in binary form must reproduce the above copyright notice,
15
+ this list of conditions and the following disclaimer in the documentation
16
+ and/or other materials provided with the distribution.
17
+
18
+ 3. Neither the name of the copyright holder nor the names of its
19
+ contributors may be used to endorse or promote products derived from
20
+ this software without specific prior written permission.
21
+
22
+ ******************************************************************************************************
23
+ DISCLAIMER
24
+
25
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
26
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
27
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
28
+ DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
29
+ FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
30
+ DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
31
+ SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
32
+ CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
33
+ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
34
+ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
35
+ ******************************************************************************************************
36
+
@@ -0,0 +1,4 @@
1
+ include README.md
2
+ include LICENSE
3
+
4
+ recursive-include aps *.py
@@ -0,0 +1,50 @@
1
+ Metadata-Version: 2.4
2
+ Name: aps-ai-beamline-controller
3
+ Version: 0.0.1
4
+ Summary: AI-driven Beamline Controller
5
+ Home-page: https://github.com/APS-XSD-OPT-Group/AI-Beamline-Controller
6
+ Download-URL: https://github.com/APS-XSD-OPT-Group/AI-Beamline-Controller
7
+ Author: Luca Rebuffi
8
+ Author-email: lrebuffi@anl.gov
9
+ Maintainer: XSD-OPT Group @ APS-ANL
10
+ Maintainer-email: lrebuffi@anl.gov
11
+ License: BSD-3
12
+ Keywords: dictionary,glossary,synchrotronsimulation
13
+ Classifier: Development Status :: 4 - Beta
14
+ Classifier: Environment :: X11 Applications :: Qt
15
+ Classifier: Environment :: Console
16
+ Classifier: Environment :: Plugins
17
+ Classifier: Programming Language :: Python
18
+ Classifier: Operating System :: POSIX
19
+ Classifier: Operating System :: Microsoft :: Windows
20
+ Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
21
+ Classifier: Topic :: Scientific/Engineering :: Visualization
22
+ Classifier: Topic :: Software Development :: Libraries :: Python Modules
23
+ Classifier: Intended Audience :: Education
24
+ Classifier: Intended Audience :: Science/Research
25
+ Classifier: Intended Audience :: Developers
26
+ Description-Content-Type: text/markdown
27
+ License-File: LICENSE
28
+ Requires-Dist: aps-common-libraries>=1.0.17
29
+ Requires-Dist: aps-beamline-driver>=0.0.2
30
+ Requires-Dist: scikit-learn
31
+ Requires-Dist: ax-platform==0.3.5
32
+ Requires-Dist: optuna
33
+ Requires-Dist: pandas
34
+ Dynamic: author
35
+ Dynamic: author-email
36
+ Dynamic: classifier
37
+ Dynamic: description
38
+ Dynamic: description-content-type
39
+ Dynamic: download-url
40
+ Dynamic: home-page
41
+ Dynamic: keywords
42
+ Dynamic: license
43
+ Dynamic: license-file
44
+ Dynamic: maintainer
45
+ Dynamic: maintainer-email
46
+ Dynamic: requires-dist
47
+ Dynamic: summary
48
+
49
+ # AI-Beamline-Controller
50
+ Ai-driven autonomous beamline controller
@@ -0,0 +1,2 @@
1
+ # AI-Beamline-Controller
2
+ Ai-driven autonomous beamline controller
@@ -0,0 +1,47 @@
1
+ #!/usr/bin/env python
2
+ # -*- coding: utf-8 -*-
3
+ # ----------------------------------------------------------------------- #
4
+ # Copyright (c) 2025, UChicago Argonne, LLC. All rights reserved. #
5
+ # #
6
+ # Copyright 2025. UChicago Argonne, LLC. This software was produced #
7
+ # under U.S. Government contract DE-AC02-06CH11357 for Argonne National #
8
+ # Laboratory (ANL), which is operated by UChicago Argonne, LLC for the #
9
+ # U.S. Department of Energy. The U.S. Government has rights to use, #
10
+ # reproduce, and distribute this software. NEITHER THE GOVERNMENT NOR #
11
+ # UChicago Argonne, LLC MAKES ANY WARRANTY, EXPRESS OR IMPLIED, OR #
12
+ # ASSUMES ANY LIABILITY FOR THE USE OF THIS SOFTWARE. If software is #
13
+ # modified to produce derivative works, such modified software should #
14
+ # be clearly marked, so as not to confuse it with the version available #
15
+ # from ANL. #
16
+ # #
17
+ # Additionally, redistribution and use in source and binary forms, with #
18
+ # or without modification, are permitted provided that the following #
19
+ # conditions are met: #
20
+ # #
21
+ # * Redistributions of source code must retain the above copyright #
22
+ # notice, this list of conditions and the following disclaimer. #
23
+ # #
24
+ # * Redistributions in binary form must reproduce the above copyright #
25
+ # notice, this list of conditions and the following disclaimer in #
26
+ # the documentation and/or other materials provided with the #
27
+ # distribution. #
28
+ # #
29
+ # * Neither the name of UChicago Argonne, LLC, Argonne National #
30
+ # Laboratory, ANL, the U.S. Government, nor the names of its #
31
+ # contributors may be used to endorse or promote products derived #
32
+ # from this software without specific prior written permission. #
33
+ # #
34
+ # THIS SOFTWARE IS PROVIDED BY UChicago Argonne, LLC AND CONTRIBUTORS #
35
+ # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT #
36
+ # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS #
37
+ # FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL UChicago #
38
+ # Argonne, LLC OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, #
39
+ # INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, #
40
+ # BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; #
41
+ # LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER #
42
+ # CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT #
43
+ # LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN #
44
+ # ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE #
45
+ # POSSIBILITY OF SUCH DAMAGE. #
46
+ # ----------------------------------------------------------------------- #
47
+ __path__ = __import__("pkgutil").extend_path(__path__, __name__)
@@ -0,0 +1,47 @@
1
+ #!/usr/bin/env python
2
+ # -*- coding: utf-8 -*-
3
+ # ----------------------------------------------------------------------- #
4
+ # Copyright (c) 2025, UChicago Argonne, LLC. All rights reserved. #
5
+ # #
6
+ # Copyright 2025. UChicago Argonne, LLC. This software was produced #
7
+ # under U.S. Government contract DE-AC02-06CH11357 for Argonne National #
8
+ # Laboratory (ANL), which is operated by UChicago Argonne, LLC for the #
9
+ # U.S. Department of Energy. The U.S. Government has rights to use, #
10
+ # reproduce, and distribute this software. NEITHER THE GOVERNMENT NOR #
11
+ # UChicago Argonne, LLC MAKES ANY WARRANTY, EXPRESS OR IMPLIED, OR #
12
+ # ASSUMES ANY LIABILITY FOR THE USE OF THIS SOFTWARE. If software is #
13
+ # modified to produce derivative works, such modified software should #
14
+ # be clearly marked, so as not to confuse it with the version available #
15
+ # from ANL. #
16
+ # #
17
+ # Additionally, redistribution and use in source and binary forms, with #
18
+ # or without modification, are permitted provided that the following #
19
+ # conditions are met: #
20
+ # #
21
+ # * Redistributions of source code must retain the above copyright #
22
+ # notice, this list of conditions and the following disclaimer. #
23
+ # #
24
+ # * Redistributions in binary form must reproduce the above copyright #
25
+ # notice, this list of conditions and the following disclaimer in #
26
+ # the documentation and/or other materials provided with the #
27
+ # distribution. #
28
+ # #
29
+ # * Neither the name of UChicago Argonne, LLC, Argonne National #
30
+ # Laboratory, ANL, the U.S. Government, nor the names of its #
31
+ # contributors may be used to endorse or promote products derived #
32
+ # from this software without specific prior written permission. #
33
+ # #
34
+ # THIS SOFTWARE IS PROVIDED BY UChicago Argonne, LLC AND CONTRIBUTORS #
35
+ # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT #
36
+ # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS #
37
+ # FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL UChicago #
38
+ # Argonne, LLC OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, #
39
+ # INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, #
40
+ # BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; #
41
+ # LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER #
42
+ # CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT #
43
+ # LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN #
44
+ # ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE #
45
+ # POSSIBILITY OF SUCH DAMAGE. #
46
+ # ----------------------------------------------------------------------- #
47
+ __path__ = __import__("pkgutil").extend_path(__path__, __name__)
@@ -0,0 +1,47 @@
1
+ #!/usr/bin/env python
2
+ # -*- coding: utf-8 -*-
3
+ # ----------------------------------------------------------------------- #
4
+ # Copyright (c) 2025, UChicago Argonne, LLC. All rights reserved. #
5
+ # #
6
+ # Copyright 2025. UChicago Argonne, LLC. This software was produced #
7
+ # under U.S. Government contract DE-AC02-06CH11357 for Argonne National #
8
+ # Laboratory (ANL), which is operated by UChicago Argonne, LLC for the #
9
+ # U.S. Department of Energy. The U.S. Government has rights to use, #
10
+ # reproduce, and distribute this software. NEITHER THE GOVERNMENT NOR #
11
+ # UChicago Argonne, LLC MAKES ANY WARRANTY, EXPRESS OR IMPLIED, OR #
12
+ # ASSUMES ANY LIABILITY FOR THE USE OF THIS SOFTWARE. If software is #
13
+ # modified to produce derivative works, such modified software should #
14
+ # be clearly marked, so as not to confuse it with the version available #
15
+ # from ANL. #
16
+ # #
17
+ # Additionally, redistribution and use in source and binary forms, with #
18
+ # or without modification, are permitted provided that the following #
19
+ # conditions are met: #
20
+ # #
21
+ # * Redistributions of source code must retain the above copyright #
22
+ # notice, this list of conditions and the following disclaimer. #
23
+ # #
24
+ # * Redistributions in binary form must reproduce the above copyright #
25
+ # notice, this list of conditions and the following disclaimer in #
26
+ # the documentation and/or other materials provided with the #
27
+ # distribution. #
28
+ # #
29
+ # * Neither the name of UChicago Argonne, LLC, Argonne National #
30
+ # Laboratory, ANL, the U.S. Government, nor the names of its #
31
+ # contributors may be used to endorse or promote products derived #
32
+ # from this software without specific prior written permission. #
33
+ # #
34
+ # THIS SOFTWARE IS PROVIDED BY UChicago Argonne, LLC AND CONTRIBUTORS #
35
+ # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT #
36
+ # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS #
37
+ # FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL UChicago #
38
+ # Argonne, LLC OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, #
39
+ # INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, #
40
+ # BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; #
41
+ # LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER #
42
+ # CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT #
43
+ # LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN #
44
+ # ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE #
45
+ # POSSIBILITY OF SUCH DAMAGE. #
46
+ # ----------------------------------------------------------------------- #
47
+ __path__ = __import__("pkgutil").extend_path(__path__, __name__)
@@ -0,0 +1,76 @@
1
+ #!/usr/bin/env python
2
+ # -*- coding: utf-8 -*-
3
+ # ----------------------------------------------------------------------- #
4
+ # Copyright (c) 2025, UChicago Argonne, LLC. All rights reserved. #
5
+ # #
6
+ # Copyright 2025. UChicago Argonne, LLC. This software was produced #
7
+ # under U.S. Government contract DE-AC02-06CH11357 for Argonne National #
8
+ # Laboratory (ANL), which is operated by UChicago Argonne, LLC for the #
9
+ # U.S. Department of Energy. The U.S. Government has rights to use, #
10
+ # reproduce, and distribute this software. NEITHER THE GOVERNMENT NOR #
11
+ # UChicago Argonne, LLC MAKES ANY WARRANTY, EXPRESS OR IMPLIED, OR #
12
+ # ASSUMES ANY LIABILITY FOR THE USE OF THIS SOFTWARE. If software is #
13
+ # modified to produce derivative works, such modified software should #
14
+ # be clearly marked, so as not to confuse it with the version available #
15
+ # from ANL. #
16
+ # #
17
+ # Additionally, redistribution and use in source and binary forms, with #
18
+ # or without modification, are permitted provided that the following #
19
+ # conditions are met: #
20
+ # #
21
+ # * Redistributions of source code must retain the above copyright #
22
+ # notice, this list of conditions and the following disclaimer. #
23
+ # #
24
+ # * Redistributions in binary form must reproduce the above copyright #
25
+ # notice, this list of conditions and the following disclaimer in #
26
+ # the documentation and/or other materials provided with the #
27
+ # distribution. #
28
+ # #
29
+ # * Neither the name of UChicago Argonne, LLC, Argonne National #
30
+ # Laboratory, ANL, the U.S. Government, nor the names of its #
31
+ # contributors may be used to endorse or promote products derived #
32
+ # from this software without specific prior written permission. #
33
+ # #
34
+ # THIS SOFTWARE IS PROVIDED BY UChicago Argonne, LLC AND CONTRIBUTORS #
35
+ # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT #
36
+ # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS #
37
+ # FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL UChicago #
38
+ # Argonne, LLC OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, #
39
+ # INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, #
40
+ # BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; #
41
+ # LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER #
42
+ # CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT #
43
+ # LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN #
44
+ # ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE #
45
+ # POSSIBILITY OF SUCH DAMAGE. #
46
+ # ----------------------------------------------------------------------- #
47
+ # FIX PROBLEM WITH LIBRARIES THAT CALL NAN THE OLD WAY
48
+ import numpy as np
49
+ np.NaN = np.nan
50
+
51
+ import sys
52
+
53
+ from aps.ai.beamline_controller.gui.main_beamline_controller import MainBeamlineController
54
+
55
+ if __name__ == "__main__":
56
+ def show_help(error=False):
57
+ print("")
58
+ if error:
59
+ print("*************************************************************")
60
+ print("******** Command not valid! ********")
61
+ print("*************************************************************\n")
62
+ else:
63
+ print("=============================================================")
64
+ print(" WELCOME TO AI-Driven Optics Controller")
65
+ print("=============================================================\n")
66
+ print("To launch a script: python -m aps.ai.beamline_controller <script id> <options>\n")
67
+ print("To show help of a script: python -m aps.ai.beamline_controller <script id> --h\n")
68
+ print("To show this help: python -m aps.ai.beamline_controller --h\n")
69
+ print("* Available scripts:\n" +
70
+ " 1) Optics Controller, id: " + MainBeamlineController.SCRIPT_ID + "\n")
71
+
72
+ if len(sys.argv) == 1 or sys.argv[1] == "--h":
73
+ show_help()
74
+ else:
75
+ if sys.argv[1] == MainBeamlineController.SCRIPT_ID: MainBeamlineController(sys_argv=sys.argv).run_script()
76
+ else: show_help(error=True)
@@ -0,0 +1,46 @@
1
+ #!/usr/bin/env python
2
+ # -*- coding: utf-8 -*-
3
+ # ----------------------------------------------------------------------- #
4
+ # Copyright (c) 2025, UChicago Argonne, LLC. All rights reserved. #
5
+ # #
6
+ # Copyright 2025. UChicago Argonne, LLC. This software was produced #
7
+ # under U.S. Government contract DE-AC02-06CH11357 for Argonne National #
8
+ # Laboratory (ANL), which is operated by UChicago Argonne, LLC for the #
9
+ # U.S. Department of Energy. The U.S. Government has rights to use, #
10
+ # reproduce, and distribute this software. NEITHER THE GOVERNMENT NOR #
11
+ # UChicago Argonne, LLC MAKES ANY WARRANTY, EXPRESS OR IMPLIED, OR #
12
+ # ASSUMES ANY LIABILITY FOR THE USE OF THIS SOFTWARE. If software is #
13
+ # modified to produce derivative works, such modified software should #
14
+ # be clearly marked, so as not to confuse it with the version available #
15
+ # from ANL. #
16
+ # #
17
+ # Additionally, redistribution and use in source and binary forms, with #
18
+ # or without modification, are permitted provided that the following #
19
+ # conditions are met: #
20
+ # #
21
+ # * Redistributions of source code must retain the above copyright #
22
+ # notice, this list of conditions and the following disclaimer. #
23
+ # #
24
+ # * Redistributions in binary form must reproduce the above copyright #
25
+ # notice, this list of conditions and the following disclaimer in #
26
+ # the documentation and/or other materials provided with the #
27
+ # distribution. #
28
+ # #
29
+ # * Neither the name of UChicago Argonne, LLC, Argonne National #
30
+ # Laboratory, ANL, the U.S. Government, nor the names of its #
31
+ # contributors may be used to endorse or promote products derived #
32
+ # from this software without specific prior written permission. #
33
+ # #
34
+ # THIS SOFTWARE IS PROVIDED BY UChicago Argonne, LLC AND CONTRIBUTORS #
35
+ # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT #
36
+ # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS #
37
+ # FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL UChicago #
38
+ # Argonne, LLC OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, #
39
+ # INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, #
40
+ # BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; #
41
+ # LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER #
42
+ # CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT #
43
+ # LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN #
44
+ # ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE #
45
+ # POSSIBILITY OF SUCH DAMAGE. #
46
+ # ----------------------------------------------------------------------- #
@@ -0,0 +1,63 @@
1
+ #!/usr/bin/env python
2
+ # -*- coding: utf-8 -*-
3
+ # ----------------------------------------------------------------------- #
4
+ # Copyright (c) 2025, UChicago Argonne, LLC. All rights reserved. #
5
+ # #
6
+ # Copyright 2025. UChicago Argonne, LLC. This software was produced #
7
+ # under U.S. Government contract DE-AC02-06CH11357 for Argonne National #
8
+ # Laboratory (ANL), which is operated by UChicago Argonne, LLC for the #
9
+ # U.S. Department of Energy. The U.S. Government has rights to use, #
10
+ # reproduce, and distribute this software. NEITHER THE GOVERNMENT NOR #
11
+ # UChicago Argonne, LLC MAKES ANY WARRANTY, EXPRESS OR IMPLIED, OR #
12
+ # ASSUMES ANY LIABILITY FOR THE USE OF THIS SOFTWARE. If software is #
13
+ # modified to produce derivative works, such modified software should #
14
+ # be clearly marked, so as not to confuse it with the version available #
15
+ # from ANL. #
16
+ # #
17
+ # Additionally, redistribution and use in source and binary forms, with #
18
+ # or without modification, are permitted provided that the following #
19
+ # conditions are met: #
20
+ # #
21
+ # * Redistributions of source code must retain the above copyright #
22
+ # notice, this list of conditions and the following disclaimer. #
23
+ # #
24
+ # * Redistributions in binary form must reproduce the above copyright #
25
+ # notice, this list of conditions and the following disclaimer in #
26
+ # the documentation and/or other materials provided with the #
27
+ # distribution. #
28
+ # #
29
+ # * Neither the name of UChicago Argonne, LLC, Argonne National #
30
+ # Laboratory, ANL, the U.S. Government, nor the names of its #
31
+ # contributors may be used to endorse or promote products derived #
32
+ # from this software without specific prior written permission. #
33
+ # #
34
+ # THIS SOFTWARE IS PROVIDED BY UChicago Argonne, LLC AND CONTRIBUTORS #
35
+ # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT #
36
+ # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS #
37
+ # FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL UChicago #
38
+ # Argonne, LLC OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, #
39
+ # INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, #
40
+ # BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; #
41
+ # LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER #
42
+ # CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT #
43
+ # LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN #
44
+ # ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE #
45
+ # POSSIBILITY OF SUCH DAMAGE. #
46
+ # ----------------------------------------------------------------------- #
47
+ from aps.ai.beamline_controller.agent.facade import IAgentListener
48
+
49
+ from aps.common.chain_of_responsibility import DynamicChainOfResponsibility
50
+ from aps.common.singleton import Singleton
51
+
52
+ def create_agent_listener(listener_id : str, **kwargs) -> IAgentListener:
53
+ return __AgentListenerChainOfResponsibility.Instance().get_instance_from_chain(listener_id, **kwargs)
54
+
55
+ def initialize_agent_listener_factory(classes : dict = {}, instances:dict = {}):
56
+ chain_of_responsibility = __AgentListenerChainOfResponsibility.Instance()
57
+ chain_of_responsibility.initialize(classes, instances)
58
+
59
+ @Singleton
60
+ class __AgentListenerChainOfResponsibility(DynamicChainOfResponsibility):
61
+ def _get_chain_interface(self) -> type: return IAgentListener
62
+
63
+
@@ -0,0 +1,66 @@
1
+ #!/usr/bin/env python
2
+ # -*- coding: utf-8 -*-
3
+ # ----------------------------------------------------------------------- #
4
+ # Copyright (c) 2025, UChicago Argonne, LLC. All rights reserved. #
5
+ # #
6
+ # Copyright 2025. UChicago Argonne, LLC. This software was produced #
7
+ # under U.S. Government contract DE-AC02-06CH11357 for Argonne National #
8
+ # Laboratory (ANL), which is operated by UChicago Argonne, LLC for the #
9
+ # U.S. Department of Energy. The U.S. Government has rights to use, #
10
+ # reproduce, and distribute this software. NEITHER THE GOVERNMENT NOR #
11
+ # UChicago Argonne, LLC MAKES ANY WARRANTY, EXPRESS OR IMPLIED, OR #
12
+ # ASSUMES ANY LIABILITY FOR THE USE OF THIS SOFTWARE. If software is #
13
+ # modified to produce derivative works, such modified software should #
14
+ # be clearly marked, so as not to confuse it with the version available #
15
+ # from ANL. #
16
+ # #
17
+ # Additionally, redistribution and use in source and binary forms, with #
18
+ # or without modification, are permitted provided that the following #
19
+ # conditions are met: #
20
+ # #
21
+ # * Redistributions of source code must retain the above copyright #
22
+ # notice, this list of conditions and the following disclaimer. #
23
+ # #
24
+ # * Redistributions in binary form must reproduce the above copyright #
25
+ # notice, this list of conditions and the following disclaimer in #
26
+ # the documentation and/or other materials provided with the #
27
+ # distribution. #
28
+ # #
29
+ # * Neither the name of UChicago Argonne, LLC, Argonne National #
30
+ # Laboratory, ANL, the U.S. Government, nor the names of its #
31
+ # contributors may be used to endorse or promote products derived #
32
+ # from this software without specific prior written permission. #
33
+ # #
34
+ # THIS SOFTWARE IS PROVIDED BY UChicago Argonne, LLC AND CONTRIBUTORS #
35
+ # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT #
36
+ # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS #
37
+ # FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL UChicago #
38
+ # Argonne, LLC OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, #
39
+ # INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, #
40
+ # BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; #
41
+ # LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER #
42
+ # CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT #
43
+ # LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN #
44
+ # ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE #
45
+ # POSSIBILITY OF SUCH DAMAGE. #
46
+ # ----------------------------------------------------------------------- #
47
+ from abc import abstractmethod
48
+ from enum import Enum
49
+
50
+ ERROR_LOSS: float = 1e4
51
+
52
+ class Fidelity:
53
+ LOW = 0
54
+ HIGH = 1
55
+
56
+ class Format(Enum):
57
+ PICKLE = 0
58
+ CSV = 1
59
+ JSON = 3
60
+
61
+ class IAgentListener():
62
+ @abstractmethod
63
+ def feedback(self, *args, **kwargs) : raise NotImplementedError
64
+
65
+
66
+
@@ -0,0 +1,58 @@
1
+ #!/usr/bin/env python
2
+ # -*- coding: utf-8 -*-
3
+ # ----------------------------------------------------------------------- #
4
+ # Copyright (c) 2025, UChicago Argonne, LLC. All rights reserved. #
5
+ # #
6
+ # Copyright 2025. UChicago Argonne, LLC. This software was produced #
7
+ # under U.S. Government contract DE-AC02-06CH11357 for Argonne National #
8
+ # Laboratory (ANL), which is operated by UChicago Argonne, LLC for the #
9
+ # U.S. Department of Energy. The U.S. Government has rights to use, #
10
+ # reproduce, and distribute this software. NEITHER THE GOVERNMENT NOR #
11
+ # UChicago Argonne, LLC MAKES ANY WARRANTY, EXPRESS OR IMPLIED, OR #
12
+ # ASSUMES ANY LIABILITY FOR THE USE OF THIS SOFTWARE. If software is #
13
+ # modified to produce derivative works, such modified software should #
14
+ # be clearly marked, so as not to confuse it with the version available #
15
+ # from ANL. #
16
+ # #
17
+ # Additionally, redistribution and use in source and binary forms, with #
18
+ # or without modification, are permitted provided that the following #
19
+ # conditions are met: #
20
+ # #
21
+ # * Redistributions of source code must retain the above copyright #
22
+ # notice, this list of conditions and the following disclaimer. #
23
+ # #
24
+ # * Redistributions in binary form must reproduce the above copyright #
25
+ # notice, this list of conditions and the following disclaimer in #
26
+ # the documentation and/or other materials provided with the #
27
+ # distribution. #
28
+ # #
29
+ # * Neither the name of UChicago Argonne, LLC, Argonne National #
30
+ # Laboratory, ANL, the U.S. Government, nor the names of its #
31
+ # contributors may be used to endorse or promote products derived #
32
+ # from this software without specific prior written permission. #
33
+ # #
34
+ # THIS SOFTWARE IS PROVIDED BY UChicago Argonne, LLC AND CONTRIBUTORS #
35
+ # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT #
36
+ # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS #
37
+ # FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL UChicago #
38
+ # Argonne, LLC OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, #
39
+ # INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, #
40
+ # BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; #
41
+ # LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER #
42
+ # CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT #
43
+ # LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN #
44
+ # ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE #
45
+ # POSSIBILITY OF SUCH DAMAGE. #
46
+ # ----------------------------------------------------------------------- #
47
+ import torch
48
+
49
+ GPU_DEVICE = None
50
+
51
+ if torch.cuda.is_available():
52
+ for i in range(torch.cuda.device_count()):
53
+ print(f"Device {i}: {torch.cuda.get_device_name(i)}")
54
+ print(f" Memory Allocated: {torch.cuda.memory_allocated(i) / 1e9} GB")
55
+ print(f" Memory Cached: {torch.cuda.memory_reserved(i) / 1e9} GB")
56
+ GPU_DEVICE = torch.device('cuda')
57
+ else:
58
+ print(f"NO GPU Device detected")
@@ -0,0 +1,46 @@
1
+ #!/usr/bin/env python
2
+ # -*- coding: utf-8 -*-
3
+ # ----------------------------------------------------------------------- #
4
+ # Copyright (c) 2025, UChicago Argonne, LLC. All rights reserved. #
5
+ # #
6
+ # Copyright 2025. UChicago Argonne, LLC. This software was produced #
7
+ # under U.S. Government contract DE-AC02-06CH11357 for Argonne National #
8
+ # Laboratory (ANL), which is operated by UChicago Argonne, LLC for the #
9
+ # U.S. Department of Energy. The U.S. Government has rights to use, #
10
+ # reproduce, and distribute this software. NEITHER THE GOVERNMENT NOR #
11
+ # UChicago Argonne, LLC MAKES ANY WARRANTY, EXPRESS OR IMPLIED, OR #
12
+ # ASSUMES ANY LIABILITY FOR THE USE OF THIS SOFTWARE. If software is #
13
+ # modified to produce derivative works, such modified software should #
14
+ # be clearly marked, so as not to confuse it with the version available #
15
+ # from ANL. #
16
+ # #
17
+ # Additionally, redistribution and use in source and binary forms, with #
18
+ # or without modification, are permitted provided that the following #
19
+ # conditions are met: #
20
+ # #
21
+ # * Redistributions of source code must retain the above copyright #
22
+ # notice, this list of conditions and the following disclaimer. #
23
+ # #
24
+ # * Redistributions in binary form must reproduce the above copyright #
25
+ # notice, this list of conditions and the following disclaimer in #
26
+ # the documentation and/or other materials provided with the #
27
+ # distribution. #
28
+ # #
29
+ # * Neither the name of UChicago Argonne, LLC, Argonne National #
30
+ # Laboratory, ANL, the U.S. Government, nor the names of its #
31
+ # contributors may be used to endorse or promote products derived #
32
+ # from this software without specific prior written permission. #
33
+ # #
34
+ # THIS SOFTWARE IS PROVIDED BY UChicago Argonne, LLC AND CONTRIBUTORS #
35
+ # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT #
36
+ # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS #
37
+ # FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL UChicago #
38
+ # Argonne, LLC OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, #
39
+ # INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, #
40
+ # BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; #
41
+ # LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER #
42
+ # CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT #
43
+ # LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN #
44
+ # ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE #
45
+ # POSSIBILITY OF SUCH DAMAGE. #
46
+ # ----------------------------------------------------------------------- #