Skip to content

Conversation

@EZoni
Copy link
Member

@EZoni EZoni commented Apr 30, 2025

This is a prototype of custom encoding/decoding for YAML format that could be done to achieve what was discussed in #3 (review) and #3 (comment).

The custom encoding/decoding produces this (custom implementation)

kind: Line
line:
- Drift:
    length: 0.25
    name: drift1
- Quadrupole:
    MagneticMultipoleP:
      Bn1: 1.0
    length: 1.0
    name: quad1
- Drift:
    length: 0.5
    name: drift2
- Quadrupole:
    MagneticMultipoleP:
      Bn1: -1.0
    length: 1.0
    name: quad2
- Drift:
    length: 0.5
    name: drift3

instead of this (basic/minimal implementation)

kind: Line
line:
- kind: Drift
  length: 0.25
  name: drift1
- MagneticMultipoleP:
    Bn1: 1.0
  kind: Quadrupole
  length: 1.0
  name: quad1
- kind: Drift
  length: 0.5
  name: drift2
- MagneticMultipoleP:
    Bn1: -1.0
  kind: Quadrupole
  length: 1.0
  name: quad2
- kind: Drift
  length: 0.5
  name: drift3

I think it should be possible to achieve the same by implementing element custom wrappers as well, as opposed to custom I/O. I could implement this alternative solution in a separate PR and then we could compare the two solutions and decide if we want to go forward with any of these.

It still seems to me like customization that could be postponed and/or avoided altogether.

@EZoni EZoni requested review from cemitch99 and removed request for cemitch99 April 30, 2025 00:45
@EZoni EZoni closed this Apr 30, 2025
@EZoni EZoni deleted the schema_more_impl branch April 30, 2025 18:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant