Closed jank324 closed 1 year ago
Following 2 dependencies of Ocelot needs to be resolved
@jank324 regarding the lattice conversion from ocelot, two ideas come to my mind:
utils.ocelot2cheetah
function. Since conversion function needs an ocelot.Element anyway, so ocelot should be installed if one wants to use it.__str__()
I personally prefer the first option. What's your opinion?
On the other hand, I would suggest to just create a write_lattice
and read_lattice
method so that one can work with only Cheetah when doing RL training, i.e. also get rid of ocelot lattice file.
As much as I would like to get rid of all dependencies for Ocelot, I agree that option 1 is probably better.
Realistically, an Ocelot lattice requires Ocelot to be installed in order to define the lattice, so there is no need to convolute things checking the class name strings.
One thing to take into consideration, though: The nice way to do this would then be to add Ocelot as an additional dependency such that someone could install Cheetah as
pip install cheetah-accelerator[ocelot]
and all Ocelot conversions would work. But I worry that PyPI will still reject the installation because they forbid dependencies that are not on PyPI. So the better option would probably be to issue a useful warning to anyone using the Ocelot conversion functions when Ocelot isn't installed.
Loading and saving of lattice files (and beams) I think warrant a new issue. I do really like the idea, because then I can really take Ocelot out of all projects where it's not directly needed.
🚀 Feature Request
Remove Ocelot as a dependency of Cheetah but keep functionalities like importing lattices and particle distributions.
Motivation
Cheetah currently depends on Ocelot which causes long import times as well as issues with the installation (see #3 ).