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:
3
.gitignore
vendored
3
.gitignore
vendored
@@ -12,3 +12,6 @@ MANIFEST
|
|||||||
|
|
||||||
# WebDAV file system cache files
|
# WebDAV file system cache files
|
||||||
.DAV/
|
.DAV/
|
||||||
|
|
||||||
|
# tags files (from ctags)
|
||||||
|
tags
|
||||||
|
|||||||
@@ -72,6 +72,10 @@ cmil = 5.067075e-10 * m ** 2 = circular_mils
|
|||||||
darcy = 9.869233e-13 * m ** 2
|
darcy = 9.869233e-13 * m ** 2
|
||||||
hectare = 100 * are = ha
|
hectare = 100 * are = ha
|
||||||
|
|
||||||
|
# Concentration
|
||||||
|
[concentration] = [substance] / [volume]
|
||||||
|
molar = mol / (1e-3 * m ** 3) = M
|
||||||
|
|
||||||
# EM
|
# EM
|
||||||
esu = 1 * erg**0.5 * centimeter**0.5 = statcoulombs = statC = franklin = Fr
|
esu = 1 * erg**0.5 * centimeter**0.5 = statcoulombs = statC = franklin = Fr
|
||||||
esu_per_second = 1 * esu / second = statampere
|
esu_per_second = 1 * esu / second = statampere
|
||||||
|
|||||||
@@ -39,7 +39,6 @@ class TestIssues(QuantityTestCase):
|
|||||||
|
|
||||||
def test_issue29(self):
|
def test_issue29(self):
|
||||||
ureg = UnitRegistry()
|
ureg = UnitRegistry()
|
||||||
ureg.define('molar = mole / liter = M')
|
|
||||||
t = 4 * ureg('mM')
|
t = 4 * ureg('mM')
|
||||||
self.assertEqual(t.magnitude, 4)
|
self.assertEqual(t.magnitude, 4)
|
||||||
self.assertEqual(t._units, UnitsContainer(millimolar=1))
|
self.assertEqual(t._units, UnitsContainer(millimolar=1))
|
||||||
|
|||||||
Reference in New Issue
Block a user