Пример #1
0
 def get_values(self, params):
     vals = []
     for p in util.listify(params):
         if not p in self.lmap:
             raise NotAParameterError("%r does not belong to %r" %
                                      (p, self))
         vals.append(self.lmap[p][0].get_values(p))
     return util.delistify(vals, params)
Пример #2
0
    def get_values(self, params):
        """
        Get the value of a list or single parameter.

        Parameters
        ----------
        params : string, list of string
            name of parameters which to retrieve
        """
        return util.delistify(
            [self.param_dict[p] for p in util.listify(params)], params)
Пример #3
0
 def get_values(self, params):
     values = []
     for p in listify(params):
         typ, ind = self._p2i(p)
         if typ == 'zscale':
             values.append(self.zscale)
         elif typ == 'x':
             values.append(self.pos[ind][2])
         elif typ == 'y':
             values.append(self.pos[ind][1])
         elif typ == 'z':
             values.append(self.pos[ind][0])
         elif typ == 'a':
             values.append(self.rad[ind])
     return delistify(values, params)
Пример #4
0
 def __getitem__(self, d=None):
     if d is None:
         d = self.obj.params
     return util.delistify(self.obj.get_values(d), d)