Skip to content

Array type inference issue for mixed magnet classes #384

Closed

Description

@gupichon
  1. magnets[:] and magnets["QD"] works but return ElementArray instead of MagnetArray
type(sr.design.magnets[":"])
>>> pyaml.arrays.element_array.ElementArray
  1. Similar bug with using subset of magnet arrays
magnets.get()        -> MagnetArray     ✅
magnets.get()[:]     -> ElementArray    ❌ should be MagnetArray
magnets.get()['S*']  -> ElementArray    ❌ should be MagnetArray

Originally posted by @GamelinAl in #376 (comment)

Activity

  1. linked a pull request that will close this issueBugfix: array type inference #385on Sep 8, 2026
  2. self-assigned this
    on Sep 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions