Skip to content

Commit

Permalink
updates to fileio
Browse files Browse the repository at this point in the history
  • Loading branch information
Louis Ponet committed Jun 9, 2021
1 parent 58bad95 commit 831f75c
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 3 deletions.
1 change: 1 addition & 0 deletions src/jobAPI.jl
Expand Up @@ -15,6 +15,7 @@ function save(job::DFJob, local_dir=job.local_dir; kwargs...)
@warn "Job had no name, changed it to: noname"
job.name = "noname"
end
maybe_register_job(job)
maybe_increment_version(job)
sanitize_magnetization!(job)
sanitize_projections!(job)
Expand Down
5 changes: 5 additions & 0 deletions src/qe/fileio.jl
Expand Up @@ -125,6 +125,11 @@ function qe_read_pw_output(filename::String, T=Float64; cleanup = true)
#fermi energy
elseif occursin("the Fermi energy is", line)
out[:fermi] = parse(T, split(line)[5])
elseif occursin("up/dw Fermi energies are", line)
sline = split(line)
out[:fermi_up] = parse(T, sline[7])
out[:fermi_down] = parse(T, sline[8])
out[:fermi] = min(out[:fermi_down], out[:fermi_up])
elseif occursin("lowest unoccupied", line) && occursin("highest occupied", line)
sline = split(line)
high = parse(T, sline[7])
Expand Down
1 change: 1 addition & 0 deletions src/registry.jl
Expand Up @@ -36,3 +36,4 @@ function maybe_register_job(abspath::String)
end
write_job_registry()
end
maybe_register_job(job::DFJob) = maybe_register_job(job.local_dir)
3 changes: 0 additions & 3 deletions src/versioning.jl
Expand Up @@ -29,11 +29,8 @@ function maybe_increment_version(job::DFJob)
return
else
if ispath(joinpath(job, "job.tt"))
@show last_version(job)
tjob = DFJob(job.local_dir, version = last_version(job)+1)
@show tjob.version
vpath = version_path(tjob)
@show vpath
mkpath(vpath)
cp(job, vpath)
job.version = last_version(job) + 1
Expand Down

0 comments on commit 831f75c

Please sign in to comment.