Skip to content
Permalink
Browse files

Version check for spglib

  • Loading branch information
mfherbst committed Feb 13, 2020
1 parent 43e2319 commit 61732304b263f1437bfacd1eedcee45887712544
Showing with 15 additions and 3 deletions.
  1. +1 −1 deps/build.jl
  2. +1 −2 src/bzmesh.jl
  3. +13 −0 src/external/spglib.jl
@@ -2,6 +2,6 @@
using PyCall
if PyCall.conda
import Conda
Conda.add("spglib"; channel="conda-forge")
Conda.add("spglib==1.12.2"; channel="conda-forge")
Conda.add("pymatgen"; channel="conda-forge")
end
@@ -1,4 +1,3 @@
using PyCall
include("external/spglib.jl")

@doc raw"""
@@ -34,7 +33,7 @@ coordinates. `tol_symmetry` is the tolerance used for searching for symmetry ope
"""
function bzmesh_ir_wedge(kgrid_size, lattice, atoms; tol_symmetry=1e-5)
all(isequal.(kgrid_size, 1)) && return bzmesh_uniform(kgrid_size)
spglib = pyimport("spglib")
spglib = import_spglib()

# Ask spglib for symmetry operations and for irreducible mesh
spg_symops = spglib.get_symmetry(spglib_cell(lattice, atoms),
@@ -1,5 +1,18 @@
using PyCall
# Routines for interaction with spglib

function import_spglib()
spglib = pyimport("spglib")
version = VersionNumber(spglib.__version__)

if version < v"1.12"
@warn "Spglib below 1.12 not tested with DFTK"
elseif v"1.13" <= version < v"1.15"
@warn "Spglib versions 1.13 and 1.14 are known to be faulty when used with DFTK."
end
spglib
end

"""
Construct a tuple containing the lattice and the positions of the species
in the convention required to take the place of a `cell` datastructure used in spglib.

0 comments on commit 6173230

Please sign in to comment.
You can’t perform that action at this time.