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)
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
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)
def get_random_tag(self, c): """Get a random LabRAD type tag.""" return str(hydrant.randType())