Add yaml load test to hooke.curve.Data.
authorW. Trevor King <wking@drexel.edu>
Wed, 10 Nov 2010 17:56:07 +0000 (12:56 -0500)
committerW. Trevor King <wking@drexel.edu>
Wed, 10 Nov 2010 17:56:07 +0000 (12:56 -0500)
hooke/curve.py

index a4819cf1ef28b03e064d508d244648904f30f667..4e1b6caecc8abcc6953cace618d6daaab3a8b10f 100644 (file)
@@ -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)]
     <BLANKLINE>
+    >>> 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):