Ejemplo n.º 1
0
 def test_cnames_get(self):
     cfg = h5.get_config()
     self.assertEqual(cfg.complex_names, ('r', 'i'))
Ejemplo n.º 2
0
 def test_cnames_set(self):
     self.addCleanup(fixnames)
     cfg = h5.get_config()
     cfg.complex_names = ('q', 'x')
     self.assertEqual(cfg.complex_names, ('q', 'x'))
Ejemplo n.º 3
0
def fixnames():
    cfg = h5.get_config()
    cfg.complex_names = ('r', 'i')
Ejemplo n.º 4
0
 def test_config(self):
     cfg = h5.get_config()
     self.assertIsInstance(cfg, h5.H5PYConfig)
     cfg2 = h5.get_config()
     self.assertIs(cfg, cfg2)
Ejemplo n.º 5
0
Archivo: common.py Proyecto: minrk/h5py
def api_16(func):
    """Decorator to run test under HDF5 1.6 only"""
    if not h5.get_config().API_18:
        return func
    return None
Ejemplo n.º 6
0
 def test_cnames_get(self):
     cfg = h5.get_config()
     self.assertEqual(cfg.complex_names, ("r", "i"))
Ejemplo n.º 7
0
 def test_cnames_get(self):
     cfg = h5.get_config()
     self.assertEqual(cfg.complex_names, ('r','i'))
Ejemplo n.º 8
0
#
# Copyright 2008-2013 Andrew Collette and contributors
#
# License:  Standard 3-clause BSD; see "license.txt" for full license terms
#           and contributor agreement.

import weakref
import sys
import os

from .base import HLObject, py3, phil, with_phil
from .group import Group
from h5py import h5, h5f, h5p, h5i, h5fd, h5t, _objects
from h5py import version

mpi = h5.get_config().mpi
hdf5_version = version.hdf5_version_tuple[0:3]

if mpi:
    import mpi4py

libver_dict = {'earliest': h5f.LIBVER_EARLIEST, 'latest': h5f.LIBVER_LATEST}
libver_dict_r = dict((y, x) for x, y in libver_dict.iteritems())


def make_fapl(driver, libver, **kwds):
    """ Set up a file access property list """
    plist = h5p.create(h5p.FILE_ACCESS)

    if libver is not None:
        if libver in libver_dict:
Ejemplo n.º 9
0
def fixnames():
    cfg = h5.get_config()
    cfg.complex_names = ('r','i')
Ejemplo n.º 10
0
 def test_config(self):
     cfg = h5.get_config()
     self.assertIsInstance(cfg, h5.H5PYConfig)
     cfg2 = h5.get_config()
     self.assertIs(cfg, cfg2)
Ejemplo n.º 11
0
def api_16(func):
    """Decorator to run test under HDF5 1.6 only"""
    if not h5.get_config().API_18:
        return func
    return None
Ejemplo n.º 12
0
def api_18(func):
    """Decorator to enable 1.8.X-only API functions"""
    if h5.get_config().API_18:
        return func
    return None
Ejemplo n.º 13
0
 def test_cnames_set_exc(self):
     self.addCleanup(fixnames)
     cfg = h5.get_config()
     with self.assertRaises(TypeError):
         cfg.complex_names = ("q", "i", "v")
     self.assertEqual(cfg.complex_names, ("r", "i"))
Ejemplo n.º 14
0
 def test_cnames_set_exc(self):
     self.addCleanup(fixnames)
     cfg = h5.get_config()
     with self.assertRaises(TypeError):
         cfg.complex_names = ('q', 'i', 'v')
     self.assertEqual(cfg.complex_names, ('r', 'i'))
Ejemplo n.º 15
0
 def test_cnames_set(self):
     self.addCleanup(fixnames)
     cfg = h5.get_config()
     cfg.complex_names = ('q','x')
     self.assertEqual(cfg.complex_names, ('q','x'))
Ejemplo n.º 16
0
 def test_repr(self):
     cfg = h5.get_config()
     repr(cfg)
Ejemplo n.º 17
0
 def test_cnames_set_exc(self):
     self.addCleanup(fixnames)
     cfg = h5.get_config()
     with self.assertRaises(TypeError):
         cfg.complex_names = ('q','i','v')
     self.assertEqual(cfg.complex_names, ('r','i'))
Ejemplo n.º 18
0
Archivo: common.py Proyecto: minrk/h5py
def api_18(func):
    """Decorator to enable 1.8.X-only API functions"""
    if h5.get_config().API_18:
        return func
    return None
Ejemplo n.º 19
0
 def test_repr(self):
     cfg = h5.get_config()
     repr(cfg)
Ejemplo n.º 20
0
#
# Copyright 2008-2013 Andrew Collette and contributors
#
# License:  Standard 3-clause BSD; see "license.txt" for full license terms
#           and contributor agreement.

import weakref
import sys
import os

from .base import HLObject, py3
from .group import Group
from h5py import h5, h5f, h5p, h5i, h5fd, h5t, _objects
from h5py import version

mpi = h5.get_config().mpi
hdf5_version = version.hdf5_version_tuple[0:3]

if mpi:
    import mpi4py

libver_dict = {"earliest": h5f.LIBVER_EARLIEST, "latest": h5f.LIBVER_LATEST}
libver_dict_r = dict((y, x) for x, y in libver_dict.items())


def make_fapl(driver, libver, **kwds):
    """ Set up a file access property list """
    plist = h5p.create(h5p.FILE_ACCESS)
    plist.set_fclose_degree(h5f.CLOSE_STRONG)

    if libver is not None:
Ejemplo n.º 21
0
def fixnames():
    cfg = h5.get_config()
    cfg.complex_names = ("r", "i")