Example #1
0
 def get_random_data(self, c, tag=None):
     """Get a random bit of data conforming to the specified type tag."""
     if tag is None:
         t = hydrant.randType()
     else:
         t = T.parseTypeTag(tag)
     return hydrant.randValue(t)
Example #2
0
 def get_random_data(self, c, tag=None):
     """Get a random bit of data conforming to the specified type tag."""
     if tag is None:
         t = hydrant.randType()
     else:
         t = T.parseTypeTag(tag)
     return hydrant.randValue(t)
Example #3
0
def test_parameters(dv):
    """Create a dataset with parameters"""
    dv.new('test', ['x', 'y'], ['z'])
    for i in xrange(100):
        t = hydrant.randType(noneOkay=False)
        a = hydrant.randValue(t)
        name = 'param{}'.format(i)
        dv.add_parameter(name, a)
        b = dv.get_parameter(name)
        flat_a = T.flatten(a)
        flat_b = T.flatten(b)
        assert flat_a == flat_b
Example #4
0
def test_parameters(dv):
    """Create a dataset with parameters"""
    dv.new('test', ['x', 'y'], ['z'])
    for i in xrange(100):
        t = hydrant.randType(noneOkay=False)
        a = hydrant.randValue(t)
        name = 'param{}'.format(i)
        dv.add_parameter(name, a)
        b = dv.get_parameter(name)
        flat_a = T.flatten(a)
        flat_b = T.flatten(b)
        assert flat_a == flat_b
Example #5
0
def add_params(dv):
    for i in range(100):
        t = hydrant.randType(noneOkay=False)
        v = hydrant.randValue(t)
        name = 'param{:04d}'.format(i)
        dv.add_parameter(name, v)
Example #6
0
 def get_random_tag(self, c):
     """Get a random LabRAD type tag."""
     return str(hydrant.randType())
Example #7
0
 def get_random_tag(self, c):
     """Get a random LabRAD type tag."""
     return str(hydrant.randType())