From d3adeb8c5dd5f179867d6fe91451d44d17f6d2ce Mon Sep 17 00:00:00 2001 From: jschueller Date: Tue, 1 Sep 2015 10:21:23 +0200 Subject: [PATCH] simplify python test --- test/test_std.py | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/test/test_std.py b/test/test_std.py index 3264c5d..f7bfca6 100644 --- a/test/test_std.py +++ b/test/test_std.py @@ -1,15 +1,13 @@ #!/usr/bin/env python +from __future__ import print_function import nlopt import numpy as np -print ('nlopt version='+nlopt.__version__) +print ('nlopt version=', nlopt.__version__) def f(x, grad): - F=x[0] - L=x[1] - E=x[2] - I=x[3] + F, L, E, I = x D=F*L**3/(3.*E*I) return D @@ -27,6 +25,6 @@ xopt = opt.optimize(x) opt_val = opt.last_optimum_value() result = opt.last_optimize_result() -print ('opt_result='+str(result)) -print ('optimizer='+str(xopt)) -print ('opt_val='+str(opt_val)) +print ('opt_result=', result) +print ('optimizer=', xopt) +print ('opt_val=', opt_val) -- 2.30.2