Example #1
0
 def test_cnames_get(self):
     cfg = h5.get_config()
     self.assertEqual(cfg.complex_names, ('r', 'i'))
Example #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'))
Example #3
0
def fixnames():
    cfg = h5.get_config()
    cfg.complex_names = ('r', 'i')
Example #4
0
 def test_config(self):
     cfg = h5.get_config()
     self.assertIsInstance(cfg, h5.H5PYConfig)
     cfg2 = h5.get_config()
     self.assertIs(cfg, cfg2)
Example #5
0
File: common.py Project: 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
Example #6
0
 def test_cnames_get(self):
     cfg = h5.get_config()
     self.assertEqual(cfg.complex_names, ("r", "i"))
Example #7
0
 def test_cnames_get(self):
     cfg = h5.get_config()
     self.assertEqual(cfg.complex_names, ('r','i'))
Example #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:
Example #9
0
def fixnames():
    cfg = h5.get_config()
    cfg.complex_names = ('r','i')
Example #10
0
 def test_config(self):
     cfg = h5.get_config()
     self.assertIsInstance(cfg, h5.H5PYConfig)
     cfg2 = h5.get_config()
     self.assertIs(cfg, cfg2)
Example #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
Example #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
Example #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"))
Example #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'))
Example #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'))
Example #16
0
 def test_repr(self):
     cfg = h5.get_config()
     repr(cfg)
Example #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'))
Example #18
0
File: common.py Project: 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
Example #19
0
 def test_repr(self):
     cfg = h5.get_config()
     repr(cfg)
Example #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:
Example #21
0
def fixnames():
    cfg = h5.get_config()
    cfg.complex_names = ("r", "i")