Skip to content

Feature: Make curves optional in LinearSerializedMagnetModel #517

Open

Description

@kparasch

Description, motivation and use case
LinearMagnetModel allows omitting curve, which defaults to None. However, LinearSerializedMagnetModel requires curves; omitting it raises:

PyAMLConfigException: missing a required argument: 'curves'

Proposed solution

Allow curves to be omitted for serialized magnets, consistently with LinearMagnetModel.
When they are omitted, a simple linear conversion with calibration_factors and calibration_offsets should be applied between hardware and strength. (As LinearMagnetModel does)

Example
Minimal script to reproduce:

from pyaml.configuration.factory import Factory

Factory.build({
    "class": "pyaml.magnet.linear_model.LinearMagnetModel",
    "unit": "m-1",
    "hardware_unit": "A",
})

Factory.build({
    "class": "pyaml.magnet.linear_serialized_model.LinearSerializedMagnetModel",
    "unit": "m-1",
    "hardware_unit": "A",
})

@gupichon @GamelinAl

Activity

  1. added
    enhancement
    on Nov 23, 2026
  2. added theissue type on Nov 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancement

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions