Skip to content

Can't use type(numpy.float64) for MagneticMultipoleP parameter #67

@ruisardkj

Description

@ruisardkj

Creating a lattice file, if the type for the Bn1 parameter in the MagneticMultipoleP class is numpy.float64, the yaml output is garbled. For other classes this type is fine. If Bn1 is type=float, everything is fine. json output is fine either way. An example is attached. SNS-BTF-xml-to-PALS.zip

example of yaml output:

- MEBT:QH01:
              kind: Quadrupole
              ApertureP:
                x_limits:
                - null
                - null
                y_limits:
                - null
                - null
                shape: ELLIPTICAL
                location: ENTRANCE_END
                material: ''
                thickness: 0.0
                aperture_shifts_with_body: false
                aperture_active: true
              length: 0.061
              MagneticMultipoleP:
                Bn1: !!python/object/apply:numpy._core.multiarray.scalar
                - &id001 !!python/object/apply:numpy.dtype
                  args:
                  - f8
                  - false
                  - true
                  state: !!python/tuple
                  - 3
                  - <
                  - null
                  - null
                  - null
                  - -1
                  - -1
                  - 0
                - !!binary |
                  AAAAAAAAOsA=

Also ApertureP limits are not set properly, but still have not ruled out user error.

Metadata

Metadata

Assignees

No one assigned

    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