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

Allow passing file objects to converter functions #321

Open
Hespe opened this issue Jan 16, 2025 · 0 comments
Open

Allow passing file objects to converter functions #321

Hespe opened this issue Jan 16, 2025 · 0 comments
Labels
enhancement New feature or request

Comments

@Hespe
Copy link
Member

Hespe commented Jan 16, 2025

The converter functions, e.g. Segment.from_elegant, Segment.from_bmad, ParticleBeam.from_astra, currently take a str argument to determine the data source. This might be limiting in certain situation if the object to convert is already loaded into memory.

Instead, one could allow the input to be given as something like Union[str, PathLike, IOBase], allowing to either pass a path or an already opened file object. This matches the behaviour of Pandas.

@Hespe Hespe added the enhancement New feature or request label Jan 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant