Skip to content

Commit 2cfcd32

Browse files
authored
rattle rename (#10)
1 parent 9e10a34 commit 2cfcd32

File tree

4 files changed

+11
-11
lines changed

4 files changed

+11
-11
lines changed

docs/src/utilities.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@ rotate_system!(sys, rot)
2020
rotate_system(sys, rot)
2121

2222
# rattle positions
23-
rattle_system(sys, 0.1)
24-
rattle_system!(sys, 0.1u"Å")
23+
rattle_positions(sys, 0.1)
24+
rattle_positions!(sys, 0.1u"Å")
2525
```
2626

2727
**Add system together or repeat them**

src/AtomsSystems.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,8 @@ export fractional_coordinates_as_matrix
3737
export generic_system
3838
export inv_cell
3939
export position_as_matrix
40-
export rattle_system
41-
export rattle_system!
40+
export rattle_positions
41+
export rattle_positions!
4242
export rotate_system
4343
export rotate_system!
4444
export system_view

src/utils.jl

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -481,15 +481,15 @@ Base.repeat(sys::CellSystem{3}, n::Integer) = Base.repeat(sys, (n,n,n))
481481
##
482482

483483
"""
484-
rattle_system(sys, q)
485-
rattle_system!(sys, q)
484+
rattle_positions(sys, q)
485+
rattle_positions!(sys, q)
486486
487487
Rattle the positions of atoms in the system `sys` by a random vector of length `q`.
488488
The random vector is in random uniform direction and uniform length in the range `0 <= r < q`.
489489
490490
If `q` is not a `Unitful.Length`, it is assumed to be in the unit of the positions in the system.
491491
"""
492-
function rattle_system!(sys::AbstractSystem{D}, q) where{D}
492+
function rattle_positions!(sys::AbstractSystem{D}, q) where{D}
493493
r0 = position(sys, 1)
494494
r0 = r0 ./ ustrip( norm(r0) )
495495
r0 *= isa(q, Unitful.Length) ? ustrip(unit(r0[1]), q) : q
@@ -500,10 +500,10 @@ function rattle_system!(sys::AbstractSystem{D}, q) where{D}
500500
end
501501
end
502502

503-
function rattle_system(sys::AbstractSystem, q)
503+
function rattle_positions(sys::AbstractSystem, q)
504504
tmp = deepcopy(sys)
505-
rattle_system!(tmp, q)
505+
rattle_positions!(tmp, q)
506506
return tmp
507507
end
508508

509-
@doc (@doc rattle_system!) rattle_system
509+
@doc (@doc rattle_positions!) rattle_positions

test/runtests.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -439,7 +439,7 @@ include("Aqua.jl")
439439

440440
# rattle
441441
sys = generic_system(ref.system)
442-
sys2 = rattle_system(sys, 0.1u"Å")
442+
sys2 = rattle_positions(sys, 0.1u"Å")
443443
@test all( diag( distance(sys, sys2) ) ) do x
444444
0.0u"Å" < x < 0.1u"Å"
445445
end

0 commit comments

Comments
 (0)