Skip to content

Commit

Permalink
Updated tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
CedricTravelletti committed Mar 4, 2024
1 parent eb900e8 commit d54dad3
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
12 changes: 6 additions & 6 deletions test/atomsbase_interface.jl
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@
new_general_pos = ComponentVector(atoms = new_positions, strain = strain)
new_system = update_positions(silicon_supercell, new_general_pos)

@test position(new_system) == new_positions
@test bounding_box(new_system) == bounding_box(silicon_supercell)
@test [austrip.(x) for x in position(new_system)] == [austrip.(x) for x in new_positions]
@test [austrip.(x) for x in bounding_box(new_system)] == [austrip.(x) for x in bounding_box(silicon_supercell)]
end

@testitem "AtomsBase interface: check positions+cell updating" setup=[TestCases] begin
Expand Down Expand Up @@ -55,8 +55,8 @@ end
new_general_pos = ComponentVector(atoms = new_positions, strain = strain)
new_system = update_positions(silicon_supercell, new_general_pos)

@test position(new_system) == deformed_new_positions
@test bounding_box(new_system) == new_lattice
@test [austrip.(x) for x in position(new_system)] == [austrip.(x) for x in deformed_new_positions]
@test [austrip.(x) for x in bounding_box(new_system)] == [austrip.(x) for x in new_lattice]
end

@testitem "AtomsBase interface: check positions+cell updating (with mask)" setup=[TestCases] begin
Expand Down Expand Up @@ -88,6 +88,6 @@ end
strain = strain)
new_system = update_not_clamped_positions(silicon_supercell, new_general_pos)

@test position(new_system) == deformed_new_positions
@test bounding_box(new_system) == new_lattice
@test [austrip.(x) for x in position(new_system)] == [austrip.(x) for x in deformed_new_positions]
@test [austrip.(x) for x in bounding_box(new_system)] == [austrip.(x) for x in new_lattice]
end
2 changes: 1 addition & 1 deletion test/geometry_optimization.jl
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,5 @@
optim_options = (f_tol=1e-6, iterations=4, show_trace=false)

results = minimize_energy!(system, calculator; optimizer, optim_options...)
@test isapprox(results.u[1], 0; atol=1e-5)
@test isapprox(results.optimization_data.u[1], 0; atol=1e-5)
end

0 comments on commit d54dad3

Please # to comment.