Skip to content

Commit

Permalink
Un-deprecate Base.copy(::Langevin).
Browse files Browse the repository at this point in the history
A generic copy function is needed for parallel tempering.
  • Loading branch information
kbarros committed Jun 1, 2024
1 parent 64e7972 commit 02df215
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
3 changes: 3 additions & 0 deletions src/Integrators.jl
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,9 @@ function Langevin(; λ=nothing, damping=nothing, kT)
Langevin(NaN; λ, damping, kT)
end

function Base.copy(dyn::Langevin)
Langevin(dyn.dt; dyn.damping, dyn.kT)
end

#=
Damping and noise terms may be included through the optional `damping` and `kT`
Expand Down
7 changes: 1 addition & 6 deletions src/deprecated.jl
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,6 @@ end
Base.@deprecate suggest_magnetic_supercell(qs, latsize) suggest_magnetic_supercell(qs)
Base.@deprecate offline_viewers() ()

function Base.copy(dyn::Langevin)
@warn "Base.copy(dyn::Langevin) will break in Sunny v0.6! Use `Langevin(dyn.dt; dyn.damping, dyn.kT)` instead."
Langevin(dyn.dt; dyn.damping, dyn.kT)
end

function Base.getproperty(value::Langevin, name::Symbol)
if name == :Δt
@warn "`Δt` field is deprecated! Use `dt` instead."
Expand Down Expand Up @@ -61,4 +56,4 @@ end
# λ argument in Langevin constructor
# Δt argument in dynamical_correlations
# large_S and biquad arguments in set_exchange! and set_exchange_at!
# Argument `q` in set_spiral_order*
# Argument `q` in set_spiral_order*

0 comments on commit 02df215

Please sign in to comment.