How to use the spglib.__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 giovannipizzi / seekpath / seekpath / hpkot / tools.py View on Github external
older than 1.9.4.

    Also raises an warning if the user has a version of SPGLIB that is
    older than 1.13, because before then there were some bugs (e.g. 
    wrong treatment of oI, see e.g. issue )

    Return the spglib module.
    """
    try:
        import spglib
    except ImportError:
        raise ValueError("spglib >= 1.9.4 is required for the creation "
                         "of the k-paths, but it could not be imported")

    try:
        version = spglib.__version__
    except NameError:
        version = "1.8.0"  # or older, version was introduced only recently

    try:
        version_pieces = [int(_) for _ in version.split('.')]
        if len(version_pieces) < 3:
            raise ValueError
    except ValueError:
        raise ValueError("Unable to parse version number")

    if tuple(version_pieces[:2]) < (1, 9):
        raise ValueError("Invalid spglib version, need >= 1.9.4")

    if version_pieces[:2] == (1, 9) and version_pieces[2] < 4:
        raise ValueError("Invalid spglib version, need >= 1.9.4")
github giovannipizzi / seekpath / webservice / seekpath_web_module.py View on Github external
inputstructure_cell_vectors=inputstructure_cell_vectors,
        inputstructure_atoms_scaled=inputstructure_atoms_scaled,
        inputstructure_atoms_cartesian=inputstructure_atoms_cartesian,
        atoms_scaled=atoms_scaled,
        with_without_time_reversal=("with"
                                    if path_results['has_inversion_symmetry']
                                    else "without"),
        atoms_cartesian=atoms_cartesian,
        reciprocal_primitive_vectors=reciprocal_primitive_vectors,
        suggested_path=suggested_path,
        qe_pw=qe_pw,
        qe_matdyn=qe_matdyn,
        cp2k=cp2k,
        compute_time=compute_time,
        seekpath_version=seekpath_module.__version__,
        spglib_version=spglib.__version__,
        time_reversal_note=(time_reversal_note
                            if path_results['augmented_path'] else ""),
        xsfstructure=xsfstructure)