maps

Maps from one value system to another

np_to_python = {<class 'numpy.bool_'>: <class 'bool'>, <class 'numpy.bytes_'>: <class 'str'>, <class 'numpy.character'>: <class 'str'>, <class 'numpy.clongdouble'>: <class 'complex'>, <class 'numpy.complex128'>: <class 'complex'>, <class 'numpy.complex64'>: <class 'complex'>, <class 'numpy.complexfloating'>: <class 'complex'>, <class 'numpy.datetime64'>: <class 'datetime.datetime'>, <class 'numpy.float16'>: <class 'float'>, <class 'numpy.float32'>: <class 'float'>, <class 'numpy.float64'>: <class 'float'>, <class 'numpy.int16'>: <class 'int'>, <class 'numpy.int32'>: <class 'int'>, <class 'numpy.int64'>: <class 'int'>, <class 'numpy.int8'>: <class 'int'>, <class 'numpy.integer'>: <class 'int'>, <class 'numpy.number'>: <class 'float'>, <class 'numpy.object_'>: typing.Any, <class 'numpy.str_'>: <class 'str'>, <class 'numpy.uint16'>: <class 'int'>, <class 'numpy.uint32'>: <class 'int'>, <class 'numpy.uint64'>: <class 'int'>, <class 'numpy.uint8'>: <class 'int'>, typing.Any: typing.Any}

Map from python types to numpy

flat_to_nptyping = {'AnyType': 'Any', 'ascii': 'String', 'bool': 'Bool', 'double': 'Double', 'float': 'Float', 'float32': 'Float32', 'float64': 'Float64', 'int': 'Int', 'int16': 'Int16', 'int32': 'Int32', 'int64': 'Int64', 'int8': 'Int8', 'isodatetime': 'Datetime64', 'long': 'LongLong', 'numeric': 'Number', 'object': 'Object', 'short': 'Short', 'str': 'Unicode', 'string': 'Unicode', 'text': 'String', 'uint': 'UInt', 'uint16': 'UInt16', 'uint32': 'UInt32', 'uint64': 'UInt64', 'uint8': 'UInt8', 'utf': 'Unicode', 'utf8': 'Unicode', 'utf_8': 'Unicode'}

Map from NWB-style flat dtypes to nptyping types

python_to_nptyping = {<class 'bool'>: <class 'numpy.bool_'>, <class 'complex'>: (<class 'numpy.complex128'>, <class 'numpy.complexfloating'>, <class 'numpy.complex64'>, <class 'numpy.complex128'>, <class 'numpy.complex64'>, <class 'numpy.complex64'>, <class 'numpy.complex128'>, <class 'numpy.complex128'>, <class 'numpy.clongdouble'>, <class 'numpy.clongdouble'>), <class 'float'>: (<class 'numpy.float64'>, <class 'numpy.float16'>, <class 'numpy.float32'>, <class 'numpy.float64'>, <class 'numpy.float32'>, <class 'numpy.float64'>), <class 'int'>: (<class 'numpy.int8'>, <class 'numpy.int16'>, <class 'numpy.int32'>, <class 'numpy.int64'>, <class 'numpy.int16'>, <class 'numpy.uint8'>, <class 'numpy.uint16'>, <class 'numpy.uint32'>, <class 'numpy.uint64'>, <class 'numpy.uint16'>), <class 'str'>: <class 'numpy.bytes_'>}

Map from python types to nptyping types