Skip to content
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

CRL disp calc fails with Py2 #92

Open
samoylv opened this issue Oct 18, 2016 · 6 comments
Open

CRL disp calc fails with Py2 #92

samoylv opened this issue Oct 18, 2016 · 6 comments

Comments

@samoylv
Copy link
Owner

samoylv commented Oct 18, 2016

calculation CRL with dispersion under Py 2.7

this line brings TypeError: only length-1 arrays can be converted to Python scalars

@buzmakov
Copy link
Collaborator

Could you please provide simple test to reproduce this error?

On Tue, Oct 18, 2016 at 1:02 PM, samoylv [email protected] wrote:

calculation CRL with dispersion under Py 2.7

this line
https://github.com/samoylv/WPG/blob/feature/srw_update/wpg/srwlib.py#L2836
brings TypeError: only length-1 arrays can be converted to Python scalars


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
#92, or mute the thread
https://github.com/notifications/unsubscribe-auth/AA6Pt1Y2qvBafkdNXHpTPBFcJWdtee6Pks5q1JkpgaJpZM4KZmV4
.

@samoylv
Copy link
Owner Author

samoylv commented Oct 18, 2016

tutorial3_beamline_focusing_CRL_disp.ipynb, running on Py 2.7
in cell 12

@samoylv
Copy link
Owner Author

samoylv commented Oct 18, 2016

BTW, numpy.exp() in srwlib.py does not help

buzmakov added a commit that referenced this issue Oct 21, 2016
buzmakov added a commit that referenced this issue Oct 21, 2016
This reverts commit 23e715b.
@buzmakov
Copy link
Collaborator

We should pass parameters for srwl_opt_setup_CRL as list

crl_delta = list(be_data[:,1])  # Dummy numbers)
crl_attenuation_length  = list(be_data[:,2]) #Dummy numbers)

May be we should check it in our wrapper create_CRL_....

@samoylv
Copy link
Owner Author

samoylv commented Oct 21, 2016

good point. it was also fix from @CFGrote #80 - is that the same issue?

@samoylv
Copy link
Owner Author

samoylv commented Jan 16, 2017

@buzmakov fixed?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants