Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bm list fails when no bookmarks are saved #3

Open
reszelaz opened this issue Apr 28, 2021 · 1 comment
Open

bm list fails when no bookmarks are saved #3

reszelaz opened this issue Apr 28, 2021 · 1 comment

Comments

@reszelaz
Copy link

Hi,

First, many thanks for developing and sharing this macro. I will announce it at ALBA.
I just checked it and found a minor issue when listening no bookmarks:

Door/zreszela/1 [13]: bm list
No bookmarks defined in environment. Creating empty.
An error occurred while running bm:
ValueError: max() arg is an empty sequence                                                                                                                                                                                                                                     
Hint: in Spock execute `www`to get more details

Door/zreszela/1 [14]: www
Traceback (most recent call last):
  File "/homelocal/zreszela/workspace/sardana/src/sardana/macroserver/msmacromanager.py", line 1659, in runMacro
    for step in macro_obj.exec_():
  File "/homelocal/zreszela/workspace/sardana/src/sardana/macroserver/macro.py", line 2356, in exec_
    res = self.run(*self._in_pars)
  File "/homelocal/zreszela/workspace/sardana-bookmarks/bookmarks.py", line 69, in run
    self.cmd_list(filter=filter, show_current=False)
  File "/homelocal/zreszela/workspace/sardana-bookmarks/bookmarks.py", line 157, in cmd_list
    ncols = max([len(ml) for ml in bm_filter.values()])
ValueError: max() arg is an empty sequence

Door/zreszela/1 [15]: bm save test mot01 mot02

Door/zreszela/1 [16]: bm list
   name   Motor   target   Motor   target
 ------ ------- -------- ------- --------
   test   mot01      0.0   mot02      0.0

move command is umv
@dscran
Copy link
Collaborator

dscran commented May 1, 2021

Hi @reszelaz,

many thanks for testing and sorry for the slow reply - I apparently had my notifications misconfigured.

I just opened another issue #4, to discuss whether separate macros instead of a single main macro + subcommands is a better way to go (branch "separate_macros"). We recently used this branch in a few beamtimes, so it is more up-to-date. I'd appreciate your thoughts on this - and the empty listing is already fixed there.

Many thanks and cheers,

Michael

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants