Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix dtype deserialization #830

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

danielballan
Copy link
Member

Closes #820

@Bilchreis
Copy link

Okay so not only the incoming dtype needs to be deserialized correctly, but in some cases also the structured arrays. So the changes needed are a little more extensive.

  1. Shape Validation (mongo):
    https://github.com/danielballan/databroker/blob/6c7c26a8752709ee102e2551c2a12bd4d671a9f2/databroker/mongo_normalized.py#L932-L946

numpy.asarray(item): the conversion of item to an ndarray has to be done with the appropriate numpy dtype, from the data_key['dtype_descr'] if it exists, and each structured array element has to be turned into a tuple

  1. Config xarray:
    https://github.com/danielballan/databroker/blob/6c7c26a8752709ee102e2551c2a12bd4d671a9f2/databroker/mongo_normalized.py#L1081

columns[key] = numpy.array(column, dtype=numpy_dtype)

if numpy_dtype is a structured array, the data in column needs to be turned into a list of lists of tuples.

How would you like to proceed, sould I open my own PR or do you want to implement these changes?

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.

Reading configuration of devices in a run doesn't work with tiled server
2 participants