ISISComputingGroup/IBEX

genie: waitfor with missing arg give unclear to user error

Open

#8850 aperta il 19 set 2025

Vedi su GitHub
 (13 commenti) (0 reazioni) (1 assegnatario) (2 fork)auto 404
1Good First Issuereviewunder review

Metriche repository

Star
 (6 star)
Metriche merge PR
 (Metriche PR in attesa)

Descrizione

On iris they entered g.waitfor(1) rather than g.waitfor(uamps=1) and had the error

Traceback (most recent call last):
  File "C:\Instrument\Apps\Python3\Lib\site-packages\genie_python\genie_api_setup.py", line 380, in decorator
    return_value = f(*args, **kwargs)
                   ^^^^^^^^^^^^^^^^^^
  File "C:\Instrument\Apps\Python3\Lib\site-packages\genie_python\genie.py", line 487, in waitfor
    _genie_api.waitfor.start_waiting(
  File "C:\Instrument\Apps\Python3\Lib\site-packages\genie_python\genie_waitfor.py", line 359, in start_waiting
    if not self.api.block_exists(block):
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Instrument\Apps\Python3\Lib\site-packages\genie_python\genie_epics_api.py", line 524, in block_exists
    return self.pv_exists(self.get_pv_from_block(name), fail_fast)
                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Instrument\Apps\Python3\Lib\site-packages\genie_python\genie_epics_api.py", line 807, in get_pv_from_block
    return self.inst_prefix + self.block_prefix + block_name.upper()
                                                  ^^^^^^^^^^^^^^^^
AttributeError: 'int' object has no attribute 'upper'

maybe we can make this a bit clearer - it looks like first arg would be a block name, so give better error if not a string type

Acceptance cirteria

  • command like g.waitfor(1) give a better error message e.g. 1 is not a valid block name

Discussed 01:46:11 - in planning 02/10/25

Guida contributor