We introduce a topology T on the space U of uniformly discrete subsets of the Euclidean space. Assume that S in U admits a unique autocorrelation measure. The diffraction measure of S is purely atomic if and only if S
Nearby in the stack
is almost periodic in
(U,T)
. This result relates idealized quasicrystals to almost periodicity. In the context of ergodic point processes, the autocorrelation measure is known to exist. Then, the diffraction measure is purely atomic if and only if the dynamical system has a pure point spectrum. As an illustration, we study deformed model sets.