Skip to content

Bad shape for reflections #349

@maffettone

Description

@maffettone

Reflections get's stored as a list of 3 membered lists, rather than an nx3 array. This raises data retrieval errors in Tiled and Databroker, as the shape in reflections.describe() is (n) rather than (n, 3).

databroker.mongo_normalized.BadShapeMetadata: For data key tardis_reflections shape (2, 3) does not match expected shape (2,).
See /var/log/bluesky/bluesky.log for the full traceback.

In [28]: tardis.reflections.describe()
Out[28]: 
{'tardis_reflections': {'source': 'PY:tardis._reflections',
  'dtype': 'array',
  'shape': [2]}}

I imagine this could be fixed by changing to ArrayAttributeSignal.

reflections = Cpt(ArrayAttributeSignal, attr="_reflections", doc="Reflections")

hklpy/hkl/diffract.py

Lines 179 to 183 in 4bc42df

reflections = Cpt(
AttributeSignal,
attr="_reflections",
doc="Reflections",
)

Tagging @ambarb for visibility.

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