diff --git a/src/RationalFunctionFields/RationalFunctionField.jl b/src/RationalFunctionFields/RationalFunctionField.jl index baedac59..cf38a9da 100644 --- a/src/RationalFunctionFields/RationalFunctionField.jl +++ b/src/RationalFunctionFields/RationalFunctionField.jl @@ -158,18 +158,30 @@ function field_contains( return field_contains(field, fractions_to_dennums(ratfuncs), prob_threshold) end -function field_contains(field::RationalFunctionField{T}, polys::Vector{T}, prob_threshold) where {T} +function field_contains( + field::RationalFunctionField{T}, + polys::Vector{T}, + prob_threshold, +) where {T} id = one(parent(first(polys))) return field_contains(field, [[id, p] for p in polys], prob_threshold) end # ------------------------------------------------------------------------------ -function issubfield(F::RationalFunctionField{T}, E::RationalFunctionField{T}, prob_threshold) where {T} +function issubfield( + F::RationalFunctionField{T}, + E::RationalFunctionField{T}, + prob_threshold, +) where {T} return all(field_contains(E, F.dennums, prob_threshold)) end -function fields_equal(F::RationalFunctionField{T}, E::RationalFunctionField{T}, prob_threshold) where {T} +function fields_equal( + F::RationalFunctionField{T}, + E::RationalFunctionField{T}, + prob_threshold, +) where {T} new_p = 1 - (1 - prob_threshold) / 2 return issubfield(F, E, new_p) && issubfield(E, F, new_p) end @@ -558,7 +570,8 @@ Out of $(length(new_fracs)) fractions $(length(new_fracs_unique)) are syntactica runtime = @elapsed new_fracs = beautifuly_generators(RationalFunctionField(new_fracs_unique)) @debug "Checking inclusion with probability $prob_threshold" - runtime = @elapsed result = issubfield(rff, RationalFunctionField(new_fracs), prob_threshold) + runtime = + @elapsed result = issubfield(rff, RationalFunctionField(new_fracs), prob_threshold) _runtime_logger[:id_inclusion_check] = runtime if !result @warn "Field membership check failed. Error will follow." diff --git a/src/StructuralIdentifiability.jl b/src/StructuralIdentifiability.jl index 40056e88..86c83993 100644 --- a/src/StructuralIdentifiability.jl +++ b/src/StructuralIdentifiability.jl @@ -105,7 +105,11 @@ function assess_identifiability( restart_logging(loglevel = loglevel) reset_timings() with_logger(_si_logger[]) do - return _assess_identifiability(ode, funcs_to_check = funcs_to_check, prob_threshold = prob_threshold) + return _assess_identifiability( + ode, + funcs_to_check = funcs_to_check, + prob_threshold = prob_threshold, + ) end end @@ -214,7 +218,11 @@ function _assess_identifiability( end funcs_to_check_ = [eval_at_nemo(each, conversion) for each in funcs_to_check] - result = _assess_identifiability(ode, funcs_to_check = funcs_to_check_, prob_threshold = prob_threshold) + result = _assess_identifiability( + ode, + funcs_to_check = funcs_to_check_, + prob_threshold = prob_threshold, + ) nemo2mtk = Dict(funcs_to_check_ .=> funcs_to_check) out_dict = OrderedDict(nemo2mtk[param] => result[param] for param in funcs_to_check_) return out_dict diff --git a/src/discrete.jl b/src/discrete.jl index ed0e6020..193d4dcb 100644 --- a/src/discrete.jl +++ b/src/discrete.jl @@ -373,8 +373,12 @@ function _assess_local_identifiability( funcs_to_check_ = [eval_at_nemo(x, conversion) for x in funcs_to_check] known_ic_ = [eval_at_nemo(x, conversion) for x in known_ic] - result = - _assess_local_identifiability_discrete_aux(dds_aux, funcs_to_check_, known_ic_, prob_threshold) + result = _assess_local_identifiability_discrete_aux( + dds_aux, + funcs_to_check_, + known_ic_, + prob_threshold, + ) nemo2mtk = Dict(funcs_to_check_ .=> funcs_to_check) out_dict = OrderedDict(nemo2mtk[param] => result[param] for param in funcs_to_check_) if length(known_ic) > 0 diff --git a/src/parametrizations.jl b/src/parametrizations.jl index 8d672ab3..a8b6e6ec 100644 --- a/src/parametrizations.jl +++ b/src/parametrizations.jl @@ -483,8 +483,12 @@ end function _reparametrize_global(ode::ODE{P}; prob_threshold = 0.99, seed = 42) where {P} Random.seed!(seed) - id_funcs = - find_identifiable_functions(ode, with_states = true, simplify = :strong, prob_threshold = prob_threshold) + id_funcs = find_identifiable_functions( + ode, + with_states = true, + simplify = :strong, + prob_threshold = prob_threshold, + ) ode_ring = parent(ode) @assert base_ring(parent(first(id_funcs))) == ode_ring @info "Constructing a new parametrization"