From 1ca205b80591c292388a756963019edbcb75828d Mon Sep 17 00:00:00 2001 From: CedricTravelletti Date: Wed, 6 Mar 2024 15:26:56 +0100 Subject: [PATCH] Removed type restriction on update position to allow for duals. --- src/atomsbase_interface.jl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/atomsbase_interface.jl b/src/atomsbase_interface.jl index 4cdfa89..06d88a5 100644 --- a/src/atomsbase_interface.jl +++ b/src/atomsbase_interface.jl @@ -11,7 +11,7 @@ Creates a new system based on ``system`` but with atoms positions updated to the ones provided. Can also update lattice vectors if `bounding_box` is provided. """ -function update_positions(system, positions::AbstractVector{<:AbstractVector{<:Unitful.Length}}; +function update_positions(system, positions; bounding_box=bounding_box(system)) particles = [Atom(atom; position) for (atom, position) in zip(system, positions)] AbstractSystem(system; particles, bounding_box) @@ -46,7 +46,7 @@ end Creates a new system based on ``system`` where the non clamped positions are updated to the ones provided (in the order in which they appear in the system). """ -function update_not_clamped_positions(system, positions::AbstractVector{<:Unitful.Length}) +function update_not_clamped_positions(system, positions) mask = not_clamped_mask(system) new_positions = deepcopy(position(system)) new_positions[mask] = eachcol(reshape(positions, 3, :))