@@ -206,7 +206,7 @@ function RemoteHPC.save(job::Job, workflow = nothing; versioncheck=true, kwargs.
206206 end
207207
208208 linkpath = joinpath (job, " $el .UPF" )
209- if p . path != linkpath || ! ispath (server, linkpath)
209+ if ! ispath (server, linkpath) || p . path != realpath (server, linkpath)
210210 if ispath (server, linkpath)
211211 rm (server, linkpath)
212212 end
@@ -394,30 +394,30 @@ function outputdata(job::Job; calcs=map(x->x.name, job.calculations), extra_pars
394394end
395395
396396"""
397- bandgap(job::Job, fermi =nothing)
397+ bandgap(job::Job, nelec =nothing)
398398
399399Calculates the bandgap (possibly indirect) around the fermi level.
400400Uses the first found bands calculation, if there is none it uses the first found nscf calculation.
401401"""
402- function bandgap (job:: Job , fermi = nothing , outdat = outputdata (job))
402+ function bandgap (job:: Job , nelec = nothing , outdat = outputdata (job))
403403 band_calcs = filter (! isnothing, getfirst .([Calculations. isbands, Calculations. isnscf, Calculations. isscf], (job. calculations,)))
404404 if isempty (band_calcs)
405405 error (" No valid calculation found to calculate the bandgap.\n Make sure the job has either a valid bands or nscf calculation." )
406406 end
407407
408- if fermi === nothing
409- fermi_calcs = filter (x -> (Calculations. isvcrelax (x) ||
408+ if nelec === nothing
409+ n_calcs = filter (x -> (Calculations. isvcrelax (x) ||
410410 Calculations. isscf (x) ||
411411 Calculations. isnscf (x)), job. calculations)
412412
413- if isempty (fermi_calcs )
414- error (" No valid calculation found to extract the fermi level .\n Please supply the fermi level manually." )
413+ if isempty (n_calcs )
414+ error (" No valid calculation found to extract the number of electrons .\n Please supply nelec manually." )
415415 end
416- fermi = maximum (x-> get (get (outdat, x. name, Dict ()), :fermi , - Inf ), fermi_calcs )
416+ nelec = maximum (x-> get (get (outdat, x. name, Dict ()), :fermi , - Inf ), n_calcs )
417417 end
418418
419419 bands = map (x-> outdat[x. name][:bands ], filter (x -> haskey (outdat, x. name), band_calcs))
420- return minimum (bandgap .(bands, fermi ))
420+ return minimum (bandgap .(bands, nelec ))
421421end
422422
423423"""
0 commit comments