EconForge / interpolation.py

BSD 2-Clause "Simplified" License
123 stars 35 forks source link

Need for silent screen output #18

Closed jorishey1234 closed 6 years ago

jorishey1234 commented 6 years ago

Installing with with pip install https://github.com/EconForge/interpolation.py works on Ubuntu but a call to LinearSpline or other functions returns extensive and unwanted screen output, for instance:

[20 20] [20 20] [20 20] [20 20] [20 20] [20 20] [20 20] [20 20] (20, 20) (20, 20) (20, 20) (20, 20) (20, 20) (20, 20) (20, 20) (20, 20) Setting Setting Setting Setting Setting Setting Setting Setting [20 20] [20 20] [20 20] [20 20] [20 20] [20 20] [20 20] [20 20] (20, 20) (20, 20) (20, 20) (20, 20) (20, 20) (20, 20) (20, 20) (20, 20)

Would it be possible to turn it off in next version ? Thanks, Joris

sglyon commented 6 years ago

Yes, we should definitely turn that off.

Can you please provide some sample code that leads to output like that? Thanks

albop commented 6 years ago

I think the print statements come from multilinear.py, the set_values methods. These statements should just be removed. @jorishey1234 : would you do a PR ?

jorishey1234 commented 6 years ago

This is an example python code

import numpy as np from interpolation.splines import LinearSpline d=20 indexes=np.arange(-d/2,d/2,1) A=np.random.randn(len(indexes),len(indexes)) S=LinearSpline(np.array([-d/2,-d/2]),np.array([d/2,d/2]),A.shape,A); n=100 x=np.vstack((np.random.rand(n)d-d/2,np.random.rand(n)d-d/2)).T a=S(x)

which gives the output

Setting [20 20] (20, 20)

albop commented 6 years ago

closed by #19