/usr/share/pyshared/quantities/units/mass.py is in python-quantities 0.10.1-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 | # -*- coding: utf-8 -*-
"""
"""
from __future__ import absolute_import
from ..unitquantity import UnitQuantity, UnitMass
from .length import m
kg = kilogram = UnitMass(
'kilogram',
symbol='kg',
aliases=['kilograms']
)
g = gram = UnitMass(
'gram',
kg/1000,
symbol='g',
aliases=['grams']
)
mg = milligram = UnitMass(
'milligram',
gram/1000,
symbol='mg',
aliases=['milligrams']
)
oz = ounce = avoirdupois_ounce = UnitMass(
'ounce',
28.349523125*g,
symbol='oz',
aliases=['ounces','avoirdupois_ounce', 'avoirdupois_ounces'],
doc='exact'
)
lb = pound = avoirdupois_pound = UnitMass(
'pound',
0.45359237*kg,
symbol='lb',
aliases=['pounds', 'avoirdupois_pound', 'avoirdupois_pounds'],
doc='exact'
)
st = stone = UnitMass(
'stone',
14*lb,
symbol='st',
doc='As defined in the UK, 1 stone = 14 avoirdupois pounds'
)
carat = UnitMass(
'carat',
200*mg,
aliases=['carats']
)
gr = grain = UnitMass(
'grain',
64.79891*mg,
symbol='gr',
aliases=['grains']
)
long_hundredweight = UnitMass(
'long_hundredweight',
112*lb,
aliases=['long_hundredweights']
)
short_hundredweight = UnitMass(
'short_hundredweight',
100*lb,
aliases=['short_hundredweights']
) # cwt is used for both short and long hundredweight, so we wont use it
t = metric_ton = tonne = UnitMass(
'tonne',
1000*kg,
symbol='t',
aliases=['tonnes']
)
dwt = pennyweight = UnitMass(
'pennyweight',
24*gr,
symbol='dwt',
aliases=['pennyweights']
)
slug = slugs = UnitMass(
'slug',
14.59390*kg,
aliases=['slugs']
)
toz = troy_ounce = apounce = apothecary_ounce = UnitMass(
'troy_ounce',
480*gr,
symbol='toz',
u_symbol='℥',
aliases=[
'apounce', 'apounces', 'apothecary_ounce', 'apothecary_ounces',
'troy_ounces'
]
)
troy_pound = appound = apothecary_pound = UnitMass(
'troy_pound',
12*toz,
symbol='tlb',
u_symbol='℔',
aliases=[
'troy_pounds', 'appound', 'appounds', 'apothecary_pound',
'apothecary_pounds'
]
)
u = amu = atomic_mass_unit = dalton = Da = UnitMass(
'atomic_mass_unit',
1.660538782e-27*kg,
symbol='u',
aliases=['amu', 'Da', 'dalton'],
doc='relative uncertainty = 5e-8'
)
scruple = UnitMass(
'scruple',
20*gr,
u_symbol='℈',
aliases=['scruples']
)
dr = dram = UnitMass(
'dram',
oz/16,
symbol='dr',
aliases=['drams'],
doc='avoirdupois dram'
)
drachm = apdram = UnitMass(
'drachm',
60*gr,
u_symbol=' ',
aliases=['drachms', 'apdram', 'apdrams'],
doc='also known as the apothecary dram'
)
bag = UnitMass(
'bag',
94*lb,
aliases=['bags']
)
ton = short_ton = UnitMass(
'short_ton',
2000*lb,
aliases=['short_tons']
)
long_ton = UnitMass(
'long_ton', 2240*lb,
aliases=['long_tons']
) # both long and short tons are referred to as "ton" so we wont use it
############################################################
## Mass per unit length ##
############################################################
denier = UnitQuantity(
'denier',
g/(9000*m),
aliases=['deniers']
)
tex = UnitQuantity(
'tex',
g/(1000*m),
aliases=['texs']
)
dtex = UnitQuantity(
'dtex',
g/(10000*m),
aliases=['dtexs']
)
del UnitQuantity, m
|