Skip to content

Commit

Permalink
remove legacy warnings from tests
Browse files Browse the repository at this point in the history
  • Loading branch information
lmiq committed Dec 1, 2023
1 parent 25c7cb1 commit b179f2b
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 17 deletions.
5 changes: 3 additions & 2 deletions src/legacy/legacy.jl
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ const contrib = contributions
import ComplexMixtures.Testing: test_dir

pdb = readPDB("$test_dir/data/NAMD/structure.pdb")
R = load("$test_dir/data/NAMD/protein_tmao.json")
R = load("$test_dir/data/NAMD/protein_tmao.json"; legacy_warning = false)

@test R.sum_md_count == R.coordination_number
@test R.sum_md_count_random == R.coordination_number_random
Expand All @@ -36,7 +36,8 @@ end

@testitem "load legacy file" begin
using ComplexMixtures
R = load("$(@__DIR__)/../../test/data/legacy/protein_tmao.json")
using ComplexMixtures.Testing: data_dir
R = load("$(data_dir)/legacy/protein_tmao.json"; legacy_warning = false)
@test R.density.solvent_bulk 0.00030523537444306325
end

4 changes: 2 additions & 2 deletions src/tools/coordination_number.jl
Original file line number Diff line number Diff line change
Expand Up @@ -85,13 +85,13 @@ end
import ComplexMixtures.Testing: test_dir

pdb = readPDB("$test_dir/data/NAMD/structure.pdb")
R = load("$test_dir/data/NAMD/protein_tmao.json")
R = load("$test_dir/data/NAMD/protein_tmao.json"; legacy_warning = false)
solute = Selection(PDBTools.select(pdb, "protein"), nmols = 1)
cn = coordination_number(solute, R.solute_atom, R, PDBTools.select(pdb, "residue 50"))
@test cn[findlast(<(5), R.d)] 0.24999999999999997 atol = 1e-10

pdb = readPDB("$test_dir/data/NAMD/Protein_in_Glycerol/system.pdb")
R = load("$test_dir/data/NAMD/Protein_in_Glycerol/protein_water.json")
R = load("$test_dir/data/NAMD/Protein_in_Glycerol/protein_water.json"; legacy_warning=false)
group = PDBTools.select(pdb, "protein")
solute = Selection(group, nmols = 1)
cn = coordination_number(solute, R.solute_atom, R, group)
Expand Down
6 changes: 3 additions & 3 deletions test/gromacs.jl
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
# Example 1: protein-EMIM

# save(R,"$dir/protein_EMI.json")
R_save = load("$dir/protein_EMI.json")
R_save = load("$dir/protein_EMI.json"; legacy_warning = false)
protein = Selection(select(atoms, "protein"), nmols = 1)
emi = Selection(select(atoms, "resname EMI"), natomspermol = 20)
traj = Trajectory("$dir/trajectory.xtc", protein, emi)
Expand All @@ -24,7 +24,7 @@
# Example 1: EMIM-DCA

# save(R,"$dir/EMI_DCA.json")
R_save = load("$dir/EMI_DCA.json")
R_save = load("$dir/EMI_DCA.json"; legacy_warning = false)
emi = Selection(select(atoms, "resname EMI"), natomspermol = 20)
dca = Selection(select(atoms, "resname NC"), natomspermol = 5)
traj = Trajectory("$dir/trajectory.xtc", emi, dca)
Expand All @@ -34,7 +34,7 @@
# Example 1: EMIM-EMIM

# save(R,"$dir/EMI_EMI.json")
R_save = load("$dir/EMI_EMI.json")
R_save = load("$dir/EMI_EMI.json"; legacy_warning = false)
emi = Selection(select(atoms, "resname EMI"), natomspermol = 20)
traj = Trajectory("$dir/trajectory.xtc", emi)
R = mddf(traj, options)
Expand Down
8 changes: 4 additions & 4 deletions test/namd.jl
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
# Example 1: protein-tmao

# save(R,"$dir/protein_tmao.json")
R_save = load("$dir/protein_tmao.json")
R_save = load("$dir/protein_tmao.json"; legacy_warning = false)
protein = Selection(select(atoms, "protein"), nmols = 1)
tmao = Selection(select(atoms, "resname TMAO"), natomspermol = 14)
traj = Trajectory("$dir/trajectory.dcd", protein, tmao)
Expand All @@ -31,7 +31,7 @@
# Example 2: water-tmao

# save(R,"$dir/water_tmao.json")
R_save = load("$dir/water_tmao.json")
R_save = load("$dir/water_tmao.json"; legacy_warning = false)
tmao = Selection(select(atoms, "resname TMAO"), natomspermol = 14)
water = Selection(select(atoms, "water"), natomspermol = 3)
traj = Trajectory("$dir/trajectory.dcd", tmao, water)
Expand All @@ -41,7 +41,7 @@
# Example 3: tmao-tmao

# save(R,"$dir/tmao_tmao.json")
R_save = load("$dir/tmao_tmao.json")
R_save = load("$dir/tmao_tmao.json"; legacy_warning = false)
tmao = Selection(select(atoms, "resname TMAO"), natomspermol = 14)
traj = Trajectory("$dir/trajectory.dcd", tmao)
R = mddf(traj, options)
Expand All @@ -50,7 +50,7 @@
# Example 3: water-water

# save(R,"$dir/water_water.json")
R_save = load("$dir/water_water.json")
R_save = load("$dir/water_water.json"; legacy_warning = false)
water = Selection(select(atoms, "water"), natomspermol = 3)
traj = Trajectory("$dir/trajectory.dcd", water)
R = mddf(traj, options)
Expand Down
8 changes: 4 additions & 4 deletions test/namd_chemfiles.jl
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
# Example 1: protein-tmao

# save(R,"$dir/protein_tmao.json")
R_save = load("$dir/protein_tmao.json")
R_save = load("$dir/protein_tmao.json"; legacy_warning = false)
protein = Selection(select(atoms, "protein"), nmols = 1)
tmao = Selection(select(atoms, "resname TMAO"), natomspermol = 14)
traj = CM.Trajectory("$dir/trajectory.dcd", protein, tmao, chemfiles = true)
Expand All @@ -31,7 +31,7 @@
# Example 2: water-tmao

# save(R,"$dir/water_tmao.json")
R_save = load("$dir/water_tmao.json")
R_save = load("$dir/water_tmao.json"; legacy_warning = false)
tmao = Selection(select(atoms, "resname TMAO"), natomspermol = 14)
water = Selection(select(atoms, "water"), natomspermol = 3)
traj = CM.Trajectory("$dir/trajectory.dcd", tmao, water, chemfiles = true)
Expand All @@ -41,7 +41,7 @@
# Example 3: tmao-tmao

# save(R,"$dir/tmao_tmao.json")
R_save = load("$dir/tmao_tmao.json")
R_save = load("$dir/tmao_tmao.json"; legacy_warning = false)
tmao = Selection(select(atoms, "resname TMAO"), natomspermol = 14)
traj = CM.Trajectory("$dir/trajectory.dcd", tmao, tmao, chemfiles = true)
R = mddf(traj, options)
Expand All @@ -50,7 +50,7 @@
# Example 3: water-water

# save(R,"$dir/water_water.json")
R_save = load("$dir/water_water.json")
R_save = load("$dir/water_water.json"; legacy_warning = false)
water = Selection(select(atoms, "water"), natomspermol = 3)
traj = CM.Trajectory("$dir/trajectory.dcd", water, water, chemfiles = true)
R = mddf(traj, options)
Expand Down
4 changes: 2 additions & 2 deletions test/pdb.jl
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
# Example 1: protein-tmao

# save(R,"$dir/protein_tmao.json")
R_save = load("$dir/protein_tmao.json")
R_save = load("$dir/protein_tmao.json"; legacy_warning = false)
protein = Selection(select(atoms, "protein"), nmols = 1)
tmao = Selection(select(atoms, "resname TMAO"), natomspermol = 14)
traj = Trajectory("$dir/trajectory.pdb", protein, tmao, format = "PDBTraj")
Expand All @@ -25,7 +25,7 @@
# Example 2: tmao-tmao

# save(R,"$dir/tmao_tmao.json")
R_save = load("$dir/tmao_tmao.json")
R_save = load("$dir/tmao_tmao.json"; legacy_warning = false)
tmao = Selection(select(atoms, "resname TMAO"), natomspermol = 14)
traj = Trajectory("$dir/trajectory.pdb", tmao, format = "PDBTraj")
R = mddf(traj, options)
Expand Down

0 comments on commit b179f2b

Please sign in to comment.