Add wtk driver for W. Trevor King's velocity clamp data format.
[hooke.git] / test / wtk_driver.py
1 # Copyright (C) 2010 W. Trevor King <wking@drexel.edu>
2 #
3 # This file is part of Hooke.
4 #
5 # Hooke is free software: you can redistribute it and/or
6 # modify it under the terms of the GNU Lesser General Public
7 # License as published by the Free Software Foundation, either
8 # version 3 of the License, or (at your option) any later version.
9 #
10 # Hooke is distributed in the hope that it will be useful,
11 # but WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13 # GNU Lesser General Public License for more details.
14 #
15 # You should have received a copy of the GNU Lesser General Public
16 # License along with Hooke.  If not, see
17 # <http://www.gnu.org/licenses/>.
18
19 """
20 Point data_logger to our test data.
21
22 >>> import os
23 >>> import os.path
24 >>> import data_logger
25 >>> data_logger.DEFAULT_PATH = os.path.join(
26 ...     os.getcwd(), 'test', 'data', 'vclamp_wtk')
27
28 Adjust Hooke in case we don't have calibcant installed.
29
30 >>> from hooke.hooke import Hooke, HookeRunner
31 >>> h = Hooke()
32 >>> h.config.set('wtk driver', 'cantilever calibration directory',
33 ...              '$DEFAULT$/calibrate_cantilever')
34 >>> h.load_drivers()
35
36 Proceed with the test itself.
37
38 >>> r = HookeRunner()
39 >>> h = r.run_lines(h, ['load_playlist test/data/vclamp_wtk/playlist']) # doctest: +ELLIPSIS
40 <FilePlaylist playlist.hkp>
41 Success
42 <BLANKLINE>
43 >>> h = r.run_lines(h, ['curve_info']) # doctest: +ELLIPSIS, +REPORT_UDIFF
44 name: 20100504135237_unfold
45 path: test/data/vclamp_wtk/unfold/20100504/20100504135237_unfold
46 experiment: <class 'hooke.experiment.VelocityClamp'>
47 driver: <hooke.driver.wtk.WTKDriver object at 0x...>
48 filetype: wtk
49 note: 
50 blocks: 2
51 block sizes: [(16001, 3), (16001, 3)]
52 Success
53 <BLANKLINE>
54 """