Skip to content

Conversation

@swhite2401
Copy link
Contributor

This PR implements an Xsuite converter.

Xsuite is not required for this to work as everything is handled using json files.

This is still work in progress fro the moment, comments and suggestions welcome!

@swhite2401 swhite2401 requested review from kandre2 and lfarv January 21, 2026 11:14
@swhite2401 swhite2401 added enhancement WIP work in progress Python For python AT code labels Jan 21, 2026
@lfarv
Copy link
Contributor

lfarv commented Jan 21, 2026

Hello @swhite2401 : very interesting !
After a first look (even if it is still evolving), I have a few remarks:

  • the BasicElement class should not inherit from Element: apparently none of the Element methods or attributes are used. And it's not meant to be used as an Element. So inheriting from object looks good enough.
  • you could make use of the new Element.from_file class method:
      def get_at_element(self) -> Element:
          self._params_to_at()
          self._integrator_to_at()
          cls = self._class_to_at()
          return cls.from_file(self.atparams)
    
    Here, the _class_to_at method returns the AT class rather than storing it in atparams, and the _xsuite2at_class directories store AT classes rather than AT class names. It looks to me simpler, but your way is good as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement Python For python AT code WIP work in progress

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants