We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 635c0b4 commit 20beeaaCopy full SHA for 20beeaa
quantities/constants/constants.py
@@ -4,13 +4,16 @@
4
5
import math as _math
6
from .codata import physical_constants as _pc
7
-from quantities.quantity import Quantity
+from quantities.quantity import Quantity, UncertainQuantity
8
9
def _cd(name):
10
entry = _pc[name]
11
- q = Quantity(entry['value'], entry['units'], 'd')
12
- q.precision = entry['precision']
13
- return q
+ if entry['precision']:
+ return UncertainQuantity(
+ entry['value'], entry['units'], entry['precision']
14
+ )
15
+ else:
16
+ return Quantity(entry['value'], entry['units'])
17
18
#mathematical constants
19
pi = _math.pi
0 commit comments