File: _utils.py

package info (click to toggle)
python-quantities 0.13.0-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 852 kB
  • sloc: python: 9,353; makefile: 72; sh: 3
file content (13 lines) | stat: -rw-r--r-- 402 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
from ._codata import physical_constants
from quantities.quantity import Quantity
from quantities.uncertainquantity import UncertainQuantity


def _cd(name):
    entry = physical_constants[name]
    if False: #entry['precision']:
        return UncertainQuantity(
            entry['value'], entry['units'], entry['precision']
        )
    else:
        return Quantity(entry['value'], entry['units'])