Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
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