Log a useful error message when trying to dump and invalid value.
[h5config.git] / README
1 H5config
2 ========
3
4 H5config is a Python package for conviniently saving and loading
5 configuration classes from disk.  After populating base configuration
6 classes with parameters, h5config automatically generates HDF5 and
7 YAML backends for saving and loading that class.  Yes, all this
8 information could go into a single database, but if you like the
9 flexibility of having a bunch of individual files that you can peek
10 into one at a time, this module is for you.
11
12 I wrote the module to support my experiment-control infrastructure,
13 and one of the key goals was to easily embed control parameters in the
14 saved data::
15
16   experiment.h5
17   |-- raw/
18   |   |-- thermocouple: [32757, 32731, 32796, 32789, 32809, ...]
19   |   `-- deflection: [29808, 29793, 29782, 29817, 29775, ...]
20   |-- timeseries-config/
21   |   |-- frequency: 0.1
22   |   |-- run-time: 100
23   |   |-- thermocouple-channel/
24   |   |   |-- conversion-coefficients: [-10.0, 0.000305180437934]
25   |   |   `-- conversion-origin: [0.0]
26   |   |-- deflection-channel/
27   |   |   |-- conversion-coefficients: [-10.0, 0.000305180437934]
28   |   |   `-- conversion-origin: [0.0]
29   |   `-- thermocouple-calibration: [25.08355e3, 7.860106e4]
30   `-- environment-config/
31       |-- temperature: 20
32       `-- timestamp: 1311851980.750180
33
34 Storing all of the calibration and conversion factors can get
35 complicated quickly.  h5config will keep you organized, and allow you
36 to focus on defining the config options without getting bogged down in
37 the bookkeeping.
38
39 As a side effect, h5config also provides some tools to support system-
40 and user-wide configuration files.  For example, the pypiezo_ package
41 uses h5config to automatically detect and load the following config
42 file::
43
44   $ cat ~/.pypiezorc.yaml
45   log-level: debug
46   matplotlib: no
47
48
49 Installation
50 ============
51
52 Packages
53 --------
54
55 Gentoo
56 ~~~~~~
57
58 I've packaged h5config for Gentoo.  You need layman_ and my `wtk
59 overlay`_.  Install with::
60
61     # emerge -av app-portage/layman
62     # layman --add wtk
63     # emerge -av dev-python/h5config
64
65
66 Dependencies
67 ------------
68
69 If you're installing by hand or packaging h5config for another
70 distribution, you'll need the following dependencies:
71
72 ===========  =================  =====================
73 Package      Debian_            Gentoo_
74 ===========  =================  =====================
75 H5Py_        python-h5py        dev-python/h5py
76 Nose_        python-nose        dev-python/nose
77 PyYAML_      python-pyyaml      dev-python/pyyaml
78 ===========  =================  =====================
79
80
81 Installing by hand
82 ------------------
83
84 H5config is available as a Git_ repository::
85
86     $ git clone http://physics.drexel.edu/~wking/code/git/h5config.git
87
88 See the homepage_ for details.  To install the checkout, run the
89 standard::
90
91     $ python setup.py install
92
93
94 Usage
95 =====
96
97 See the module docstrings for simple examples.
98
99
100 Testing
101 =======
102
103 Run internal unit tests with::
104
105     $ nosetests --with-doctest --doctest-tests h5config
106
107
108 Licence
109 =======
110
111 This project is distributed under the `GNU General Public License
112 Version 3`_ or greater.
113
114
115 Author
116 ======
117
118 W. Trevor King
119 wking@drexel.edu
120 Copyright 2011
121
122
123 .. _pypiezo: 
124      http://physics.drexel.edu/~wking/unfolding-disasters/posts/pypiezo/
125 .. _layman: http://layman.sourceforge.net/
126 .. _wtk overlay:
127      http://physics.drexel.edu/~wking/unfolding-disasters/posts/Gentoo_overlay
128 .. _Debian: http://www.debian.org/
129 .. _Gentoo: http://www.gentoo.org/
130 .. _H5Py: http://code.google.com/p/h5py/
131 .. _Nose: http://somethingaboutorange.com/mrl/projects/nose/
132 .. _PyYAML: http://pyyaml.org/wiki/PyYAML
133 .. _Git: http://git-scm.com/
134 .. _homepage:
135      http://physics.drexel.edu/~wking/unfolding-disasters/posts/h5config/
136 .. _GNU General Public License Version 3: http://www.gnu.org/licenses/gpl.txt