shell: Axis __info__ can fail if axis is DISABLED
Feedback from @cyril.guilloud
CYRIL [2]: mm1
Traceback (most recent call last):
File "/opt/bliss/conda/miniconda/envs/bliss/lib/python3.9/site-packages/ptpython/repl.py", line 333, in _format_result_output
result_repr = repr(result)
File "/home/guilloud/PROJECTS/bliss/bliss/shell/cli/repl.py", line 416, in __repr__
return info(arg)
File "/home/guilloud/PROJECTS/bliss/bliss/common/standard.py", line 411, in info
info_str = obj.__info__()
File "/home/guilloud/PROJECTS/bliss/bliss/common/axis.py", line 798, in func_wrapper
raise RuntimeError(f"Axis {self.name} is disabled")
RuntimeError: Axis mm1 is disabled
controller:
axes:
- acceleration: 10
backlash: 0.1
high_limit: 100
low_limit: -100
name: mm1
sign: 1
steps_per_unit: 100000
tolerance: 0.1
unit: parsec
velocity: 9
closed_loop: # <- this is causing the problem
state: manual
kp: 1
ki: 2
kd: 3
There is 2 problems here
- At the second call of the lazy init the exception became pointless, there is no more way to understand the problem
-
__info__
should always display something, but here it is wrapped withlazy_init
Edited by Valentin Valls