W. Trevor King [Sun, 22 Aug 2010 06:18:52 +0000 (02:18 -0400)]
Save nicely scaled WLC parameters to the fit dict in polymer_fit.py.
W. Trevor King [Sun, 22 Aug 2010 05:54:12 +0000 (01:54 -0400)]
Updated test/ to match the new explicit YAML format.
And other minor tweaks to get things passing again.
$ nosetests --with-doctest --doctest-tests -vv test/ 2>&1 | less
...
Ran 27 tests in 43.349s
OK
Note that the tutorial.py and note.py tests were going so slowly
before (but are fast again now) because I was (re)loading
playlist/curve/etc. items in .__setstate__, when they are supposed to
be set with `listitems`. If you're going to go messing around with
__getstate__ or __setstate__, it would be a good idea to read
http://www.python.org/dev/peps/pep-0307/
(especially Case 2 and Case 3) *carefully* before wasting a bunch
of time and confusion bungling around like I did ;).
W. Trevor King [Sun, 22 Aug 2010 05:49:02 +0000 (01:49 -0400)]
Add `name playlist' command.
To avoid collisions if you load the same playlist twice, etc.
W. Trevor King [Sun, 22 Aug 2010 05:23:35 +0000 (01:23 -0400)]
Upgrade test/data/ playlists to new explicit YAML format.
W. Trevor King [Sun, 22 Aug 2010 05:13:43 +0000 (01:13 -0400)]
Stay on top of Curve.set_hooke() so we can run CommandStacks.
W. Trevor King [Sun, 22 Aug 2010 05:08:27 +0000 (01:08 -0400)]
Remove debugging printout from hooke.playlist.load.
W. Trevor King [Sun, 22 Aug 2010 05:03:28 +0000 (01:03 -0400)]
Cleaned up hooke.playlist.load() and its use in `load playlist`.
W. Trevor King [Sun, 22 Aug 2010 04:44:16 +0000 (00:44 -0400)]
Adjust Hooke internals to use unsafe YAML (not just builtin Python types).
Pros:
* More explicit YAML.
* Simple, robust code.
* Easily (de)serialize everything, regardless of nesting, etc.
Cons:
* Uglier YAML.
After wrestling with a yaml.safe_dump()able representation, I've given
up and shifted to yaml.dump(). Now we can dump anything easily, which
is great :). For example, this will allow you to access polymer fit
parameters. However, there will be things like
!!python/object/new:hooke.playlist.FilePlaylist
in the output YAML files. Such is life.
While I was at it, I ran
$ nosetests --with-doctest --doctest-tests hooke/ 2>&1 | log
and cleaned up a number of the doctests. Now the only things that
fail in there are the yet-to-be-upgraded submods left over from before
my rewrite.
I haven't checked test/ recently, that's next ;).
W. Trevor King [Sat, 21 Aug 2010 22:22:50 +0000 (18:22 -0400)]
Fix hooke.util.yaml handling of assorted numpy.dtypes.
W. Trevor King [Sat, 21 Aug 2010 22:21:57 +0000 (18:21 -0400)]
Fix polymer fit info name
W. Trevor King [Sat, 21 Aug 2010 20:25:54 +0000 (16:25 -0400)]
Don't ignore Curve.data in playlist serialization (now that we have hooke.util.yaml).
W. Trevor King [Sat, 21 Aug 2010 20:11:12 +0000 (16:11 -0400)]
Added command_stack option to all' default.
W. Trevor King [Sat, 21 Aug 2010 19:05:41 +0000 (15:05 -0400)]
Clear NoteIndexList in .__setstate__ to avoid doubling items during engine->UI passing.
W. Trevor King [Sat, 21 Aug 2010 18:47:02 +0000 (14:47 -0400)]
Fix to plugin experiment checks after
8687bbf30e87.
W. Trevor King [Sat, 21 Aug 2010 18:40:03 +0000 (14:40 -0400)]
Fix item -> items() bug in command_stack.py (now loaded curve playlist serialization works!)
W. Trevor King [Sat, 21 Aug 2010 18:37:20 +0000 (14:37 -0400)]
Added hooke.util.yaml fixing YAML/NumPy type issues (by dropping data).
W. Trevor King [Sat, 21 Aug 2010 17:44:05 +0000 (13:44 -0400)]
Tracked down problems saving playlists with loaded curves to numpy.dtype
W. Trevor King [Sat, 21 Aug 2010 17:25:44 +0000 (13:25 -0400)]
Demonstrate issue
1062277 if you serialize the command stack first
W. Trevor King [Sat, 21 Aug 2010 17:18:34 +0000 (13:18 -0400)]
Add doctests proving recursive curve->command_stack->arguments->curve serializing works
W. Trevor King [Sat, 21 Aug 2010 16:53:54 +0000 (12:53 -0400)]
Remove CommandStack.__getstate__ to avoid type ambiguity for command arguments.
W. Trevor King [Sat, 21 Aug 2010 16:01:19 +0000 (12:01 -0400)]
Oops, store the serialized Experiment in state not self.info.
W. Trevor King [Sat, 21 Aug 2010 15:33:46 +0000 (11:33 -0400)]
Serialize hooke.experiment.Experiment instances in Curves.
Also use singleton instances of the classes rather than the classes
themselves. This will allow usage of isinstance() rather than
.__mro__ to determine experiment type.
W. Trevor King [Sat, 21 Aug 2010 14:37:21 +0000 (10:37 -0400)]
Add hooke.playlist.Playlists for better playlist serialization.
W. Trevor King [Sat, 21 Aug 2010 14:36:18 +0000 (10:36 -0400)]
Remove trailing blank lines from vclamp_picoforce/README
W. Trevor King [Sat, 21 Aug 2010 13:57:08 +0000 (09:57 -0400)]
Transition from v0.1 XML playlists to v0.2 YAML playlists.
All test/ tests pass except for tutorial.py and note.py, which take
forever to run. I'm going to figure out what's going on there next.
Anyone with old playlist files can either upgrade by hand (the new
syntax is pretty simple, see the playlists under test/data/ for
examples), or use the automatic script
contrib/upgrade_playlist_0p1.py
which converts the playlists automatically. The output from the
upgrade script is, like most auto-generated files, less concise
than a hand coded playlist, but it will work just fine.
For an introduction to YAML, see
http://www.yaml.orlg/
which contains links YAML libraries in a number of languages. The
playlists are generated with PyYAML
http://pyyaml.org/
which handles YAML 1.1
http://yaml.org/spec/1.1/
The Hooke playlist format is pretty simple, so it shouldn't be too
strongly tied to any particular version of YAML, although I haven't
actually tested it with a 1.0 or 1.2 parser.
W. Trevor King [Fri, 20 Aug 2010 14:24:03 +0000 (10:24 -0400)]
Name Hemingway data blocks so they may be viewed in the GUI.
W. Trevor King [Fri, 20 Aug 2010 13:49:31 +0000 (09:49 -0400)]
Use 'Indexes' to split MFP3D curves into blocks.
W. Trevor King [Fri, 20 Aug 2010 13:14:11 +0000 (09:14 -0400)]
First attempt at temperature extraction for MFP3D (+ convert spring constant to float).
W. Trevor King [Fri, 20 Aug 2010 12:12:22 +0000 (08:12 -0400)]
Attach raw info etc. to curve in MFP3D driver (used to be just data blocks).
W. Trevor King [Fri, 20 Aug 2010 11:03:50 +0000 (07:03 -0400)]
Convert JPK deflection sign to follow Hooke convention.
W. Trevor King [Fri, 20 Aug 2010 10:44:31 +0000 (06:44 -0400)]
Fast curve review seems to be a GUI-specific feature.
W. Trevor King [Fri, 20 Aug 2010 10:43:17 +0000 (06:43 -0400)]
Command line UI now handles EOF during request/response interactions.
For example
$ echo | ./bin/hk.py -c 'new_playlist'
-c 'glob_curves_to_playlist test/data/*' --persist
used to loop forever thinking it was getting invalid responses to
Exit? [y/N]
Also, change str() to unicode() in DoCommand.__call__ to handle
non-ascii messages (e.g. ยต (micro) from SI units).
W. Trevor King [Fri, 20 Aug 2010 09:02:08 +0000 (05:02 -0400)]
Remove debugging printout from JPK driver
W. Trevor King [Fri, 20 Aug 2010 08:59:05 +0000 (04:59 -0400)]
Convert all channels to their default calibration in the JPK driver.
The previous implementation only scaled height and vDeflection, which
meant that the other unscaled (and therefore unitless) columns broke
distance formatting commands (e.g. 'point info').
W. Trevor King [Fri, 20 Aug 2010 08:13:26 +0000 (04:13 -0400)]
Set filetype and experiment fields in JPK driver.
W. Trevor King [Fri, 20 Aug 2010 07:45:00 +0000 (03:45 -0400)]
Push GUI config setting changes to the engine process' Hooke.
W. Trevor King [Fri, 20 Aug 2010 06:39:00 +0000 (02:39 -0400)]
Ran update_copyright.py, which fixed some spellcheck errors in hooke/plugin/curve.py
W. Trevor King [Fri, 20 Aug 2010 01:37:44 +0000 (21:37 -0400)]
Flesh out command stack execution.
W. Trevor King [Thu, 19 Aug 2010 19:16:48 +0000 (15:16 -0400)]
'new playlist' now puts the new playlist into outqueue (see
fafab694b2dc)
W. Trevor King [Thu, 19 Aug 2010 19:13:06 +0000 (15:13 -0400)]
Set Curve._hooke after joining engine in HookeRunner (see
f2bdd7aa2269)
W. Trevor King [Thu, 19 Aug 2010 18:52:47 +0000 (14:52 -0400)]
Remove duplicate Command arguments (e.g. help, stack) from FlatFilterCommand
W. Trevor King [Thu, 19 Aug 2010 18:36:48 +0000 (14:36 -0400)]
Log the troublesome command for command line option conflicts.
W. Trevor King [Thu, 19 Aug 2010 17:47:56 +0000 (13:47 -0400)]
Patch GUI to handle 'new playlist' and 'glob curves to playlist'
W. Trevor King [Thu, 19 Aug 2010 16:58:40 +0000 (12:58 -0400)]
Allow flattening of path-less playlists for command.
W. Trevor King [Thu, 19 Aug 2010 16:52:44 +0000 (12:52 -0400)]
Point out in doc/gui.txt that the folders panel is still unimplemented
W. Trevor King [Thu, 19 Aug 2010 11:56:41 +0000 (07:56 -0400)]
Copy spring constant into block info in JPK driver.
Although JPK's curve-level spring constant makes more sense. Perhaps
I will convert all drivers to store it there in the future.
W. Trevor King [Tue, 17 Aug 2010 13:21:18 +0000 (09:21 -0400)]
Added 'Command stack' section to doc/tutorial.txt
W. Trevor King [Tue, 17 Aug 2010 13:05:24 +0000 (09:05 -0400)]
Update WLC/FJC fitting section of doc/tutorial.txt
W. Trevor King [Tue, 17 Aug 2010 10:57:44 +0000 (06:57 -0400)]
Update distance-measurement sections of doc/tutorial.txt and doc/gui.txt
W. Trevor King [Tue, 17 Aug 2010 10:56:23 +0000 (06:56 -0400)]
Remove export and distance sections from test/tutorial.py (they duplicate other test/*s).
W. Trevor King [Tue, 17 Aug 2010 10:38:18 +0000 (06:38 -0400)]
Use UUID in test/config.py's output file name.
W. Trevor King [Tue, 17 Aug 2010 10:29:34 +0000 (06:29 -0400)]
Broke config section of test/tutorial.py out into test/config.py
W. Trevor King [Tue, 17 Aug 2010 04:02:33 +0000 (00:02 -0400)]
Added 'save config'. Adjusted test/tutorial.py (and test/ in general) passes.
W. Trevor King [Tue, 17 Aug 2010 02:56:48 +0000 (22:56 -0400)]
Update test/flat_filter_playlist.py to explicitly specify input columns.
W. Trevor King [Tue, 17 Aug 2010 02:17:26 +0000 (22:17 -0400)]
Use 'simple' conversion handler to process 'file'-type JPK conversions.
Michael Haggerty at JPK pointed out that the information from the
external file was already stored in the curve file. He also confirmed
that my interpretation of the external calibration file format was
correct, although that no longer matters now that I've just removed
the 'file'-specific conversion code.
W. Trevor King [Tue, 17 Aug 2010 01:47:25 +0000 (21:47 -0400)]
Make file-format-version=0.5 support explicit in JPKDriver
W. Trevor King [Tue, 17 Aug 2010 01:20:42 +0000 (21:20 -0400)]
Confirm big-endian binary data format for JPK files.
Michael Haggerty, JPK's head of software development, sent me their
file specs. I'll add the specs themselves to our version control if I
get permission from them.
W. Trevor King [Tue, 17 Aug 2010 01:07:30 +0000 (21:07 -0400)]
Add test/note.py and adjust playlist handling so NoteFilterCommand works again.
W. Trevor King [Mon, 16 Aug 2010 19:16:05 +0000 (15:16 -0400)]
Added hooke.util.itertools with reverse_enumerate
W. Trevor King [Mon, 16 Aug 2010 18:59:27 +0000 (14:59 -0400)]
Don't save Curve._hooke when pickling or deepcopying.
Two reasons:
1) It crashes because hooke.config._comment_textwrap contains a
compiled regexp, and these cannot be deepcopied. See
http://mail.python.org/pipermail/python-dev/2008-November/083348.html
http://bugs.python.org/issue416670
2) We don't want to copy Hooke instances anyway, since we need them to stay
in sync. Anything copying curves (e.g. Playlist.filter) should shallow
copy Hooke instances between the curves.
If this turns up anywhere else, we should think about adding a
Curve.copy method to get the "just right" copy depth ;).
W. Trevor King [Mon, 16 Aug 2010 18:53:06 +0000 (14:53 -0400)]
Adjust test/tutorial.py to account for
4f4640207a50
W. Trevor King [Mon, 16 Aug 2010 18:51:28 +0000 (14:51 -0400)]
Adjust test/polynomial_flatten.py to account for
01ff9349a0c6
W. Trevor King [Mon, 16 Aug 2010 18:50:43 +0000 (14:50 -0400)]
Adjust test/flat_filter_peaks.py to account for
01ff9349a0c6
W. Trevor King [Mon, 16 Aug 2010 16:33:39 +0000 (12:33 -0400)]
Upgraded hooke.plugin.polymer_fit commands to ColumnAddingArgument subclasses.
Now the following command works:
$ bin/hk.py
-c 'load_playlist test/data/test'
-c 'zero_surface_contact_point --block retract'
-c 'flat_filter_peaks --block retract --min_points 1'
-c 'zero_surface_contact_point --block retract
--ignore_after_last_peak_info_name "flat filter peaks"'
-c 'convert_distance_to_force --block retract
--deflection_column "surface deflection (m)"'
-c 'remove_cantilever_from_extension --block retract'
-c 'flat_peaks_to_polymer_peaks --block retract'
-c 'polymer_fit_peaks --block retract'
-c 'export_block --block retract --output myblock.dat'
--persist
See related commands in
725a18055518 and
27bf3c1e98e1.
W. Trevor King [Mon, 16 Aug 2010 16:29:27 +0000 (12:29 -0400)]
Point to config.txt rather than hardcoding hooke.cfg in doc/gui.txt
W. Trevor King [Mon, 16 Aug 2010 16:01:44 +0000 (12:01 -0400)]
Rewrap a line in test/zero_surface_contact_point.py
W. Trevor King [Mon, 16 Aug 2010 16:00:43 +0000 (12:00 -0400)]
Apply constant offset to contact region in 'polynomial flatten' to avoid discontinuity
W. Trevor King [Mon, 16 Aug 2010 14:48:19 +0000 (10:48 -0400)]
Fix playlist filename preservation for 'load playlist' and 'new playlist'
W. Trevor King [Sun, 15 Aug 2010 22:17:40 +0000 (18:17 -0400)]
Move NoteFilterCommand from plugin.playlist to plugin.note.
W. Trevor King [Sun, 15 Aug 2010 14:41:18 +0000 (10:41 -0400)]
Added test/tutorial.py. Works until you get to note_filter_playlist
W. Trevor King [Sun, 15 Aug 2010 12:21:11 +0000 (08:21 -0400)]
Mention playlist navigation commands in doc/tutorial.txt
W. Trevor King [Sun, 15 Aug 2010 12:18:47 +0000 (08:18 -0400)]
Fix existing Driver.is_me's crashes if path is a directory.
I didn't add this at the curve level, since it seems reasonable that
someone might develop a curve format where the 'file' is a directory.
W. Trevor King [Sun, 15 Aug 2010 12:11:47 +0000 (08:11 -0400)]
Log a warning (rather than raising a Failure) on glob-loading a non-curve
W. Trevor King [Sun, 15 Aug 2010 12:02:23 +0000 (08:02 -0400)]
Updated tutorial's new_playlist call for new PlaylistAddingCommand syntax
W. Trevor King [Sun, 15 Aug 2010 12:01:47 +0000 (08:01 -0400)]
Use input name in 'new playlist' and 'load playlist' if p.name == None.
W. Trevor King [Sun, 15 Aug 2010 11:52:01 +0000 (07:52 -0400)]
Cleanups to playlist name handling in 'load playlist'.
Also:
* push new curves to outqueue during 'glob curves to playlist'.
* 'new playlist' transitioned to a subclass of PlaylistAddingCommand.
W. Trevor King [Sun, 15 Aug 2010 11:49:49 +0000 (07:49 -0400)]
Lowercase initial word in some log messages.
W. Trevor King [Sun, 15 Aug 2010 11:48:46 +0000 (07:48 -0400)]
Add "or '.'" after dirname() calls in hooke.command_stack and .playlist.
Because
>>> import os.path
>>> os.path.dirname('some-file')
''
>>> os.path.dirname('some-file') or '.'
'.'
and
>>> import os
>>> os.makedirs('')
Traceback (most recent call last):
...
OSError: [Errno 2] No such file or directory: ''
W. Trevor King [Sun, 15 Aug 2010 11:12:43 +0000 (07:12 -0400)]
bin/hooke -> bin/hk.py in setup.py. Thanks to amantedpaz for pointing this out.
W. Trevor King [Sat, 14 Aug 2010 15:49:54 +0000 (11:49 -0400)]
Bring doc/config.txt up to speed
W. Trevor King [Sat, 14 Aug 2010 15:28:55 +0000 (11:28 -0400)]
Added command stack saving and loading.
W. Trevor King [Sat, 14 Aug 2010 15:28:00 +0000 (11:28 -0400)]
Replace .config rather than reconstructing plugins, drivers, and UIs.
The previous implementation destroyed any state the plugins, etc. were
holding. For example, it cleared CommandStackPlugin.command_stack.
W. Trevor King [Sat, 14 Aug 2010 13:19:59 +0000 (09:19 -0400)]
Fix p name collision bug in plugin.playlist.LoadCommand._run
W. Trevor King [Sat, 14 Aug 2010 13:08:43 +0000 (09:08 -0400)]
Add logging import to hooke.ui
W. Trevor King [Sat, 14 Aug 2010 08:32:23 +0000 (04:32 -0400)]
Update (don't re-add) already loaded playlists in HookeFrame._postprocess_playlists
W. Trevor King [Sat, 14 Aug 2010 08:20:33 +0000 (04:20 -0400)]
Don't process unhandled arguments (e.g. 'driver') in HookeFrame.execute_command
W. Trevor King [Sat, 14 Aug 2010 08:11:26 +0000 (04:11 -0400)]
Fix self.command.name -> command.name in gui.HookeFrame.execute_command
W. Trevor King [Sat, 14 Aug 2010 08:08:04 +0000 (04:08 -0400)]
Fix toolbar -> self._c['toolbar'] in gui.panel.plot on MS Windows.
W. Trevor King [Sat, 14 Aug 2010 07:58:05 +0000 (03:58 -0400)]
Oops, protect hk.py's hooke.main() call with if __name__ == '__main__'.
*This* fixes amantedpaz' crash ;).
W. Trevor King [Sat, 14 Aug 2010 07:50:55 +0000 (03:50 -0400)]
Renamed bin/hooke -> bin/hk.py.
This fixes amantedpaz' crash from
http://code.google.com/p/hooke/issues/detail?id=40#c17
It turned out to not be related to issue8534, as I'd originally thought.
The crash looked like:
C:\hooke>c:\python26\python bin/hooke
...
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "c:\python26\lib\multiprocessing\forking.py", line 341, in main
prepare(preparation_data)
File "c:\python26\lib\multiprocessing\forking.py", line 450, in prepare
file, path_name, etc = imp.find_module(main_name, dirs)
ImportError: No module named hooke
...
W. Trevor King [Fri, 13 Aug 2010 16:34:25 +0000 (12:34 -0400)]
Fleshed out hooke.plugin.command_stack except for save/load
W. Trevor King [Fri, 13 Aug 2010 15:27:13 +0000 (11:27 -0400)]
Remove superfluous doctest comment from test/load_playlist.py
W. Trevor King [Fri, 13 Aug 2010 15:26:27 +0000 (11:26 -0400)]
Lowercase initial word in some log messages.
W. Trevor King [Fri, 13 Aug 2010 14:56:11 +0000 (10:56 -0400)]
Consolidate UI command submission to hooke.ui.UserInterface._submit_command().
Currently this just ensures standardized logging, but eventually it
will allow us to easily record command histories in a UI-agnostic way.
W. Trevor King [Fri, 13 Aug 2010 11:31:19 +0000 (07:31 -0400)]
Removed hooke.compat.forking since issue8534 can't be monkey patched.
You'll have to apply simonsteiner's issue8534 patch
http://bugs.python.org/file17092/forking.patch
to your Python's multiprocessing.forking by hand (on MS Windows). See
http://bugs.python.org/issue8534
http://docs.python.org/library/multiprocessing.html#windows
Here's what happens on Linux:
1) main program starts running
2) monkey patch applied
3) multiprocessing.Process() forks off the subprocess.
a) child process inherits parent's memory, getting all currently
imported libraries for free.
b) child process continues successful run.
4) main process continues successful run.
Here's what happens on MS Windows:
1) main program starts running
2) monkey patch applied
3) multiprocessing.Process() spawns subprocess, feeding its pickling
state to the child through the connecting socket.
a) child process starts, loading (unpatched) base Python libraries
to figure out what it should do.
b) child process starts reading pickled parent state.
c) child process attempts to find hooke to unpickle parent state.
d) child process cannot find hooke (with unpatched
multiprocessing) and dies.
4) main process dies from lack of child.
After applying simonsteiner's issue8534 patch, Windows looks like:
1) main program starts running
2) multiprocessing.Process() spawns subprocess, feeding its pickling
state to the child through the connecting socket.
a) child process starts, loading (patched) base Python libraries
to figure out what it should do.
b) child process starts reading pickled parent state.
c) child process attempts to find hooke to unpickle parent state.
d) child process loads hooke.
e) child process continues successful run.
3) main process continues successful run.
W. Trevor King [Fri, 13 Aug 2010 11:03:02 +0000 (07:03 -0400)]
Added log warnings on monkey patch imports
W. Trevor King [Fri, 13 Aug 2010 02:08:24 +0000 (22:08 -0400)]
Use the playlist's basename if it doesn't colide with earlier playlists.
W. Trevor King [Fri, 13 Aug 2010 01:55:38 +0000 (21:55 -0400)]
Remove PlaylistArgument from plugin.playlist.SaveCommand now that it's a PlaylistCommand
W. Trevor King [Fri, 13 Aug 2010 01:38:04 +0000 (21:38 -0400)]
Added hooke.plugin.playlist.ApplyCommandStack and related changes.
Highlights:
* Added test/apply_command_stack.py testing the new command.
* Added hooke.plugin.playlist.PlaylistCommand mirroring CurveCommand.
* Added hooke.plugin.playlist.AddingPlaylistCommand mirroring
ColumnAddingCommand.
* Renamed CommandStack._execute -> .execute_command since it may be
used externally.
* Changed assorted log messages to use CommandMessage string-ification.
* Set Hooke.engine to None in the UI process.
* Set ._index during NoteIndexList.items() iteration.
W. Trevor King [Thu, 12 Aug 2010 22:01:41 +0000 (18:01 -0400)]
Added nicer CommandMessage string-ification methods