Skip to content

Commit

Permalink
modelfit takes opt method as string for python
Browse files Browse the repository at this point in the history
  • Loading branch information
akabla committed Sep 6, 2021
1 parent 4890515 commit 20bd63b
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/processing.jl
Original file line number Diff line number Diff line change
Expand Up @@ -427,7 +427,7 @@ Suitable options include `:LN_SBPLX` (default), `:LN_COBYLA`, `:LN_BOBYQA` for
- `rel_tol`: Relative tolerance of optimization, see NLOpt docs for more details
- `diff_method`: Set finite difference formula to use for derivative, currently `"BD"` or `"CD"`
- `weights`: Vector of indices weighted according to importance, can be generated by `indexweight` function
- `optmethod`: optimisation algorithm used by NLOpt
- `optmethod`: optimisation algorithm used by NLOpt (passed as symbol or string)
"""
function modelfit(data::RheoTimeData,
model::RheoModelClass,
Expand All @@ -439,7 +439,7 @@ function modelfit(data::RheoTimeData,
rel_tol = 1e-4,
diff_method="BD",
weights::Union{Vector{Integer},Nothing} = nothing,
optmethod::Symbol = :LN_SBPLX)
optmethod::Union{Symbol,String}= :LN_SBPLX)

p0a = fill_init_params(model, symbol_to_unicode(p0))
loa = fill_lower_bounds(model, symbol_to_unicode(lo))
Expand Down Expand Up @@ -509,7 +509,7 @@ function modelfit(data::RheoTimeData,
singularity = sing,
_rel_tol = rel_tol,
indweights = weights,
optmethod = optmethod)
optmethod = Symbol(optmethod))

println("Time: $timetaken s, Why: $ret, Parameters: $minx, Error: $minf")

Expand Down

0 comments on commit 20bd63b

Please sign in to comment.