@@ -333,18 +333,17 @@ in `varmap`. Does not perform symbolic substitution in the values of `varmap`.
333333
334334Keyword arguments:
335335- `tofloat`: Convert values to floating point numbers using `float`.
336- - `use_union`: Use a `Union`-typed array if the values have heterogeneous types.
337336- `container_type`: The type of container to use for the values.
338337- `toterm`: The `toterm` method to use for converting symbolics.
339338- `promotetoconcrete`: whether the promote to a concrete buffer (respecting
340- `tofloat` and `use_union` ). Defaults to `container_type <: AbstractArray`.
339+ `tofloat`). Defaults to `container_type <: AbstractArray`.
341340- `check`: Error if any variables in `vars` do not have a mapping in `varmap`. Uses
342341 [`missingvars`](@ref) to perform the check.
343342- `allow_symbolic` allows the returned array to contain symbolic values. If this is `true`,
344343 `promotetoconcrete` is set to `false`.
345344"""
346345function better_varmap_to_vars (varmap:: AbstractDict , vars:: Vector ;
347- tofloat = true , use_union = true , container_type = Array,
346+ tofloat = true , container_type = Array,
348347 toterm = default_toterm, promotetoconcrete = nothing , check = true , allow_symbolic = false )
349348 isempty (vars) && return nothing
350349
@@ -366,7 +365,7 @@ function better_varmap_to_vars(varmap::AbstractDict, vars::Vector;
366365
367366 promotetoconcrete === nothing && (promotetoconcrete = container_type <: AbstractArray )
368367 if promotetoconcrete && ! allow_symbolic
369- vals = promote_to_concrete (vals; tofloat = tofloat, use_union = use_union )
368+ vals = promote_to_concrete (vals; tofloat = tofloat, use_union = false )
370369 end
371370
372371 if isempty (vals)
@@ -704,8 +703,7 @@ Keyword arguments:
704703- `fully_determined`: Override whether the initialization system is fully determined.
705704- `check_initialization_units`: Enable or disable unit checks when constructing the
706705 initialization problem.
707- - `tofloat`, `use_union`: Passed to [`better_varmap_to_vars`](@ref) for building `u0` (and
708- possibly `p`).
706+ - `tofloat`: Passed to [`better_varmap_to_vars`](@ref) for building `u0` (and possibly `p`).
709707- `u0_constructor`: A function to apply to the `u0` value returned from `better_varmap_to_vars`
710708 to construct the final `u0` value.
711709- `du0map`: A map of derivatives to values. See `implicit_dae`.
@@ -735,7 +733,7 @@ function process_SciMLProblem(
735733 implicit_dae = false , t = nothing , guesses = AnyDict (),
736734 warn_initialize_determined = true , initialization_eqs = [],
737735 eval_expression = false , eval_module = @__MODULE__ , fully_determined = nothing ,
738- check_initialization_units = false , tofloat = true , use_union = false ,
736+ check_initialization_units = false , tofloat = true ,
739737 u0_constructor = identity, du0map = nothing , check_length = true ,
740738 symbolic_u0 = false , warn_cyclic_dependency = false ,
741739 circular_dependency_max_cycle_length = length (all_symbols (sys)),
@@ -814,8 +812,7 @@ function process_SciMLProblem(
814812 evaluate_varmap! (op, dvs; limit = substitution_limit)
815813
816814 u0 = better_varmap_to_vars (
817- op, dvs; tofloat, use_union = false ,
818- container_type = u0Type, allow_symbolic = symbolic_u0)
815+ op, dvs; tofloat, container_type = u0Type, allow_symbolic = symbolic_u0)
819816
820817 if u0 != = nothing
821818 u0 = u0_constructor (u0)
@@ -840,7 +837,7 @@ function process_SciMLProblem(
840837 if is_split (sys)
841838 p = MTKParameters (sys, op)
842839 else
843- p = better_varmap_to_vars (op, ps; tofloat, use_union, container_type = pType)
840+ p = better_varmap_to_vars (op, ps; tofloat, container_type = pType)
844841 end
845842
846843 if implicit_dae && du0map != = nothing
@@ -909,15 +906,14 @@ end
909906# #############
910907
911908"""
912- u0, p, defs = get_u0_p(sys, u0map, parammap; use_union=true, tofloat=true)
909+ u0, p, defs = get_u0_p(sys, u0map, parammap; tofloat=true)
913910
914911Take dictionaries with initial conditions and parameters and convert them to numeric arrays `u0` and `p`. Also return the merged dictionary `defs` containing the entire operating point.
915912"""
916913function get_u0_p (sys,
917914 u0map,
918915 parammap = nothing ;
919916 t0 = nothing ,
920- use_union = true ,
921917 tofloat = true ,
922918 symbolic_u0 = false )
923919 dvs = unknowns (sys)
@@ -956,19 +952,19 @@ function get_u0_p(sys,
956952 end
957953
958954 if symbolic_u0
959- u0 = varmap_to_vars (u0map, dvs; defaults = defs, tofloat = false , use_union = false )
955+ u0 = varmap_to_vars (u0map, dvs; defaults = defs, tofloat = false )
960956 else
961- u0 = varmap_to_vars (u0map, dvs; defaults = defs, tofloat = true , use_union )
957+ u0 = varmap_to_vars (u0map, dvs; defaults = defs, tofloat = true )
962958 end
963- p = varmap_to_vars (parammap, ps; defaults = defs, tofloat, use_union )
959+ p = varmap_to_vars (parammap, ps; defaults = defs, tofloat)
964960 p = p === nothing ? SciMLBase. NullParameters () : p
965961 t0 != = nothing && delete! (defs, get_iv (sys))
966962 u0, p, defs
967963end
968964
969965function get_u0 (
970966 sys, u0map, parammap = nothing ; symbolic_u0 = false ,
971- toterm = default_toterm, t0 = nothing , use_union = true )
967+ toterm = default_toterm, t0 = nothing )
972968 dvs = unknowns (sys)
973969 ps = parameters (sys)
974970 defs = defaults (sys)
@@ -991,9 +987,9 @@ function get_u0(
991987 defs = mergedefaults (defs, obsmap, u0map, dvs)
992988 if symbolic_u0
993989 u0 = varmap_to_vars (
994- u0map, dvs; defaults = defs, tofloat = false , use_union = false , toterm)
990+ u0map, dvs; defaults = defs, tofloat = false , toterm)
995991 else
996- u0 = varmap_to_vars (u0map, dvs; defaults = defs, tofloat = true , use_union, toterm)
992+ u0 = varmap_to_vars (u0map, dvs; defaults = defs, tofloat = true , toterm)
997993 end
998994 t0 != = nothing && delete! (defs, get_iv (sys))
999995 return u0, defs
0 commit comments