Skip to content

Commit

Permalink
removing _plan_stubs_to_alias as it is now redundant
Browse files Browse the repository at this point in the history
  • Loading branch information
awalter-bnl committed Jul 25, 2024
1 parent 8d5dee3 commit e6c7edb
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 10 deletions.
Binary file modified src/ari_sxn_common/__pycache__/common_bluesky.cpython-312.pyc
Binary file not shown.
5 changes: 0 additions & 5 deletions src/ari_sxn_common/bluesky_test_setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,6 @@

EpicsSignalBase.set_defaults(timeout=10, connection_timeout=10)

# create the plan_stub objects
for aliases, plan_stub in common_bluesky._plan_stubs_to_alias.items():
for alias in aliases:
globals()[alias] = plan_stub
# create the plan objects
for aliases, plan in common_bluesky._plans_to_alias.items():
for alias in aliases:
Expand All @@ -40,7 +36,6 @@
labels=('device',))
M1 = m1 # Create a reference object so that m1 or M1 are equivalent.

common_bluesky._plans_to_alias.update(common_bluesky._plan_stubs_to_alias)
plans = common_bluesky.PlanCollector(
plans_for_methods=common_bluesky._plans_to_alias,
name='plans')
8 changes: 3 additions & 5 deletions src/ari_sxn_common/common_bluesky.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,11 @@
from bluesky import plan_stubs
from types import SimpleNamespace

# Note that the dict has the structure {[alias1, alias2, ...]:plan_stub, ...}
_plan_stubs_to_alias = {('move', 'mv'): plan_stubs.mv,
('relative_move', 'mvr'): plan_stubs.mvr}

# Note that the dict has the structure {[alias1, alias2, ...]:'plan', ...}
# noinspection PyRedundantParentheses
_plans_to_alias = {('count',): plans.count,
_plans_to_alias = {('move', 'mv'): plan_stubs.mv,
('relative_move', 'mvr'): plan_stubs.mvr,
('count',): plans.count,
('scan',): plans.scan,
('relative_scan', 'rel_scan'): plans.rel_scan,
('grid_scan',): plans.grid_scan,
Expand Down

0 comments on commit e6c7edb

Please sign in to comment.