labscript-suite-temp-2 / lyse

lyse is an analysis framework. It coordinates the running of python analysis scripts on experiment data as it becomes availiable, updating plots in real time.
BSD 2-Clause "Simplified" License
0 stars 0 forks source link

Run.get_image has arguments with names that differ from labscript args #53

Open philipstarkey opened 5 years ago

philipstarkey commented 5 years ago

Original report (archived issue) by Chris Billington (Bitbucket: cbillington, GitHub: chrisjbillington).


Lyse's Run.get_image accepts 'label' and 'image' kwargs to specify the two possible levels of the hierarchy we use to store images. However, Camera.expose, IMAXdxCamera.expose etc call these 'name' and 'frametype'.

The lyse args should be changed to match the labscript ones with backward compatibility, something like:

def get_image(self, orientation, name=None, frametype=None, **kwargs):
    name = kwargs.pop('image', name)
    frametype = kwargs.pop('label', frametype)
    if kwargs:
        # raise an error saying remaining kwargs not allowed
    if name is None or frametype is None:
        # raise an error about this too, they are non-optional.
        # Better yet, make 'frametype' optional with the default value
        # matching that of the expose() method: frametype='frame'.
        # name can't be optional though.
    # rest of function here with renamed variables
philipstarkey commented 5 years ago

Original comment by Chris Billington (Bitbucket: cbillington, GitHub: chrisjbillington).