Ejemplo n.º 1
0
def print_versions():
    """Print all the versions of software that PyTables relies on."""
    print '-=' * 38
    print "PyTables version:  %s" % tables.__version__
    print "HDF5 version:      %s" % tables.whichLibVersion("hdf5")[1]
    print "NumPy version:     %s" % numpy.__version__
    tinfo = tables.whichLibVersion("zlib")
    if numexpr.use_vml:
        # Get only the main version number and strip out all the rest
        vml_version = numexpr.get_vml_version()
        vml_version = re.findall("[0-9.]+", vml_version)[0]
        vml_avail = "using VML/MKL %s" % vml_version
    else:
        vml_avail = "not using Intel's VML/MKL"
    print "Numexpr version:   %s (%s)" % (numexpr.__version__, vml_avail)
    if tinfo is not None:
        print "Zlib version:      %s (%s)" % (tinfo[1],
                                              "in Python interpreter")
    tinfo = tables.whichLibVersion("lzo")
    if tinfo is not None:
        print "LZO version:       %s (%s)" % (tinfo[1], tinfo[2])
    tinfo = tables.whichLibVersion("bzip2")
    if tinfo is not None:
        print "BZIP2 version:     %s (%s)" % (tinfo[1], tinfo[2])
    tinfo = tables.whichLibVersion("blosc")
    if tinfo is not None:
        blosc_date = tinfo[2].split()[1]
        print "Blosc version:     %s (%s)" % (tinfo[1], blosc_date)
    try:
        from Cython.Compiler.Main import Version as Cython_Version
        print 'Cython version:    %s' % Cython_Version.version
    except:
        pass
    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' % detectNumberOfCores()
    print '-=' * 38
Ejemplo n.º 2
0
def print_versions():
    """Print all the versions of software that PyTables relies on."""
    print "-=" * 38
    print "PyTables version:  %s" % tables.__version__
    print "HDF5 version:      %s" % tables.whichLibVersion("hdf5")[1]
    print "NumPy version:     %s" % numpy.__version__
    tinfo = tables.whichLibVersion("zlib")
    if numexpr.use_vml:
        # Get only the main version number and strip out all the rest
        vml_version = numexpr.get_vml_version()
        vml_version = re.findall("[0-9.]+", vml_version)[0]
        vml_avail = "using VML/MKL %s" % vml_version
    else:
        vml_avail = "not using Intel's VML/MKL"
    print "Numexpr version:   %s (%s)" % (numexpr.__version__, vml_avail)
    if tinfo is not None:
        print "Zlib version:      %s (%s)" % (tinfo[1], "in Python interpreter")
    tinfo = tables.whichLibVersion("lzo")
    if tinfo is not None:
        print "LZO version:       %s (%s)" % (tinfo[1], tinfo[2])
    tinfo = tables.whichLibVersion("bzip2")
    if tinfo is not None:
        print "BZIP2 version:     %s (%s)" % (tinfo[1], tinfo[2])
    tinfo = tables.whichLibVersion("blosc")
    blosc_date = tinfo[2].split()[1]
    if tinfo is not None:
        print "Blosc version:     %s (%s)" % (tinfo[1], blosc_date)
    try:
        from Cython.Compiler.Main import Version as Cython_Version

        print "Cython version:    %s" % Cython_Version.version
    except:
        pass
    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" % detectNumberOfCores()
    print "-=" * 38
Ejemplo n.º 3
0
def print_versions():
    """Print all the versions of software that PyTables relies on."""
    print "-=" * 38
    print "PyTables version:  %s" % tables.__version__
    print "HDF5 version:      %s" % tables.whichLibVersion("hdf5")[1]
    # print "HDF5 version:      %s" % tables.hdf5Version
    print "NumPy version:     %s" % numpy.__version__
    # print "Zlib version:      %s" % tables.whichLibVersion("zlib")[1]
    tinfo = tables.whichLibVersion("zlib")
    if tinfo is not None:
        print "Zlib version:      %s" % (tinfo[1])
    tinfo = tables.whichLibVersion("lzo")
    if tinfo is not None:
        print "LZO version:       %s (%s)" % (tinfo[1], tinfo[2])
    tinfo = tables.whichLibVersion("bzip2")
    if tinfo is not None:
        print "BZIP2 version:     %s (%s)" % (tinfo[1], tinfo[2])
    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 "-=" * 38
Ejemplo n.º 4
0
def print_versions():
    """Print all the versions of software that PyTables relies on."""
    print '-=' * 38
    print "PyTables version:  %s" % tables.__version__
    print "HDF5 version:      %s" % tables.whichLibVersion("hdf5")[1]
    #print "HDF5 version:      %s" % tables.hdf5Version
    print "NumPy version:     %s" % numpy.__version__
    #print "Zlib version:      %s" % tables.whichLibVersion("zlib")[1]
    tinfo = tables.whichLibVersion("zlib")
    if tinfo is not None:
        print "Zlib version:      %s" % (tinfo[1])
    tinfo = tables.whichLibVersion("lzo")
    if tinfo is not None:
        print "LZO version:       %s (%s)" % (tinfo[1], tinfo[2])
    tinfo = tables.whichLibVersion("bzip2")
    if tinfo is not None:
        print "BZIP2 version:     %s (%s)" % (tinfo[1], tinfo[2])
    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 '-=' * 38
Ejemplo n.º 5
0
    print_versions()
    print_heavy(heavy)

    # What a context this is!
    oldverbose, common.verbose = common.verbose, verbose
    oldheavy, common.heavy = common.heavy, heavy
    try:
        unittest.TextTestRunner().run(suite())
    finally:
        common.verbose = oldverbose
        common.heavy = oldheavy  # there are pretty young heavies, too ;)


if __name__ == "__main__":

    hdf5_version = get_tuple_version(tables.whichLibVersion("hdf5")[0])
    if hdf5_version < min_hdf5_version:
        print "*Warning*: HDF5 version is lower than recommended: %s < %s" % (hdf5_version, min_hdf5_version)

    if numpy.__version__ < min_numpy_version:
        print "*Warning*: NumPy version is lower than recommended: %s < %s" % (numpy.__version__, min_numpy_version)

    # Handle some global flags (i.e. only useful for test_all.py)
    only_versions = 0
    args = sys.argv[:]
    for arg in args:
        # Remove 'show-versions' for PyTables 2.3 or higher
        if arg in ["--print-versions", "--show-versions"]:
            only_versions = True
            sys.argv.remove(arg)
        elif arg == "--show-memory":
Ejemplo n.º 6
0
    print_versions()
    print_heavy(heavy)

    # What a context this is!
    oldverbose, common.verbose = common.verbose, verbose
    oldheavy, common.heavy = common.heavy, heavy
    try:
        unittest.TextTestRunner().run(suite())
    finally:
        common.verbose = oldverbose
        common.heavy = oldheavy  # there are pretty young heavies, too ;)


if __name__ == "__main__":

    hdf5_version = tables.whichLibVersion("hdf5")[1]
    if hdf5_version < minimum_hdf5_version:
        print "*Warning*: HDF5 version is lower than recommended: %s < %s" % (hdf5_version, minimum_hdf5_version)

    if numpy.__version__ < minimum_numpy_version:
        print "*Warning*: NumPy version is lower than recommended: %s < %s" % (numpy.__version__, minimum_numpy_version)

    # Handle some global flags (i.e. only useful for test_all.py)
    only_versions = 0
    args = sys.argv[:]
    for arg in args:
        if arg == "--show-versions":
            only_versions = True
            sys.argv.remove(arg)
        elif arg == "--show-memory":
            common.show_memory = True
Ejemplo n.º 7
0
    oldverbose, common.verbose = common.verbose, verbose
    oldheavy, common.heavy = common.heavy, heavy
    try:
        result = unittest.TextTestRunner().run(suite())
        if result.wasSuccessful():
            return 0
        else:
            return 1
    finally:
        common.verbose = oldverbose
        common.heavy = oldheavy  # there are pretty young heavies, too ;)


if __name__ == '__main__':

    hdf5_version = get_tuple_version(tables.whichLibVersion("hdf5")[0])
    if hdf5_version < min_hdf5_version:
        print "*Warning*: HDF5 version is lower than recommended: %s < %s" % \
              (hdf5_version, min_hdf5_version)

    if numpy.__version__ < min_numpy_version:
        print "*Warning*: NumPy version is lower than recommended: %s < %s" % \
              (numpy.__version__, min_numpy_version)

    # Handle some global flags (i.e. only useful for test_all.py)
    only_versions = 0
    args = sys.argv[:]
    for arg in args:
        # Remove 'show-versions' for PyTables 2.3 or higher
        if arg in ['--print-versions', '--show-versions']:
            only_versions = True
Ejemplo n.º 8
0
Archivo: poly.py Proyecto: 87/PyTables
    f.close()
    print_filesize(h5fname, clib, clevel)


if __name__ == '__main__':

    tb.print_versions()

    print "Total size for datasets:", round(2*N*dtype.itemsize/MB, 1), "MB"

    # Get the compression libraries supported
    #supported_clibs = [clib for clib in ("zlib", "lzo", "bzip2", "blosc")
    #supported_clibs = [clib for clib in ("zlib", "lzo", "blosc")
    supported_clibs = [clib for clib in ("blosc",)
                       if tb.whichLibVersion(clib)]

    # Initialization code
    #for what in ["numpy", "numpy.memmap", "numexpr"]:
    for what in ["numpy", "numexpr"]:
        #break
        print "Populating x using %s with %d points..." % (what, N)
        t0 = time()
        if what == "numpy":
            populate_x_numpy()
            compute = compute_numpy
        elif what == "numexpr":
            populate_x_numpy()
            compute = compute_numexpr
        elif what == "numpy.memmap":
            populate_x_memmap()
Ejemplo n.º 9
0
    f.close()
    print_filesize(h5fname, clib, clevel)


if __name__ == '__main__':

    tb.print_versions()

    print "Total size for datasets:", round(2 * N * dtype.itemsize / MB,
                                            1), "MB"

    # Get the compression libraries supported
    #supported_clibs = [clib for clib in ("zlib", "lzo", "bzip2", "blosc")
    #supported_clibs = [clib for clib in ("zlib", "lzo", "blosc")
    supported_clibs = [
        clib for clib in ("blosc", ) if tb.whichLibVersion(clib)
    ]

    # Initialization code
    #for what in ["numpy", "numpy.memmap", "numexpr"]:
    for what in ["numpy", "numexpr"]:
        #break
        print "Populating x using %s with %d points..." % (what, N)
        t0 = time()
        if what == "numpy":
            populate_x_numpy()
            compute = compute_numpy
        elif what == "numexpr":
            populate_x_numpy()
            compute = compute_numexpr
        elif what == "numpy.memmap":
Ejemplo n.º 10
0
    def helpVersions(self):
        """
        Message box with info about versions of libraries used by
        ``ViTables``.
        """

        # The libraries versions dictionary
        libs_versions = {
            'title': translate('VTApp', 'Version Numbers',
                'Caption of the Versions dialog'),
            'Python': reduce(lambda x,y: '.'.join([unicode(x), unicode(y)]),
                sys.version_info[:3]),
            'PyTables': tables.__version__ ,
            'NumPy': tables.numpy.__version__,
            'Qt': QtCore.qVersion(),
            'PyQt': QtCore.PYQT_VERSION_STR,
            'ViTables': vtconfig.getVersion()
        }

        # Add new items to the dictionary
        libraries = ('HDF5', 'Zlib', 'LZO', 'BZIP2')
        for lib in libraries:
            lversion = tables.whichLibVersion(lib.lower())
            if lversion:
                libs_versions[lib] = lversion[1]
            else:
                libs_versions[lib] = translate('VTApp', 'not available',
                    'Part of the library not found text')

        # Construct the dialog
        versions_dlg = QtGui.QDialog(self.gui)
        versions_dlg.setWindowTitle(translate('VTApp', 'Version Numbers',
                                             'Caption of the Versions dialog'))
        layout = QtGui.QVBoxLayout(versions_dlg)
        versions_edit = QtGui.QTextEdit(versions_dlg)
        buttons_box = QtGui.QDialogButtonBox(QtGui.QDialogButtonBox.Ok)
        layout.addWidget(versions_edit)
        layout.addWidget(buttons_box)

        buttons_box.accepted.connect(versions_dlg.accept)

        versions_edit.setReadOnly(1)
        versions_edit.setText(\
            u"""
            <qt>
            <h3>{title}</h3>
            <table>
            <tr><td><b>Python</b></td><td>{Python}</td></tr>
            <tr><td><b>PyTables</b></td><td>{PyTables}</td></tr>
            <tr><td><b>NumPy</b></td><td>{NumPy}</td></tr>
            <tr><td><b>HDF5</b></td><td>{HDF5}</td></tr>
            <tr><td><b>Zlib</b></td><td>{Zlib}</td></tr>
            <tr><td><b>LZO</b></td><td>{LZO}</td></tr>
            <tr><td><b>BZIP2</b></td><td>{BZIP2}</td></tr>
            <tr><td><b>Qt</b></td><td>{Qt}</td></tr>
            <tr><td><b>PyQt</b></td><td>{PyQt}</td></tr>
            <tr><td><b>ViTables</b></td><td>{ViTables}</td></tr>
            </table>
            </qt>""".format(
                title=libs_versions['title'],
                Python=libs_versions['Python'],
                PyTables=libs_versions['PyTables'],
                NumPy=libs_versions['NumPy'],
                Qt=libs_versions['Qt'],
                PyQt=libs_versions['PyQt'],
                ViTables=libs_versions['ViTables'],
                HDF5=libs_versions['HDF5'],
                Zlib=libs_versions['Zlib'],
                LZO=libs_versions['LZO'],
                BZIP2=libs_versions['BZIP2'],
                ))

        # Show the dialog
        versions_dlg.exec_()
Ejemplo n.º 11
0
    print_versions()
    print_heavy(heavy)

    # What a context this is!
    oldverbose, common.verbose = common.verbose, verbose
    oldheavy, common.heavy = common.heavy, heavy
    try:
        unittest.TextTestRunner().run(suite())
    finally:
        common.verbose = oldverbose
        common.heavy = oldheavy  # there are pretty young heavies, too ;)


if __name__ == '__main__':

    hdf5_version = tables.whichLibVersion("hdf5")[1]
    if hdf5_version < minimum_hdf5_version:
        print "*Warning*: HDF5 version is lower than recommended: %s < %s" % \
              (hdf5_version, minimum_hdf5_version)

    if numpy.__version__ < minimum_numpy_version:
        print "*Warning*: NumPy version is lower than recommended: %s < %s" % \
              (numpy.__version__, minimum_numpy_version)

    # Handle some global flags (i.e. only useful for test_all.py)
    only_versions = 0
    args = sys.argv[:]
    for arg in args:
        if arg == '--show-versions':
            only_versions = True
            sys.argv.remove(arg)