Skip to content

Commit

Permalink
ENH: fix deprecated features and document local testing
Browse files Browse the repository at this point in the history
  • Loading branch information
dmgav committed Sep 12, 2023
1 parent 7c7facc commit c1f9984
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 5 deletions.
2 changes: 2 additions & 0 deletions requirements-dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,5 @@ matplotlib
numpydoc
sphinx-copybutton
sphinx_rtd_theme
# These dependencies are necessary for test the GUI with simulated profile collection
nslsii
32 changes: 32 additions & 0 deletions srx_gui/tests/config/readme.rst
Original file line number Diff line number Diff line change
@@ -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 <root>/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=<root>/srx_gui/tests/startup --keep-re --zmq-publish-console=ON

or stand-alone simulated profile collection (copy files from ``<root>/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=<root>/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.
7 changes: 3 additions & 4 deletions srx_gui/tests/startup/00-config.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion srx_gui/tests/startup/user_group_permissions.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit c1f9984

Please sign in to comment.