示例#1
0
 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")
示例#2
0
 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")
示例#3
0
 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]")
示例#4
0
 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')
示例#5
0
文件: profile.py 项目: santiama/OOF3D
 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')
示例#6
0
文件: enum.py 项目: anilkunwar/OOF2
 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)
示例#7
0
文件: output.py 项目: song2001/OOF2
 def checker(self, x):
     if not isinstance(x, Output):
         parameter.raiseTypeError(type(x), 'Output')
示例#8
0
 def checker(self, x):
     if not isinstance(x, flux.FluxPtr):
         parameter.raiseTypeError(x, "Flux")
示例#9
0
 def checker(self, x):
     if not isinstance(x, field.FieldPtr):
         parameter.raiseTypeError(x, "Field")
示例#10
0
 def checker(self, x):
     if not isinstance(
             x, equation.EquationPtr) or not x.allow_boundary_conditions():
         parameter.raiseTypeError(x, "Equation with BC capability")
示例#11
0
 def checker(self, x):
     if not isinstance(x, equation.EquationPtr):
         parameter.raiseTypeError(x, "Equation")
示例#12
0
文件: output.py 项目: anilkunwar/OOF2
 def checker(self, x):
     if not isinstance(x, Output):
         parameter.raiseTypeError(type(x), 'Output')
示例#13
0
文件: output.py 项目: anilkunwar/OOF2
 def checker(self, x):
     if not (isinstance(x, Output)
             and issubclass(x.otype, outputval.ScalarOutputValPtr)):
         parameter.raiseTypeError(type(x), 'Scalar Output')
示例#14
0
 def checker(self, x):
     if not isinstance(x, flux.FluxPtr):
         parameter.raiseTypeError(x, "Flux")
示例#15
0
 def checker(self, x):
     if not isinstance(x, equation.EquationPtr):
         parameter.raiseTypeError(x, "Equation")
示例#16
0
文件: output.py 项目: song2001/OOF2
 def checker(self, x):
     if not (isinstance(x, Output)
             and issubclass(x.otype, outputval.ScalarOutputValPtr)):
         parameter.raiseTypeError(type(x), 'Scalar Output')
示例#17
0
文件: output.py 项目: song2001/OOF2
 def checker(self, x):
     if not isinstance(x, Output):
         parameter.raiseTypeError(type(x), 'Position Output')
     PositionOutputParameter.oktypes(x.otype)
示例#18
0
 def checker(self, x):
     if not isinstance(x, equation.EquationPtr) or not x.allow_boundary_conditions():
         parameter.raiseTypeError(x, "Equation with BC capability")
示例#19
0
文件: output.py 项目: anilkunwar/OOF2
 def checker(self, x):
     if not isinstance(x, Output):
         parameter.raiseTypeError(type(x), 'Position Output')
     PositionOutputParameter.oktypes(x.otype)
示例#20
0
 def checker(self, x):
     if not isinstance(x, field.FieldPtr):
         parameter.raiseTypeError(x, "Field")