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 stack BOOL (bool) Add this command to appropriate command stacks.
42 output_playlist STRING (string) Name of the new playlist (defaults to
43 an auto-generated name).
44 input FILE (file) File name for the input playlist.
45 drivers DRIVER (driver) Drivers for loading curves.
50 Usage: load_playlist [options] input
54 >>> h = r.run_lines(h, ['cd --path .'])
57 >>> h = r.run_lines(h, ['pwd']) # doctest: +ELLIPSIS
61 >>> h = r.run_lines(h, ['ls']) # doctest: +ELLIPSIS +REPORT_UDIFF
72 >>> h = r.run_lines(h, ['new_playlist --output_playlist mylist'])
76 >>> h = r.run_lines(h, ['jump_to_playlist -- -1'])
79 >>> h = r.run_lines(h, ['get_playlist'])
83 >>> h = r.run_lines(h, ['glob_curves_to_playlist test/data/vclamp_picoforce/*']
84 ... ) # doctest: +ELLIPSIS
87 <Curve 20071120a_i27_t33.100>
88 <Curve 20071120a_i27_t33.101>
90 <Curve 20071120a_i27_t33.199>
93 >>> playlist_already_exists = os.path.exists('mylist.hkp')
94 >>> playlist_already_exists
96 >>> h = r.run_lines(h, ['save_playlist --output mylist'])
99 >>> os.path.isfile('mylist.hkp')
101 >>> h = r.run_lines(h, ['load_playlist mylist.hkp'])
102 <FilePlaylist mylist.hkp>
105 >>> if playlist_already_exists == False:
106 ... os.remove('mylist.hkp')
108 *Navigating the playlist*
110 >>> h = r.run_lines(h, ['get_curve'])
114 >>> h = r.run_lines(h, ['next_curve'])
117 >>> h = r.run_lines(h, ['get_curve'])
121 >>> h = r.run_lines(h, ['previous_curve'])
124 >>> h = r.run_lines(h, ['get_curve'])
128 >>> h = r.run_lines(h, ['curve_index'])
132 >>> h = r.run_lines(h, ['previous_curve'])
135 >>> h = r.run_lines(h, ['get_curve'])
136 <Curve 20071120a_i27_t33.199>
139 >>> h = r.run_lines(h, ['curve_index'])
143 >>> h = r.run_lines(h, ['next_curve'])
146 >>> h = r.run_lines(h, ['get_curve'])
150 >>> h = r.run_lines(h, ['curve_index'])
154 >>> h = r.run_lines(h, ['jump_to_curve 14'])
157 >>> h = r.run_lines(h, ['get_curve'])
158 <Curve 20071120a_i27_t33.112>
161 >>> h = r.run_lines(h, ['curve_index'])
166 >>> h = r.run_lines(h, ['get_playlist'])
167 <FilePlaylist mylist>
170 >>> h = r.run_lines(h, ['next_playlist'])
173 >>> h = r.run_lines(h, ['get_playlist'])
174 <FilePlaylist mylist.hkp>
177 >>> h = r.run_lines(h, ['previous_playlist'])
180 >>> h = r.run_lines(h, ['get_playlist'])
181 <FilePlaylist mylist>
184 >>> h = r.run_lines(h, ['playlist_index'])
188 >>> h = r.run_lines(h, ['previous_playlist'])
191 >>> h = r.run_lines(h, ['get_playlist'])
192 <FilePlaylist mylist.hkp>
195 >>> h = r.run_lines(h, ['playlist_index'])
199 >>> h = r.run_lines(h, ['next_playlist'])
202 >>> h = r.run_lines(h, ['get_playlist'])
203 <FilePlaylist mylist>
206 >>> h = r.run_lines(h, ['playlist_index'])
210 >>> h = r.run_lines(h, ['jump_to_playlist 1'])
213 >>> h = r.run_lines(h, ['get_playlist'])
214 <FilePlaylist mylist.hkp>
217 >>> h = r.run_lines(h, ['playlist_index'])
228 See :file:`export_block.py`.
230 *Measuring distances and forces*
232 See :file:`delta.py`.
234 *Worm like chain and freely jointed chain fitting*
238 See :file:`command_stack.py`,
239 :file:`apply_command_stack_to_playlist.py`, and
240 :file:`command_stack_save_load.py`.
242 *Multiple curve analysis*
244 See :file:`multiple_curve_analysis`.
246 *Fast curve reviewing and saving*
250 See :file:`config.py`.