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

Multi valued parameters #207

Closed
MerlinSmiles opened this issue May 31, 2016 · 4 comments
Closed

Multi valued parameters #207

MerlinSmiles opened this issue May 31, 2016 · 4 comments
Assignees
Labels

Comments

@MerlinSmiles
Copy link
Contributor

I've been running into issues with multi valued parameters.

i.e. in the magnet driver, I want a fld parameter that returns and sets x, y, z values, reading the values works just fine with the Anything validator, but setting failes.

For reference, something like this:

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=Numbers())

There are at least two issues here:

  1. in the parameter.py file, lines 146+:
        if names is not None:
...
        elif name is not None:
...
        else:
            raise ValueError('either name or names is required')

The multi valued parameters no longer have a name, and a _vals attribute anymore.

If I do

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

It kindof works, but at least the docstring and units is broken (and I have to use the Anything validator)
2. The validators only work on single-valued inputs, not on multi-values.

@Rubenknex
Copy link
Contributor

I also encountered a command in which I need to pass two arguments. It would be nice if this was included in the functionality of the Parameter class.

@AdriaanRol AdriaanRol added this to the V0.1 milestone Jul 15, 2016
@giulioungaretti
Copy link
Contributor

@MerlinSmiles let's look at this when you are back here, it seems like that can be fixed creating a custom parameter instead of the standardparameter that add_parameter uses by default.

@jenshnielsen
Copy link
Collaborator

related to #378, #166 and #498

@jenshnielsen
Copy link
Collaborator

I believe this was solved along with #166

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

No branches or pull requests

6 participants