From c1f998419e65547ba89922e7ae09b8c039504e99 Mon Sep 17 00:00:00 2001 From: Dmitri Gavrilov Date: Mon, 11 Sep 2023 22:18:56 -0400 Subject: [PATCH] ENH: fix deprecated features and document local testing --- requirements-dev.txt | 2 ++ srx_gui/tests/config/readme.rst | 32 +++++++++++++++++++ srx_gui/tests/startup/00-config.py | 7 ++-- .../tests/startup/user_group_permissions.yaml | 2 +- 4 files changed, 38 insertions(+), 5 deletions(-) create mode 100644 srx_gui/tests/config/readme.rst diff --git a/requirements-dev.txt b/requirements-dev.txt index 55894e2..7f5fe48 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -15,3 +15,5 @@ matplotlib numpydoc sphinx-copybutton sphinx_rtd_theme +# These dependencies are necessary for test the GUI with simulated profile collection +nslsii \ No newline at end of file diff --git a/srx_gui/tests/config/readme.rst b/srx_gui/tests/config/readme.rst new file mode 100644 index 0000000..a9d5d86 --- /dev/null +++ b/srx_gui/tests/config/readme.rst @@ -0,0 +1,32 @@ +How to Manually Test the GUI with Simulated Profile Collection +============================================================== + +1. Install the package in develop mode:: + + $ pip install -e . + $ pip install -r requirements-dev.txt + +2. Start Kafka Docker container (in a separate terminal):: + + $ cd /srx_gui/tests/config + $ sudo docker-compose -f bitnami-kafka-docker-compose.yml u + +3. Start the Queue Server using simulated profile collection, which is part of the repository:: + + $ start-re-manager --startup-dir=/srx_gui/tests/startup --keep-re --zmq-publish-console=ON + + or stand-alone simulated profile collection (copy files from ``/srx_gui/tests/startup`` + to ``~/.ipython/profile_srx_sim/startup``):: + + $ start-re-manager --startup-profile=srx_sim --keep-re --zmq-publish-console=ON + + or using IPython kernel:: + + $ start-re-manager --startup-profile=srx_sim --keep-re --use-ipython-kernel=ON --zmq-publish-console=ON + +4. Start SRX GUI:: + + $ srx-gui --kafka-config-path=/srx_gui/tests/config/kafka.yml --kafka-topics=srx.bluesky.runengine.documents + +5. Test the GUI using the plan ``nano_scan_and_fly`` with the parameters such as ``[0, 1, 15, 0, 2, 5, 0.1]``. + Adding `kwarg` ``{"snaking": True}`` emulates scan with snaking. diff --git a/srx_gui/tests/startup/00-config.py b/srx_gui/tests/startup/00-config.py index a296127..427876b 100644 --- a/srx_gui/tests/startup/00-config.py +++ b/srx_gui/tests/startup/00-config.py @@ -15,10 +15,9 @@ RE = RunEngine() -from databroker import Broker - -db = Broker.named("srx") -RE.subscribe(db.insert) +# from databroker import Broker +# db = Broker.named("srx") +# RE.subscribe(db.insert) from bluesky import SupplementalData diff --git a/srx_gui/tests/startup/user_group_permissions.yaml b/srx_gui/tests/startup/user_group_permissions.yaml index 1ba0105..5db3e47 100644 --- a/srx_gui/tests/startup/user_group_permissions.yaml +++ b/srx_gui/tests/startup/user_group_permissions.yaml @@ -12,7 +12,7 @@ user_groups: - null # Allow all forbidden_functions: - ":^_" # All functions with names starting with '_' - admin: # The group includes beamline staff, includes all or most of the plans and devices + primary: # The group includes beamline staff, includes all or most of the plans and devices allowed_plans: - ":.*" # Different way to allow all plans. forbidden_plans: