Skip to content

Commit 19207ca

Browse files
committed
remove unused interface
1 parent 4b8d292 commit 19207ca

4 files changed

Lines changed: 18 additions & 30 deletions

File tree

src/MolecularMinimumDistances/AllPairs.jl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -155,9 +155,9 @@ end
155155
for (iframe, frame) in enumerate(simulation)
156156
pos = positions(frame)
157157
local uc = unitcell(current_frame(simulation))
158-
sys.xpositions .= @view(pos[popc])
159-
sys.ypositions .= @view(pos[protein])
160-
sys.unitcell = uc.orthorhombic ? diag(uc.matrix) : uc.matrix
158+
sys.system.xpositions .= @view(pos[popc])
159+
sys.system.ypositions .= @view(pos[protein])
160+
sys.system.unitcell = uc.orthorhombic ? diag(uc.matrix) : uc.matrix
161161
md = minimum_distances!(sys)
162162
xmd_min[iframe] = minimum(p -> p.d, md[1])
163163
ymd_indices[iframe] = minimum(p -> p.i, md[2])

src/MolecularMinimumDistances/CrossPairs.jl

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ more general `mol_indices` function, which, for each atomic index, returns the
3838
corresponding
3939
molecular index (which is `mol_indices(i) = (i-1)%n + 1` where `n` is the
4040
number of atoms per molecule if all molecules have the same number of
41-
atoms and are continously stored in the array of positions).
41+
atoms and are continuously stored in the array of positions).
4242
4343
# Examples
4444
@@ -131,9 +131,9 @@ end
131131
for (iframe, frame) in enumerate(simulation)
132132
pos = positions(frame)
133133
local uc = unitcell(frame)
134-
sys.xpositions .= @view(pos[popc])
135-
sys.ypositions .= @view(pos[protein])
136-
sys.unitcell = uc.orthorhombic ? diag(uc.matrix) : uc.matrix
134+
sys.system.xpositions .= @view(pos[popc])
135+
sys.system.ypositions .= @view(pos[protein])
136+
sys.system.unitcell = uc.orthorhombic ? diag(uc.matrix) : uc.matrix
137137
md = minimum_distances!(sys)
138138
md_count[iframe] = count(p -> p.within_cutoff, md)
139139
# Test direct (out-of-place) call
@@ -143,7 +143,7 @@ end
143143
ypositions = xsolute,
144144
xn_atoms_per_molecule = 134,
145145
cutoff = 6.0,
146-
unitcell = sys.unitcell
146+
unitcell = sys.system.unitcell
147147
)
148148
@test all(md_out .≈ md)
149149
end

src/MolecularMinimumDistances/MolecularMinimumDistances.jl

Lines changed: 5 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@ julia> init_list(x, i -> (i-1)÷2 + 1)
203203
204204
```
205205
206-
The above annonymous function `i -> (i-1)÷2 + 1` is equivalent to `i -> mol_indices(i,2)`,
206+
The above anonymous function `i -> (i-1)÷2 + 1` is equivalent to `i -> mol_indices(i,2)`,
207207
and can be generalized if the the number of atoms of each molecule is not the same.
208208
209209
=#
@@ -229,7 +229,7 @@ init_list(::Type{T}, n::Integer) where {T} = fill(zero(MinimumDistance{T}), n)
229229
# Note that we have two types of output variables here: List, and a tuple of List.
230230
# The List is simply an array of `MinimumDistance{T}`, and we have defined above
231231
# `copy` and `zero` methods for this type, such that we only need to define
232-
# that reseting this variable consists of returing its zero, and set up the reducer.
232+
# that resetting this variable consists of returning its zero, and set up the reducer.
233233
# The methods for abstract arrays will take care of the rest.
234234
#
235235
# For the Tuple of lists, we need to be more explicit, and define appropriate copy_output,
@@ -261,7 +261,7 @@ end
261261
Function that computes the minimum distances for an initialized system,
262262
of `SelfPairs`, `CrossPairs`, or `AllPairs` types.
263263
264-
The function returs a `Vector{MinimumDistance}` cor `SelfPairs` and `CrossPairs`
264+
The function returns a `Vector{MinimumDistance}` cor `SelfPairs` and `CrossPairs`
265265
inputs, and a Tuple of two of such vectors for the `AllPairs` input types.
266266
267267
This function is used as an advanced alternative from preallocated system inputs. Only a few allocations
@@ -477,24 +477,12 @@ abstract type SystemPairs end
477477

478478
import Base: getproperty, propertynames
479479
getproperty(sys::SystemPairs, s::Symbol) = getproperty(sys, Val(s))
480+
getproperty(sys::SystemPairs, ::Val{:minimum_distances}) = sys.system.output
480481
getproperty(sys::SystemPairs, ::Val{:system}) = getfield(sys, :system)
481482
getproperty(sys::SystemPairs, ::Val{:mol_indices}) = getfield(sys, :mol_indices)
482483
getproperty(sys::SystemPairs, ::Val{:xmol_indices}) = getfield(sys, :xmol_indices)
483484
getproperty(sys::SystemPairs, ::Val{:ymol_indices}) = getfield(sys, :ymol_indices)
484-
getproperty(sys::SystemPairs, ::Val{:minimum_distances}) = sys.system.output
485-
getproperty(sys::SystemPairs, ::Val{:xpositions}) = sys.system.xpositions
486-
getproperty(sys::SystemPairs, ::Val{:ypositions}) = sys.system.ypositions
487-
getproperty(sys::SystemPairs, ::Val{:cutoff}) = sys.system.cutoff
488-
getproperty(sys::SystemPairs, ::Val{:unitcell}) = sys.system.unitcell
489-
getproperty(sys::SystemPairs, ::Val{:parallel}) = sys.system.parallel
490-
propertynames(sys::SystemPairs, private::Bool) =
491-
(:system, :mol_indices, :minimum_distances, :xpositions, :ypositions, :unitcell, :cutoff)
492-
493-
import Base: setproperty!
494-
setproperty!(sys::SystemPairs, s::Symbol, value) = setproperty!(sys, Val(s), value)
495-
setproperty!(sys::SystemPairs, ::Val{:cutoff}, cutoff) = update!(sys.system; cutoff=cutoff)
496-
setproperty!(sys::SystemPairs, ::Val{:unitcell}, unitcell) = update!(sys.system; unitcell=unitcell)
497-
setproperty!(sys::SystemPairs, ::Val{:parallel}, parallel) = sys.system.parallel = parallel
485+
propertynames(sys::SystemPairs, private::Bool) = (:system, :minimum_distances)
498486

499487
#
500488
# Functions for when the lists of minimum-distances is that of a single

src/MolecularMinimumDistances/SelfPairs.jl

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ more general `mol_indices` function, which, for each atomic index, returns the
3333
corresponding
3434
molecular index (which is `mol_indices(i) = (i-1)%n + 1` where `n` is the
3535
number of atoms per molecule if all molecules have the same number of
36-
atoms and are continously stored in the array of positions).
36+
atoms and are continuously stored in the array of positions).
3737
3838
# Examples
3939
@@ -84,7 +84,7 @@ function SelfPairs(;
8484
end
8585

8686
#
87-
# This file containst the functions for single-sets, that is for those cases where
87+
# This file contains the functions for single-sets, that is for those cases where
8888
# the list of minimum-distances is between the molecules of a single component.
8989
#
9090
function update_list!(pair, list::List, system::SelfPairs)
@@ -126,8 +126,8 @@ end
126126
for (iframe, frame) in enumerate(simulation)
127127
pos = positions(frame)
128128
local uc = unitcell(frame)
129-
sys.xpositions .= @view(pos[popc])
130-
sys.unitcell = uc.orthorhombic ? diag(uc.matrix) : uc.matrix
129+
sys.system.xpositions .= @view(pos[popc])
130+
sys.system.unitcell = uc.orthorhombic ? diag(uc.matrix) : uc.matrix
131131
md = minimum_distances!(sys)
132132
md_min[iframe] = minimum(p -> p.d, md)
133133
# Test direct (out-of-place) call
@@ -136,7 +136,7 @@ end
136136
xpositions = xsolvent,
137137
xn_atoms_per_molecule = 134,
138138
cutoff = 6.0,
139-
unitcell = sys.unitcell
139+
unitcell = sys.system.unitcell
140140
)
141141
@test all(md_out .≈ md)
142142
end

0 commit comments

Comments
 (0)