Skip to content

Commit 9fe7586

Browse files
fix: respect tofloat when using floatT, default to not promoting
1 parent f9cdd16 commit 9fe7586

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/systems/problem_utils.jl

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -343,7 +343,7 @@ Keyword arguments:
343343
- `is_initializeprob, guesses`: Used to determine whether the system is missing guesses.
344344
"""
345345
function better_varmap_to_vars(varmap::AbstractDict, vars::Vector;
346-
tofloat = true, container_type = Array, floatT = Float64,
346+
tofloat = true, container_type = Array, floatT = Nothing,
347347
toterm = default_toterm, promotetoconcrete = nothing, check = true,
348348
allow_symbolic = false, is_initializeprob = false)
349349
isempty(vars) && return nothing
@@ -366,8 +366,9 @@ function better_varmap_to_vars(varmap::AbstractDict, vars::Vector;
366366
is_initializeprob ? throw(MissingGuessError(missingsyms, missingvals)) :
367367
throw(UnexpectedSymbolicValueInVarmap(missingsyms[1], missingvals[1]))
368368
end
369-
370-
vals = floatT.(vals)
369+
if tofloat && !(floatT == Nothing)
370+
vals = floatT.(vals)
371+
end
371372
end
372373

373374
if container_type <: Union{AbstractDict, Tuple, Nothing, SciMLBase.NullParameters}

0 commit comments

Comments
 (0)