Example #1
0
 def __init__(self, clevel=5, shuffle=True, cname="blosclz"):
     if not isinstance(clevel, int):
         raise ValueError("`clevel` must an int.")
     if not isinstance(shuffle, (bool, int)):
         raise ValueError("`shuffle` must a boolean.")
     shuffle = bool(shuffle)
     if clevel < 0:
         raise ValueError("clevel must be a positive integer")
     self._clevel = clevel
     self._shuffle = shuffle
     list_cnames = blosc_compressor_list()
     # Store the cname as bytes object internally
     if hasattr(cname, 'encode'):
         cname = cname.encode()
     if cname not in list_cnames:
         raise ValueError(
             "Compressor '%s' is not available in this build" % cname)
     self._cname = cname
Example #2
0
def print_versions():
    """Print all the versions of software that BLZ relies on."""
    print("-=" * 38)
    print("BLZ version:       %s" % blz.__version__)
    print("NumPy version:     %s" % numpy.__version__)
    tinfo = blz.blosc_version()
    blosc_cnames = blz.blosc_compressor_list()
    print("Blosc version:     %s (%s)" % (tinfo[0], tinfo[1]))
    print("Blosc compressors: %s" % (blosc_cnames,))
    if blz.numexpr_here:
        print("Numexpr version:   %s" % blz.numexpr.__version__)
    else:
        print("Numexpr version:   not available "
              "(version >= %s not detected)" %  blz.min_numexpr_version)
    print("Python version:    %s" % sys.version)
    if os.name == "posix":
        (sysname, nodename, release, version, machine) = os.uname()
        print("Platform:          %s-%s" % (sys.platform, machine))
    print("Byte-ordering:     %s" % sys.byteorder)
    print("Detected cores:    %s" % blz.detect_number_of_cores())
    print("-=" * 38)