From 1f8406169993c037286c82d714cb8e6af24f74c2 Mon Sep 17 00:00:00 2001 From: Denis-Titov Date: Sat, 24 Feb 2024 08:47:59 -0800 Subject: [PATCH] edit tests --- test/runtests.jl | 6 +++--- test/tests_for_rate_eq_fitting.jl | 4 +++- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/test/runtests.jl b/test/runtests.jl index d52f011..30ffc18 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -3,13 +3,13 @@ using Test using SafeTestsets @time begin - @time @safetestset "MWC Rate Eq Derivation" begin + @safetestset "MWC Rate Eq Derivation" begin include("tests_for_rate_eq_derivation.jl") end - @time @safetestset "MWC Rate Eq Fitting" begin + @safetestset "MWC Rate Eq Fitting" begin include("tests_for_rate_eq_fitting.jl") end - @time @safetestset "MWC Rate Eq Subset Selection" begin + @safetestset "MWC Rate Eq Subset Selection" begin include("tests_for_rate_eq_subset_selection.jl") end end diff --git a/test/tests_for_rate_eq_fitting.jl b/test/tests_for_rate_eq_fitting.jl index b8559f3..d8d9241 100644 --- a/test/tests_for_rate_eq_fitting.jl +++ b/test/tests_for_rate_eq_fitting.jl @@ -52,5 +52,7 @@ benchmark_result = @benchmark EnzymeFitting.loss_rate_equation(kinetic_params, r benchmark_result = @benchmark EnzymeFitting.loss_rate_equation($(kinetic_params), rate_equation, $(rate_data_nt), $(param_names), $(fig_point_indexes)) @test mean(benchmark_result.times) <= 100_000 #ns -fit_result = @time fit_rate_equation(rate_equation, data, metab_names, param_names; n_iter=20) +#TODO: make fake data with noise and known params and ensure known params are recovered +fit_result = fit_rate_equation(rate_equation, data, metab_names, param_names; n_iter=20) @test isapprox(fit_result.loss, 0.08946088323758938, rtol=1e-3) +@test fit_result.params isa NamedTuple{param_names}{NTuple{length(param_names), Float64}}