Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

missing _vals and name #166

Closed
MerlinSmiles opened this issue May 11, 2016 · 3 comments
Closed

missing _vals and name #166

MerlinSmiles opened this issue May 11, 2016 · 3 comments
Assignees

Comments

@MerlinSmiles
Copy link
Contributor

@alexcjohnson and others,

I have a parameter:

        self.add_parameter('fld',
                           names=['B'+ax.lower() for ax in self.axes],
                           get_cmd=partial(self._get_fld, self.axes, 'FLD'),
                           set_cmd=partial(self._ramp_to_setpoint, self.axes, 'FSET'),
                           units=['T'for ax in self.axes],
                           vals=Anything())

When I want to use this parameter:

magnet.fld.set([0.8,0.1,0.0])

this fails.
At first qc complains that the parameter has no attribute name this is because I have supplied n names for n axes. If I add self.name in parameter.py that error goes away.
Then qc complains that the parameter has no attribute _vals which is also missing due to the names.
If I add that too, I can do what I planned.

in parameter.py I see:

        if names is not None:
            # check for names first - that way you can provide both name
            # AND names for instrument parameters - name is how you get the
            # object (from the parameters dict or the delegated attributes),
            # and names are the items it returns

...
        elif name is not None:

That comment seems to contradict what is actually happening, should this just be if and if instead?

Btw, what is the correct validator for a list of numbers?

@MerlinSmiles
Copy link
Contributor Author

if the structure should be like

        if names is not None:

        if name is not None:

        if (name is None) and (names is None):

there would be conflicts with units which might be a typo? I guess it should be unit in the name section..?

@jenshnielsen
Copy link
Collaborator

@MerlinSmiles I think this can close now? The current issue with Array/Multiparameters is that they are not settable #207 and the confusing setpoints #498

@MerlinSmiles
Copy link
Contributor Author

@jenshnielsen I guess yes, there have been a lot of changes that resolve this, I think

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants