Did I find the right examples for you? yes no

All Samples(17)  |  Call(13)  |  Derive(0)  |  Import(4)

src/p/y/pyHMSA-0.1/pyhmsa/fileformat/xmlhandler/xmlhandler.py   pyHMSA(Download)
# Local modules.
from pyhmsa.type.numerical import convert_value
from pyhmsa.type.language import langstr
from pyhmsa.type.checksum import Checksum
        unit = element.get('Unit')
        return convert_value(value, unit)
    def _parse_text_attribute(self, element, attrib=None):

src/p/y/pyHMSA-0.1/pyhmsa/util/parameter.py   pyHMSA(Download)
# Local modules.
from pyhmsa.type.numerical import convert_value
from pyhmsa.type.unit import validate_unit
from pyhmsa.type.checksum import Checksum
            unit = self.default_unit
        return convert_value(value, unit)
    def _new(self, cls, clsname, bases, methods, name):

src/p/y/pyHMSA-0.1/pyhmsa/spec/condition/composition.py   pyHMSA(Download)
from pyhmsa.util.parameter import ParameterMetaclass, UnitAttribute
from pyhmsa.spec.condition.condition import _Condition
from pyhmsa.type.numerical import convert_value
from pyhmsa.util.element_properties import get_symbol, get_atomic_number
        if key > 118:
            raise ValueError('Atomic number cannot be greater than Uuo')
        self._data[np.uint8(key)] = convert_value(item)
    def __delitem__(self, key):

src/p/y/pyHMSA-0.1/pyhmsa/type/test_numerical.py   pyHMSA(Download)
# Local modules.
from pyhmsa.type.numerical import convert_value, validate_dtype, convert_unit
# Globals and constants variables.
    def testconvert_value(self):
        # Numerical value
        x = convert_value(5.0, 's')
        self.assertAlmostEqual(5.0, x, 4)
        self.assertEqual('s', x.unit)
        x = convert_value(None, 'ms')
        x = convert_value([5.0, 6.0, 7.0], 'A')
        self.assertEqual('A', x.unit)
        x = convert_value(x)
        self.assertEqual(3, len(x))
        self.assertAlmostEqual(5.0, x[0], 4)