Пример #1
0
    def test04_read_longdouble(self):
        dtype = "longdouble"
        if hasattr(tables, "Float96Atom") or hasattr(tables, "Float128Atom"):
            ds = getattr(self.h5file.root, dtype)
            self.assertFalse(isinstance(ds, tables.UnImplemented))
            self.assertEqual(ds.shape, (self.nrows, self.ncols))
            self.assertEqual(ds.dtype, dtype)
            self.assertTrue(
                common.allequal(ds.read(), self.values.astype(dtype)))

            if hasattr(tables, "Float96Atom"):
                self.assertEqual(ds.dtype, "float96")
            elif hasattr(tables, "Float128Atom"):
                self.assertEqual(ds.dtype, "float128")
        else:
            # XXX: check
            # the behavior depends on the HDF5 lib configuration
            try:
                with self.assertWarns(UserWarning):
                    ds = getattr(self.h5file.root, dtype)
                self.assertTrue(isinstance(ds, tables.UnImplemented))
            except AssertionError:
                from tables.utilsextension import _broken_hdf5_long_double
                if not _broken_hdf5_long_double():
                    ds = getattr(self.h5file.root, dtype)
                    self.assertEqual(ds.dtype, "float64")
Пример #2
0
    def test04_read_longdouble(self):
        dtype = "longdouble"
        if "Float96Atom" in globals() or "Float128Atom" in globals():
            ds = getattr(self.fileh.root, dtype)
            self.assertFalse(isinstance(ds, UnImplemented))
            self.assertEqual(ds.shape, (self.nrows, self.ncols))
            self.assertEqual(ds.dtype, dtype)
            self.assertTrue(common.allequal(
                ds.read(), self.values.astype(dtype)))

            if "Float96Atom" in globals():
                self.assertEqual(ds.dtype, "float96")
            elif "Float128Atom" in globals():
                self.assertEqual(ds.dtype, "float128")
        else:
            # XXX: check
            # the behavior depends on the HDF5 lib configuration
            try:
                ds = self.assertWarns(UserWarning,
                                      getattr, self.fileh.root, dtype)
                self.assertTrue(isinstance(ds, UnImplemented))
            except AssertionError:
                from tables.utilsextension import _broken_hdf5_long_double
                if not _broken_hdf5_long_double():
                    ds = getattr(self.fileh.root, dtype)
                    self.assertEqual(ds.dtype, "float64")
Пример #3
0
    'copyFile',
    'openFile',
    'print_versions',
    'test',
    'split_type',
    'restrict_flavors',
    'setBloscMaxThreads',
    'silenceHDF5Messages',
]

if 'Float16Atom' in locals():
    # float16 is new in numpy 1.6.0
    __all__.extend(('Float16Atom', 'Float16Col'))

from tables.utilsextension import _broken_hdf5_long_double
if not _broken_hdf5_long_double():
    if 'Float96Atom' in locals():
        __all__.extend(('Float96Atom', 'Float96Col'))
        __all__.extend(('Complex192Atom', 'Complex192Col'))  # XXX check

    if 'Float128Atom' in locals():
        __all__.extend(('Float128Atom', 'Float128Col'))
        __all__.extend(('Complex256Atom', 'Complex256Col'))  # XXX check

else:

    from tables import atom as _atom
    from tables import description as _description
    try:
        del _atom.Float96Atom, _atom.Complex192Col
        del _description.Float96Col, _description.Complex192Col
Пример #4
0
    #
    # Pending deprecation!!!
    #
    'isHDF5File', 'isPyTablesFile', 'whichLibVersion',
    'copyFile', 'openFile', 'print_versions', 'test',
    'split_type', 'restrict_flavors', 'setBloscMaxThreads',
    'silenceHDF5Messages',
]

if 'Float16Atom' in locals():
    # float16 is new in numpy 1.6.0
    __all__.extend(('Float16Atom', 'Float16Col'))


from tables.utilsextension import _broken_hdf5_long_double
if not _broken_hdf5_long_double():
    if 'Float96Atom' in locals():
        __all__.extend(('Float96Atom', 'Float96Col'))
        __all__.extend(('Complex192Atom', 'Complex192Col'))    # XXX check

    if 'Float128Atom' in locals():
        __all__.extend(('Float128Atom', 'Float128Col'))
        __all__.extend(('Complex256Atom', 'Complex256Col'))    # XXX check

else:

    from tables import atom as _atom
    from tables import description as _description
    try:
        del _atom.Float96Atom, _atom.Complex192Col
        del _description.Float96Col, _description.Complex192Col