Commit daec003e authored by Linus Pithan's avatar Linus Pithan
Browse files

some more type checking in shell standard

parent 5ad70f00
......@@ -42,7 +42,8 @@ from bliss.common.protocols import CounterContainer
from bliss.common import measurementgroup
from bliss.common.soft_axis import SoftAxis
from bliss.common.counter import SoftCounter, Counter
from bliss.common.utils import ShellStr
from bliss.common.utils import ShellStr, typecheck_var_args_pattern, modify_annotations
from bliss.common.measurementgroup import MeasurementGroup
# objects given to Bliss shell user
from bliss.common.standard import mv, mvr, move
......@@ -61,6 +62,14 @@ from import user_dialog, pt_widgets
from tabulate import tabulate
from bliss.common.types import (
__all__ = (
......@@ -300,7 +309,8 @@ def wid():
def stm(*axes, read_hw=False):
# @typeguard.typechecked # type checking acually acceses all members ... does not work for 'bad' motor
def stm(*axes: _scannable_or_name, read_hw: bool = False):
Displays state information of the given axes
......@@ -325,7 +335,8 @@ def stm(*axes, read_hw=False):
_print_errors_with_traceback(errors, device_type="motor")
def sta(read_hw=False):
def sta(read_hw: bool = False):
Return state information about all axes
......@@ -378,7 +389,8 @@ def wa(**kwargs):
def wm(*axes, **kwargs):
def wm(*axes: _scannable_or_name, **kwargs):
Display information (position - user and dial, limits) of the given axes
......@@ -497,6 +509,8 @@ def wm(*axes, **kwargs):
print(_tabulate(table).replace("~", " "))
@modify_annotations({"args": "motor1, pos1, motor2, pos2, ..."})
@typecheck_var_args_pattern([_scannable, _float])
def umv(*args):
Moves given axes to given absolute positions providing updated display of
......@@ -507,6 +521,8 @@ def umv(*args):
@modify_annotations({"args": "motor1, rel. pos1, motor2, rel. pos2, ..."})
@typecheck_var_args_pattern([_scannable, _float])
def umvr(*args):
Moves given axes to given relative positions providing updated display of
......@@ -595,7 +611,8 @@ def prdef(obj_or_name):
def plotselect(*counters):
def plotselect(*counters: _countable):
Selects counters to plot and used by alignment functions (cen, peak, etc).
User-level function built on top of bliss.common.scans.plotselect()
......@@ -738,7 +755,8 @@ def clear():
def edit_mg(mg=None):
def edit_mg(mg: MeasurementGroup):
Edit the measurement group with a simple dialog.
mg -- a measurement group if left to None == default
......@@ -796,19 +814,22 @@ def edit_mg(mg=None):
# from bliss/scanning/
def newproposal(proposal_name=None):
def newproposal(proposal_name: Optional[str] = None):
"""Change the proposal name used to determine the saving path.
def newsample(sample_name=None):
def newsample(sample_name: Optional[str] = None):
"""Change the sample name used to determine the saving path.
def newdataset(dataset_name=None):
def newdataset(dataset_name: Optional[str] = None):
"""Change the dataset name used to determine the saving path.
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment