Skip to content

Commit

Permalink
format
Browse files Browse the repository at this point in the history
  • Loading branch information
sumiya11 committed Nov 12, 2023
1 parent 93dbef9 commit cd54b1d
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 23 deletions.
4 changes: 2 additions & 2 deletions benchmarking/IdentifiableFunctions/experiments.jl
Original file line number Diff line number Diff line change
Expand Up @@ -995,8 +995,8 @@ begin
end

begin
StructuralIdentifiability.find_identifiable_functions(Pivastatin);
StructuralIdentifiability.print_timings_table();
StructuralIdentifiability.find_identifiable_functions(Pivastatin)
StructuralIdentifiability.print_timings_table()
end

fracs = StructuralIdentifiability.dennums_to_fractions(dennums);
Expand Down
4 changes: 2 additions & 2 deletions src/ODE.jl
Original file line number Diff line number Diff line change
Expand Up @@ -460,13 +460,13 @@ macro ODEmodel(ex::Expr...)
end

logging_exprs = [
# :(with_logger(StructuralIdentifiability._si_logger[]) do),
# :(with_logger(StructuralIdentifiability._si_logger[]) do),
:(@info "Summary of the model:"),
:(@info "State variables: " * $(join(map(string, collect(x_vars)), ", "))),
:(@info "Parameters: " * $(join(map(string, collect(params)), ", "))),
:(@info "Inputs: " * $(join(map(string, collect(u_vars)), ", "))),
:(@info "Outputs: " * $(join(map(string, collect(y_vars)), ", "))),
# :(end),
# :(end),
]
# creating the ode object
ode_expr = :(StructuralIdentifiability.ODE{StructuralIdentifiability.Nemo.fmpq_mpoly}(
Expand Down
15 changes: 4 additions & 11 deletions src/StructuralIdentifiability.jl
Original file line number Diff line number Diff line change
Expand Up @@ -96,10 +96,7 @@ function assess_identifiability(
restart_logging(loglevel = loglevel)
reset_timings()
with_logger(_si_logger[]) do
return _assess_identifiability(ode,
funcs_to_check = funcs_to_check,
p = p
)
return _assess_identifiability(ode, funcs_to_check = funcs_to_check, p = p)
end
end

Expand All @@ -108,7 +105,6 @@ function _assess_identifiability(
funcs_to_check = Vector(),
p::Float64 = 0.99,
) where {P <: MPolyElem{fmpq}}

p_glob = 1 - (1 - p) * 0.9
p_loc = 1 - (1 - p) * 0.1

Expand Down Expand Up @@ -182,7 +178,8 @@ function assess_identifiability(
)
restart_logging(loglevel = loglevel)
with_logger(_si_logger[]) do
return _assess_identifiability(ode,
return _assess_identifiability(
ode,
measured_quantities = measured_quantities,
funcs_to_check = funcs_to_check,
p = p,
Expand All @@ -207,11 +204,7 @@ 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_,
p = p,
)
result = _assess_identifiability(ode, funcs_to_check = funcs_to_check_, p = p)
nemo2mtk = Dict(funcs_to_check_ .=> funcs_to_check)
out_dict = Dict(nemo2mtk[param] => result[param] for param in funcs_to_check_)
return out_dict
Expand Down
10 changes: 6 additions & 4 deletions src/identifiable_functions.jl
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,8 @@ function find_identifiable_functions(
restart_logging(loglevel = loglevel)
reset_timings()
with_logger(_si_logger[]) do
return _find_identifiable_functions(ode,
return _find_identifiable_functions(
ode,
p = p,
seed = seed,
with_states = with_states,
Expand All @@ -71,7 +72,7 @@ function _find_identifiable_functions(
with_states = false,
simplify = :standard,
rational_interpolator = :VanDerHoevenLecerf,
) where {T <: MPolyElem{fmpq}}
) where {T <: MPolyElem{fmpq}}
Random.seed!(seed)
@assert simplify in (:standard, :weak, :strong, :absent)
runtime_start = time_ns()
Expand Down Expand Up @@ -112,7 +113,7 @@ function _find_identifiable_functions(
_runtime_logger[:id_total] = (time_ns() - runtime_start) / 1e9
_runtime_logger[:are_id_funcs_polynomial] = all(isone denominator, id_funcs_fracs)
@info "The search for identifiable functions concluded in $(_runtime_logger[:id_total]) seconds"

return id_funcs_fracs
end

Expand Down Expand Up @@ -166,7 +167,8 @@ function find_identifiable_functions(
restart_logging(loglevel = loglevel)
reset_timings()
with_logger(_si_logger[]) do
return _find_identifiable_functions(ode,
return _find_identifiable_functions(
ode,
measured_quantities = measured_quantities,
p = p,
seed = seed,
Expand Down
2 changes: 1 addition & 1 deletion src/lincomp.jl
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ function linear_compartment_model(
graph::Vector{Vector{Int}},
inputs::Vector{Int},
outputs::Vector{Int},
leaks::Vector{Int}
leaks::Vector{Int},
)
n = length(graph)
x_vars_names = ["x$i" for i in 1:n]
Expand Down
7 changes: 4 additions & 3 deletions src/local_identifiability.jl
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,8 @@ function assess_local_identifiability(
)
restart_logging(loglevel = loglevel)
with_logger(_si_logger[]) do
return _assess_local_identifiability(ode,
return _assess_local_identifiability(
ode,
measured_quantities = measured_quantities,
funcs_to_check = funcs_to_check,
p = p,
Expand Down Expand Up @@ -260,7 +261,8 @@ function assess_local_identifiability(
restart_logging(loglevel = loglevel)
reset_timings()
with_logger(_si_logger[]) do
return _assess_local_identifiability(ode,
return _assess_local_identifiability(
ode,
funcs_to_check = funcs_to_check,
p = p,
type = type,
Expand All @@ -276,7 +278,6 @@ function _assess_local_identifiability(
type = :SE,
trbasis = nothing,
) where {P <: MPolyElem{Nemo.fmpq}}

if isempty(funcs_to_check)
funcs_to_check = ode.parameters
if type == :SE
Expand Down

0 comments on commit cd54b1d

Please sign in to comment.