How to use the spglib.get_version function in spglib

To help you get started, we’ve selected a few spglib examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github MaterialsDiscovery / PyChemia / pychemia / crystal / symmetry.py View on Github external
def spglib_version():
    from pychemia import Structure
    from . import CrystalSymmetry

    # Testing version of spglib
    st = Structure(symbols=['H'])
    symm = CrystalSymmetry(st)
    ret = spg.spglib.spg.dataset(symm.transposed, symm.reduced, symm.numbers, 1e-5, -1.0)
    if type(ret[3]) is list:
        HAS_SPGLIB = False
        version = "%d.%d.%d" % spg.get_version()
        print('SPGLIB current version is %s, please install spglib > 1.9' % version)
    else:
        HAS_SPGLIB = True
    return HAS_SPGLIB