Skip to content

Commit

Permalink
printing for projections and append!
Browse files Browse the repository at this point in the history
  • Loading branch information
louisponet committed Oct 30, 2019
1 parent 77d90e9 commit 2cbafda
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/atom.jl
Original file line number Diff line number Diff line change
Expand Up @@ -150,8 +150,10 @@ function setpseudo!(at::AbstractAtom, pseudo::Pseudo; print=true)
atom(at).pseudo = pseudo
end

setprojections!(at::AbstractAtom, projections::Vector{Projection}) =
function setprojections!(at::AbstractAtom, projections::Vector{Projection}; print=true)
print && @info "Setting projections for atom $(name(at)) to $projections"
atom(at).projections = projections
end

bondlength(at1::AbstractAtom{T}, at2::AbstractAtom{T}, R=T(0.0)) where T<:AbstractFloat = norm(position_cart(at1) - position_cart(at2) - R)

Expand Down
2 changes: 2 additions & 0 deletions src/jobAPI.jl
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,8 @@ Base.insert!(job::DFJob, index::Int, input::DFInput) = insert!(job.inputs, index
Base.push!(job::DFJob, input::DFInput) = push!(job.inputs, input)
Base.pop!(job::DFJob) = pop!(job.inputs)

Base.append!(job::DFJob, args...) = append!(job.inputs, args...)

"""Access an input inside the job using it's name. E.g `job["scf"]`"""
function Base.getindex(job::DFJob, id::String)
tmp = getfirst(x -> name(x)==id, inputs(job))
Expand Down

0 comments on commit 2cbafda

Please sign in to comment.