projects
/
hooke.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
7e42f27
)
Add yaml load test to hooke.curve.Data.
author
W. Trevor King
<wking@drexel.edu>
Wed, 10 Nov 2010 17:56:07 +0000
(12:56 -0500)
committer
W. Trevor King
<wking@drexel.edu>
Wed, 10 Nov 2010 17:56:07 +0000
(12:56 -0500)
hooke/curve.py
patch
|
blob
|
history
diff --git
a/hooke/curve.py
b/hooke/curve.py
index a4819cf1ef28b03e064d508d244648904f30f667..4e1b6caecc8abcc6953cace618d6daaab3a8b10f 100644
(file)
--- 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)]
<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):