kiv / Unum
Unum stands for 'unit-numbers'. It is a Python module that allows you to define and manipulate quantities with units attached such as 60 seconds, 500 watts, 42 miles-per-hour, 100 kg per square meter, 14400 bits per second, 30 dollars, and so on. Features include exceptions for incorrect use of units, automatic and manual conversion between compatible units, easy extension to arbitrary units, and integration with other arithmetic types including Numpy arrays and standard library types like complex and fractions.Fraction.
| commit 13: | 0a9a40ae2bca |
| parent 12: | a2f348945348 |
| branch: | default |
Update README file for new version.
5 months ago
Changed (Δ846 bytes):
raw changeset »
README.txt (40 lines added, 22 lines removed)
1 |
1 |
************************************************************************* |
2 |
2 |
* * |
3 |
* Unum 4. |
|
3 |
* Unum 4.1 * |
|
4 |
4 |
* Units in Python * |
5 |
5 |
* * |
6 |
6 |
* (c) 2000-2003 Pierre Denis * |
7 |
* (c) 2009 Chris MacLeod * |
|
7 |
8 |
* * |
8 |
9 |
************************************************************************* |
9 |
10 |
|
10 |
11 |
------------------------------------------------------------------------- |
11 |
* |
|
12 |
* Visible changes since Unum 4.0: |
|
12 |
13 |
------------------------------------------------------------------------- |
13 |
14 |
|
14 |
- platform : any (Unum is a pure Python package, hence the portablity |
|
15 |
is presumed to be high) |
|
16 |
- |
|
15 |
- To support Python 2.5 and higher, the method Unum.as was renamed to |
|
16 |
Unum.asUnit; this was necessary since "as" became a reserved word. |
|
17 |
If you are still using old versions of Python, both names are |
|
18 |
available. |
|
19 |
||
20 |
- In addition to unit names in uppercase, unit names in the correct case |
|
21 |
are now available. So, both "kg" and "KG" refer to the kilogram Unum, |
|
22 |
and both "eV" and "EV" refer to the electron volt Unum. |
|
23 |
||
24 |
- Value types are no longer automatically coerced to floats. This allows |
|
25 |
the fractions.Fraction standard library type to be used, but may |
|
26 |
introduce incompatibilities with old code from integer vs. floating |
|
27 |
point division. In Python 3.x there is no problem. |
|
17 |
28 |
|
18 |
29 |
------------------------------------------------------------------------- |
19 |
* |
|
30 |
* Prerequisites: |
|
20 |
31 |
------------------------------------------------------------------------- |
21 |
32 |
|
22 |
- unzip Unum installation files in <your-install-directory> |
|
23 |
- cd <your-install-directory>/Unum-4.0 |
|
33 |
- Python 2.2 or higher. Python 3.x should work as well, but please |
|
34 |
report any bugs. |
|
35 |
||
36 |
------------------------------------------------------------------------- |
|
37 |
* To install Unum: |
|
38 |
------------------------------------------------------------------------- |
|
39 |
||
40 |
- unzip Unum installation files to any directory. |
|
41 |
- cd <install-directory> |
|
24 |
42 |
- python setup.py install |
25 |
43 |
this will install Unum packages in your Python site-packages directory |
26 |
44 |
i.e. it will create the directory <python-site-packages-dir>/unum |
27 |
45 |
- if the installation is successful (see below), |
28 |
46 |
you can safely remove <your-install-directory> |
29 |
47 |
|
48 |
- alternately, if you have setuptools installed you can do: |
|
49 |
"easy_install unum" to obtain it online from PyPI. |
|
50 |
||
51 |
- On Windows you may need to do "python -m easy_install unum" instead. |
|
52 |
- On Linux you may need to do "sudo easy_install unum". |
|
53 |
||
30 |
54 |
------------------------------------------------------------------------- |
31 |
* To run the test cases |
|
55 |
* To run the test cases: |
|
32 |
56 |
------------------------------------------------------------------------- |
33 |
57 |
|
34 |
(usage : installation check-up, non-regression tests) |
|
35 |
- change directory to <python-site-packages-dir>/unum/tools |
|
36 |
- type the following: |
|
37 |
python test.py |
|
38 |
A couple of lines should report the results of the test cases |
|
39 |
Note : depending on your platform, some spurious errors may be |
|
40 |
reported due to numerical precision issues |
|
41 |
||
58 |
- cd <install-directory> |
|
59 |
- python setup.py test |
|
60 |
||
42 |
61 |
------------------------------------------------------------------------- |
43 |
62 |
* Other information : |
44 |
63 |
------------------------------------------------------------------------- |
45 |
64 |
|
46 |
- E-mail : pierre.denis@spacebel.be |
|
47 |
(for questions, comments, bug report, etc) |
|
48 |
||
49 |
- Unum site : http://home.tiscali.be/be052320/Unum.html |
|
50 |
|
|
65 |
- Website: http://bitbucket.org/kiv/unum/ |
|
66 |
- E-mail : ChrisM6794@gmail.com |
|
67 |
- Old site : http://home.tiscali.be/be052320/Unum.html |
|
68 |
(for a comprehensive tutorial, papers, etc.) |
|
51 |
69 |
|
52 |
70 |
|
53 |
71 |
========================================================================= |
