1 # Copyright (C) 2010 W. Trevor King <wking@drexel.edu>
3 # This file is part of Hooke.
5 # Hooke is free software: you can redistribute it and/or modify it
6 # under the terms of the GNU Lesser General Public License as
7 # published by the Free Software Foundation, either version 3 of the
8 # License, or (at your option) any later version.
10 # Hooke is distributed in the hope that it will be useful, but WITHOUT
11 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
12 # or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General
13 # Public License for more details.
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/>.
20 Test the commands listed in :file:`doc/tutorial.txt`.
24 >>> from hooke.hooke import Hooke, HookeRunner
30 >>> h = r.run_lines(h, ['help']) # doctest: +ELLIPSIS
32 Documented commands (type help <topic>):
33 ========================================
35 >>> h = r.run_lines(h, ['help load_playlist'])
36 Command: load_playlist
40 help BOOL (bool) Print a help message.
41 output_playlist STRING (string) Name of the new playlist (defaults to
42 an auto-generated name).
43 input FILE (file) File name for the input playlist.
44 drivers DRIVER (driver) Drivers for loading curves.
49 Usage: load_playlist [options] input
53 >>> h = r.run_lines(h, ['cd --path .'])
56 >>> h = r.run_lines(h, ['pwd']) # doctest: +ELLIPSIS
60 >>> h = r.run_lines(h, ['ls']) # doctest: +ELLIPSIS +REPORT_UDIFF
71 >>> h = r.run_lines(h, ['new_playlist --output_playlist mylist'])
74 >>> h = r.run_lines(h, ['jump_to_playlist -- -1'])
77 >>> h = r.run_lines(h, ['get_playlist'])
81 >>> h = r.run_lines(h, ['glob_curves_to_playlist test/data/vclamp_picoforce/*']
82 ... ) # doctest: +ELLIPSIS
85 <Curve 20071120a_i27_t33.100>
86 <Curve 20071120a_i27_t33.101>
88 <Curve 20071120a_i27_t33.199>
91 >>> playlist_already_exists = os.path.exists('mylist.hkp')
92 >>> playlist_already_exists
94 >>> h = r.run_lines(h, ['save_playlist --output mylist'])
97 >>> os.path.isfile('mylist.hkp')
99 >>> h = r.run_lines(h, ['load_playlist mylist.hkp'])
100 <FilePlaylist mylist.hkp>
103 >>> if playlist_already_exists == False:
104 ... os.remove('mylist.hkp')
106 *Navigating the playlist*
108 >>> h = r.run_lines(h, ['get_curve'])
112 >>> h = r.run_lines(h, ['next_curve'])
115 >>> h = r.run_lines(h, ['get_curve'])
119 >>> h = r.run_lines(h, ['previous_curve'])
122 >>> h = r.run_lines(h, ['get_curve'])
126 >>> h = r.run_lines(h, ['curve_index'])
130 >>> h = r.run_lines(h, ['previous_curve'])
133 >>> h = r.run_lines(h, ['get_curve'])
134 <Curve 20071120a_i27_t33.199>
137 >>> h = r.run_lines(h, ['curve_index'])
141 >>> h = r.run_lines(h, ['next_curve'])
144 >>> h = r.run_lines(h, ['get_curve'])
148 >>> h = r.run_lines(h, ['curve_index'])
152 >>> h = r.run_lines(h, ['jump_to_curve 14'])
155 >>> h = r.run_lines(h, ['get_curve'])
156 <Curve 20071120a_i27_t33.112>
159 >>> h = r.run_lines(h, ['curve_index'])
164 >>> h = r.run_lines(h, ['get_playlist'])
165 <FilePlaylist mylist>
168 >>> h = r.run_lines(h, ['next_playlist'])
171 >>> h = r.run_lines(h, ['get_playlist'])
172 <FilePlaylist mylist.hkp>
175 >>> h = r.run_lines(h, ['previous_playlist'])
178 >>> h = r.run_lines(h, ['get_playlist'])
179 <FilePlaylist mylist>
182 >>> h = r.run_lines(h, ['playlist_index'])
186 >>> h = r.run_lines(h, ['previous_playlist'])
189 >>> h = r.run_lines(h, ['get_playlist'])
190 <FilePlaylist mylist.hkp>
193 >>> h = r.run_lines(h, ['playlist_index'])
197 >>> h = r.run_lines(h, ['next_playlist'])
200 >>> h = r.run_lines(h, ['get_playlist'])
201 <FilePlaylist mylist>
204 >>> h = r.run_lines(h, ['playlist_index'])
208 >>> h = r.run_lines(h, ['jump_to_playlist 1'])
211 >>> h = r.run_lines(h, ['get_playlist'])
212 <FilePlaylist mylist.hkp>
215 >>> h = r.run_lines(h, ['playlist_index'])
226 See :file:`export_block.py`.
228 *Measuring distances and forces*
230 See :file:`delta.py`.
232 *Worm like chain and freely jointed chain fitting*
236 See :file:`command_stack.py`and :file:`command_stack_save_load.py`.
238 *Multiple curve fitting and measuring*
240 *Fast curve reviewing and saving*
244 See :file:`config.py`.