Skip to content

Commit

Permalink
Merge pull request #14 from MineralsCloud:EachAtom
Browse files Browse the repository at this point in the history
Remove `EachAtom` from `Cell`, that should only be done by `eachatom`
  • Loading branch information
singularitti authored Sep 18, 2023
2 parents 1c760ed + 3e15966 commit a60bf42
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/eachatom.jl
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,13 @@ struct EachAtom{A,B}
atoms::Vector{A}
positions::Vector{B}
end
EachAtom(cell::Cell) = EachAtom(cell.atoms, cell.positions)

"""
eachatom(cell::Cell)
Create a generator that iterates over the atoms in a `Cell`.
"""
eachatom(cell::Cell) = EachAtom(cell)
eachatom(cell::Cell) = EachAtom(cell.atoms, cell.positions)

# Similar to https://github.com/JuliaCollections/IterTools.jl/blob/0ecaa88/src/IterTools.jl#L1028-L1032
function Base.iterate(iter::EachAtom, state=1)
Expand Down

0 comments on commit a60bf42

Please sign in to comment.