File: energy.py

package info (click to toggle)
python-measurement 3.2.2-2
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 332 kB
  • sloc: python: 1,402; makefile: 13
file content (23 lines) | stat: -rw-r--r-- 400 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
from measurement.base import MeasureBase


__all__ = [
    'Energy'
]


class Energy(MeasureBase):
    STANDARD_UNIT = 'J'
    UNITS = {
        'c': 4.18400,
        'C': 4184.0,
        'J': 1.0,
        'eV': 1.602177e-19,
        'tonne_tnt': 4184000000,
    }
    ALIAS = {
        'joule': 'J',
        'calorie': 'c',
        'Calorie': 'C',
    }
    SI_UNITS = ['J', 'c', 'eV', 'tonne_tnt']