opticspy / lightpipes

LightPipes for Python, "Pure Python version"
https://opticspy.github.io/lightpipes/
BSD 3-Clause "New" or "Revised" License
227 stars 52 forks source link

LPtest() fails on some systems while installation is correct #66

Open FELman2011 opened 2 years ago

FELman2011 commented 2 years ago

After installing LightPipes and running LPtest(), the test sometimes fails while the installation is correct. In the test an optical field is initialized, propagated over a distance using the Fresnel propagator and the resulting intensity is summed and compared with a predefined value. The comparison is of the form a==b, which means that the two need to be equal up to and including the last digit. Depending on python version, machine precision, etc., the two values may actually differ slightly (e.g in the last or last two digits). A better test would be to check that abs(a-b) is less than a threshold value to determine if the installation is correct.

Furthermore, the text printed after test is successful differs from the text mentioned in the manual (at least in version 2.0.9)

FredvanGoor commented 2 years ago

Yes you are right! I have changed that in the newest version (2.1.1) Thank you, Fred.