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

Handle empty distributions consistently in Switchyard #44

Open
cchall opened this issue Jan 20, 2023 · 0 comments
Open

Handle empty distributions consistently in Switchyard #44

cchall opened this issue Jan 20, 2023 · 0 comments

Comments

@cchall
Copy link
Member

cchall commented Jan 20, 2023

Reading an empty distribution file from elegant results in an error right now:

File "/home/vagrant/.pyenv/versions/3.7.2/envs/py3/lib/python3.7/site-packages/rsbeams/rsdata/switchyard.py", line 39, in read_elegant
    particle_data[:, i] = sdds_data[col][:]
IndexError: only integers, slices (`:`), ellipsis (`...`), numpy.newaxis (`None`) and integer or boolean arrays are valid indices

This can be sidestepped and we can read and write empty distribution files. This appears to already be the case for the OPAL read/write. It might be better to just make this an error though.

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

When branches are created from issues, their pull requests are automatically linked.

1 participant