Skip to content

Commit

Permalink
fixed some things
Browse files Browse the repository at this point in the history
  • Loading branch information
louisponet committed Mar 20, 2019
1 parent b3cd8df commit d049f33
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
1 change: 1 addition & 0 deletions Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ Parameters = "d96e819e-fc66-5662-9728-84c9c7592b0a"
RecipesBase = "3cdcf5f2-1ef4-517c-9805-6587b60abb01"
StaticArrays = "90137ffa-7385-5640-81b9-e52037218182"
BinDeps = "9e28174c-4ba2-5203-b857-d8d62c4213ee"
DelimitedFiles = "8bb1440f-4735-579b-a4ab-409b98df4dab"
Crayons = "a8cc5b0e-0ffa-5ad4-8c14-923d3ee1735f"
Requires = "ae029012-a4dd-5104-9daa-d747884805df"
Media = "e89f7d12-3494-54d1-8411-f7d8b9ae1f27"
Expand Down
4 changes: 3 additions & 1 deletion deps/asset_init.jl
Original file line number Diff line number Diff line change
Expand Up @@ -88,9 +88,11 @@ open(joinpath(@__DIR__, "wannier90flags.jl"), "w") do wf
continue
else
s_line = split(line, "::")
flagpart = s_line[end]
flag = Symbol(strip(strip(split(split(split(s_line[end], "=")[1],"(")[1],"!")[1], ':')))
fl_type = fort2julia(strip(split(s_line[1])[1],','))
writefbodyline(wf, 1, """Symbol("$flag") => $fl_type,""")
flagstring = occursin("(", flagpart) && occursin(")", flagpart) ? """Symbol("$flag") => Vector{$fl_type},""" : """Symbol("$flag") => $fl_type,"""
writefbodyline(wf, 1, flagstring)
end
end
end
Expand Down
6 changes: 3 additions & 3 deletions src/qe/fileio.jl
Original file line number Diff line number Diff line change
Expand Up @@ -294,16 +294,16 @@ Returns:
function qe_read_projwfc(filename::String)
lines = readlines(filename) .|> strip

state_tuple = NamedTuple{(:atom_id, :wfc_id, :l, :m, :s), Tuple{Int, Int, Int, Int, Float64}}
state_tuple = NamedTuple{(:atom_id, :wfc_id, :l, :m, :s), Tuple{Int, Int, Float64, Float64, Float64}}
states = state_tuple[]
istart = findfirst(x -> x == "Atomic states used for projection", lines) + 3
istop = findnext(isempty, lines, istart) - 1
for i = istart:istop
l = replace_multiple(lines[i], "(" => " ", ")" => " ", "," => "", "=" => " ", ":" => "", "#" => " ") |> split
if length(l) == 11
push!(states, state_tuple((parse.(Int,(l[4], l[7], l[9], l[11]))...,0.0)))
push!(states, state_tuple((parse.(Int,(l[4], l[7]))..., parse.(Float64,( l[9], l[11]))...,0.0)))
else
push!(states, state_tuple((parse.(Int,(l[4], l[7], l[9], l[11]))...,parse(Float64,l[13]))))
push!(states, state_tuple((parse.(Int,(l[4], l[7]))..., parse.(Float64, (l[9], l[11], l[13]))...)))
end
end

Expand Down

0 comments on commit d049f33

Please sign in to comment.