From f9538d74220ac14eacc4d4a55ba69ee25be71742 Mon Sep 17 00:00:00 2001 From: tmigot Date: Sun, 1 Sep 2024 08:58:05 -0400 Subject: [PATCH] apply linter --- src/parse-functions.jl | 6 +++--- test/parse-function-test.jl | 11 ++++++----- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/src/parse-functions.jl b/src/parse-functions.jl index 2bf67ee..1a9c387 100644 --- a/src/parse-functions.jl +++ b/src/parse-functions.jl @@ -13,6 +13,6 @@ function isnls(nlp) expr_tree = ExpressionTreeForge.get_expression_tree(nlp) F_expr = ExpressionTreeForge.extract_element_functions(expr_tree) test_square(expr) = expr.field == ExpressionTreeForge.M_power_operator.Power_operator{Int}(2) - is_nls = mapreduce(test_square, &, F_expr) :: Bool - return is_nls -end + is_nls = mapreduce(test_square, &, F_expr)::Bool + return is_nls +end diff --git a/test/parse-function-test.jl b/test/parse-function-test.jl index 9f2717e..19d5b23 100644 --- a/test/parse-function-test.jl +++ b/test/parse-function-test.jl @@ -1,5 +1,6 @@ -problems_names = meta[!,:name][1:50] # we test only the 50 first problems -problems_symbols = map(name -> OptimizationProblems.ADNLPProblems.eval(Meta.parse(name)), problems_names) +problems_names = meta[!, :name][1:50] # we test only the 50 first problems +problems_symbols = + map(name -> OptimizationProblems.ADNLPProblems.eval(Meta.parse(name)), problems_names) @testset "NLS from NLP" begin result_list_isnls = Bool[] @@ -12,11 +13,11 @@ problems_symbols = map(name -> OptimizationProblems.ADNLPProblems.eval(Meta.pars @test detect_nls == is_nls @debug "Least squares objective, $index : $problem" # detect_nls != is_nls && (@debug "$index : $problem") - else + else @debug "Not least squares objective, $index : $problem" end - catch + catch @debug "the $index-th $(problems_names[index]) problem is unsupported." - end + end end end