atcollab / at

Accelerator Toolbox
Apache License 2.0
48 stars 31 forks source link

Relaxed passmethod coherence tests when loading files #600

Closed lfarv closed 1 year ago

lfarv commented 1 year ago

When loading .mat files, a series of tests check the coherence between the element class and the pass method, and by default raise an exception. This created several problems in the past (like here). The changes here are:

  1. the number of tests is reduced to a minimum, to avoid problems when new pass methods are implemented:
    • IdentityPass with a non-null length,
    • missing C integrator,
    • a few remaining class checks.
  2. More important: a warning is emitted instead of an error. So the lattice is created and the user has the possibility of correcting the doubtful elements if needed. Up to now, the only workaround was to create a new .mat file.

As before, the quiet=True keyword shortcuts the tests (no more warnings emitted).