Decorator to shorten signature
This issue was reported by @papillon
After introducing typeguard
in bliss.common.scans
the signatures of scans became very complicated and basically unusable by the ptpython inline signature. E.g. for an a2scan
a terminal spanning over 2 screens:
BLISS [1]: a2scan(
a2scan(param motor1: <class 'bliss.common.protocols.Scannable'>, param start1: <class 'float'>, param stop1: <class 'float'>, param motor2: <class 'bliss.common.protocols.Scannable'>, param start2: <class 'float'>, param stop2: <class 'float'>, param intervals: <class 'int'>, param count_time: <class 'float'>, param *counter_args: typing.Union[bliss.common.counter.Count...
I suggest to short it as far as this:
BLISS [1]: a2scan(motor1, start1, stop1, motor2, start2, stop2, intervals, count_time, *counter_args, name=None, title=None, save=True, save_images=None, sleep_time=None, run=True, return_scan=True, scan_info=None)
To be discussed:
- should all kwargs be displayed or should there be a possiblitiy to hide some in order to simplify the signature?
- should there be a possibility to give hints e.g.
save_images=True|False
instead ofsave_images=None
?
Edited by Linus Pithan