Ran update_copyright.py.
[hooke.git] / test / tutorial.py
index 967cda8498f57afd472b2e790ff1747b34f02bdd..718ab0514e936dee7a5bc26fd8bfcb82994bac59 100644 (file)
@@ -1,4 +1,4 @@
-# Copyright (C) 2010 W. Trevor King <wking@drexel.edu>
+# Copyright (C) 2010-2012 W. Trevor King <wking@drexel.edu>
 #
 # This file is part of Hooke.
 #
@@ -33,15 +33,15 @@ Documented commands (type help <topic>):
 ========================================
 ...
 >>> h = r.run_lines(h, ['help load_playlist'])
-Command: load_playlist
+Usage: load_playlist [options]
 <BLANKLINE>
-Arguments:
-<BLANKLINE>
-help BOOL (bool) Print a help message.
-output_playlist STRING (string) Name of the new playlist (defaults to
-    an auto-generated name).
-input FILE (file) File name for the input playlist.
-drivers DRIVER (driver) Drivers for loading curves.
+Options:
+  -h, --help            show this help message and exit
+  --disable-stack       Add this command to appropriate command stacks. (True)
+  --output_playlist=OUTPUT_PLAYLIST
+                        Name of the new playlist (defaults to an auto-
+                        generated name). (None)
+  --drivers=DRIVERS     Drivers for loading curves. (None)
 <BLANKLINE>
 Load a playlist.
 <BLANKLINE>
@@ -69,6 +69,7 @@ hooke
 Success
 <BLANKLINE>
 >>> h = r.run_lines(h, ['new_playlist --output_playlist mylist'])
+<FilePlaylist mylist>
 Success
 <BLANKLINE>
 >>> h = r.run_lines(h, ['jump_to_playlist -- -1'])
@@ -94,10 +95,14 @@ False
 >>> h = r.run_lines(h, ['save_playlist --output mylist'])
 Success
 <BLANKLINE>
+>>> h = r.run_lines(h, ['name_playlist my_old_list'])
+<FilePlaylist my_old_list>
+Success
+<BLANKLINE>
 >>> os.path.isfile('mylist.hkp')
 True
 >>> h = r.run_lines(h, ['load_playlist mylist.hkp'])
-<FilePlaylist mylist.hkp>
+<FilePlaylist mylist>
 Success
 <BLANKLINE>
 >>> if playlist_already_exists == False:
@@ -161,22 +166,24 @@ Success
 Success
 <BLANKLINE>
 
+>>> [p for p in h.playlists]
+[<FilePlaylist my_old_list>, <FilePlaylist mylist>]
 >>> h = r.run_lines(h, ['get_playlist'])
-<FilePlaylist mylist>
+<FilePlaylist my_old_list>
 Success
 <BLANKLINE>
 >>> h = r.run_lines(h, ['next_playlist'])
 Success
 <BLANKLINE>
 >>> h = r.run_lines(h, ['get_playlist'])
-<FilePlaylist mylist.hkp>
+<FilePlaylist mylist>
 Success
 <BLANKLINE>
 >>> h = r.run_lines(h, ['previous_playlist'])
 Success
 <BLANKLINE>
 >>> h = r.run_lines(h, ['get_playlist'])
-<FilePlaylist mylist>
+<FilePlaylist my_old_list>
 Success
 <BLANKLINE>
 >>> h = r.run_lines(h, ['playlist_index'])
@@ -187,7 +194,7 @@ Success
 Success
 <BLANKLINE>
 >>> h = r.run_lines(h, ['get_playlist'])
-<FilePlaylist mylist.hkp>
+<FilePlaylist mylist>
 Success
 <BLANKLINE>
 >>> h = r.run_lines(h, ['playlist_index'])
@@ -198,7 +205,7 @@ Success
 Success
 <BLANKLINE>
 >>> h = r.run_lines(h, ['get_playlist'])
-<FilePlaylist mylist>
+<FilePlaylist my_old_list>
 Success
 <BLANKLINE>
 >>> h = r.run_lines(h, ['playlist_index'])
@@ -209,7 +216,7 @@ Success
 Success
 <BLANKLINE>
 >>> h = r.run_lines(h, ['get_playlist'])
-<FilePlaylist mylist.hkp>
+<FilePlaylist mylist>
 Success
 <BLANKLINE>
 >>> h = r.run_lines(h, ['playlist_index'])
@@ -223,56 +230,25 @@ See :file:`note.py`.
 
 *Exporting curves*
 
->>> export_already_exists = os.path.exists('mycurve.dat')
->>> export_already_exists
-False
->>> h = r.run_lines(h, ['export_block --output mycurve.dat'])
-Success
-<BLANKLINE>
->>> os.path.isfile('mycurve.dat')
-True
->>> if export_already_exists == False:
-...    os.remove('mycurve.dat')
+See :file:`export_block.py`.
 
 *Measuring distances and forces*
 
->>> h = r.run_lines(h, ['delta 300 500'])  # doctest: +ELLIPSIS
-[('z piezo (m)', -4.913...e-08), ('deflection (m)', -2.834...e-08)]
-Success
-<BLANKLINE>
+See :file:`delta.py`.
 
 *Worm like chain and freely jointed chain fitting*
 
-*Multiple curve fitting and measuring*
+*Command stacks*
+
+See :file:`command_stack.py`,
+:file:`apply_command_stack_to_playlist.py`, and
+:file:`command_stack_save_load.py`.
 
-*Fast curve reviewing and saving*
+*Multiple curve analysis*
+
+See :file:`multiple_curve_analysis`.
 
 *Configuring Hooke*
 
->>> h = r.run_lines(h, ['set_config conditions temperature 300.0'])
-Success
-<BLANKLINE>
->>> h = r.run_lines(h, ['get_config conditions temperature'])
-300.0
-Success
-<BLANKLINE>
->>> h = r.run_lines(h, ['set_config conditions temperature 295.3'])
-Success
-<BLANKLINE>
->>> h = r.run_lines(h, ['get_config conditions temperature'])
-295.3
-Success
-<BLANKLINE>
->>> h = r.run_lines(h, ['print_config'])  # doctest: +ELLIPSIS
-# Default environmental conditions in case they are not specified in
-# the force curve data.  Configuration options in this section are
-# available to every plugin.
-[conditions]
-# Temperature in Kelvin
-temperature = 295.3
-<BLANKLINE>
-...
->>> h = r.run_lines(h, ['save_config'])
-Success
-<BLANKLINE>
+See :file:`config.py`.
 """