コード例 #1
0
ファイル: quadmesh.py プロジェクト: sureshdontha/datashader
 def validate(self, in_dshape):
     if not isreal(in_dshape.measure[str(self.x)]):
         raise ValueError('x must be real')
     elif not isreal(in_dshape.measure[str(self.y)]):
         raise ValueError('y must be real')
     elif not isreal(in_dshape.measure[str(self.name)]):
         raise ValueError('aggregate value must be real')
コード例 #2
0
ファイル: line.py プロジェクト: tomwhite/datashader
    def validate(self, in_dshape):
        if not all([isreal(in_dshape.measure[str(xcol)]) for xcol in self.x]):
            raise ValueError('x columns must be real')
        elif not all([isreal(in_dshape.measure[str(ycol)])
                      for ycol in self.y]):
            raise ValueError('y columns must be real')

        unique_x_measures = set(in_dshape.measure[str(xcol)]
                                for xcol in self.x)
        if len(unique_x_measures) > 1:
            raise ValueError('x columns must have the same data type')

        unique_y_measures = set(in_dshape.measure[str(ycol)]
                                for ycol in self.y)
        if len(unique_y_measures) > 1:
            raise ValueError('y columns must have the same data type')
コード例 #3
0
ファイル: test_utils.py プロジェクト: mdboom/datashader
def test_isreal():
    assert isreal('int32')
    assert isreal(dshape('int32'))
    assert isreal('?int32')
    assert isreal('float64')
    assert not isreal('complex64')
    assert not isreal('{x: int64, y: float64}')
コード例 #4
0
ファイル: test_utils.py プロジェクト: xl3783/datashader
def test_isreal():
    assert isreal('int32')
    assert isreal(dshape('int32'))
    assert isreal('?int32')
    assert isreal('float64')
    assert not isreal('complex64')
    assert not isreal('{x: int64, y: float64}')
コード例 #5
0
ファイル: line.py プロジェクト: tomwhite/datashader
 def validate(self, in_dshape):
     if not all([isreal(in_dshape.measure[str(xcol)]) for xcol in self.x]):
         raise ValueError('x columns must be real')
     elif not all([isreal(in_dshape.measure[str(ycol)])
                   for ycol in self.y]):
         raise ValueError('y columns must be real')
コード例 #6
0
ファイル: trimesh.py プロジェクト: xl3783/datashader
 def validate(self, in_dshape):
     for col in [self.x, self.y] + list(self.z):
         if not isreal(in_dshape.measure[str(col)]):
             raise ValueError('{} must be real'.format(col))