Added [concentration] quantity, molar units, modified a test that had defined molar units locally, and added tags files to the .gitignore.

This commit is contained in:
Matthew McDermott 2017-06-08 13:24:21 -04:00
parent 240349f2ee
commit b2bccc153d
3 changed files with 8 additions and 2 deletions

3
.gitignore vendored
View File

@ -12,3 +12,6 @@ MANIFEST
# WebDAV file system cache files
.DAV/
# tags files (from ctags)
tags

View File

@ -72,6 +72,10 @@ cmil = 5.067075e-10 * m ** 2 = circular_mils
darcy = 9.869233e-13 * m ** 2
hectare = 100 * are = ha
# Concentration
[concentration] = [substance] / [volume]
molar = mol / (1e-3 * m ** 3) = M
# EM
esu = 1 * erg**0.5 * centimeter**0.5 = statcoulombs = statC = franklin = Fr
esu_per_second = 1 * esu / second = statampere

View File

@ -39,7 +39,6 @@ class TestIssues(QuantityTestCase):
def test_issue29(self):
ureg = UnitRegistry()
ureg.define('molar = mole / liter = M')
t = 4 * ureg('mM')
self.assertEqual(t.magnitude, 4)
self.assertEqual(t._units, UnitsContainer(millimolar=1))
@ -561,4 +560,4 @@ class TestIssuesNP(QuantityTestCase):
a = np.asarray([1, 2, 3])
q = [1, 2, 3] * ureg.dimensionless
p = (q ** q).m
np.testing.assert_array_equal(p, a ** a)
np.testing.assert_array_equal(p, a ** a)