Skip to content

Commit 8d1e4c1

Browse files
authored
AtomsBase v0.4 support (#74)
1 parent 590b5f1 commit 8d1e4c1

File tree

3 files changed

+5
-15
lines changed

3 files changed

+5
-15
lines changed

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ ACE1 = "0.12.1"
3535
ACE1x = "0.1.8"
3636
ACEbase = "0.4.3"
3737
ACEfit = "0.1.4, 0.2.0"
38-
AtomsBase = "0.3"
38+
AtomsBase = "0.3, 0.4"
3939
AtomsCalculators = "0.2"
4040
ChunkSplitters = "2"
4141
Folds = "0.2"

src/utils.jl

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -68,17 +68,7 @@ end
6868

6969

7070
function neighborlist(ab, cutoff; length_unit=default_length, kwargs...)
71-
cell = ustrip.(length_unit, hcat( bounding_box(ab)... )' )
72-
pbc = map( boundary_conditions(ab) ) do x
73-
x == Periodic()
74-
end
75-
r = map( 1:length(ab)) do i
76-
# Need to have SVector here for PairList to work
77-
# if position does not give SVector
78-
SVector( ustrip.(length_unit, position(ab,i))...)
79-
end
80-
nlist = PairList(r, ustrip(length_unit, cutoff), cell, pbc; int_type=Int)
81-
return nlist
71+
return PairList(ab, cutoff)
8272
end
8373

8474

test/runtests.jl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ end
6161
@testset "AtomsBase" begin
6262
pot = load_ace_model(fname_ace)
6363
julip_data = read_extxyz(fname_xyz)[end]
64-
ab_data = FastSystem(ExtXYZ.Atoms(read_frame(fname_xyz)))
64+
ab_data = ExtXYZ.Atoms(read_frame(fname_xyz))
6565

6666
@test ace_energy(pot, julip_data) ace_energy(pot, ab_data)
6767
@test all( ace_forces(pot, julip_data) .≈ ace_forces(pot, ab_data) )
@@ -104,7 +104,7 @@ end
104104

105105
@testset "Units" begin
106106
pot = load_ace_model(fname_ace; energy_unit=u"eV", length_unit=u"pm")
107-
data = FastSystem(ExtXYZ.Atoms(read_frame(fname_xyz)))
107+
data = ExtXYZ.Atoms(read_frame(fname_xyz))
108108

109109
@test unit( ace_energy(pot, data) ) == u"eV"
110110
@test unit( ace_forces(pot, data)[1][1] ) == u"eV" / u"pm"
@@ -128,7 +128,7 @@ end
128128

129129
@testset "Combination interface" begin
130130
pot = load_ace_model(fname_ace)
131-
data = FastSystem(ExtXYZ.Atoms(read_frame(fname_xyz)))
131+
data = ExtXYZ.Atoms(read_frame(fname_xyz))
132132

133133
E = ace_energy(pot, data)
134134
F = ace_forces(pot, data)

0 commit comments

Comments
 (0)