Skip to content

Handle empty distributions consistently in Switchyard #44

@cchall

Description

@cchall

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions