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 >>> h = r.run_lines(h, ['name_playlist my_old_list'])
100 <FilePlaylist my_old_list>
103 >>> os.path.isfile('mylist.hkp')
105 >>> h = r.run_lines(h, ['load_playlist mylist.hkp'])
106 <FilePlaylist mylist>
109 >>> if playlist_already_exists == False:
110 ... os.remove('mylist.hkp')
112 *Navigating the playlist*
114 >>> h = r.run_lines(h, ['get_curve'])
118 >>> h = r.run_lines(h, ['next_curve'])
121 >>> h = r.run_lines(h, ['get_curve'])
125 >>> h = r.run_lines(h, ['previous_curve'])
128 >>> h = r.run_lines(h, ['get_curve'])
132 >>> h = r.run_lines(h, ['curve_index'])
136 >>> h = r.run_lines(h, ['previous_curve'])
139 >>> h = r.run_lines(h, ['get_curve'])
140 <Curve 20071120a_i27_t33.199>
143 >>> h = r.run_lines(h, ['curve_index'])
147 >>> h = r.run_lines(h, ['next_curve'])
150 >>> h = r.run_lines(h, ['get_curve'])
154 >>> h = r.run_lines(h, ['curve_index'])
158 >>> h = r.run_lines(h, ['jump_to_curve 14'])
161 >>> h = r.run_lines(h, ['get_curve'])
162 <Curve 20071120a_i27_t33.112>
165 >>> h = r.run_lines(h, ['curve_index'])
170 >>> [p for p in h.playlists]
171 [<FilePlaylist my_old_list>, <FilePlaylist mylist>]
172 >>> h = r.run_lines(h, ['get_playlist'])
173 <FilePlaylist my_old_list>
176 >>> h = r.run_lines(h, ['next_playlist'])
179 >>> h = r.run_lines(h, ['get_playlist'])
180 <FilePlaylist mylist>
183 >>> h = r.run_lines(h, ['previous_playlist'])
186 >>> h = r.run_lines(h, ['get_playlist'])
187 <FilePlaylist my_old_list>
190 >>> h = r.run_lines(h, ['playlist_index'])
194 >>> h = r.run_lines(h, ['previous_playlist'])
197 >>> h = r.run_lines(h, ['get_playlist'])
198 <FilePlaylist mylist>
201 >>> h = r.run_lines(h, ['playlist_index'])
205 >>> h = r.run_lines(h, ['next_playlist'])
208 >>> h = r.run_lines(h, ['get_playlist'])
209 <FilePlaylist my_old_list>
212 >>> h = r.run_lines(h, ['playlist_index'])
216 >>> h = r.run_lines(h, ['jump_to_playlist 1'])
219 >>> h = r.run_lines(h, ['get_playlist'])
220 <FilePlaylist mylist>
223 >>> h = r.run_lines(h, ['playlist_index'])
234 See :file:`export_block.py`.
236 *Measuring distances and forces*
238 See :file:`delta.py`.
240 *Worm like chain and freely jointed chain fitting*
244 See :file:`command_stack.py`,
245 :file:`apply_command_stack_to_playlist.py`, and
246 :file:`command_stack_save_load.py`.
248 *Multiple curve analysis*
250 See :file:`multiple_curve_analysis`.
254 See :file:`config.py`.