New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
issue with unit_check_wrapper #171
Comments
Comment by josePhoenix Thanks for the report! I'll look into this for you. Can you come up with a minimal test case? Does it happen any time a quantity is passed through that wrapper, or only with certain virtual optics or functions? |
Comment by josePhoenix As a data point, I created a fresh Python 3.5 conda env and installed POPPY 0.5.0 from source. (There was an issue with a distutils import on install, which was unrelated.) Running this example from the from astropy import units as u
osys = poppy.OpticalSystem()
osys.add_pupil( poppy.CircularAperture(radius=3 * u.m)) # pupil radius in meters
osys.add_detector(pixelscale=0.010, fov_arcsec=5.0) # image plane coordinates in arcseconds
psf = osys.calc_psf(2e-6) # wavelength in microns
poppy.display_psf(psf, title='The Airy Function') |
Comment by tiggersternchen Thanks for the fast response. This example file works for me too. The problem occurs with the MatrixFTCoronagraph.ipynb example, more precisely during the execution of the following call: "annFPM_mft_psf, annFPM_mft_interm = matrixFTcoron_annFPM_osys.calcPSF(wavelen, display_intermediates=True, return_intermediates=True)" The error also occurs if I run the tests: import poppy |
Comment by josePhoenix Okay, there might be more than one bug here. (Haven't had the chance to run the test suite yet.) Looks like in https://github.com/mperrin/poppy/blob/master/poppy/poppy_core.py#L2083 there's an attempt to format a unit-having quantity as a simple float, which is incorrect. It's done correctly elsewhere, so I'm going to read through and see how we missed that one. If you want a quick fix, replace that line with just |
Comment by tiggersternchen Great, your workaround does the trick. Thanks a lot |
Issue by tiggersternchen
Friday Jul 08, 2016 at 09:20 GMT
Originally opened as mperrin/poppy#171
First of all: thanks for this great toolbox !
Unfortunately I have encountered an error with the unit_check_wrapper in poppy 0.5.0. If I try to run the unit tests or the example scripts the following error (or similar) occurs:
"Only dimensionless scalar quantities can be converted to Python scalars" or
" 'm' (length) and '' (dimensionless) are not convertible"
I've tried this on a fresh installed system with Python 2.7 x64, Python 3.5 x64 and Python 3.5 x32 (Anaconda distributions). The same for the included ipython notebook files.
With poppy 0.4.1 the error doesn't occur.
What am I doing wrong ? Thanks in advance.
Sven
The text was updated successfully, but these errors were encountered: