From: W. Trevor King Date: Wed, 10 Nov 2010 17:56:07 +0000 (-0500) Subject: Add yaml load test to hooke.curve.Data. X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=eeb1eade49c685a862cb8f65046efa62711d6f92;p=hooke.git Add yaml load test to hooke.curve.Data. --- diff --git a/hooke/curve.py b/hooke/curve.py index a4819cf..4e1b6ca 100644 --- a/hooke/curve.py +++ b/hooke/curve.py @@ -92,10 +92,14 @@ class Data (numpy.ndarray): The data-type is also YAMLable (see :mod:`hooke.util.yaml`). >>> import yaml - >>> print yaml.dump(d) + >>> s = yaml.dump(d) + >>> print s !hooke.curve.DataInfo columns: [distance (m), force (N)] + >>> z = yaml.load(s) + >>> z + Data([], shape=(0, 0), dtype=float32) """ def __new__(subtype, shape, dtype=numpy.float, buffer=None, offset=0, strides=None, order=None, info=None):