Skip to content

Commit

Permalink
Removed type restriction to AbstractSystem in functions.
Browse files Browse the repository at this point in the history
  • Loading branch information
CedricTravelletti committed Jan 9, 2024
1 parent 0cfe514 commit a3a9a2b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/optimization.jl
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export minimize_energy
are used.
"""
function Optimization.OptimizationFunction(system::AbstractSystem, calculator; kwargs...)
function Optimization.OptimizationFunction(system, calculator; kwargs...)
mask = not_clamped_mask(system) # mask is assumed not to change during optim.

f = function(x::AbstractVector{<:Real}, p)
Expand All @@ -35,7 +35,7 @@ function Optimization.OptimizationFunction(system::AbstractSystem, calculator; k
OptimizationFunction(f; grad=g!)
end

function minimize_energy(system::AbstractSystem, calculator; solver=Optim.LBFGS(), kwargs...)
function minimize_energy(system, calculator; solver=Optim.LBFGS(), kwargs...)
# Use current system parameters as starting positions.
x0 = austrip.(not_clamped_positions(system)) # Optim modifies x0 in-place, so need a mutable type.
f_opt = OptimizationFunction(system, calculator)
Expand Down

0 comments on commit a3a9a2b

Please # to comment.