From 4dcf27278d629e05b7828212675f4301d3fb38a9 Mon Sep 17 00:00:00 2001 From: Avik Pal Date: Wed, 16 Oct 2024 22:26:52 -0400 Subject: [PATCH] test: minor fixes --- test/IDE_tests.jl | 5 +++-- test/runtests.jl | 5 ++++- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/test/IDE_tests.jl b/test/IDE_tests.jl index 339023857..1335450d2 100644 --- a/test/IDE_tests.jl +++ b/test/IDE_tests.jl @@ -64,9 +64,8 @@ end res = solve(prob, BFGS(); callback, maxiters = 100) xs = [infimum(d.domain):0.01:supremum(d.domain) for d in domains][1] phi = discretization.phi - analytic_sol_func(x) = @. cospi(5x) * x - u_real = [analytic_sol_func(x) for x in xs] + u_real = [x^2 / cos(x) for x in xs] u_predict = [first(phi([x], res.u)) for x in xs] @test mean(abs2, u_real .- u_predict) < 0.01 end @@ -94,6 +93,7 @@ end @named pde_system = PDESystem(eq, bcs, domains, [x, y], [u(x, y)]) prob = discretize(pde_system, discretization) res = solve(prob, BFGS(); callback, maxiters = 100) + phi = discretization.phi xs = 0.0:0.01:1.0 ys = 0.0:0.01:1.0 @@ -126,6 +126,7 @@ end @named pde_system = PDESystem(eq, bcs, domains, [x, y], [u(x, y)]) prob = discretize(pde_system, discretization) res = solve(prob, BFGS(); callback, maxiters = 100) + phi = discretization.phi xs = 0.0:0.01:1.0 ys = 0.0:0.01:1.0 diff --git a/test/runtests.jl b/test/runtests.jl index 4aba084cf..dc2d2d7df 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -2,7 +2,7 @@ using ReTestItems, InteractiveUtils, Hwloc @info sprint(versioninfo) -const GROUP = get(ENV, "GROUP", "all") +const GROUP = lowercase(get(ENV, "GROUP", "all")) const RETESTITEMS_NWORKERS = parse( Int, get(ENV, "RETESTITEMS_NWORKERS", string(min(Hwloc.num_physical_cores(), 4)))) @@ -12,6 +12,9 @@ const RETESTITEMS_NWORKER_THREADS = parse(Int, using NeuralPDE +@info "Running tests with $(RETESTITEMS_NWORKERS) workers and \ + $(RETESTITEMS_NWORKER_THREADS) threads for group $(GROUP)" + ReTestItems.runtests(NeuralPDE; tags = (GROUP == "all" ? nothing : [Symbol(GROUP)]), nworkers = RETESTITEMS_NWORKERS, nworker_threads = RETESTITEMS_NWORKER_THREADS, testitem_timeout = 3600)