def checker(self, x): if type(x) is not types.ListType: parameter.raiseTypeError(type(x), "list of Points") for y in x: if not isinstance(y, Point): parameter.raiseTypeError("list of %s" % type(y), "list of Points")
def checker(self, x): if type(x) is not types.ListType: parameter.raiseTypeError(type(x), "list of Points") for y in x: if not isinstance(y, primitives.Point): parameter.raiseTypeError("list of %s" % type(y), "list of Points")
def checker(self, x): if not isinstance(x, (ListType, TupleType)): parameter.raiseTypeError(type(x), "list of index pairs") for s in x: if not (isinstance(s, StringType) and len(s) == 2 and s[0] in "123" and s[1] in "123456"): parameter.raiseTypeError("list of %s" % typename(type(s)), "list of index pairs [1-3][1-6]")
def checker(self, x): # A single ProfileXT or a FluxProfileSet is allowed if isinstance(x, ProfileXT) or isinstance(x, FluxProfileSet): return # A list or tuple of Profiles is allowed if type(x) in (types.ListType, types.TupleType): for y in x: if not isinstance(y, ProfileXT): parameter.raiseTypeError('List or tuple of '+ type(y), 'List of Profiles') parameter.raiseTypeError(type(x), 'List of Profiles, or FluxProfileSet')
def checker(self, x): # A single ProfileXT or a FluxProfileSet is allowed if isinstance(x, ProfileXT) or isinstance(x, FluxProfileSet): return # A list or tuple of Profiles is allowed if type(x) in (types.ListType, types.TupleType): for y in x: if not isinstance(y, ProfileXT): parameter.raiseTypeError('List or tuple of ' + type(y), 'List of Profiles') parameter.raiseTypeError(type(x), 'List of Profiles, or FluxProfileSet')
def set(self, value): if value is None: self._set(value) else: if type(value) is not types.ListType: parameter.raiseTypeError( 'list of objects from' + `self.classnames()`, value) convertedval = [] for e in value: if type(e) is types.StringType: # string representation of enum for ec in self.enumclasses: if e in ec.names: convertedval.append(ec(e)) break else: parameter.raiseTypeError( 'list of objects from' + `self.classnames()`, value) else: # not a string for ec in self.enumclasses: if isinstance(e, ec): convertedval.append(e) break else: parameter.raiseTypeError( 'list of objects from' + `self.classnames()`, value) self._set(convertedval)
def checker(self, x): if not isinstance(x, Output): parameter.raiseTypeError(type(x), 'Output')
def checker(self, x): if not isinstance(x, flux.FluxPtr): parameter.raiseTypeError(x, "Flux")
def checker(self, x): if not isinstance(x, field.FieldPtr): parameter.raiseTypeError(x, "Field")
def checker(self, x): if not isinstance( x, equation.EquationPtr) or not x.allow_boundary_conditions(): parameter.raiseTypeError(x, "Equation with BC capability")
def checker(self, x): if not isinstance(x, equation.EquationPtr): parameter.raiseTypeError(x, "Equation")
def checker(self, x): if not (isinstance(x, Output) and issubclass(x.otype, outputval.ScalarOutputValPtr)): parameter.raiseTypeError(type(x), 'Scalar Output')
def checker(self, x): if not isinstance(x, Output): parameter.raiseTypeError(type(x), 'Position Output') PositionOutputParameter.oktypes(x.otype)
def checker(self, x): if not isinstance(x, equation.EquationPtr) or not x.allow_boundary_conditions(): parameter.raiseTypeError(x, "Equation with BC capability")